<template>
	<view class="container cashier">
		<cu-custom :navbar-data='nvabarData'></cu-custom>
		<view class="container-cash clearfix" :style="{marginTop:CustomBar+'px'}">
			<view class="container-wrapper">
				<view class="cash-icon">
					<image src="https://admin-b.caimei365.com/userfiles/1/images/photo/2020/05/%E8%AE%A2%E5%8D%95%E6%94%AF%E4%BB%98%E6%88%90%E5%8A%9F%402x.png" mode=""></image>
				</view>
				<view class="cash-text">
					<text>{{ successText }}</text>
				</view>
				<view class="cash-btn">
					<view class="btn btn-open" @click="this.$api.navigateTo('/pages/user/order/order-details?type=confim&orderID='+orderID)">查看订单</view>
					<view class="btn btn-home" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">继续采购</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				orderID:'',
				nvabarData: {		//顶部自定义导航
					haveBack:false,
					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
					showSearch: 0,
					title: '支付结果',  // 导航栏 中间的标题
					textLeft:this.$store.state.isIphone
				},
				successText:'订单提交并支付成功',
				isIphoneX:this.$store.state.isIphoneX,
				CustomBar:this.CustomBar,// 顶部导航栏高度
				
			}
		},
		onLoad(option) {
			if(option.type == 'deduction'){
				this.successText = '支付成功'
			}else{
				this.successText = '订单提交并支付成功'
			}
			this.initData(option)
		},
		methods:{
			initData(e){
				let data = JSON.parse(e.data);
				this.orderID = data.data.orderID
			}
		},
		onShow() {
			
		}
	}
</script>

<style lang="scss">
	page{
		height: auto !important;
	}
	.container-cash{
		width: 100%;
		.container-wrapper{
			width:662rpx;
			margin: 0 auto;
			margin-top: 120rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			.cash-icon{
				width: 348rpx;
				height: 348rpx;
				margin-top: 120rpx;
				image{
					width: 348rpx;
					height: 348rpx;
				}
			}
			.cash-text{
				font-size: $font-size-40;
				color: $color-system;
				line-height: 104rpx;
			}
			.cash-btn{
				margin-top: 120rpx;
				.btn{
					width: 256rpx;
					height: 80rpx;
					border-radius: 40rpx;
					line-height: 80rpx;
					text-align: center;
					font-size: $font-size-26;
					color: #FFFFFF;
					margin: 12rpx 0;
					&.btn-open{
						background:linear-gradient(315deg,rgba(0,212,150,1) 0%,rgba(126,243,174,1) 100%);
					}
					&.btn-home{
						background:$btn-confirm;
					}
				}
			}
		}
	}
</style>
