<template>
	<view class="body">
		<!-- <image src="/static/payCentre/loading.gif" mode=""></image> -->
		<image class="payLogo" src="/static/payCentre/payLogo.png" mode=""></image>
		<view>
			正在进入宜格收银台 
			<text>{{text}}s</text>
		</view>
		<view class="footerBox">宜昌城市大脑运营管理有限公司提供技术支持</view>
	</view>
</template>

<script>
	import uniWeb from '@/utils/uni.webview.1.5.4.js'
	export default {
		data() {
			return {
				data:"",
				text:3
			}
		},
		onLoad(options) {
			if(options.orderNo){
				// this.$nextTick(()=>{
				// 	this.goto(options.orderNo)
				// })
				setTimeout(()=>{
					this.goto(options.orderNo)
				},100);
			}
			this.init()
		},
		methods: {
			init(){
				this.text=3;
				let setTime=setInterval(()=>{
					this.text--;
					if(this.text==0&&setTime){
						clearInterval(setTime)
					}
				},1000)
			},
			goto(orderNo) {
				try {
					uniWeb.webView.postMessage({
						data: {
							   action: 'pay',
							   orderNo:orderNo
						}
					})
				} catch (err) {
					console.log('err==>', err)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.body{
		text-align: center;
		padding-top: 300rpx;
		color: #303133;
		image{
			width: 200rpx;
			height: 200rpx;
		}
		.payLogo{
			width: 294rpx;
			height: 294rpx;
		}
		>view{
			font-size: 30rpx;
			color: #333333;
			font-weight: 700;
			margin-top: 45rpx;
			text{
				font-size: 36rpx;
				color: #FF0511;
			}
		}
		.footerBox{
			width: 100%;
			font-size: 24rpx;
			color: #999999;
			text-align: center;
			position: fixed;
			bottom: 90rpx;
		}
	}
</style>