<template>
	<view class="web_box">
		<!-- <u-navbar height="44" leftIcon="arrow-left" leftIconColor="#000" :leftText="leftText" @leftClick="leftClick" :autoBack="true" bgColor="#fff">
		</u-navbar> -->
		<view class="box hflex acenter">
			<image :src="order.course_info.img" mode="widthFix" style="width: 322rpx;border-radius: 16rpx;"></image>
			<view class="img_right">
				<view class="title">{{order.course_info.name}}</view>
				<view class="text_style1">总学时：{{order.period}}学时</view>
				<view class="text_style1">讲师：{{order.course_info.lecturer}}</view>
				<view class="order_price">￥{{order.course_info.price}}</view>
			</view>
		</view>
		<view class="box">
			<view class="title">订单信息</view>
			<view class="hflex acenter jbetween cell">
				<view class="left">商品总价</view>
				<view class="order_price">￥{{order.course_info.price}}</view>
			</view>
			<view class="hflex acenter jbetween cell">
				<view class="left">订单编号</view>
				<view class="right">{{order.order_no}}</view>
			</view>
			<view class="hflex acenter jbetween cell">
				<view class="left">创建时间</view>
				<view class="right">{{order.create_at}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	export default {
		data() {
			return {
				leftText: '',
				order: {
					
				},
				order_no: ''
			}
		},
		onLoad(e) {
			this.order_no = e.order_no
			this.getData()
		},
		methods: {
			leftClick() {},
			getData() {
				var that = this
				$api.req({
					url: '/api/User/OrderDetail',
					data: {
						order_no: that.order_no
					}
				}, function(res) {
					if(res.code == 1) {
						that.order = res.data
						if(res.data.status == 1) {
							that.leftText="买家已付款"
						} else {
							that.leftText="等待买家付款"
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.web_box::v-deep {
		padding: 0 30rpx;
		
		.u-navbar {
			width: 100%;
			box-sizing: border-box;
			padding: 36px 16px 58rpx 0;
		}
		.box {
			width: 100%;
			box-sizing: border-box;
			padding: 24rpx 22rpx;
			margin-top: 20rpx;
			background: #FFFFFF;
			box-shadow: 0px 2px 6px 0px rgba(213,213,213,0.5);
			border-radius: 24rpx;
		}
		.img_right {
			width: calc(100% - 322rpx);
			padding-left: 12rpx;
		}
		.title {
			font-size: 28rpx;
			font-weight: 600;
			color: #333333;
			padding-bottom: 14rpx;
		}
		.text_style1 {
			font-size: 20rpx;
			font-weight: 400;
			color: #999999;
			padding-bottom: 12rpx;
		}
		.order_price {
			font-size: 32rpx;
			font-weight: 600;
			color: #FA6400;
		}
		.left {
			font-size: 28rpx;
			font-weight: 400;
			color: #333333;
		}
		.right {
			font-size: 28rpx;
			font-weight: 400;
			color: #333333;
		}
		.cell {
			padding-top: 28rpx;
		}
		.u-button {
			margin: 28rpx 0 0;
			width: 362rpx;
			height: 70rpx;
			background: linear-gradient(135deg, #53BDFF 0%, #2988FE 100%);
			border-radius: 40rpx;
			font-size: 36rpx;
			font-weight: 400;
			color: #FFFFFF;	
		}
	}
</style>