stylemap.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. "headerheight":headerheight,
  30. "topsearchheight":78,
  31. "footerheight":app.globalData.isIpx?140:98,
  32. "contentheight":windowstyle.windowHeight-headerheight/windowstyle.scale
  33. }