App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <script>
  2. //app.js
  3. var http = require("./utils/http.js");
  4. var util = require('./utils/util.js')
  5. export default {
  6. onLaunach: function() {},
  7. onShow: function() {
  8. console.log('mall4j.v230313')
  9. // 判断浏览器环境
  10. var ua = navigator.userAgent.toLowerCase();
  11. // if (ua.search(/MicroMessenger/i) > -1 && !uni.getStorageSync('appType')) {
  12. // // 微信环境
  13. // uni.setStorageSync('appType', 2)
  14. // http.mpAuthLogin()
  15. // }
  16. // const state = util.getUrlKey('state')
  17. // const code = util.getUrlKey('code')
  18. // if ((state == 'needCode' || state == 'unNeedCode') && code) {
  19. // let path = window.location.href
  20. // if (path.indexOf('code=') > 0 && path.indexOf('&state=unNeedCode') > -1) {
  21. // http.mpLogin(null, code)
  22. // path = path.substring(0, path.indexOf('code=') - 1)
  23. // history.replaceState({}, '', path)
  24. // }
  25. http.getCartCount()
  26. // }
  27. },
  28. globalData: {
  29. // 定义全局请求队列
  30. requestQueue: [],
  31. // 是否正在进行登陆
  32. isLanding: false,
  33. // 购物车商品数量
  34. totalCartCount: 0
  35. },
  36. methods: {
  37. }
  38. };
  39. </script>
  40. <style>
  41. @import "./app.css";
  42. /* 隐藏头部 */
  43. uni-page-head {
  44. display: none;
  45. }
  46. /* 轮播图指示点 */
  47. uni-swiper .uni-swiper-dots-horizontal {
  48. bottom: 20px !important;
  49. }
  50. </style>