App.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <script>
  2. import {
  3. mapState,
  4. mapMutations
  5. } from 'vuex'
  6. export default {
  7. // 此处globalData为了演示其作用,不是uView框架的一部分
  8. computed: {
  9. ...mapState(['hasLogin'])
  10. },
  11. globalData: {
  12. username: '白居易'
  13. },
  14. methods: {
  15. ...mapMutations(['login'])
  16. },
  17. created() {
  18. const storeInfo = uni.getStorageSync("storeInfo") || "";
  19. if (storeInfo) {
  20. uni.getStorage({
  21. key: "storeInfo",
  22. success: (res) => {
  23. this.login(res.data)
  24. this.$u.route({
  25. url: 'pages/home/index',
  26. type: 'switchTab',
  27. })
  28. },
  29. })
  30. } else {
  31. this.$u.route({
  32. url: "pages/login/index",
  33. type: "redirect"
  34. })
  35. }
  36. },
  37. onLaunch() {
  38. console.log("卧槽??????")
  39. this.$u.route({
  40. url: 'pages/login/upgrade'
  41. })
  42. // 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
  43. // 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
  44. // import httpInterceptor from '@/common/http.interceptor.js'
  45. // Vue.use(httpInterceptor, app)
  46. },
  47. onShow() {}
  48. }
  49. </script>
  50. <style lang="scss">
  51. @import "uview-ui/index.scss";
  52. @import "common/demo.scss";
  53. /*每个页面公共css */
  54. // uni-page-head
  55. // {
  56. // display: none;
  57. // }
  58. .u-checkbox__label[data-v-54acf820] {
  59. color: #B2B2B2 !important;
  60. }
  61. .uni-input-placeholder {
  62. color: #B2B2B2 !important;
  63. }
  64. page {
  65. background-color: #F4F4F4;
  66. font-weight: 500;
  67. }
  68. .u-skeleton {
  69. height: 100%;
  70. }
  71. </style>