<template>
	<mobile-frame>
		<view class="main">
			<view class="one">
				地图
			</view>
			<view class="two">
				代付
			</view>
		</view>
	</mobile-frame>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				user: {},
				info: {}
			};
		},
		onLoad: function(e) {
			const that = this;
			that.$set(that, `id`, e.id || '6343b53f21b24c75ad8dbf7a');
			that.watchLogin()
		},
		onShow: function() {},
		methods: {
			watchLogin() {
				const that = this;
				uni.getStorage({
					key: 'token',
					success: function(res) {
						let user = that.$jwt(res.data);
						if (user) that.$set(that, `user`, user);
						that.searchInfo();
					}
				})
			},
			async searchInfo() {
				const that = this;
				if (that.id) {
					let res = await that.$api(`/orderDetail/${that.id}`, 'GET')
					if (res.errcode == '0') {
						that.$set(that, `info`, res.data);
					} else {
						uni.showToast({
							title: res.errmsg,
							icon: 'none'
						})
					}
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
