App.vue 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script>
  2. import * as api from 'common/api/index.js'
  3. import {
  4. getConfig
  5. } from "@/common/api/common.js";
  6. const getConfigData = () => {
  7. api.getConfig()
  8. .then((res) => {
  9. if (res.code == 200) {
  10. uni.setStorageSync("configs", res.data)
  11. console.log("getConfig=>", res.data);
  12. }
  13. })
  14. .catch((err) => {});
  15. }
  16. export default {
  17. onLaunch: async (options) => {
  18. console.log("App Launch");
  19. uni.hideTabBar()
  20. getConfigData()
  21. },
  22. onShow: function() {
  23. console.log("App Show");
  24. },
  25. onHide: function() {
  26. console.log("App Hide");
  27. },
  28. };
  29. </script>
  30. <style lang="scss">
  31. @import "@/components/uview-ui/index.scss";
  32. @import "./common/styles/common.scss";
  33. /*每个页面公共css */
  34. page {
  35. font-family: "PingFang SC";
  36. -webkit-font-smoothing: antialiased;
  37. -moz-osx-font-smoothing: grayscale;
  38. height: 100%;
  39. font-size: 28rpx;
  40. color: $fontMain;
  41. background: #F5F6F8;
  42. view {
  43. display: block;
  44. flex-direction: row;
  45. // box-sizing: border-box;
  46. }
  47. }
  48. </style>