| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*
- * 全局注入器
- */
- 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 + 'px'
- }
- return 0
- }
- },
- methods: {
- },
- onLoad(options) {
- let currentPage = this.$util.getCurrentRoute()
- //全局登录拦截
- let WHiTE_LIST = ['pages/login/login',
- 'pages/login/forget',
- 'pages/login/register',
- 'pages/login/account-login',
- 'pages/shop-info/shop-info',
- 'pages/webView/webView',
- 'pages/login/submit-success',
- 'pages/test/test',
- 'pages/chooseLable/chooseLable',
- 'pages/withdraw/withdraw',
- 'pages/withdraw/select-bank',
- 'pages/pay/pay',
- ]
- if (!WHiTE_LIST.includes(currentPage)) {
- if (!this.$cache.get('phone')) {
- uni.reLaunch({
- url: "/pages/login/account-login"
- })
- return
- }
- }
- //判断商场id是否为空
- WHiTE_LIST.push('pages/index/index')
- if (!WHiTE_LIST.includes(currentPage)) {
- if (!this.vuex_shopId) {
- uni.reLaunch({
- url:"/pages/index/index"
- })
- return
- }
- }
- }
- }
- export default page
|