App.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. uni.setStorageSync("teaCateId",res.content.teaCateId)
  29. }
  30. })
  31. },
  32. onHide: function() {
  33. console.log('App Hide')
  34. },
  35. }
  36. </script>
  37. <style lang="scss">
  38. /*每个页面公共css */
  39. @import "@/uni_modules/uview-ui/index.scss";
  40. </style>