App.vue 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script>
  2. import {
  3. getGoodsTypeObj,
  4. getUserDetail
  5. } from '@/api/common.js';
  6. import {getGdShopInfo} from '@/api/study.js';
  7. // 腾讯地图
  8. // var QQMapWX = require('@/libs/qqmap-wx-jssdk.min.js');
  9. // var qqmapsdk = new QQMapWX({key:'KX5BZ-B64RC-RO62W-AMWAZ-VVTC3-YAFXF'});
  10. export default {
  11. onLaunch: function() {
  12. console.log('App Launch')
  13. },
  14. onShow: function() {
  15. console.log('App Show')
  16. // 获取商品类型字段
  17. getGoodsTypeObj().then(res => {
  18. if (res.state == 'Success') {
  19. uni.setStorageSync('goodsTypeObj',JSON.stringify(res.content))
  20. }
  21. })
  22. // 获取贵大文创ID
  23. getGdShopInfo().then(res=>{
  24. console.log('res',res);
  25. if(res.state == "Success"){
  26. uni.setStorageSync('gdShopId',res.content.shopId)
  27. uni.setStorageSync("gdTeaId",res.content.teaShop.shopId)
  28. }
  29. })
  30. },
  31. onHide: function() {
  32. console.log('App Hide')
  33. },
  34. }
  35. </script>
  36. <style lang="scss">
  37. /*每个页面公共css */
  38. @import "@/uni_modules/uview-ui/index.scss";
  39. </style>