修复偶发性短剧详情视频页面未跳转到播放历史位置

This commit is contained in:
2025-01-14 09:45:25 +08:00
parent 34e1b9ed1f
commit 2969521d89
2 changed files with 11 additions and 8 deletions

View File

@@ -244,6 +244,7 @@
}) })
onMounted(() => { onMounted(() => {
init() init()
console.log('itemMounted',props.index);
emits('itemMounted', props.index) emits('itemMounted', props.index)
}) })

View File

@@ -157,7 +157,7 @@
import { import {
useCommonStore useCommonStore
} from '@/store/common.js' } from '@/store/common.js'
const $common=useCommonStore() const $common = useCommonStore()
// #ifdef APP // #ifdef APP
const domModule = uni.requireNativePlugin('dom') const domModule = uni.requireNativePlugin('dom')
// #endif // #endif
@@ -167,7 +167,8 @@
} from '@/commons/config.js' } from '@/commons/config.js'
import color from '@/commons/color.js' import color from '@/commons/color.js'
import { import {
debounce,throttle debounce,
throttle
} from 'lodash'; } from 'lodash';
import * as Api from '@/api/video/index.js' import * as Api from '@/api/video/index.js'
import infoBox from '@/utils/infoBox.js' import infoBox from '@/utils/infoBox.js'
@@ -255,7 +256,7 @@
const $mountedComponents = {} const $mountedComponents = {}
function itemMounted(index) { function itemMounted(index) {
// $mountedComponents[index]=true $mountedComponents[index]=true
} }
function back() { function back() {
@@ -305,7 +306,7 @@
let cacheIndex = null let cacheIndex = null
function appear(isFirst, item, index) { function appear(isFirst, item, index) {
if (isFirst) { if(isFirst){
$mountedComponents[index] = true $mountedComponents[index] = true
} }
if (!initing) { if (!initing) {
@@ -334,7 +335,7 @@
async function payOrder(data) { async function payOrder(data) {
const res = await Api.payOrder(data) const res = await Api.payOrder(data)
if (res) { if (res) {
uni.setStorageSync('nobuyCourseId',popup.data.courseId) uni.setStorageSync('nobuyCourseId', popup.data.courseId)
// #ifdef APP // #ifdef APP
uni.navigateTo({ uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
@@ -405,7 +406,7 @@
function jiClick(item, index) { function jiClick(item, index) {
initing=false initing = false
let newCurrent = (current.value + 1) % 3; let newCurrent = (current.value + 1) % 3;
videoList.value[newCurrent] = item; videoList.value[newCurrent] = item;
current.value = newCurrent; current.value = newCurrent;
@@ -433,7 +434,8 @@
console.log('goListPosition:' + index) console.log('goListPosition:' + index)
const el = refList.value[index] const el = refList.value[index]
if (initing) { if (initing) {
if (!$mountedComponents[props.list.length - 1]) { console.log($mountedComponents);
if (!$mountedComponents[index]) {
positonmer = setTimeout(() => { positonmer = setTimeout(() => {
goListPosition(index) goListPosition(index)
}, 200) }, 200)
@@ -473,7 +475,7 @@
} }
let goldBili = ref($common.goldBili||0) let goldBili = ref($common.goldBili || 0)
let wHeight = ref(0) let wHeight = ref(0)
async function configInit() { async function configInit() {
goldBili.value = $common.goldBili goldBili.value = $common.goldBili