增加推荐页面
This commit is contained in:
100
pages/video/index.nvue
Normal file
100
pages/video/index.nvue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="min-page " :style="comStyle">
|
||||
<!-- <up-button @click="toDetail">toDetail</up-button> -->
|
||||
<my-video-list isCommand isTabbar v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||
:info="state"
|
||||
></my-video-list>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/api/video/index.js'
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
slice
|
||||
} from 'lodash'
|
||||
|
||||
let height = ref(0)
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
height.value = sysInfo.screenHeight - 50
|
||||
const comStyle = computed(() => {
|
||||
return {
|
||||
// height: height.value + 'px'
|
||||
}
|
||||
})
|
||||
|
||||
function toDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/video/detail?courseId=1208'
|
||||
})
|
||||
}
|
||||
let options = {}
|
||||
const state = reactive({
|
||||
collect: 0,
|
||||
current: {},
|
||||
list: [],
|
||||
price: 0,
|
||||
title: ''
|
||||
})
|
||||
async function init() {
|
||||
const res = await Api.tuijianVideo(options)
|
||||
state.current = res.list[0]
|
||||
Object.assign(state, res)
|
||||
state.list = res.list
|
||||
}
|
||||
|
||||
function update({
|
||||
index,
|
||||
item
|
||||
}) {
|
||||
state.list[index] = item
|
||||
}
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
init()
|
||||
})
|
||||
|
||||
function swiperChange({
|
||||
current,
|
||||
direction,
|
||||
data
|
||||
}) {}
|
||||
|
||||
onShow(() => {
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
height: calc(100vh - 50px);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - 50px);
|
||||
/* #endif */
|
||||
/* #ifdef APP */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
background-color: #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.u-popup {
|
||||
position: fixed;
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +0,0 @@
|
||||
<template>
|
||||
<view class="u-p-60">
|
||||
<up-button @click="toDetail">toDetail</up-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
function toDetail(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/video/detail?courseId=1208'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user