chore:商品分类可以分享了
This commit is contained in:
@@ -54,6 +54,6 @@ const localDevConfig = ({
|
|||||||
uniacid: 115,
|
uniacid: 115,
|
||||||
domain: 'https://5g.aigc-quickapp.com/',
|
domain: 'https://5g.aigc-quickapp.com/',
|
||||||
},
|
},
|
||||||
})['1']; // 选择要使用的环境配置
|
})['115']; // 选择要使用的环境配置
|
||||||
|
|
||||||
export default localDevConfig;
|
export default localDevConfig;
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
diyData: null
|
diyData: null,
|
||||||
|
mpShareData: null //小程序分享数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -38,6 +39,25 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.$util.hideHomeButton();
|
this.$util.hideHomeButton();
|
||||||
if (this.$refs.category) this.$refs.category[0].pageShow();
|
if (this.$refs.category) this.$refs.category[0].pageShow();
|
||||||
|
|
||||||
|
//小程序分享
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.$util.getMpShare('/pages_goods/category').then(res => {
|
||||||
|
this.mpShareData = res;
|
||||||
|
}).catch(err => {
|
||||||
|
// 如果后台没配置,用默认值
|
||||||
|
this.mpShareData = {
|
||||||
|
appMessage: {
|
||||||
|
title: '发现超多好物,快来看看',
|
||||||
|
path: '/pages_goods/category'
|
||||||
|
},
|
||||||
|
timeLine: {
|
||||||
|
title: '发现超多好物,快来看看',
|
||||||
|
query: '/pages_goods/category'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
|
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
|
||||||
@@ -69,6 +89,24 @@ export default {
|
|||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
this.getDiyInfo();
|
this.getDiyInfo();
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
return this.mpShareData?.appMessage || {
|
||||||
|
title: '发现超多好物,快来看看',
|
||||||
|
path: '/pages_goods/category'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShareTimeline() {
|
||||||
|
return this.mpShareData?.timeLine || {
|
||||||
|
title: '发现超多好物,快来看看',
|
||||||
|
query: '/pages_goods/category'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onAddToFavorites() {
|
||||||
|
return {
|
||||||
|
title: '发现超多好物,快来看看',
|
||||||
|
path: '/pages_goods/category'
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ export default {
|
|||||||
levelId: 0,
|
levelId: 0,
|
||||||
levelInfo: {
|
levelInfo: {
|
||||||
bg_color: '#333'
|
bg_color: '#333'
|
||||||
}
|
},
|
||||||
|
mpShareData: null //小程序分享数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -161,7 +162,26 @@ export default {
|
|||||||
});
|
});
|
||||||
this.levelInfo = levelInfo;
|
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: {
|
methods: {
|
||||||
headimgError() {
|
headimgError() {
|
||||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||||
@@ -185,6 +205,24 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||||
return true;
|
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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user