修复h5一进来是未解锁剧集时选集等信息不出现问题

This commit is contained in:
YeMingfei666 2025-01-13 14:33:04 +08:00
parent 8728844446
commit adf4fcfcfc
3 changed files with 37 additions and 12 deletions

View File

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

View File

@ -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%'})`

View File

@ -48,7 +48,11 @@
index,
item
}) {
state.list[index] = item
if(item){
state.list[index] = item
}else{
init()
}
}
onLoad((opt) => {
Object.assign(options, opt)