App.vue 574 B

1234567891011121314151617181920212223242526272829303132
  1. <script>
  2. import {
  3. getGoodsTypeObj,
  4. getUserDetail
  5. } from '@/api/common.js';
  6. export default {
  7. onLaunch: function() {
  8. console.log('App Launch')
  9. },
  10. onShow: function() {
  11. console.log('App Show')
  12. // 获取商品类型字段
  13. getGoodsTypeObj().then(res => {
  14. if (res.state == 'Success') {
  15. uni.setStorageSync('goodsTypeObj',JSON.stringify(res.content))
  16. }
  17. })
  18. },
  19. onHide: function() {
  20. console.log('App Hide')
  21. },
  22. }
  23. </script>
  24. <style lang="scss">
  25. /*每个页面公共css */
  26. @import "@/uni_modules/uview-ui/index.scss";
  27. </style>