/*
 * 全局注入器
 */
let page = {
	data() {
		return {

		}
	},
	computed: {
		//ios底部安全区域
		safeAreaBottom() {
			let info = uni.getSystemInfoSync()
			let safe = 20
			if (
				info && ['devtools', 'ios'].includes(info.platform) &&
				info.statusBarHeight > safe
			) {
				return info.statusBarHeight - safe
			}
			return 0
		}
	},
	methods: {

	},
	onLoad(options) {
		let currentPage = this.$util.getCurrentRoute()
		//全局登录拦截
		if (!this.vuex_userId) {
			if (currentPage.indexOf('pages/mine/') != -1 && currentPage != 'pages/mine/mine') {
				uni.reLaunch({
					url: "/pages/mine/mine"
				})
				return
			}
			if (currentPage.indexOf('pages/agent/') != -1) {
				uni.reLaunch({
					url: "/pages/gain/gain?current=1"
				})
				return
			}
		}
	}
}

export default page
