stylemap.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. var app = getApp();
  2. var windowstyle = {
  3. }
  4. wx.getSystemInfo({
  5. success:function(res) {
  6. // _self.globalData.pxscale = res.pixelRatio;
  7. // _self.globalData.scale = 750/res.windowWidth;
  8. // _self.globalData.windowHeight = res.windowHeight;
  9. // _self.globalData.windowh = res.windowHeight*_self.globalData.scale;
  10. // _self.globalData.Authorization = false;
  11. windowstyle.pxscale = res.pixelRatio;
  12. windowstyle.scale = 750/res.windowWidth;
  13. windowstyle.windowHeight = res.windowHeight;
  14. windowstyle.windowh = res.windowHeight*windowstyle.scale;
  15. windowstyle.Authorization = false;
  16. // var model = res.model
  17. // if (model.search('iPhone X') != -1){
  18. // _self.globalData.isIpx = true;
  19. // }else{
  20. // _self.globalData.isIpx = false;
  21. // }
  22. }
  23. });
  24. var headerheight = 170;
  25. export default {
  26. "windowh": windowstyle.windowh,
  27. "windowHeight": windowstyle.windowHeight,
  28. "pxscale":windowstyle.pxscale,
  29. "scale":windowstyle.scale,
  30. "headerheight":headerheight,
  31. "topsearchheight":78,
  32. "footerheight":app.globalData.isIpx?140:98,
  33. "contentheight":windowstyle.windowHeight-headerheight/windowstyle.scale
  34. }