uni-app寫的app
// 分享小程序
async handleShare(index) {
let _this = this;
setTimeout(() => {
this.drawCanvas();
setTimeout(async () => {
this.canvasFlag = false;
}, 4000);
}, 100);
this.canvasFlag = true;
},
drawCanvas() {
let _this = this;
this.$nextTick(async () => {
//初始化
await this.$refs.rCanvas
.init({
canvas_id: 'rCanvas',
canvas_width: 399,
canvas_height: 299,
background_color: '#fff',
position: 'fixed',
top: 50,
left: 50
})
.catch(err_msg => {
uni.showToast({
title: err_msg,
icon: 'none'
});
});
console.log('_this.detail.info.factorycategory', _this.$config.imgBaseUrl);
//畫圖片 暫時隱藏
await this.$refs.rCanvas
.drawImage({
url: _this.$config.imgBaseUrl + 'share_bg.png',
x: -12,
y: 0,
w: 399,
h: 299
})
.catch(err_msg => {
uni.showToast({
title: err_msg,
icon: 'none'
});
});
// 畫文字
//、文字的第一行
await this.$refs.rCanvas
.drawSpecialText({
general: {
x: 80,
y: 35
},
list: [
{
text: _this.detail.info.title,
font_color: '#000',
font_size: 15,
text_align: 'center',
font_weight: 'bold'
}
]
})
.catch(err_msg => {
uni.showToast({
title: err_msg,
icon: 'none'
});
});
await this.$refs.rCanvas
.drawSpecialText({
general: {
x: 140,
y: 35
},
list: [
{
text: '|',
font_color: '#666',
font_size: 10,
text_align: 'center',
font_weight: 'bold'
}
]
})
.cat
文章來源地址http://www.zghlxwxcb.cn/news/detail-606918.html
文章來源:http://www.zghlxwxcb.cn/news/detail-606918.html
到了這里,關(guān)于uni-app寫app點擊app的分享,分享至微信,在微信中點擊分享卡片打開小程序并跳轉(zhuǎn)至相應頁面的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!