<template>
	<view class="">
		<u-navbar :border-bottom="false" back-icon-size="35" :title="title" title-size="32" :background="background"
			:back-text-style="hhyanm" title-color="#000000" back-icon-color="#000000"></u-navbar>
		<!-- 视频列表 -->
		<view class="rmknuy">
			<view class="zyhttry" style="padding: 20rpx 30rpx;">
				<view class="rmknuy-title">{{title}}</view>
			</view>
			<view style="padding: 20rpx 30rpx;">
				<view class="zytlidde" @click="toDetail(item)"
					v-for="(item,index) in dkhkList" :key="index">
					<view class="zytyyrimg" style="overflow: hidden;">
						<image :src="item.cover" mode="aspectFill" style="width: 100%; height: 100%;"></image>
					</view>
					<view class="zytyyopf">
						<view class="zytyotxta"><text>{{item.title}}</text></view>
						
						<view class="flztoa zytyotxtb">
							<text>{{item.lecturer_name}}</text>
						</view>
						<view class="flztoa zytyotxtc" style="margin-top: 6rpx;">
							<text>
								<text style="padding-right: 10rpx;">折扣价格: {{item.current_price}}</text>
								<text>原价格: {{item.original_price}}</text>
							</text>
							<image src="/static/zy/zyb3.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
						</view>
						<view class="flztoa">
							<view class="fzctob zytyotxtc">
								<text>{{item.play_count}}播放量 - 共{{item.chapter_num}}课时</text>
								<!-- <image v-show="xqaxuye" @click="xqaxuye = false" src="/static/zy/zyb1.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image>
								<image  v-show="!xqaxuye"  @click="xqaxuye = true" src="/static/zy/zyb2.png" style="width: 36rpx;height: 36rpx;margin-left: 20rpx;" mode=""></image> -->
							</view>
							<!-- 分钟 -->
							<text class="zytyotxtd">{{item.time}}</text>
						</view>
					</view>
				</view>
				<view class="zyhxyyer"></view>
			</view>
		</view>
	</view>
</template>
<style>
	page {
		background: #FAFAFA;
	}
</style>
<script>
	export default {
		data() {
			return {
				xqaxuye: false,
				xqaxuyea: true,
				xqaxuyeb: true,
				background: {
					backgroundColor: '#ffffff',
				},
				hhyanm: {
					color: '#FFFFFF',
				},
				timestamp: 86400,
				list: [],
				identity: 0, // 0普通用户 1 讲师
				dkhkList:[],
				courseList: [
					{
						id:1,
						cover:'',//封面
						title:'标题',
						original_price:0,
						current_price:0,
						pay_count:0,//领取数量
						one_level_label:0,
						tow_level_label:0,
						type:0,//类型
					},
				],
				id: '',
				title: ''
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.title = option.title;
			this.getCourseListByLabel();
			this.identity = uni.getStorageSync('userinfo').identity || 0
			
		},
		methods: {
			// 课程筛选 
			getCourseListByLabel() {
				let that = this;
				this.$request.getCourseListByLabel({
					tow_label:that.id, 
				}).then(res => {
					console.log(res)
					this.dkhkList = res.data;
				}).catch(err => {
					console.log(err)
				})
			},
			toDetail(i) {
				let item = JSON.stringify(i);
				uni.navigateTo({
					url: './kcxq-x?item=' + item
				})
			},
		}


	}
</script>

<style lang="scss" scoped>
	.rmknuy{
		padding-bottom: 100rpx;
	}
	.rmknuy-title{
		font-size: 40rpx;
		font-weight: bold;
	}
	.nav{width: 80rpx;height: 80rpx !important;margin: 0 auto;}
	.nav-box{
		display: flex;
		width: 100%;
		flex-wrap: wrap; padding: 0 0 40rpx 0;margin-bottom: 15rpx;}
	.grid-item{
		width: 25%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		text-align: center;
		margin-top: 20rpx;
		}
	.nav-box .text{margin-top: 8rpx;}
	.bgfff{background-color: #fff;}
</style>
