<template>
	<view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	import {
		unionStagingPay
	} from '../../../../Utils/Api.js';
	export default {
		data() {
			return {
				orderId: '', //订单号
				url: '' //访问地址
			}
		},
		onLoad(options) {
			this.orderId = options.orderid;
			this.unionStagingPay();
		},
		methods: {
			unionStagingPay() {
				uni.showLoading({
					title: '加载中...'
				})
				let datas = {
					"orderId": this.orderId
				}
				unionStagingPay(datas).then(res => {
					uni.hideLoading();
					if (res.return_code == '000000' && res.return_data.bizData
						.redirectUrl) {
						this.url = res.return_data.bizData.redirectUrl;
					} else {
						uni.showToast({
							title: res.return_msg,
							icon: 'none',
							duration: 2000,
							success() {
								setTimeout(() => {
									uni.navigateBack({})
								}, 2000);
							}
						});
					}
				})
			},
		}
	}
</script>

<style>

</style>
