wangfukang 3 weeks ago
parent
commit
cb5fda9028
  1. 39
      package4/ieBrowser/index.vue

39
package4/ieBrowser/index.vue

@ -286,10 +286,13 @@
<script>
import { ieHome, getIeUnreadCount, updateIeStatus, startIeMatch, matchIeProfile, getIeDailyQuestion, saveIeProfile } from '@/common/ieApi.js'
import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js'
import { buildHomeSharePath } from '@/utils/sharePath.js'
import IeBottomTab from '@/package4/components/ie-bottom-tab/ie-bottom-tab.vue'
import IeAuthDialog from '@/package4/components/ie-auth-dialog/ie-auth-dialog.vue'
import CommonLoading from '@/package4/components/common-loading/common-loading.vue'
const SHARE_TARGET_PATH = '/package4/ieBrowser/index'
export default {
components: { IeBottomTab, IeAuthDialog, CommonLoading },
data() {
@ -448,6 +451,7 @@
}
},
onLoad() {
this.enableShareMenu()
if (uni.getMenuButtonBoundingClientRect) {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
}
@ -461,6 +465,7 @@
this.displayMoodCopy = this.activeMood.copy
},
onShow() {
this.enableShareMenu()
this.startPageTimers()
if (this.hasShownOnce) {
this.loadHome()
@ -484,7 +489,32 @@
onUnload() {
this.stopPageTimers()
},
onShareAppMessage() {
return this.buildShareInfo()
},
onShareTimeline() {
const info = this.buildShareInfo()
return {
title: info.title,
query: info.path.split('?')[1] || '',
imageUrl: info.imageUrl
}
},
methods: {
enableShareMenu() {
if (!uni.showShareMenu) return
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
buildShareInfo() {
return {
title: '此刻有人在等你,来半匿名漂流一下',
path: buildHomeSharePath(SHARE_TARGET_PATH),
imageUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png'
}
},
startPageTimers() {
if (!this.liveTimer) {
this.liveTimer = setInterval(() => {
@ -989,7 +1019,14 @@
goFate() { uni.navigateTo({ url: '/package4/ieBrowser/fate' }) },
goMessages() { uni.navigateTo({ url: '/package4/ieBrowser/messages?unreadCount=' + encodeURIComponent(String(this.unreadCount || 0)) }) },
goUniverse() { uni.navigateTo({ url: '/package4/ieBrowser/universe?unreadCount=' + encodeURIComponent(String(this.unreadCount || 0)) }) },
backHome() { uni.switchTab({ url: '/pages/index/index' }) }
backHome() {
uni.switchTab({
url: '/pages/index/index',
fail: () => {
uni.reLaunch({ url: '/pages/index/index' })
}
})
}
}
}
</script>

Loading…
Cancel
Save