xiaoe_mp_npm 0.5.42-alpha7 → 0.5.42-alpha8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,13 +58,13 @@ export const isPhone = (val) => {
58
58
  // 大屏适配 rpx 转 vmin
59
59
  export const rpxToVmin = (rpx) => {
60
60
  const { screenWidth, screenHeight, deviceOrientation, platform } = wx.getSystemInfoSync()
61
- const isPad = (screenWidth >= 768 && deviceOrientation === 'portrait') || (screenHeight >= 768 && deviceOrientation === 'landscape')
61
+ const isPadSize = (screenWidth >= 768 && deviceOrientation === 'portrait') || (screenHeight >= 768 && deviceOrientation === 'landscape')
62
62
  const isPcEquipment = platform === 'windows' || platform === 'mac' || platform === 'devtools'
63
- const isPC = screenHeight >= 768
63
+ const pcHighResolution = screenHeight >= 768
64
64
  let deviceWidth = 750
65
- if (isPcEquipment) {
66
- // ipad平板 或 PC放大
67
- deviceWidth = isPad || isPC ? 1536 : 1260
68
- }
65
+ // ipad平板
66
+ if (isPadSize) deviceWidth = 1536
67
+ // PC高分辨率或PC放大项目
68
+ if (isPcEquipment) deviceWidth = pcHighResolution ? 1536 : 1260
69
69
  return `${rpx * 100 / deviceWidth}vmin`
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.5.42-alpha7",
3
+ "version": "0.5.42-alpha8",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -58,13 +58,13 @@ export const isPhone = (val) => {
58
58
  // 大屏适配 rpx 转 vmin
59
59
  export const rpxToVmin = (rpx) => {
60
60
  const { screenWidth, screenHeight, deviceOrientation, platform } = wx.getSystemInfoSync()
61
- const isPad = (screenWidth >= 768 && deviceOrientation === 'portrait') || (screenHeight >= 768 && deviceOrientation === 'landscape')
61
+ const isPadSize = (screenWidth >= 768 && deviceOrientation === 'portrait') || (screenHeight >= 768 && deviceOrientation === 'landscape')
62
62
  const isPcEquipment = platform === 'windows' || platform === 'mac' || platform === 'devtools'
63
- const isPC = screenHeight >= 768
63
+ const pcHighResolution = screenHeight >= 768
64
64
  let deviceWidth = 750
65
- if (isPcEquipment) {
66
- // ipad平板 或 PC放大
67
- deviceWidth = isPad || isPC ? 1536 : 1260
68
- }
65
+ // ipad平板
66
+ if (isPadSize) deviceWidth = 1536
67
+ // PC高分辨率或PC放大项目
68
+ if (isPcEquipment) deviceWidth = pcHighResolution ? 1536 : 1260
69
69
  return `${rpx * 100 / deviceWidth}vmin`
70
70
  }