App.vue 1.1 KB

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