<template>
	<!--pages/empty/empty.wxml-->
	<navigator url='/pages/index/index' open-type="switchTab" hover-class="none">返回首页</navigator>
</template>

<script>
	// pages/empty/empty.js
	const app = getApp();
	const req = require("../../utils/request.js");

	export default {
		data() {
			return {
				header: req.header
			};
		},

		components: {},
		props: {},
		onLoad: async function(options) {
			// await this.loadCodeParams();

			if (options.scene) {
				this.scene = options.scene;
			}
		},
		methods: {
			loadCodeParams() {
				let _ts = this;

				return new Promise((resolve, reject) => {
					if (!_ts.scene) {
						resolve();
						return false;
					}

					req.getRequest('/api/code/params', {
						scene: _ts.scene
					}, data => {
						req.setStorage('pidCode', data.userId);
						resolve();
					});
				});
			}

		}
	};
</script>
<style>
	@import "./empty.css";
</style>