App.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. created() {
  12. let storeInfo=uni.getStorageSync("storeInfo")||"";
  13. if(storeInfo.storeId){
  14. uni.getStorage({
  15. key:"storeInfo",
  16. success:(res)=>{
  17. this.login(res.data)
  18. }
  19. })
  20. }
  21. },
  22. onLaunch() {
  23. // 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
  24. // 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
  25. // import httpInterceptor from '@/common/http.interceptor.js'
  26. // Vue.use(httpInterceptor, app)
  27. },
  28. }
  29. </script>
  30. <style lang="scss">
  31. @import "uview-ui/index.scss";
  32. @import "common/demo.scss";
  33. /*每个页面公共css */
  34. // uni-page-head
  35. // {
  36. // display: none;
  37. // }
  38. .u-checkbox__label[data-v-54acf820] {
  39. color: #B2B2B2 !important;
  40. }
  41. .uni-input-placeholder {
  42. color: #B2B2B2 !important;
  43. }
  44. page{
  45. height: 100%;
  46. background-color: #F4F4F4;
  47. font-weight: 500;
  48. }
  49. .u-skeleton{
  50. height: 100%;
  51. }
  52. </style>