From 6a5a96558c37c6d2c06ffc2e9127341e0283f797 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 13 Jan 2025 16:19:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=94=AF=E4=BB=98=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-video-list/my-video-list.vue | 1 + pages/video/detail.nvue | 28 ++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index e08a27a..13c1b46 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -339,6 +339,7 @@ // #ifdef H5 window.location.href = res.h5Url // #endif + popupClose() } } //金币支付 diff --git a/pages/video/detail.nvue b/pages/video/detail.nvue index 9fbd9ad..a087f23 100644 --- a/pages/video/detail.nvue +++ b/pages/video/detail.nvue @@ -1,7 +1,7 @@ @@ -12,14 +12,15 @@ } from '@dcloudio/uni-app' import * as Api from '@/api/video/index.js' import { - reactive, ref + reactive, + ref } from 'vue' import { slice } from 'lodash' - const boxStyle = { - height: '835px' - } + + const sysInfo = uni.getSystemInfoSync() + let isFirstLoad=true let options = {} const state = reactive({ collect: 0, @@ -28,10 +29,11 @@ price: 0, title: '' }) - const refVideoList=ref(null) + const refVideoList = ref(null) async function init() { try { const res = await Api.getVideoDetail(options) + isFirstLoad=false Object.assign(state, res) state.list = res.list } catch (error) { @@ -49,11 +51,10 @@ index, item }) { - if(item){ + if (item) { state.list[index] = item - }else{ + } else { await init() - refVideoList.value.videoListUpdata() } } onLoad((opt) => { @@ -67,8 +68,11 @@ data }) {} - onShow(() => { - init() + onShow(async () => { + if(!isFirstLoad){ + await init() + refVideoList.value.videoListUpdata() + } })