first commit
This commit is contained in:
26
uni_modules/uview-plus/libs/mixin/mpShare.js
Normal file
26
uni_modules/uview-plus/libs/mixin/mpShare.js
Normal file
@@ -0,0 +1,26 @@
|
||||
export default {
|
||||
onLoad(options) {
|
||||
if (options.invite_code) {
|
||||
uni.setStorageSync('invite_code', options.invite_code);
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
let userInfoGet = uni.getStorageSync('user')
|
||||
if(userInfoGet && userInfoGet.pemType == 1){
|
||||
this.mpShare.path = `/pages/index/index?invite_code=${userInfoGet.shareCode}`
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mpShare: {
|
||||
title: '', // 默认为小程序名称
|
||||
path: `/pages/index/index?invite_code=`, // 默认为当前页面路径
|
||||
imageUrl: '' // 默认为当前页面的截图
|
||||
}
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
this.mpShare.path = `/pages/index/index?invite_code=${uni.getStorageSync('user') ? uni.getStorageSync('user').shareCode :''}`
|
||||
return this.mpShare;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user