<script>
	import {
		mapGetters,
		mapActions,
		mapMutations
	} from 'vuex'
	export default {
		computed:{
			...mapGetters({'user':'getUser'})
		},
		methods: {
		
			...mapActions(['memberLogin','getLoginCode']),
			...mapMutations(['setVisitChannels']),
		},
		onLaunch: function(options) {
			let _this = this
			if (this.user.WeChat_MiniProToken) {
				this.memberLogin() // 获取用户数据
			} else {
				this.getLoginCode()
			}
			
			this.setVisitChannels = options.scene
			const updateManager = uni.getUpdateManager()
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});

			});
		},
		onShow: function() {
			var pages = getCurrentPages() // 获取加载的页面
			    let len = pages.length
			    if (len > 0) {
			      var currentPage = pages[len - 1] // 获取当前页面的对象
			      var nowRoute = '/' + currentPage.route // 当前页面url
			      this.$store.dispatch('addUserBehavior', {intoRoute: nowRoute, outtoRoute: ''}) // 记录用户行为
			    }
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import url("./common/uni.css");

	/*每个页面公共css */
	page {
		font-size: 26upx;
		color: #333;
		height: 100%;
		background-color: #f8f9fb;
		line-height: 1.2;

	}

	/* 加载更多 */
	.load-more {
		text-align: center;
		width: 100%;
		height: 80upx;
		color: #9999;
		font-size: 24upx;
	}

	/* 审核环节最后一个加底部边距 */
	.process-box.uni-active {
		padding-bottom: 30upx;
	}

	.ico,
	.ico-s {
		display: block;

	}

	.ico-s:before,
	.ico:before {
		content: '';
		width: 36upx;
		height: 34upx;
		display: block;

		margin-right: 6upx;
		background-repeat: no-repeat;
		background-size: contain;
		background-position: center;
	}

	.ico-s:before {
		width: 18upx;
		height: 18upx;
	}

	.ico-fj:before {
		background-image: url('./static/images/fjwj.png');
	}

	.ico-tp:before {
		background-image: url('./static/images/fjtp.png');
	}

	.ico-bz:before {
		background-image: url('./static/images/tender/yj.png');
	}

	/* #ifdef MP-WEIXIN */

	checkbox .wx-checkbox-input {
		border-radius: 50%;
		border: 1upx solid #63B7F9;
		width: 42upx;
		height: 42upx;

	}

	checkbox .wx-checkbox-input.wx-checkbox-input-checked {
		background-color: #63B7F9;
		color: #fff !important;
	}

	checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
		font-size: 30upx;
	}

	/* #endif */
</style>
