diff --git a/pages/home/index.vue b/pages/home/index.vue index 997a61b..126d49c 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -381,6 +381,7 @@ import { getLocationSetting, openLocationSettting } from "@/utils/common" +import { getWeixinShareConfig } from '@/api/public' export default { name: 'IndexPage', components: { @@ -431,7 +432,8 @@ export default { tabIconPostion: {}, messageIcon: {}, recommendKeyword: [], - keywordIndex: 0 + keywordIndex: 0, + shareData: {} } }, onLoad() { @@ -452,6 +454,12 @@ export default { _this.statusBarHeight = statusBar } }) + getWeixinShareConfig().then(res => { + const { success, data } = res + if (success) { + this.shareData = data + } + }) }, onHide() { this.pageToHideHandle() @@ -459,6 +467,17 @@ export default { onPageScroll(e) { this.scrollTop = e.scrollTop }, + onShareTimeline() { + uni.updateShareMenu({ + isPrivateMessage: false, + withShareTicket: false + }) + return { + title: this.shareData.title || this.share.title, + query: '', + imageUrl: this.shareData.image || this.share.imageUrl + } + }, methods: { changeRecommendKeyword(e) { this.keywordIndex = e