App.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <script>
  2. import {
  3. onBackPress
  4. } from "@dcloudio/uni-app"
  5. import {
  6. toast,
  7. getUserIdentity
  8. } from "@/utils/common";
  9. import cacheManager from "@/utils/cacheManager.js";
  10. export default {
  11. // creat by wgy 0619 生命周期 钩子
  12. onLaunch: function() {
  13. //console.log('App Launch')
  14. },
  15. onShow: function() {
  16. // #ifdef APP-PLUS
  17. // if (cacheManager.get('auth')) {
  18. // uni.reLaunch({
  19. // url: `/pages/study/index`
  20. // })
  21. // }else if(!(cacheManager.get('wxLogin').bind)){
  22. // console.log('asdfadsfadsfasd')
  23. // // 微信登录且未绑定
  24. // } else {
  25. // cacheManager.clearAll()
  26. // uni.redirectTo({
  27. // url: '/pages/login/index'
  28. // });
  29. // }
  30. const webview = plus.webview.currentWebview();
  31. plus.key.addEventListener('backbutton', () => {
  32. event.preventDefault();
  33. return false
  34. });
  35. // #endif
  36. },
  37. onHide: function() {
  38. // // console.log('App Hide')
  39. // // #ifdef APP-PLUS
  40. // if (cacheManager.get('auth')) {
  41. // uni.reLaunch({
  42. // url: `/pages/study/index`
  43. // })
  44. // }else if(!(cacheManager.get('wxLogin').bind)){
  45. // console.log('asdfadsfadsfasd')
  46. // // 微信登录且未绑定
  47. // } else {
  48. // cacheManager.clearAll()
  49. // uni.redirectTo({
  50. // url: '/pages/login/index'
  51. // });
  52. // }
  53. // // #endif
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. /* 公共样式 */
  59. @import '/common/styles/index.scss';
  60. body,
  61. html,
  62. #app {
  63. font-family: "Helvetica Neue", "Microsoft YaHei", "SimHei", "SimSun", "Arial", sans-serif;
  64. margin: 0;
  65. padding: 0;
  66. box-sizing: border-box;
  67. }
  68. </style>