<template>
	<view class="main">
		{{info}}
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {},
				user: {},
			}
		},
		onLoad: async function(e) {
			const that = this;
			uni.setNavigationBarTitle({
				title: e && e.title || '分类'
			});
			await that.searchOther();
			that.searchConfig();
			that.searchToken();
			that.search();
		},
		methods: {
			searchToken() {
				const that = this;
				try {
					const res = uni.getStorageSync('token');
					if (res) that.$set(that, `user`, res);
				} catch (e) {
					uni.showToast({
						title: err.errmsg,
						icon: 'error',
						duration: 2000
					});
				}
			},
			searchConfig() {
				const that = this;
				try {
					const res = uni.getStorageSync('config');
					if (res) that.$set(that, `config`, res);
				} catch (e) {
					uni.showToast({
						title: err.errmsg,
						icon: 'error',
						duration: 2000
					});
				}
			},
			// 查询
			async search() {
				const that = this;
				let res;

			},
			async searchOther() {
				const that = this;
			}
		}
	}
</script>

<style>
	.main {}
</style>