diff --git a/pages_tool/contact/contact.vue b/pages_tool/contact/contact.vue index 9b97a97..692ffdb 100644 --- a/pages_tool/contact/contact.vue +++ b/pages_tool/contact/contact.vue @@ -248,7 +248,8 @@ export default { latitude: 0, longitude: 0, }, - personnel_bg: '' + personnel_bg: '', + mpShareData: null //小程序分享数据 }; }, onLoad(option) { @@ -303,6 +304,24 @@ export default { }); }, onShow() { + // #ifdef MP-WEIXIN + this.$util.getMpShare('/pages_tool/contact/contact').then(res => { + this.mpShareData = res; + }).catch(err => { + // 如果后台没配置,用默认值 + this.mpShareData = { + appMessage: { + title: '联系我们', + path: '/pages_tool/contact/contact' + }, + timeLine: { + title: '联系我们', + query: '' + } + }; + }); + // #endif + this.$util.hideHomeButton(); }, methods: { @@ -449,9 +468,28 @@ export default { longitude: parseFloat(this.shop.longitude), name: this.$lang('oneClickNavigation'), }); - } - } + }, + onShareAppMessage() { + return this.mpShareData?.appMessage || { + title: '联系我们', + path: '/pages_tool/contact/contact' + }; + }, + onShareTimeline() { + return this.mpShareData?.timeLine || { + title: '联系我们', + query: '' + }; + }, + onAddToFavorites() { + return { + title: '联系我们', + path: '/pages_tool/contact/contact' + }; + }, + }, }; +