@alipay/ams-checkout 0.0.1742285920-dev.1 → 0.0.1742285920-dev.2

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.
@@ -46,9 +46,10 @@ export var ContainerService = /*#__PURE__*/function () {
46
46
  }, {
47
47
  key: "init",
48
48
  value: function init(initOptions, instanceId, sdkMetaData) {
49
+ var _window;
49
50
  this.instanceId = instanceId;
50
51
  this.sdkMetaData = sdkMetaData;
51
- this.clientHeight = Math.max(window.innerHeight, window.visualViewport.height);
52
+ this.clientHeight = Math.max(window.innerHeight, ((_window = window) === null || _window === void 0 || (_window = _window.visualViewport) === null || _window === void 0 ? void 0 : _window.height) || 0);
52
53
  this.eventCenter = ServiceProvider.getInstance(instanceId).getService('EventCenter');
53
54
  this.logService = ServiceProvider.getInstance(instanceId).getService('Log');
54
55
  this.popupManager = new PopupManager();
@@ -164,10 +165,10 @@ export var ContainerService = /*#__PURE__*/function () {
164
165
  }, {
165
166
  key: "handleAccountFocus",
166
167
  value: function handleAccountFocus(focus) {
167
- var _window$visualViewpor, _window;
168
+ var _window$visualViewpor, _window2;
168
169
  // 失焦时v2会走默认的sizeChange还原高度,这里仅移除监听
169
170
  (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.removeEventListener('resize', this.boundFocusResizeChange);
170
- (_window = window) === null || _window === void 0 || _window.removeEventListener('resize', this.boundFocusResizeChange);
171
+ (_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', this.boundFocusResizeChange);
171
172
  // 只有聚焦才监听,失焦后移除,避免影响别的场景
172
173
  if (focus) {
173
174
  var _window$visualViewpor2;
@@ -309,12 +310,12 @@ export var ContainerService = /*#__PURE__*/function () {
309
310
  }, {
310
311
  key: "focusResizeChange",
311
312
  value: function focusResizeChange() {
312
- var _window2;
313
+ var _window3;
313
314
  // 计算出当前iframe应有的高度,需要和顶部留有距离
314
315
  var webPageHeightRatio = 0.9;
315
316
  var browserPageHeightFocusRatio = 0.9;
316
317
  // sdk层才能拿到当前键盘弹起后页面的高度
317
- var height = ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.visualViewport) === null || _window2 === void 0 ? void 0 : _window2.height) || window.innerHeight;
318
+ var height = ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.visualViewport) === null || _window3 === void 0 ? void 0 : _window3.height) || window.innerHeight;
318
319
  height = height * webPageHeightRatio;
319
320
  height = height * browserPageHeightFocusRatio;
320
321
  // 调用handleSizeChanged修改iframe高度
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1742285920-dev.1",
3
+ "version": "0.0.1742285920-dev.2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",