视频详情页面代码更新

This commit is contained in:
YeMingfei666 2025-01-07 11:02:52 +08:00
parent 75088f78c8
commit b26713a0ac
3 changed files with 35 additions and 10 deletions

8
api/video/index.js Normal file
View File

@ -0,0 +1,8 @@
import http from '@/http/http.js'
//获取短剧视频详情
export function getVideoDetail(data) {
return http.request({
url: 'course/courseSets?courseId='+data.courseId,
})
}

View File

@ -1,18 +1,24 @@
<template>
<view>
<!-- #ifdef H5 -->
<swiper :indicator-dots="false" :autoplay="false" :duration="500">
<swiper-item v-for="(item,index) in list" :key="index">
<view class="swiper-item"></view>
</swiper-item>
</swiper>
<!-- #endif -->
</view>
</template>
<script>
export default {
name:"my-video-list",
data() {
return {
};
<script setup>
const props = defineProps({
list: {
type: Array,
default: () => {
[]
}
}
}
})
</script>
<style lang="scss">

View File

@ -6,8 +6,19 @@
<script setup>
import {onLoad,onShow} from '@dcloudio/uni-app'
import * as Api from '@/api/video/index.js'
let options={}
onLoad((opt)=>{
Object.assign(options,opt)
try {
Api.getVideoDetail(options)
} catch (error) {
console.log(error)
setTimeout(()=>{
uni.navigateBack()
},500)
//TODO handle the exception
}
})
onShow(()=>{