app.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {
  2. ApiModel
  3. } from "./utils/api";
  4. const _Http = new ApiModel();
  5. App({
  6. onLaunch() {
  7. //轮播图
  8. _Http.basic({
  9. "classname": "publicmethod.bannermag.bannermag",
  10. "method": "query_bannerlocationlist",
  11. "content": {
  12. "siteid": "BWJ",
  13. "fclienttype": "MOBILE"
  14. }
  15. }).then(res => {
  16. console.log(res)
  17. })
  18. /* 计算tabbar+iphone安全距离 tabbar页面+100rpx*/
  19. let safeAreaBottom = 0,
  20. capsule = wx.getMenuButtonBoundingClientRect(),
  21. height = 200,
  22. that = this;
  23. wx.getSystemInfo({
  24. success(res) {
  25. //计算底部安全距离高度
  26. // safeAreaBottom += res.screenHeight - res.safeArea.height;
  27. //计算自定义导航的高度
  28. height = capsule.height + res.statusBarHeight + (capsule.top - res.statusBarHeight) + 8;
  29. that.globalData.safeAreaBottom = safeAreaBottom;
  30. //判断是否为平板
  31. if (res.model.slice(0, 4) == "iPad") return that.globalData.myNavBorHeight = height;
  32. that.globalData.myNavBorHeight = height * 2;
  33. }
  34. })
  35. },
  36. globalData: {
  37. myNavBorHeight: null, //自定义头部导航高度
  38. account_list: [], //用户列表
  39. }
  40. })