Feat(首页):分享朋友圈功能
This commit is contained in:
+20
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user