App.vue 1.2 KB

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