<template>
	<view >
		<view class="video_body">
			<view class="video_box">
				<image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
			</view>
			<view>
				<u-row >
					<u-col span="8" offset="1">
						<view class="video_t1">
							{{detail.name}}
						</view>
					</u-col>
					<u-col span="3">
						<view class="price_num">
							￥{{detail.price}}
						</view>
					</u-col>
				</u-row>
			</view>
			<view>
				<u-tabs :list="list" font-size="24" bar-width="110" :current="current" @change="change" active-color="#32467B"></u-tabs>
			</view>
			<u-line color="#D6D6DB" />
			<view v-if="current==0">
				<!-- 重点考点介绍-->
				<view style="margin-top: 15rpx;">
					<u-row >
						<u-col span="9" >
							<view class="video_t2" style="display: flex;align-items: center;">
								<view class="top_line"></view>
								重点考点介绍
							</view>
						</u-col>
					</u-row>
					<view class="text_box">
						<u-parse :html="detail.introduction"></u-parse>
					</view>
				</view>
				<u-line color="#D6D6DB" />
			</view>
			<!-- 出题名师-->
			<view v-if="current<=1">
				<view style="margin: 15rpx 0;">
					<u-row >
						<u-col span="8" >
							<view class="video_t2" style="display: flex;align-items: center;">
								<view class="top_line"></view>
								出题名师
							</view>
						</u-col>
					</u-row>
					<view  v-for="(item,index) in teacherList" :key="index">
						<u-row >
							<view style="margin: 25rpx;display: flex;">
								<view >
									<image :src="$method.splitImgHost(item.avatar)" class="teacher_img"></image>
								</view>
								<view class="teacher_t">
									{{item.introduce}}
								</view>
							</view>
						</u-row>
					</view>
					
				</view>
				<u-line color="#D6D6DB" />
			</view>
			<!-- 相关推荐-->
			<view style="margin: 15rpx 0;">
				<u-row >
					<u-col span="8" >
						<view class="video_t2" style="display: flex;align-items: center;">
							<view class="top_line"></view>
							相关推荐
						</view>
					</u-col>
				</u-row>
				<view style="margin: 10rpx;">
					<view class="tj_box" v-for="(item,index) in recommendList" :key="index" @click="jumpDetail(item)">
						<image :src="$method.splitImgHost(item.coverUrl)"   style="width: 320rpx;height: 160rpx;"></image>
						<view style="font-size: 24rpx;color: #666666;text-align: left;">
							{{item.name}}
						</view>
						<view>
							<u-row >
								<u-col span="6" >
									<view style="margin-left: 20rpx;">
										<image src="/static/people.png"   style="width: 20rpx;height: 20rpx;"></image>
										<text style="color: #999999;font-size: 20rpx;margin-left: 10rpx;">2023</text>
									</view>
								</u-col>
								<u-col span="6" text-align="right">
									<text style="color: #E91313;font-size: 16rpx;margin-left: 8rpx;">
										活动价 
									</text>
									<text style="color: #E91313;font-size: 24rpx;font-weight: bold;">
										￥{{item.price}}
									</text>
								</u-col>
							</u-row>
						</view>
						
					</view>
				</view>
			</view>
		</view>
		<view  class="footer_tab">
			<u-line color="#D6D6DB" />
			<view style="height: 100%;display: flex;align-items: center;position: relative;">
				<view style="text-align: center;margin-left: 30rpx;">
					<image src="/static/sc.png" class="sc"></image>
					<view class="sc_t">收藏</view>
				</view>
				
				<view class="buy" @click="jumpRead">
					开始阅读
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '重点考点介绍'
				}, {
					name: '出题名师',
				}, {
					name: '相关推荐',
				}],
				current: 0,
				id:0,
				detail:{},
				teacherList:[],
				recommendList:[]
			}
		},
		onLoad(option) {
			this.id = option.id
			this.getDetail()
			this.noteRecommendList({fileId:this.id})
		},
		onShow(){
		},
		methods: {
			jumpDetail(item) {
				this.$navTo.togo('/pages2/course/keynote', {
					id:item.fileId
				});
			},
			getDetail(){
				let self = this
				this.$api.noteInfo(this.id).then(res => {
					self.detail = res.data.data
					 if(self.detail.teacherIds&&self.detail.teacherIds!=''){
						 let param = {
							 teacherIds : self.detail.teacherIds
						 }
						 self.getTeacherList(param);
					} 
				})
			},
			getTeacherList(param){
				let self = this
				this.$api.teacherList(param).then(res => {
					self.teacherList = res.data.rows 
					
				})
			},
			noteRecommendList(param){
				let self = this
				this.$api.noteRecommendList(param).then(res => {
					self.recommendList = res.data.data
					
				})
			},
			change(index) {
				this.current = index;
			},
			jumpRead(){
				if(!this.$method.isLogin()){
					this.$navTo.togo('/pages/login/login');
				}else{
					this.$navTo.togo('/pages2/payment/payment', {})
				//	this.$navTo.togo('/pages2/course/read', {})
				}
				
			}
		
		},
		
	}
</script>
<style>
	::-webkit-scrollbar{
		width: 0;
		height: 0;
		color: transparent;
	}
</style>
<style scope>
	.text_box{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #666666;
		line-height: 36rpx;
		padding: 20rpx;
	}
	.price_num{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #E91313;
	}
	.price_t2{
		font-size: 18rpx;
		font-family: PingFang SC;
		font-weight: 500;
		text-decoration: line-through;
		color: #999999;
	}
	.price_t1{
		font-size: 33rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #E91313;
	}
	.sc_t{
		font-size: 22rpx;
		color: #000000;
	}
	.sc{
		width: 29rpx ;
		height: 29rpx;
	}
	.buy{
		width: 138rpx;
		height: 48rpx;
		line-height: 48rpx;
		background: #32467B;
		border-radius: 10rpx;
		color: #FFFFFF;
		font-size: 28rpx;
		text-align: center;
		vertical-align: middle;
		position: absolute;
		right: 30rpx;
	}
	.video_body{
		padding-bottom: 96rpx;
	}
	.footer_tab{
		position:fixed;
		bottom:0;
		height: 96rpx;
		width: 100%;
		background-color: #FFFFFF;
	}
	.tj_box{
		width: 50%;
		display: inline-block;
		text-align: center;
		margin: 10rpx 0;
	}
	.teacher_t{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #666666;
		line-height: 36rpx;
		margin-left: 15rpx;
	}
	.teacher_img{
		width: 87rpx;
		height: 129rpx;
	}
	.t2{
		font-size: 24rpx;
		font-family: PingFang SC;
		color: #666666;
		line-height: 36rpx;
		margin: 15rpx;
	}
	.r_t2{
		width: 201rpx;
		height: 49rpx;
		background: rgba(22, 119, 255, 0.05);
		border: 1rpx solid #32467B;
		border-radius: 16rpx;
		color: #666666;
		font-size: 23rpx;
		text-align: center;
		display: flex;
		align-items: center;
		padding: 5rpx;
		
	}
	.scroll_box{
		width: 100%;
		height: 60rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
		white-space:nowrap;
		overflow: hidden;
		margin: 15rpx 0;
	}
	.r_sliper{
		padding: 0 20rpx;
	}
	.top_line{
		width: 6rpx;
		height: 22rpx;
		background: #32467B;
		margin-right: 10rpx;
	}
	.video_t2{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #666666;
	}
	.video_t1{
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
	}
	.video_play{
		position:absolute;
		width: 95rpx;
		height: 95rpx;
		top:0;
		left:0;
		right:0;
		bottom:0;
		margin:auto;
	}
	.video_box{
		position: relative;
	}
	
page {
		background: #FFFFFF;
	}
</style>
