Browse Source

Merge pull request 'fox' (#10) from fox into master

Reviewed-on: http://175.178.51.79:3000/hly/fission-star-applet-250304/pulls/10
fox
Fox 1 month ago
parent
commit
27af45486a
5 changed files with 29 additions and 78 deletions
  1. +3
    -8
      pages_order/auth/wxLogin.vue
  2. +1
    -3
      pages_order/sharing/article.vue
  3. +7
    -12
      pages_order/sharing/group.vue
  4. +7
    -9
      pages_order/sharing/personal.vue
  5. +11
    -46
      pages_order/sharing/video.vue

+ 3
- 8
pages_order/auth/wxLogin.vue View File

@ -93,14 +93,9 @@
} }
}, },
onCancel() { onCancel() {
uni.navigateBack({
delta: 1,
fail: () => {
uni.reLaunch({
url: '/pages/index/index'
})
}
});
uni.reLaunch({
url: '/pages/index/index'
})
}, },
} }
} }


+ 1
- 3
pages_order/sharing/article.vue View File

@ -55,7 +55,7 @@
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) { if (this.id && uni.getStorageSync('token')) {
this.initData()
this.detail.id ? this.refreshLockStatus() : this.initData()
} }
}, },
async onLoad(option) { async onLoad(option) {
@ -103,8 +103,6 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
this.refreshLockStatus()
return o return o
}, },
methods: { methods: {


+ 7
- 12
pages_order/sharing/group.vue View File

@ -48,7 +48,7 @@
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) { if (this.id && uni.getStorageSync('token')) {
this.fetchDetails()
this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
} }
}, },
onLoad(option) { onLoad(option) {
@ -88,17 +88,12 @@
query: `id=${this.id}&state=2&shareId=${this.userInfo.id}`, query: `id=${this.id}&state=2&shareId=${this.userInfo.id}`,
} }
//
const params = {
id:this.id,
state:"2",
}
this.$fetch('addLogShareInfo', params)
this.refreshLockStatus()
//
const params = {
id:this.id,
state:"2",
}
this.$fetch('addLogShareInfo', params)
return o return o
}, },


+ 7
- 9
pages_order/sharing/personal.vue View File

@ -49,7 +49,7 @@
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) { if (this.id && uni.getStorageSync('token')) {
this.fetchDetails()
this.detail.id ? this.refreshLockStatus() : this.fetchDetails()
} }
}, },
onLoad(option) { onLoad(option) {
@ -89,14 +89,12 @@
query: `id=${this.id}&state=0&shareId=${this.userInfo.id}`, query: `id=${this.id}&state=0&shareId=${this.userInfo.id}`,
} }
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
this.refreshLockStatus()
//
const params = {
id:this.id,
state:"0",
}
this.$fetch('addLogShareInfo', params)
return o return o
}, },


+ 11
- 46
pages_order/sharing/video.vue View File

@ -62,7 +62,7 @@
}, },
onShow() { onShow() {
if (this.id && uni.getStorageSync('token')) { if (this.id && uni.getStorageSync('token')) {
this.initData()
this.detail.id ? this.refreshLockStatus() : this.initData()
} }
}, },
async onLoad(option) { async onLoad(option) {
@ -110,8 +110,6 @@
} }
this.$fetch('addLogShareInfo', params) this.$fetch('addLogShareInfo', params)
this.refreshLockStatus()
return o return o
}, },
methods: { methods: {
@ -123,11 +121,7 @@
} }
}, },
async initData() { async initData() {
this.fetchCheckShare().then(result => {
const { open } = result
this.isLocked = !open
})
this.isLocked = true
await this.fetchDetails(this.id) await this.fetchDetails(this.id)
this.videoContext = uni.createVideoContext('video'); this.videoContext = uni.createVideoContext('video');
@ -139,51 +133,22 @@
return {} return {}
} }
}, },
async refreshLockStatus() {
const result = await this.fetchCheckShare()
const { title, open } = result
console.log('--open', open)
this.$refs.popupUnlock.close();
if (open) {
this.isLocked = false
this.timeIsUp = false
refreshLockStatus() {
this.isLocked = false
this.timeIsUp = false
setTimeout(() => {
this.videoContext.play() this.videoContext.play()
return
}
title && uni.showToast({
title,
icon: 'none'
console.log('--play')
}) })
}, },
async onPlay() { async onPlay() {
if (!this.isLocked) { if (!this.isLocked) {
return return
} }
const result = await this.fetchCheckShare()
const { open, need_num, num } = result
console.log('--open', open)
if (open) { //
this.isLocked = false
this.timeIsUp = false
this.videoContext.play()
} else {
this.videoContext.pause()
this.timeIsUp = true
uni.showToast({
title: `还需转发${need_num - num}`,
icon: 'none',
})
this.$refs.popupUnlock.open();
}
this.videoContext.pause()
this.timeIsUp = true
this.$refs.popupUnlock.open();
}, },
async onTimeupdate(e) { async onTimeupdate(e) {
const { currentTime } = e.target const { currentTime } = e.target


Loading…
Cancel
Save