From adf4fcfcfcf076eca84be6c10c45a13f89b46888 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 13 Jan 2025 14:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dh5=E4=B8=80=E8=BF=9B=E6=9D=A5?= =?UTF-8?q?=E6=98=AF=E6=9C=AA=E8=A7=A3=E9=94=81=E5=89=A7=E9=9B=86=E6=97=B6?= =?UTF-8?q?=E9=80=89=E9=9B=86=E7=AD=89=E4=BF=A1=E6=81=AF=E4=B8=8D=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-video-list/list-item.vue | 1 + components/my-video-list/my-video-list.vue | 42 ++++++++++++++++------ pages/video/detail.nvue | 6 +++- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/components/my-video-list/list-item.vue b/components/my-video-list/list-item.vue index 3878bab..f1f1cbc 100644 --- a/components/my-video-list/list-item.vue +++ b/components/my-video-list/list-item.vue @@ -233,6 +233,7 @@ }) onMounted(() => { init() + console.log('itemMounted', props.index); emits('itemMounted', props.index) }) diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index addc099..acd7606 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -332,10 +332,6 @@ const res = await Api.payOrder(data) console.log(res); if (res) { - uni.navigateTo({ - url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url - }); - return // #ifdef APP uni.navigateTo({ url: '/pages/pays/pays?orderId=' + res.orderId + '&url=' + res.h5Url @@ -348,8 +344,20 @@ } //金币支付 async function goldPay(data) { + emits('update', { + index: popup.index + }) const res = await Api.goldPay(data) - console.log(res); + if (res) { + uni.showToast({ + title: '解锁成功', + icon: 'none' + }) + emits('update', { + index: popup.index + }) + } + } //确认支付 async function payConfirm() { @@ -364,21 +372,21 @@ if (num == 1) { data.courseDetailsId = popup.data.courseDetailsId } - + const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data) if (res) { - if(type=='gold'){ + if (type == 'gold') { goldPay({ orderId: res.orders.ordersId }) - }else{ + } else { payOrder({ orderId: res.orders.ordersId }) } - + } else { - + } @@ -420,7 +428,7 @@ clearTimeout(positonmer) console.log('goListPosition:' + index) const el = refList.value[index] - if ($mountedComponents[props.list.length - 1]) { + if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) { domModule.scrollToElement(el, { animated: false }) @@ -682,6 +690,12 @@ return videoList.value[current.value].price }) const rightStyle = computed(() => { + const item = props.list[nowIndex.value] + if (!item.videoUrl) { + return { + transform: `translateX(0)` + } + } // #ifdef H5 return { transform: `translateX(${!control.showControls?'0':60}px)` @@ -694,6 +708,12 @@ // #endif }) const infoStyle = computed(() => { + const item = props.list[nowIndex.value] + if (!item.videoUrl) { + return { + transform: `translateX(0)` + } + } // #ifdef H5 return { transform: `translateX(${!control.showControls?0:'-110%'})` diff --git a/pages/video/detail.nvue b/pages/video/detail.nvue index da418ea..e27861d 100644 --- a/pages/video/detail.nvue +++ b/pages/video/detail.nvue @@ -48,7 +48,11 @@ index, item }) { - state.list[index] = item + if(item){ + state.list[index] = item + }else{ + init() + } } onLoad((opt) => { Object.assign(options, opt)