<template>
	<view class="page">
		<!-- 顶部导航 -->
		<u-navbar title-width='300' title='' :is-back="true" :border-bottom="false"
			:background="{background:'rgba(0,0,0,0)'}" :isFixed="true"></u-navbar>
		<view class="index-navbar">
			<view class="" style="position: relative;;">
				<view class="back"></view>
			</view>
		</view>
		<view class="success">
			交易已完成
		</view>
		<view class="order">
			<view class="">订单信息</view>
			<view v-if="info.type==1" class="" style="display: flex;margin-top: 32rpx;" v-for="(item,index) in goodslist" :key="index">
				<view class="box">
					<image style="width: 200rpx;height: 160rpx;" :src="item.good_item.image" mode=""></image>
				</view>
				<view class="flexc" style="">
					<view class="">
						<view class="title u-line-1 ">{{item.good_item.title}}</view>
						<view class="" style="margin-top: 12rpx;">资源类型：付费资源</view>
					</view>
					<view class="" style="margin-top: 32rpx;">¥{{item.good_item.price}}</view>
				</view>
			</view>
			<view v-else class="" style="display: flex;margin-top: 32rpx;" v-for="(item,index) in goodslist" :key="index">
				<view class="box">
					<image style="width: 120rpx;height: 160rpx;" :src="item.good_item.image" mode=""></image>
				</view>
				<view class="flexc" style="">
					<view class="">
						<view class="title u-line-1">{{item.good_item.title}}</view>
						<view class="" style="margin-top: 12rpx;">资源类型：付费资源</view>
					</view>
					<view class="" style="margin-top: 32rpx;">¥{{item.good_item.price}}</view>
				</view>
			</view>
			<view class="bottom" style="text-align: right;">
				<text class="fu">实付</text>
				<text class="yuan" style="font-size: 8rpx;">¥</text>
				<text class="money1">{{info.total_price}}</text>
			</view>
		</view>
		<view class="info">
			<view class="">订单信息</view>
			<view class="order1">
				<text class="info1">订单编号</text>
				<text class="math">{{info.order_on}}</text>
			</view>
			<view class="order1">
				<text class="info1">下单时间</text>
				<text class="math">{{info.createtime}}</text>
			</view>
			<view class="order1">
				<text class="info1">支付时间</text>
				<text class="math">{{info.paytime}}</text>
			</view>
			<view class="order1">
				<text class="info1">支付方式</text>
				<text class="math">微信支付</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				goodslist: [],
				info: {
					order_on: '',
					total_price: '',
					createtime:'',
					paytime:'',
					type:''
				}
			};
		},
		onLoad(options) {
			this.id = options.id
			this.getOrderInfo()
		},
		methods: {
			getOrderInfo() {
				this.$u.post('api/order/getOrderInfo', {
					id: this.id
				}).then(res => {
					if (res.code == 1) {
						this.goodslist = res.data.goods
						this.info = res.data
					}
				})
			},
			toorder() {
				uni.navigateTo({
					url: '/pages/mine/myorder'
				})
			},
			tocard() {
				uni.navigateTo({
					url: '/pages/mine/card'
				})
			},
			tosetting() {
				uni.navigateTo({
					url: '/pages/mine/setting'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.flexc {
		margin-left: 20rpx;
	}

	.order1 {
		margin-top: 40rpx;
	}

	.info1 {
		font-size: 28rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #555555;
	}

	.math {
		font-size: 28rpx;
		font-family: SFPro, SFPro;
		font-weight: 400;
		color: #333333;
		margin-left: 44rpx;
	}

	.bottom {
		border-top: 2rpx solid rgba(151, 151, 151, 0.2);
		padding-top: 26rpx;
		margin-top: 32rpx;
	}

	.fu {
		font-size: 26rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #222222;
		margin-right: 20rpx;
	}

	.money1 {
		font-size: 36rpx;
		font-family: JDZhengHT, JDZhengHT;
		font-weight: 400;
		color: #222222;
	}

	.money {
		font-size: 32rpx;
		font-family: SFPro, SFPro;
		font-weight: 400;
		color: #333333;
	}

	.yuan {
		font-size: 26rpx;
		font-family: JDZhengHT, JDZhengHT;
		font-weight: 300;
		color: #222222;
	}

	.fu {
		font-size: 24rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #444444;
		margin-top: 12rpx;
	}

	.box {
		// width: 160rpx;
		// height: 160rpx;
		border: 1rpx solid rgba(151, 151, 151, 0.2);
		padding: 0 20rpx;
	}

	.title {
		font-size: 28rpx;
		font-family: PingFangHK, PingFangHK;
		font-weight: 400;
		color: #333333;
		width: 400rpx;
	}

	.felxc {
		display: flex;
		justify-content: space-between;
		flex-direction: column;
		margin-left: 20rpx;
		padding: 4rpx 0;
	}

	.page {
		min-height: 100vh;
		position: relative;
		z-index: 1;
		background: #F4F5F7;
		padding: 0 28rpx 40rpx;
	}

	.order {
		width: 694rpx;
		// height: 592rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		padding: 30rpx 20rpx;
	}

	.success {
		font-size: 40rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		margin-top: 12rpx;
		margin-bottom: 38rpx;
	}

	.info {
		width: 694rpx;
		height: 420rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin-top: 20rpx;
		padding: 30rpx 20rpx;
	}

	.index-navbar {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		z-index: -1;

		// overflow: hidden;
		.back {
			position: absolute;
			top: 0;
			left: 0;
			z-index: -1;
			width: 750rpx;
			height: 636rpx;
			background: linear-gradient(180deg, #06A971 0%, #F4F4F4 100%);
		}
	}
</style>