<template>
	<view class="container">
		<!-- 课程详情 -->
		<view class="courseInfoContent">
			<view class="thumbnailBox">
				<img :src="courseInfoItem.displayImage" alt="">
			</view>
			<view class="courseDetailBox">
				<h4>{{courseInfoItem.fileTitle}}</h4>
				<view class="summaryBox">
					<text>{{courseInfoItem.fileSynopsis}}</text>
				</view>
				<view class="dataBox">
					<strong>￥{{courseInfoItem.coursePrice}}</strong>
					<text>{{courseInfoItem.salesNumber}}人购买</text>
				</view>
				<view class="tagListBox">
					<view class="tagItem">{{courseInfoItem.fileLecturerName}}</view>
					<view class="tagItem">{{courseInfoItem.fileLecturerRanks}}</view>
				</view>
			</view>
		</view>
		<!-- 价格明细 -->
		<view class="priceInfoContent">
			<h4>价格明细</h4>
			<view><text>现价</text><text>￥{{courseInfoItem.coursePrice}}</text></view>
			<view>
				<text>积分抵扣<i class="iconfont icon-31tishi"></i></text>
				<text class="integralBox">未选积分，可抵扣XXX<i class="iconfont icon-youjiantou"></i></text>
			</view>
			<view><text>合计</text><text>￥{{courseInfoItem.coursePrice}}</text></view>
		</view>
		<!-- 支付方式 -->
		<view class="paymentMethodContent">
			<h4>选择支付方式</h4>
			<view class="paymentItem">
				<view>
					<i class="iconfont icon-zhifubao"></i>
					<text>支付宝支付</text>
				</view>
				<view class="selectRadio actived">
					<i class="iconfont icon-duihao"></i>
				</view>
				
			</view>
			<view class="paymentItem">
				<view>
					<i class="iconfont icon-py_weixinzhifu"></i>
					<text>微信支付</text>
				</view>
				<view class="selectRadio">
					<i class="iconfont icon-duihao"></i>
				</view>
			</view>
		</view>
		<!-- 底部 -->
		<view class="totalContent">
			<view class="priceInfoBox">
				<view>合计： <strong style="font-size: 36rpx;">￥{{courseInfoItem.coursePrice}}</strong></view>
				<view>共优惠：<strong style="color:#F15A1F">￥{{courseInfoItem.coursePrice}}</strong> </view>
			</view>
			<view class="confirmOrder">提交订单</view>
		</view>
	</view>
</template>

<script>
	import api from "@/api/api";
	export default {
		data() {
			return {
				courseInfoItem:{},
				fileId:null
			}
		},
		methods: {
			// 课程详情页面
			courseDetail(){
				api.courseDetail({fileId:this.fileId}).then(res=>{
					console.log('课程详情',res);
					if(res['success']){
						this.courseInfoItem =  res['data']['data'];
					}
				})
			},
		},
		onLoad(option){
			console.log(option)
			this.fileId = option.fileId;
			
		},
		mounted() {
			this.courseDetail();
		}
	}
</script>

<style lang="scss">
	.container{
		position: relative;
		height: 100%;
		.courseInfoContent{
			display: flex;
			align-items: center;
			background-color: #fff;
			border-radius: 20rpx;
			margin-bottom: 10rpx;
			padding: 5rpx 10rpx;
			.thumbnailBox{
				width: 200rpx;
				height: 200rpx;
				background-color: #888;
				margin-right: 26rpx;
				img{
					max-width: 100%;
					height: auto;
				}
			}
			.courseDetailBox{
				width: 100%;
				color: #333;
				h4{
					font-size: 32rpx;
				}
				.summaryBox{
					font-size: 24rpx;
					margin: 10rpx 0;
					text{
						margin-right: 20rpx;
					}
				}
				.dataBox{
					strong{
						color: #F15A1F;
						font-size: 30rpx;
						margin-right: 20rpx;
					}
					text{
						font-size: 28rpx;
					}
				}
				.tagListBox{
					display: flex;
					.tagItem{
						color: #20279B;
						font-size: 28rpx;
						border-radius: 20rpx;
						border-top-left-radius: 0;
						border-bottom-right-radius: 0;
						padding: 10rpx 18rpx;
						border: 1px solid #20279B;
						margin-right: 20rpx;
					}
				}
			}
		}
		.priceInfoContent,.paymentMethodContent,.totalContent{
			background-color: #fff;
			margin: 0 10rpx;
			padding: 20rpx;
		}
		.priceInfoContent{
			view{
				display: flex;
				justify-content: space-between;
				text{
					&:last-child{
						font-weight: bold;
					}
					&.integralBox{
						color: #FA6900;
						font-weight: normal;
						.iconfont{
							color: #999;
						}
					}
				}
				.iconfont{
					margin-left: 10rpx;
				}
				
			}
		}
		.priceInfoContent,.paymentMethodContent{
			border-bottom: 5px solid #fbfbfb;
			color: #333;
			h4{
				font-size: 32rpx;
				margin-bottom: 20rpx;
			}
			view{
				margin-bottom: 10rpx;
			}
		}
		.paymentMethodContent{
			.paymentItem{
				display: flex;
				align-items: center;
				justify-content: space-between;
				view{
					display: flex;
					align-items: center;
				}
				.icon-zhifubao{
					color: #5A9EF7;
					font-size: 60rpx;
					margin-right: 20rpx;
				}
				.icon-py_weixinzhifu{
					color: #09BB07;
					font-size: 60rpx;
					margin-right: 20rpx;
				}
				.selectRadio{
					width: 40rpx;
					height: 40rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					border-radius: 50%;
					border: 1px solid #D8D8D8;
					color: transparent;
					&.actived{
						background-color: #0A2F99;
						color: #fff;
					}
				}
				
			}
		}
		.totalContent{
			position: absolute;
			bottom: 0;
			left: 0;
			width: 100%;
			padding: 40rpx 28rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			box-sizing: border-box;
			.priceInfoBox{
				font-size: 30rpx;
				color: #333;
				view:first-child{
					margin-bottom: 10rpx;
				}
			}
			.confirmOrder{
				    background-color: #20269B;
				    color: #fff;
				    padding: 14rpx 38rpx;
					border-radius: 80rpx;
			}
		}
	}

</style>
