diff --git a/pages/index/center.vue b/pages/index/center.vue index a987155..c0c334a 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -22,7 +22,7 @@ - + 普通会员 @@ -39,7 +39,7 @@ 代理商权益 - 将于{{userInfo.endTime}}到期 + 将于{{userInfo.endTime || '-'}}到期 diff --git a/pages_order/sharing/group.vue b/pages_order/sharing/group.vue index 2158076..f1cf787 100644 --- a/pages_order/sharing/group.vue +++ b/pages_order/sharing/group.vue @@ -5,7 +5,7 @@ {{ detail.headTitle || '' }} - {{ `群人数:${detail.memberNum || 0}` }} + {{ `(${detail.memberNum || 0})` }} @@ -52,7 +54,7 @@ }, timeIsUp: false, isLocked: true, - videoContext: null + videoContext: null, } }, computed: { @@ -64,7 +66,6 @@ } }, async onLoad(option) { - console.log('--onLoad', option) const { id, state, shareId } = option if (shareId) { @@ -122,6 +123,11 @@ } }, async initData() { + this.fetchCheckShare().then(result => { + const { open } = result + + this.isLocked = !open + }) await this.fetchDetails(this.id) this.videoContext = uni.createVideoContext('video'); @@ -144,7 +150,8 @@ if (open) { this.isLocked = false - this.$refs.popupQrCode.open() + this.timeIsUp = false + this.videoContext.play() return } @@ -156,7 +163,6 @@ }, async onPlay() { if (!this.isLocked) { - this.$refs.popupQrCode.open() return } @@ -167,8 +173,11 @@ if (open) { // 转发已达标 this.isLocked = false - this.$refs.popupQrCode.open() + this.timeIsUp = false + this.videoContext.play() } else { + this.videoContext.pause() + this.timeIsUp = true uni.showToast({ title: `还需转发${need_num - num}次`, icon: 'none', @@ -179,13 +188,15 @@ async onTimeupdate(e) { const { currentTime } = e.target - // todo: check - if (currentTime >= this.detail.timeNum) { + if (currentTime >= this.detail.timeNum && this.isLocked) { this.videoContext.pause() this.timeIsUp = true this.onPlay() } }, + onTimeEnd() { + this.$refs.popupQrCode.open() + }, }, }