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
文章来源地址https://www.toymoban.com/news/detail-606918.html
文章来源:https://www.toymoban.com/news/detail-606918.html
到了这里,关于uni-app写app点击app的分享,分享至微信,在微信中点击分享卡片打开小程序并跳转至相应页面的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!