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, getLocationSetting,
openLocationSettting openLocationSettting
} from "@/utils/common" } from "@/utils/common"
import { getWeixinShareConfig } from '@/api/public'
export default { export default {
name: 'IndexPage', name: 'IndexPage',
components: { components: {
@@ -431,7 +432,8 @@ export default {
tabIconPostion: {}, tabIconPostion: {},
messageIcon: {}, messageIcon: {},
recommendKeyword: [], recommendKeyword: [],
keywordIndex: 0 keywordIndex: 0,
shareData: {}
} }
}, },
onLoad() { onLoad() {
@@ -452,6 +454,12 @@ export default {
_this.statusBarHeight = statusBar _this.statusBarHeight = statusBar
} }
}) })
getWeixinShareConfig().then(res => {
const { success, data } = res
if (success) {
this.shareData = data
}
})
}, },
onHide() { onHide() {
this.pageToHideHandle() this.pageToHideHandle()
@@ -459,6 +467,17 @@ export default {
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop 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: { methods: {
changeRecommendKeyword(e) { changeRecommendKeyword(e) {
this.keywordIndex = e this.keywordIndex = e