初始提交
This commit is contained in:
36
utils/share.js
Normal file
36
utils/share.js
Normal file
@@ -0,0 +1,36 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//设置默认的分享参数
|
||||
share: {
|
||||
title: 'jnpf快速开放平台',
|
||||
path: '/pages/index/index',
|
||||
imageUrl: '',
|
||||
desc: '',
|
||||
content: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
//#ifdef MP-WEIXIN
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
title: this.share.title,
|
||||
path: this.share.path,
|
||||
imageUrl: this.share.imageUrl,
|
||||
desc: this.share.desc,
|
||||
content: this.share.content,
|
||||
success(res) {
|
||||
uni.showToast({
|
||||
title: '分享成功'
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
uni.showToast({
|
||||
title: '分享失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
}
|
||||
Reference in New Issue
Block a user