增加短剧视频详情页面

This commit is contained in:
YeMingfei666 2025-01-07 17:26:09 +08:00
parent 7c978d7e85
commit b244bf94d7
2 changed files with 41 additions and 18 deletions

View File

@ -1,25 +1,47 @@
<template> <template>
<view class="min-page"> <view class="min-page">
<my-video-list></my-video-list> <my-video-list @swiperChange="swiperChange" :list="state.list" :isCollect="state.isCollect" @share="share"
></my-video-list>
</view> </view>
</template> </template>
<script setup> <script setup>
import {onLoad,onShow} from '@dcloudio/uni-app' import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import * as Api from '@/api/video/index.js' import * as Api from '@/api/video/index.js'
import {
reactive
} from 'vue'
import {
slice
} from 'lodash'
let options = {} let options = {}
const state = reactive({
collect: 0,
current: {},
list: [],
price: 0,
title: ''
})
async function init() {
const res = await Api.getVideoDetail(options)
Object.assign(state, res)
state.list = res.list
}
onLoad((opt) => { onLoad((opt) => {
Object.assign(options, opt) Object.assign(options, opt)
try { init()
Api.getVideoDetail(options)
} catch (error) {
console.log(error)
setTimeout(()=>{
uni.navigateBack()
},500)
//TODO handle the exception
}
}) })
function swiperChange({
current,
direction,
data
}) {
}
onShow(() => { onShow(() => {
}) })
@ -28,6 +50,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.min-page { .min-page {
height: 100vh; height: 100vh;
flex: 1;
background-color: #000; background-color: #000;
overflow: hidden; overflow: hidden;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<view> <view class="u-p-60">
<up-button @click="toDetail">toDetail</up-button> <up-button @click="toDetail">toDetail</up-button>
</view> </view>
</template> </template>