12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <script>
- import {
- onBackPress
- } from "@dcloudio/uni-app"
- import {
- toast,
- getUserIdentity
- } from "@/utils/common";
- import cacheManager from "@/utils/cacheManager.js";
- export default {
- // creat by wgy 0619 生命周期 钩子
- onLaunch: function() {
- console.log('App Launch')
- console.log('App Launch')
- console.log('App Launch')
- console.log('App Launch')
- console.log('App Launch')
- if (cacheManager.get('auth')) {
- uni.reLaunch({
- url: `/pages/study/index`
- })
- }else if(!(cacheManager.get('wxLogin').bind)){
- console.log('asdfadsfadsfasd')
- // 微信登录且未绑定
- } else {
- cacheManager.clearAll()
- uni.redirectTo({
- url: '/pages/login/index'
- });
- }
-
- },
- onShow: function() {
- // #ifdef APP-PLUS
- // if (cacheManager.get('auth')) {
- // uni.reLaunch({
- // url: `/pages/study/index`
- // })
- // }else if(!(cacheManager.get('wxLogin').bind)){
- // console.log('asdfadsfadsfasd')
- // // 微信登录且未绑定
- // } else {
- // cacheManager.clearAll()
- // uni.redirectTo({
- // url: '/pages/login/index'
- // });
- // }
- const webview = plus.webview.currentWebview();
- plus.key.addEventListener('backbutton', () => {
- event.preventDefault();
- return false
- });
- // #endif
- },
- onHide: function() {
- // // console.log('App Hide')
- // // #ifdef APP-PLUS
- // if (cacheManager.get('auth')) {
- // uni.reLaunch({
- // url: `/pages/study/index`
- // })
- // }else if(!(cacheManager.get('wxLogin').bind)){
- // console.log('asdfadsfadsfasd')
- // // 微信登录且未绑定
- // } else {
- // cacheManager.clearAll()
- // uni.redirectTo({
- // url: '/pages/login/index'
- // });
- // }
-
- // // #endif
- }
- }
- </script>
- <style lang="scss">
- /* 公共样式 */
- @import '/common/styles/index.scss';
- body,
- html,
- #app {
- font-family: "Helvetica Neue", "Microsoft YaHei", "SimHei", "SimSun", "Arial", sans-serif;
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- </style>
|