视频列表支付更新

This commit is contained in:
2025-01-13 15:50:56 +08:00
parent 2ef47931e5
commit 3433ebb6aa
4 changed files with 92 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="min-page">
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
:info="state"></my-video-list>
</view>
</template>
@@ -12,7 +12,7 @@
} from '@dcloudio/uni-app'
import * as Api from '@/api/video/index.js'
import {
reactive
reactive, ref
} from 'vue'
import {
slice
@@ -28,6 +28,7 @@
price: 0,
title: ''
})
const refVideoList=ref(null)
async function init() {
try {
const res = await Api.getVideoDetail(options)
@@ -44,14 +45,15 @@
}
}
function update({
async function update({
index,
item
}) {
if(item){
state.list[index] = item
}else{
init()
await init()
refVideoList.value.videoListUpdata()
}
}
onLoad((opt) => {