视频详情页面代码更新
This commit is contained in:
8
api/video/index.js
Normal file
8
api/video/index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import http from '@/http/http.js'
|
||||||
|
|
||||||
|
//获取短剧视频详情
|
||||||
|
export function getVideoDetail(data) {
|
||||||
|
return http.request({
|
||||||
|
url: 'course/courseSets?courseId='+data.courseId,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,18 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
const props = defineProps({
|
||||||
name:"my-video-list",
|
list: {
|
||||||
data() {
|
type: Array,
|
||||||
return {
|
default: () => {
|
||||||
|
[]
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -6,8 +6,19 @@
|
|||||||
|
|
||||||
<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'
|
||||||
|
let options={}
|
||||||
onLoad((opt)=>{
|
onLoad((opt)=>{
|
||||||
|
Object.assign(options,opt)
|
||||||
|
try {
|
||||||
|
Api.getVideoDetail(options)
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.navigateBack()
|
||||||
|
},500)
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
})
|
})
|
||||||
onShow(()=>{
|
onShow(()=>{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user