| | |
| | | export default { |
| | | onLaunch: function() { |
| | | // this.init() |
| | | var ua = window.navigator.userAgent |
| | | if(ua.indexOf('MicroMessenger') == -1){ |
| | | // 等于-1时 说明不是从微信扫码打开的,就跳转其它页面 |
| | | uni.reLaunch({ |
| | | url:'/pages/exception/exception' |
| | | }) |
| | | return |
| | | } |
| | | this.goException() |
| | | this.initRegister() |
| | | }, |
| | | onShow: function() { |
| | | var ua = window.navigator.userAgent |
| | | if(ua.indexOf('MicroMessenger') == -1){ |
| | | // 等于-1时 说明不是从微信扫码打开的,就跳转其它页面 |
| | | uni.reLaunch({ |
| | | url:'/pages/exception/exception' |
| | | }) |
| | | return |
| | | } |
| | | //this.goException() |
| | | console.log('App Show') |
| | | }, |
| | | onHide: function() { |
| | | console.log('App Hide') |
| | | }, |
| | | methods: { |
| | | goException(){ |
| | | try { |
| | | const res = wx.getSystemInfoSync() |
| | | if!res.environment || res.environment !=='wxwork' ){ |
| | | uni.reLaunch({ |
| | | url:'/pages/exception/exception' |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | uni.reLaunch({ |
| | | url:'/pages/exception/exception' |
| | | }) |
| | | } |
| | | }, |
| | | async initRegister() { |
| | | let fullURL = window.location.href.substring(0, window.location.href.lastIndexOf('#')) |
| | | console.log(fullURL) |