<template>
	<view class="m-app">
		<view class="fx-h fx-ac fx-bc">
			<view class="yyok"><image src="/static/img/pay_ok.png" mode="widthFix"/></view>
			<view class="title" >支付成功</view>
			<view class="pay_name" v-if="orderId != ''">单号:{{ orderId }}</view>
			<view class="pay_time" v-if="time != ''">{{ time }}</view>
			<view class="title" v-else>感谢您的支持</view>
			<view class="nt yy-btn" @tap="tapHome" v-if="isHome">点击返回首页</view>
			<view class="nt yy-btn" @tap="tapOrder" v-else>点击返回订单</view>
		</view>
	</view>
</template>

<script>
	var orderId = "";
	var activeType = "";
import {mapState,mapMutations} from 'vuex';
	export default {
		computed: mapState(['user']),
		data() {
			return {
				orderId  : "",
				time     : "",
				pay_card : "",
				payType  : "",
				isHome   : false
			}
		},
		onLoad(options){
			this.orderId = options.orderId || '';
			this.time = options.time || '';
			this.pay_card = options.pay_card || '';
			this.payType = options.payType || '';
			this.isHome = options.isHome || false;
		},
		methods: {
			tapOrder:function(){
				uni.redirectTo({
					url:'/pages/user/order/index'
				});
			},
			tapHome:function(){
				uni.redirectTo({
					url:"/pages/index/home"
				})
			}
		}
	}
</script>

<style>
	.m-app{width:100vw}
	.yyok{ margin-top: 100px;}
	.yyok image{ width: 100px;}
	.title{ font-size: 24px;color: #000;font-weight: bold;color:#ef4034; margin-top: 10px;}
	.yyok-view{ font-size: 14px;color: #303033; margin-top: 10px;}
	.pay_name{padding: 5px 0;font-size: 14px;}
	.pay_card{padding: 5px 0;font-size: 14px;}
	.pay_time{font-size: 14px;color: #303033;}
	.yy-btn{position: absolute;bottom: 60px;width: 80%;text-align: center;background: #ef4034; padding: 15px 0; color: #fff; font-size: 14px; margin-top: 20px; border-radius: 20px;}
</style>
