<template>
	<view class="min-page " >
		<!-- <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'


	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;
		flex: 1;
	}

	.u-popup {
		position: fixed;
	}
</style>