Feat(首页):分享朋友圈功能

This commit is contained in:
lifizer
2025-11-20 12:03:51 +08:00
parent 13dee18ef1
commit 7a49c7c493
+20 -1
View File
@@ -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