#5 fox

Merged
Fox merged 4 commits from fox into master 1 week ago
  1. +2
    -2
      pages/index/center.vue
  2. +1
    -1
      pages_order/sharing/group.vue
  3. +15
    -4
      pages_order/sharing/personal.vue
  4. +19
    -8
      pages_order/sharing/video.vue

+ 2
- 2
pages/index/center.vue View File

@ -22,7 +22,7 @@
<!-- <view v-else class="tag" > <!-- <view v-else class="tag" >
代理商:{{userInfo.endTime}} 到期 代理商:{{userInfo.endTime}} 到期
</view> --> </view> -->
<view v-else class="tag" v-else>
<view v-else class="tag">
普通会员 普通会员
</view> </view>
</view> </view>
@ -39,7 +39,7 @@
<view class="activate-tips" style="padding-left: 27rpx;"> <view class="activate-tips" style="padding-left: 27rpx;">
<view>代理商权益</view> <view>代理商权益</view>
<view> <view>
将于<text class="activate-highlight">{{userInfo.endTime}}</text>到期
将于<text class="activate-highlight">{{userInfo.endTime || '-'}}</text>到期
</view> </view>
</view> </view>
<view class="btn-activate" @click="onActivate"> <view class="btn-activate" @click="onActivate">


+ 1
- 1
pages_order/sharing/group.vue View File

@ -5,7 +5,7 @@
<view class="content"> <view class="content">
<image class="avatar" :src="detail.headImage"></image> <image class="avatar" :src="detail.headImage"></image>
<text class="nick-name">{{ detail.headTitle || '' }}</text> <text class="nick-name">{{ detail.headTitle || '' }}</text>
<text class="desc">{{ `群人数:${detail.memberNum || 0}` }}</text>
<text class="desc">{{ `${detail.memberNum || 0}` }}</text>
<template v-if="isLocked"> <template v-if="isLocked">
<button class="btn" type="success" @click="onAdd">加入</button> <button class="btn" type="success" @click="onAdd">加入</button>


+ 15
- 4
pages_order/sharing/personal.vue View File

@ -9,9 +9,10 @@
<template v-if="isLocked"> <template v-if="isLocked">
<button class="btn" type="success" @click="onAdd">添加</button> <button class="btn" type="success" @click="onAdd">添加</button>
</template> </template>
<template v-else>
<view v-else class="flex flex-column qr-popup">
<text class="tips">长按识别二维码了解更多内容</text>
<image class="qr" :src="detail.wxCodeImage" :show-menu-by-longpress="true"></image> <image class="qr" :src="detail.wxCodeImage" :show-menu-by-longpress="true"></image>
</template>
</view>
</view> </view>
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-user.png"></popupUnlock> <popupUnlock ref="popupUnlock" src="../static/sharing/unlock-user.png"></popupUnlock>
@ -175,7 +176,7 @@
margin-top: 30rpx; margin-top: 30rpx;
} }
.btn, .qr {
.btn, .qr-popup {
position: absolute; position: absolute;
} }
@ -195,9 +196,19 @@
box-sizing: border-box; box-sizing: border-box;
} }
.qr-popup {
width: 100vw;
bottom: 269rpx;
.tips {
color: #1B1B1B;
font-size: 32rpx;
}
}
.qr { .qr {
margin-top: 40rpx;
width: 350rpx; width: 350rpx;
height: 350rpx; height: 350rpx;
bottom: 269rpx;
} }
</style> </style>

+ 19
- 8
pages_order/sharing/video.vue View File

@ -12,6 +12,7 @@
:show-fullscreen-btn="false" :show-fullscreen-btn="false"
:show-center-play-btn="true" :show-center-play-btn="true"
@timeupdate="onTimeupdate" @timeupdate="onTimeupdate"
@ended="onTimeEnd"
></video> ></video>
<view class="info"> <view class="info">
<view class="author">{{ detail.author || '' }}</view> <view class="author">{{ detail.author || '' }}</view>
@ -22,8 +23,9 @@
<uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998"> <uv-overlay :show="timeIsUp" @click="onPlay" zIndex="998">
<popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock> <popupUnlock ref="popupUnlock" src="../static/sharing/unlock-video.png"></popupUnlock>
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
</uv-overlay> </uv-overlay>
<popupQrCode ref="popupQrCode" :src="detail.wxCodeImage"></popupQrCode>
</view> </view>
</template> </template>
@ -52,7 +54,7 @@
}, },
timeIsUp: false, timeIsUp: false,
isLocked: true, isLocked: true,
videoContext: null
videoContext: null,
} }
}, },
computed: { computed: {
@ -64,7 +66,6 @@
} }
}, },
async onLoad(option) { async onLoad(option) {
console.log('--onLoad', option)
const { id, state, shareId } = option const { id, state, shareId } = option
if (shareId) { if (shareId) {
@ -115,6 +116,11 @@
} }
}, },
async initData() { async initData() {
this.fetchCheckShare().then(result => {
const { open } = result
this.isLocked = !open
})
await this.fetchDetails(this.id) await this.fetchDetails(this.id)
this.videoContext = uni.createVideoContext('video'); this.videoContext = uni.createVideoContext('video');
@ -137,7 +143,8 @@
if (open) { if (open) {
this.isLocked = false this.isLocked = false
this.$refs.popupQrCode.open()
this.timeIsUp = false
this.videoContext.play()
return return
} }
@ -149,7 +156,6 @@
}, },
async onPlay() { async onPlay() {
if (!this.isLocked) { if (!this.isLocked) {
this.$refs.popupQrCode.open()
return return
} }
@ -160,8 +166,11 @@
if (open) { // if (open) { //
this.isLocked = false this.isLocked = false
this.$refs.popupQrCode.open()
this.timeIsUp = false
this.videoContext.play()
} else { } else {
this.videoContext.pause()
this.timeIsUp = true
uni.showToast({ uni.showToast({
title: `还需转发${need_num - num}`, title: `还需转发${need_num - num}`,
icon: 'none', icon: 'none',
@ -172,13 +181,15 @@
async onTimeupdate(e) { async onTimeupdate(e) {
const { currentTime } = e.target const { currentTime } = e.target
// todo: check
if (currentTime >= this.detail.timeNum) {
if (currentTime >= this.detail.timeNum && this.isLocked) {
this.videoContext.pause() this.videoContext.pause()
this.timeIsUp = true this.timeIsUp = true
this.onPlay() this.onPlay()
} }
}, },
onTimeEnd() {
this.$refs.popupQrCode.open()
},
}, },
} }
</script> </script>


Loading…
Cancel
Save