From 2969521d89de54450a675f79ef2f08e4a1e53ef8 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 14 Jan 2025 09:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=B6=E5=8F=91=E6=80=A7?= =?UTF-8?q?=E7=9F=AD=E5=89=A7=E8=AF=A6=E6=83=85=E8=A7=86=E9=A2=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9C=AA=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E4=BD=8D=E7=BD=AE?= 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 | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/my-video-list/list-item.vue b/components/my-video-list/list-item.vue index df8b80b..8d7abd4 100644 --- a/components/my-video-list/list-item.vue +++ b/components/my-video-list/list-item.vue @@ -244,6 +244,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 c0d2312..47d6e58 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -157,7 +157,7 @@ import { useCommonStore } from '@/store/common.js' - const $common=useCommonStore() + const $common = useCommonStore() // #ifdef APP const domModule = uni.requireNativePlugin('dom') // #endif @@ -167,7 +167,8 @@ } from '@/commons/config.js' import color from '@/commons/color.js' import { - debounce,throttle + debounce, + throttle } from 'lodash'; import * as Api from '@/api/video/index.js' import infoBox from '@/utils/infoBox.js' @@ -255,7 +256,7 @@ const $mountedComponents = {} function itemMounted(index) { - // $mountedComponents[index]=true + $mountedComponents[index]=true } function back() { @@ -305,7 +306,7 @@ let cacheIndex = null function appear(isFirst, item, index) { - if (isFirst) { + if(isFirst){ $mountedComponents[index] = true } if (!initing) { @@ -334,7 +335,7 @@ async function payOrder(data) { const res = await Api.payOrder(data) if (res) { - uni.setStorageSync('nobuyCourseId',popup.data.courseId) + uni.setStorageSync('nobuyCourseId', popup.data.courseId) // #ifdef APP uni.navigateTo({ url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url @@ -405,7 +406,7 @@ function jiClick(item, index) { - initing=false + initing = false let newCurrent = (current.value + 1) % 3; videoList.value[newCurrent] = item; current.value = newCurrent; @@ -433,7 +434,8 @@ console.log('goListPosition:' + index) const el = refList.value[index] if (initing) { - if (!$mountedComponents[props.list.length - 1]) { + console.log($mountedComponents); + if (!$mountedComponents[index]) { positonmer = setTimeout(() => { goListPosition(index) }, 200) @@ -473,7 +475,7 @@ } - let goldBili = ref($common.goldBili||0) + let goldBili = ref($common.goldBili || 0) let wHeight = ref(0) async function configInit() { goldBili.value = $common.goldBili