<script>
	import {
		getGoodsTypeObj,
		getUserDetail
	} from '@/api/common.js';

	import {getGdShopInfo} from '@/api/study.js';
	// 腾讯地图
	// var QQMapWX = require('@/libs/qqmap-wx-jssdk.min.js');
	// var qqmapsdk = new QQMapWX({key:'KX5BZ-B64RC-RO62W-AMWAZ-VVTC3-YAFXF'});
	export default {

		onLaunch: function() {
			console.log('App Launch')
		
			
		},
		onShow: function() {
			console.log('App Show')
			// 获取商品类型字段
			getGoodsTypeObj().then(res => {
				if (res.state == 'Success') {
					uni.setStorageSync('goodsTypeObj',JSON.stringify(res.content))
				}
			})
			// 获取贵大文创ID
			getGdShopInfo().then(res=>{
				console.log('res',res);
				if(res.state == "Success"){
					uni.setStorageSync('gdShopId',res.content.shopId)
					uni.setStorageSync("gdTeaId",res.content.teaShop.shopId)
					uni.setStorageSync("teaCateId",res.content.teaCateId)
				}
			})
		},
		onHide: function() {
			console.log('App Hide')
			 // 解决我的页面多个登录窗堆叠问题
			 let pages = getCurrentPages()
			 let currentPage = pages[pages.length - 1]
			 if(currentPage.route == 'pages/my/index'){
			 	uni.reLaunch({
			 		url:'/pages/index/index'
			 	})
			 }
		},

	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
</style>