<template>
	<view class="paysuccess">
		<view class="pd-box" :style="{'background':mainColor}">
			<view
			  class="headStatus"
			  :style="[
			    headStyle,
			  ]"
			>
			  <view class="arrow" @click="goback">
			    <u-icon name="arrow-left" size="48" color="#000"></u-icon>
			  </view>
			  <view class="title" style="color: #000000;" >{{pageTitle}}</view>
			  <view class="arrow"></view>
			</view>
			<view class="pay-title">
				<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/pay-sicon.png" style="width: 49px;height: 49px;"></image>
				<view class="pay-title-r">
					<text style="font-size: 18px;font-weight: bold;">支付成功</text>
					<text>不要忘记预约时间哟~</text>
				</view>
			</view>
			<view class="pay-h">
				<view class="pay-h-box">
					<view class="pay-h-c">
						<view style="display: flex;flex-direction: row;align-items: flex-end;">
							<text style="margin-bottom: 5px;">￥</text>
							<text style="font-size: 33px;">{{payInfo.total_price}}</text>
						</view>
					</view>
					<view class="pay-item" style="margin-top: 10px;">
						<text>订单编号：</text>
						<text>{{OrderInfo.OrderNo?OrderInfo.OrderNo:''}}</text>
					</view>
					<view class="pay-item">
						<text>下单时间：</text>
						
						<text>{{OrderInfo.CreateDate?OrderInfo.CreateDate:''}}</text>
					</view>
					<view class="pay-item">
						<text>支付方式：</text>
						<text>微信</text>
					</view>
				</view>
			</view>
		</view>
		<view class="btn" :style="{'background':mainColor}" @click="godingdan">
			查看订单
		</view>
	
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				pageTitle: "交易成功",
				mainColor: "",
				headStyle:{},
				payInfo:{},
				OrderInfo:{}
			};
		},
		
		onLoad(option) {
			if (option.payInfo) {
				this.payInfo = JSON.parse(option.payInfo)
			}
			this.mainColor = this.$uiConfig.mainColor;
			uni.setNavigationBarTitle({
				title: this.pageTitle,
			});
			let nav = uni.getMenuButtonBoundingClientRect().top;
			this.headStyle.paddingTop = nav +'px';
			this.init()
		},
		mounted() {
		
			
		},
		methods: {
			init() {
				this.payInfo.OpenId = uni.getStorageSync('mall_UserInfo').OpenId;
				this.request2({
						url: '/api/OSGoods/GetOfflineOrderInfo',
						data: {
							OrderId: this.payInfo.OrderId,
							NewUserId: 0,
						}
					},
					(res) => {
						
						this.OrderInfo = res.data
					}
				);
			},
			goback(){
				uni.navigateBack({})
			},
			godingdan(){
				
				uni.reLaunch({
					url: '/pages/reserve/personal/orderlist?status=2',
				});
				
			}
	
		
		},
	};
</script>

<style>
	.paysuccess {
		height: 100%;
		background: #FFF;
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.pd-box{
		width: 100%;
		height: 191px;
	}
	.paysuccess .headStatus {
		  overflow: hidden;
		  position: relative;
		  width: 140vw;
		  padding-right: 40vw;
		  padding-bottom: 10px;
		  display: flex;
		  flex-direction: row;
		  align-items: center;
		  justify-content: space-between;
		 
	}
     .paysuccess .arrow {
		  height: 24px;
		  margin: 5px 10px;
		  width: 24px;
	}
	.paysuccess .pay-title{
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		margin-top: 20px;
		font-size: 14px;
		color: #FFF;
	}
	.paysuccess .pay-title-r{
		margin-left: 15px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		height: 48px;
	}
	.paysuccess .pay-h{
		width: calc(100vw - 20px);
		height: 9px;
		border-radius: 4.5px;
		background: #F32931;
		margin-top: 20px;
		margin-left: 10px;
		position: relative;
	}
	.paysuccess .pay-h-box{
		width: calc(100vw - 30px);
		height: 266px;
		background: #FFF;
		box-shadow:0 4px 10px 1px #D2D2D2;
		position: absolute;
		left: 5px;
		top: 5px;
		
		border-bottom-left-radius: 6px;
		border-bottom-right-radius: 6px;
		
	}
	.pay-h-c{
		height: 95px;
		font-size: 16px;
		color: #010101;
		display: flex;
		
		align-items: center;
		justify-content: center;
		border-bottom: 1px solid rgba(170, 170, 170, 0.3);
	}
	.pay-item{
		width: calc(100vw - 60px);
		height: 45px;
		display: flex;
		flex-direction: row;
		align-items: center;
		font-size: 14px;
		color: #9F9F9F;
		margin-left: 15px;
	}
	.btn{
		width: 185px;
		height: 45px;
		border-radius: 6px;
		font-size: 14px;
		color: #FFF;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top:290px;
	}
</style>
