视频列表支付更新
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user