chore:商品分类可以分享了
This commit is contained in:
@@ -134,7 +134,8 @@ export default {
|
||||
levelId: 0,
|
||||
levelInfo: {
|
||||
bg_color: '#333'
|
||||
}
|
||||
},
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -161,7 +162,26 @@ export default {
|
||||
});
|
||||
this.levelInfo = levelInfo;
|
||||
},
|
||||
onShow() { },
|
||||
onShow() {
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare('/pages_tool/member/card').then(res => {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
},
|
||||
timeLine: {
|
||||
title: '专属会员权益,快来体验',
|
||||
query: '/pages_tool/member/card'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
@@ -185,6 +205,24 @@ export default {
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: '专属会员权益,快来体验',
|
||||
query: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user