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

This commit is contained in:
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(() => { onMounted(() => {
init() init()
console.log('itemMounted', props.index);
emits('itemMounted', props.index) emits('itemMounted', props.index)
}) })

View File

@@ -332,10 +332,6 @@
const res = await Api.payOrder(data) const res = await Api.payOrder(data)
console.log(res); console.log(res);
if (res) { if (res) {
uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
});
return
// #ifdef APP // #ifdef APP
uni.navigateTo({ uni.navigateTo({
url: '/pages/pays/pays?orderId=' + res.orderId + '&url=' + res.h5Url url: '/pages/pays/pays?orderId=' + res.orderId + '&url=' + res.h5Url
@@ -348,8 +344,20 @@
} }
//金币支付 //金币支付
async function goldPay(data) { async function goldPay(data) {
emits('update', {
index: popup.index
})
const res = await Api.goldPay(data) const res = await Api.goldPay(data)
console.log(res); if (res) {
uni.showToast({
title: '解锁成功',
icon: 'none'
})
emits('update', {
index: popup.index
})
}
} }
//确认支付 //确认支付
async function payConfirm() { async function payConfirm() {
@@ -364,21 +372,21 @@
if (num == 1) { if (num == 1) {
data.courseDetailsId = popup.data.courseDetailsId data.courseDetailsId = popup.data.courseDetailsId
} }
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data) const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
if (res) { if (res) {
if(type=='gold'){ if (type == 'gold') {
goldPay({ goldPay({
orderId: res.orders.ordersId orderId: res.orders.ordersId
}) })
}else{ } else {
payOrder({ payOrder({
orderId: res.orders.ordersId orderId: res.orders.ordersId
}) })
} }
} else { } else {
} }
@@ -420,7 +428,7 @@
clearTimeout(positonmer) clearTimeout(positonmer)
console.log('goListPosition:' + index) console.log('goListPosition:' + index)
const el = refList.value[index] const el = refList.value[index]
if ($mountedComponents[props.list.length - 1]) { if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) {
domModule.scrollToElement(el, { domModule.scrollToElement(el, {
animated: false animated: false
}) })
@@ -682,6 +690,12 @@
return videoList.value[current.value].price return videoList.value[current.value].price
}) })
const rightStyle = computed(() => { const rightStyle = computed(() => {
const item = props.list[nowIndex.value]
if (!item.videoUrl) {
return {
transform: `translateX(0)`
}
}
// #ifdef H5 // #ifdef H5
return { return {
transform: `translateX(${!control.showControls?'0':60}px)` transform: `translateX(${!control.showControls?'0':60}px)`
@@ -694,6 +708,12 @@
// #endif // #endif
}) })
const infoStyle = computed(() => { const infoStyle = computed(() => {
const item = props.list[nowIndex.value]
if (!item.videoUrl) {
return {
transform: `translateX(0)`
}
}
// #ifdef H5 // #ifdef H5
return { return {
transform: `translateX(${!control.showControls?0:'-110%'})` transform: `translateX(${!control.showControls?0:'-110%'})`

View File

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