@gm-mobile/mp 3.9.3 → 3.9.4-alpha.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-mobile/mp",
3
- "version": "3.9.3",
3
+ "version": "3.9.4-alpha.0",
4
4
  "description": "",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-mobile#readme",
@@ -21,9 +21,9 @@
21
21
  "url": "https://github.com/gmfe/gm-mobile/issues"
22
22
  },
23
23
  "dependencies": {
24
- "@gm-mobile/c-react": "^3.9.3",
25
- "@gm-mobile/c-tool": "^3.9.3",
26
- "@gm-mobile/locales": "^3.9.3"
24
+ "@gm-mobile/c-react": "^3.9.4-alpha.0",
25
+ "@gm-mobile/c-tool": "^3.9.4-alpha.0",
26
+ "@gm-mobile/locales": "^3.9.4-alpha.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@tarojs/components": "3.0.18",
@@ -33,5 +33,5 @@
33
33
  "prop-types": "^15.7.2",
34
34
  "react": "^16.13.1"
35
35
  },
36
- "gitHead": "1f1d2b656046efe6479f05f9fde2e34cb99df4de"
36
+ "gitHead": "2c9ac39754b961f782bf891b220e2e61b521ec00"
37
37
  }
@@ -158,3 +158,16 @@ const PageMP: FC<PageMPProps> = ({
158
158
 
159
159
  export default PageMP
160
160
  export type { PageMPProps }
161
+
162
+ /** 适配后的高度,考虑ipad 大屏裁剪宽度后的比例 */
163
+ export function calcPageHeightWithMaxWidth(maxWidth = 480) {
164
+ const { screenWidth } = wx.getSystemInfoSync()
165
+ const transformRatio = maxWidth / screenWidth
166
+ return `calc(100vh / ${transformRatio})`
167
+ }
168
+
169
+ export function calcPageWidthWithMaxWidth(maxWidth = 800) {
170
+ const { screenWidth } = wx.getSystemInfoSync()
171
+ const transformRatio = maxWidth / screenWidth
172
+ return `calc(100vw / ${transformRatio})`
173
+ }