<template>
	<view class="container safe-area-inset-bottom">
		<MessageNotification />
		<!-- 中转页 -->
		<view class="none">
			<!-- 订单未生成 -->
			<image src="@/static/mine/shop_no.gif" mode=""></image>
			<view class="order">
				订单正在生成中，请稍后...
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getToNext
	} from '../../../request/api/api'
	export default {
		data() {
			return {
				id: "", // 订单id
				order_no: "", // 订单编号
			}
		},
		onLoad(e) {
			// console.log(e,'order_no');
			this.order_no = e.order_no
		},
		created() {},
		methods: {
			getInfo() {
				getToNext({
					method: "get",
					data: {
						store_id: uni.getStorageSync('store_id') || '11001',
						order_no: this.order_no
					}
				}).then((res) => {
					// console.log(res, 'info');
					if (res.data.errcode == 0) {
						uni.navigateTo({
							url: '/subPackages/my/my-drug/drug-info?id=' + res.data.data.order_id
						})
					} else {
						setTimeout(()=>{
							this.getInfo()
						},20000)
					}
				})

			}
		},
		mounted() {
			this.getInfo()
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		height: 100vh;
		padding-bottom: env(safe-area-inset-bottom);

		.none {
			width: 100vw;
			height: 600rpx;
			margin: 200rpx auto;
			text-align: center;

			image {
				width: 190rpx;
				height: 180rpx;
				margin-bottom: 20rpx;
			}

			.order {
				font-size: 28rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #232323;
			}
		}
	}
</style>