<template>
	<view class="page-box" style="display: grid;">
		<view style="text-align: center;margin: 100rpx;">
			<u-icon name="checkbox-mark" color="#2979ff" size="50"></u-icon>您的订单支付完成
		</view>
		<u-button type="primary" size='medium' shape="circle" @click = 'toOrder()' :plain="true">返回查看订单</u-button>
	</view>
</template>

<script>
	// var goldPlan = require('../../common/jgoldplan-1.0.0.js');
	// import api from '@/common/api.js'
	export default {
		data() {
			return {
				sub_mch_id: '',
				out_trade_no: '',
				orderInfo : {}
			}
		},
		onLoad(option) {
			this.sub_mch_id = option.sub_mch_id; //特约商户号
			this.out_trade_no = option.out_trade_no; //商户订单号
		},
		onReady() {
			let mchData = {
				action: 'onIframeReady',
				displayStyle: 'SHOW_CUSTOM_PAGE'
			};
			let postData = JSON.stringify(mchData);
			parent.postMessage(postData, 'https://payapp.weixin.qq.com');
		},
		methods: {
			//注册点击事件(去详情)
			// getOrder(){
			// 	setTimeout(async function(){
			// 		let info = await api.getOrderInfo(this.out_trade_no);
			// 		this.orderInfo = info;
			// 	},1000);
			// },
			toOrder: function() {
				var mchData = {
					action: 'jumpOut',
					jumpOutUrl: 'https://fjmp.yuchangchina.com/test/hkzxh5/?rd=order' //跳转的页面
				}				
				var pData = JSON.stringify(mchData);
				parent.postMessage(pData, 'https://payapp.weixin.qq.com')
			}
		}
	}
</script>