App.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <script>
  2. import { checkLogin } from "./libs/login";
  3. import { HTTP_REQUEST_URL } from './config/app';
  4. export default {
  5. globalData: {
  6. spid: 0,
  7. code:0,
  8. isLogin:false,
  9. userInfo:{},
  10. MyMenus:[]
  11. },
  12. onLaunch: function(option) {
  13. let that = this;
  14. // #ifdef MP
  15. if (HTTP_REQUEST_URL==''){
  16. console.error("请配置根目录下的config.js文件中的 'HTTP_REQUEST_URL'\n\n请修改开发者工具中【详情】->【AppID】改为自己的Appid\n\n请前往后台【小程序】->【小程序配置】填写自己的 appId and AppSecret");
  17. return false;
  18. }
  19. if (option.query.hasOwnProperty('scene')){
  20. switch (option.scene) {
  21. //扫描小程序码
  22. case 1047:
  23. let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
  24. that.globalData.code = val.pid;
  25. break;
  26. //长按图片识别小程序码
  27. case 1048:
  28. that.globalData.code = option.query.scene;
  29. break;
  30. //手机相册选取小程序码
  31. case 1049:
  32. that.globalData.code = option.query.scene;
  33. break;
  34. //直接进入小程序
  35. case 1001:
  36. that.globalData.spid = option.query.scene;
  37. break;
  38. }
  39. }
  40. // #endif
  41. // 获取导航高度;
  42. uni.getSystemInfo({
  43. success: function (res) {
  44. that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
  45. }
  46. });
  47. },
  48. mounted() {
  49. },
  50. onHide: function() {
  51. //console.log('App Hide')
  52. }
  53. }
  54. </script>
  55. <style>
  56. @import url("@/plugin/animate/animate.min.css");
  57. @import 'static/css/base.css';
  58. @import 'static/iconfont/iconfont.css';
  59. @import 'static/iconfont/iconfont1.css';
  60. @import 'static/css/guildford.css';
  61. @import 'static/css/style.scss';
  62. view{
  63. box-sizing: border-box;
  64. }
  65. .bg-color-red {
  66. background-color: #e93323!important;
  67. }
  68. .syspadding{
  69. padding-top: var(--status-bar-height);
  70. }
  71. .flex{
  72. display: flex;
  73. }
  74. .uni-scroll-view::-webkit-scrollbar {
  75. /* 隐藏滚动条,但依旧具备可以滚动的功能 */
  76. display: none
  77. }
  78. ::-webkit-scrollbar {
  79. width: 0;
  80. height: 0;
  81. color: transparent;
  82. }
  83. </style>