@alipay/ams-checkout 0.0.1726713131-dev.3 → 0.0.1726734012-dev.1

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.
@@ -25,15 +25,14 @@ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSce
25
25
  import { getType, isJsonString, isPC } from "../../util";
26
26
  import { isLocalMock } from "../../util/mock";
27
27
  import { matchVersion } from "../../util/versionCompare";
28
- import { handlePaymentSessionConfig } from "../payment-element/utils";
29
28
  import { createIframe, createPreloadIframe, getAppDomain, getIframeUrl } from "./cashierApp";
30
29
  import { getChannelBehavior } from "./channel";
31
30
  import { addInlineLoading, createInlineBaseElement } from "./component.inline.style";
32
- import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup, slideInAndOutKeyframes } from "./component.popup.style";
33
- import { createModal, destroyModal, insertStyleSheet, removePopupLoading } from "./popupWindow.style";
31
+ import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup } from "./component.popup.style";
32
+ import { createModal, destroyModal, insertStyleSheet } from "./popupWindow.style";
34
33
  window.changingPageHeight = window.innerHeight;
35
34
  var ComponentApp = /*#__PURE__*/function () {
36
- function ComponentApp(componentOption) {
35
+ function ComponentApp() {
37
36
  _classCallCheck(this, ComponentApp);
38
37
  _defineProperty(this, "app", void 0);
39
38
  _defineProperty(this, "AMSSDK", void 0);
@@ -59,7 +58,7 @@ var ComponentApp = /*#__PURE__*/function () {
59
58
  _defineProperty(this, "_multipleCallbackEvents", void 0);
60
59
  _defineProperty(this, "_merchantAppointParam", void 0);
61
60
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
62
- this._appVersion = componentOption.appVersion;
61
+ this._appVersion = '1.20.2';
63
62
  this._isInitComponent = false;
64
63
  this._selector = "#".concat(COMPONENT_SECTION_ID);
65
64
  this.createIframeNode = function () {
@@ -260,12 +259,12 @@ var ComponentApp = /*#__PURE__*/function () {
260
259
  return Promise.reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
261
260
  }
262
261
  renderParams = this.setParameterDefaultValues(componentSign, renderParams);
263
- this._merchantAppointParam = renderParams.merchantAppointParam;
264
262
  this._isInitComponent = true;
265
263
  this._renderParams = renderParams;
266
264
  this._componentSign = componentSign;
267
265
  if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
268
266
  this._renderDisplayType = renderParams.renderDisplayType;
267
+ this._merchantAppointParam = renderParams.merchantAppointParam;
269
268
  var insertedNode = this._renderDisplayType === renderDisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
270
269
  this.initLoggerMeta();
271
270
  this.initSecurity();
@@ -388,22 +387,10 @@ var ComponentApp = /*#__PURE__*/function () {
388
387
  }, {
389
388
  key: "renderInlineLoading",
390
389
  value: function renderInlineLoading(renderParams, selector) {
391
- var _renderParams$appeara, _this$_renderParams11;
390
+ var _renderParams$appeara;
392
391
  var showLoading = renderParams === null || renderParams === void 0 || (_renderParams$appeara = renderParams.appearance) === null || _renderParams$appeara === void 0 ? void 0 : _renderParams$appeara.showLoading;
393
392
  showLoading = typeof showLoading === 'boolean' ? showLoading : true;
394
- var extendInfo = renderParams.paymentSessionMetaData.extendInfo;
395
- var isExpressCheckout = false;
396
- try {
397
- // expressCheckout可能出现string(false) JSON.parse再转一次
398
- isExpressCheckout = JSON.parse(JSON.parse(extendInfo).expressCheckout);
399
- } catch (error) {
400
- // 遇到JSON解析错误,默认false
401
- }
402
- if (showLoading) addInlineLoading(selector, this.platform, {
403
- componentSign: this._componentSign,
404
- type: (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.appearance) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.layout) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.type,
405
- isExpressCheckout: isExpressCheckout
406
- });
393
+ if (showLoading) addInlineLoading(selector, this.platform);
407
394
  }
408
395
  }, {
409
396
  key: "renderPopupLoading",
@@ -440,7 +427,9 @@ var ComponentApp = /*#__PURE__*/function () {
440
427
  }, {
441
428
  key: "createActionQueryPromise",
442
429
  value: function createActionQueryPromise() {
443
- var _this5 = this;
430
+ var _this$_renderParams11,
431
+ _this5 = this;
432
+ var paymentMethodType = (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentSessionMetaData) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentMethodInfoView) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.paymentMethodType;
444
433
  this._performanceData.push({
445
434
  key: 'sdk_action_query_start',
446
435
  value: Date.now()
@@ -449,7 +438,7 @@ var ComponentApp = /*#__PURE__*/function () {
449
438
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
450
439
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
451
440
  var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6;
452
- var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams8, _action$web2, _action$wap2, action, signType;
441
+ var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _this5$_renderParams8, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _ref9, _ref9$action, _ref9$action2, _ref9$action2$autoDeb, autoDebitWithToken, _this5$_renderParams9, _action$web2, _action$wap2, action, signType;
453
442
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
454
443
  while (1) switch (_context2.prev = _context2.next) {
455
444
  case 0:
@@ -485,35 +474,22 @@ var ComponentApp = /*#__PURE__*/function () {
485
474
  success: true
486
475
  }));
487
476
  case 9:
488
- if (componentSignEnum.ELEMENT_PAYMENT === _this5._componentSign) {
489
- params.paymentSessionConfig = handlePaymentSessionConfig(params.paymentSessionConfig);
490
- }
491
- /** 地址组件跳过接口查询 */
492
- if (!(componentSignEnum.ELEMENT_ADDRESS === _this5._componentSign)) {
493
- _context2.next = 12;
494
- break;
495
- }
496
- return _context2.abrupt("return", resolve({
497
- message: 'sdk no need to make query request',
498
- success: true
499
- }));
500
- case 12:
501
477
  if (!(componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
502
- _context2.next = 24;
478
+ _context2.next = 21;
503
479
  break;
504
480
  }
505
481
  if (!enableVaultingApiOptimize) {
506
- _context2.next = 24;
482
+ _context2.next = 21;
507
483
  break;
508
484
  }
509
485
  if (!skipSdkQueryForm) {
510
- _context2.next = 21;
486
+ _context2.next = 18;
511
487
  break;
512
488
  }
513
489
  // 优先判断 skipSdkQueryForm
514
490
  ifSkip = matchVersion(skipSdkQueryForm, _this5._appVersion);
515
491
  if (!ifSkip) {
516
- _context2.next = 19;
492
+ _context2.next = 16;
517
493
  break;
518
494
  }
519
495
  resolve({
@@ -521,12 +497,12 @@ var ComponentApp = /*#__PURE__*/function () {
521
497
  success: true
522
498
  });
523
499
  return _context2.abrupt("return");
524
- case 19:
525
- _context2.next = 24;
500
+ case 16:
501
+ _context2.next = 21;
526
502
  break;
527
- case 21:
503
+ case 18:
528
504
  if (!skipSdkQuery) {
529
- _context2.next = 24;
505
+ _context2.next = 21;
530
506
  break;
531
507
  }
532
508
  resolve({
@@ -534,10 +510,10 @@ var ComponentApp = /*#__PURE__*/function () {
534
510
  success: true
535
511
  });
536
512
  return _context2.abrupt("return");
537
- case 24:
513
+ case 21:
538
514
  channelBehavior = getChannelBehavior((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
539
515
  if (!(channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.usePaymentSessionAsQueryResult)) {
540
- _context2.next = 27;
516
+ _context2.next = 24;
541
517
  break;
542
518
  }
543
519
  return _context2.abrupt("return", resolve({
@@ -545,78 +521,79 @@ var ComponentApp = /*#__PURE__*/function () {
545
521
  amountConfirmRequired: actionData === null || actionData === void 0 ? void 0 : actionData.amountConfirmRequired,
546
522
  success: true
547
523
  }));
548
- case 27:
524
+ case 24:
549
525
  if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
550
- _context2.next = 33;
526
+ _context2.next = 30;
551
527
  break;
552
528
  }
553
529
  params.paymentMethodType = 'CARD';
554
- _context2.next = 31;
530
+ _context2.next = 28;
555
531
  return _this5.getDeviceIdAndLog();
556
- case 31:
532
+ case 28:
557
533
  envInfo.deviceId = _context2.sent;
558
534
  if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
559
535
  envInfo.extendInfo = {
560
536
  WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
561
537
  };
562
538
  }
563
- case 33:
539
+ case 30:
564
540
  if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
565
- _context2.next = 42;
541
+ _context2.next = 40;
566
542
  break;
567
543
  }
568
544
  _ref8 = params.paymentSessionConfig || {}, _ref8$productSceneVer = _ref8.productSceneVersion, productSceneVersion = _ref8$productSceneVer === void 0 ? '' : _ref8$productSceneVer, _ref8$productScene = _ref8.productScene, productScene = _ref8$productScene === void 0 ? '' : _ref8$productScene;
569
- if (!((_this5$_renderParams7 = _this5._renderParams) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.action) !== null && _this5$_renderParams7 !== void 0 && _this5$_renderParams7.skipSdkQuery && enableEasypayApiOptimize)) {
570
- _context2.next = 37;
545
+ _ref9 = ((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData) || {}, _ref9$action = _ref9.action, _ref9$action2 = _ref9$action === void 0 ? {} : _ref9$action, _ref9$action2$autoDeb = _ref9$action2.autoDebitWithToken, autoDebitWithToken = _ref9$action2$autoDeb === void 0 ? false : _ref9$action2$autoDeb;
546
+ if (!((_this5$_renderParams8 = _this5._renderParams) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.action) !== null && _this5$_renderParams8 !== void 0 && _this5$_renderParams8.skipSdkQuery && enableEasypayApiOptimize)) {
547
+ _context2.next = 35;
571
548
  break;
572
549
  }
573
550
  return _context2.abrupt("return", resolve({
574
551
  message: 'sdk no need to make query request',
575
552
  success: true
576
553
  }));
577
- case 37:
554
+ case 35:
578
555
  if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0')) {
579
- _context2.next = 39;
556
+ _context2.next = 37;
580
557
  break;
581
558
  }
582
559
  return _context2.abrupt("return", resolve({
583
560
  message: 'sdk no need to make query request',
584
561
  success: true
585
562
  }));
586
- case 39:
587
- _context2.next = 41;
563
+ case 37:
564
+ _context2.next = 39;
588
565
  return _this5.getDeviceIdAndLog();
589
- case 41:
566
+ case 39:
590
567
  envInfo.deviceId = _context2.sent;
591
- case 42:
568
+ case 40:
592
569
  if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
593
- _context2.next = 52;
570
+ _context2.next = 50;
594
571
  break;
595
572
  }
596
- action = ((_this5$_renderParams8 = _this5._renderParams) === null || _this5$_renderParams8 === void 0 || (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) === null || _this5$_renderParams8 === void 0 ? void 0 : _this5$_renderParams8.action) || {};
573
+ action = ((_this5$_renderParams9 = _this5._renderParams) === null || _this5$_renderParams9 === void 0 || (_this5$_renderParams9 = _this5$_renderParams9.paymentSessionMetaData) === null || _this5$_renderParams9 === void 0 ? void 0 : _this5$_renderParams9.action) || {};
597
574
  signType = isPC() ? action === null || action === void 0 || (_action$web2 = action.web) === null || _action$web2 === void 0 ? void 0 : _action$web2.signType : action === null || action === void 0 || (_action$wap2 = action.wap) === null || _action$wap2 === void 0 ? void 0 : _action$wap2.signType;
598
575
  if (!(signType === 'SMS')) {
599
- _context2.next = 47;
576
+ _context2.next = 45;
600
577
  break;
601
578
  }
602
579
  return _context2.abrupt("return", resolve({
603
580
  message: 'sdk no need to make query request',
604
581
  success: true
605
582
  }));
606
- case 47:
583
+ case 45:
607
584
  if (!(!signType || signType !== 'REDIRECT')) {
608
- _context2.next = 49;
585
+ _context2.next = 47;
609
586
  break;
610
587
  }
611
588
  return _context2.abrupt("return", resolve({
612
589
  success: false
613
590
  }));
614
- case 49:
615
- _context2.next = 51;
591
+ case 47:
592
+ _context2.next = 49;
616
593
  return _this5.getDeviceIdAndLog();
617
- case 51:
594
+ case 49:
618
595
  envInfo.deviceId = _context2.sent;
619
- case 52:
596
+ case 50:
620
597
  _this5.AMSSDK.logger.logInfo({
621
598
  title: 'sdk_event_sdkQuery'
622
599
  }, {
@@ -655,7 +632,7 @@ var ComponentApp = /*#__PURE__*/function () {
655
632
  }).send();
656
633
  reject(err);
657
634
  });
658
- case 54:
635
+ case 52:
659
636
  case "end":
660
637
  return _context2.stop();
661
638
  }
@@ -687,21 +664,12 @@ var ComponentApp = /*#__PURE__*/function () {
687
664
  var channelBehavior = getChannelBehavior((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.paymentSessionMetaData);
688
665
  // eslint-disable-next-line no-async-promise-executor
689
666
  this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
690
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
667
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
691
668
  var _channelBehavior$buil, _this6$_renderParams$;
692
- var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _ref10, _ref10$productSceneVe, productSceneVersion, _ref10$productScene, productScene, _ref11, _ref11$action, _ref11$action2, _ref11$action2$enable, enableSignAgreement, _ref11$action2$autoDe, autoDebitWithToken, extParams;
669
+ var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _ref11, _ref11$productSceneVe, productSceneVersion, _ref11$productScene, productScene, _ref12, _ref12$action, _ref12$action2, _ref12$action2$enable, enableSignAgreement, _ref12$action2$autoDe, autoDebitWithToken, extParams;
693
670
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
694
671
  while (1) switch (_context3.prev = _context3.next) {
695
672
  case 0:
696
- if (!(_this6.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS)) {
697
- _context3.next = 2;
698
- break;
699
- }
700
- return _context3.abrupt("return", resolve({
701
- message: 'sdk no need to make submitPay request',
702
- success: true
703
- }));
704
- case 2:
705
673
  shouldSkipSubmitPayInSDK = false;
706
674
  if (channelBehavior) {
707
675
  // 新逻辑走 channelBehavior判断
@@ -710,8 +678,8 @@ var ComponentApp = /*#__PURE__*/function () {
710
678
  shouldSkipSubmitPayInSDK = !((_this6$_renderParams = _this6._renderParams) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.paymentSessionMetaData) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.action) !== null && _this6$_renderParams !== void 0 && _this6$_renderParams.skipSdkQuery) || componentSignEnum.EASY_PAY_WALLET !== _this6._componentSign;
711
679
  }
712
680
  if (componentSignEnum.EASY_PAY_WALLET === _this6._componentSign) {
713
- _ref10 = params.paymentSessionConfig || {}, _ref10$productSceneVe = _ref10.productSceneVersion, productSceneVersion = _ref10$productSceneVe === void 0 ? '' : _ref10$productSceneVe, _ref10$productScene = _ref10.productScene, productScene = _ref10$productScene === void 0 ? '' : _ref10$productScene;
714
- _ref11 = ((_this6$_renderParams2 = _this6._renderParams) === null || _this6$_renderParams2 === void 0 ? void 0 : _this6$_renderParams2.paymentSessionMetaData) || {}, _ref11$action = _ref11.action, _ref11$action2 = _ref11$action === void 0 ? {} : _ref11$action, _ref11$action2$enable = _ref11$action2.enableSignAgreement, enableSignAgreement = _ref11$action2$enable === void 0 ? false : _ref11$action2$enable, _ref11$action2$autoDe = _ref11$action2.autoDebitWithToken, autoDebitWithToken = _ref11$action2$autoDe === void 0 ? false : _ref11$action2$autoDe;
681
+ _ref11 = params.paymentSessionConfig || {}, _ref11$productSceneVe = _ref11.productSceneVersion, productSceneVersion = _ref11$productSceneVe === void 0 ? '' : _ref11$productSceneVe, _ref11$productScene = _ref11.productScene, productScene = _ref11$productScene === void 0 ? '' : _ref11$productScene;
682
+ _ref12 = ((_this6$_renderParams2 = _this6._renderParams) === null || _this6$_renderParams2 === void 0 ? void 0 : _this6$_renderParams2.paymentSessionMetaData) || {}, _ref12$action = _ref12.action, _ref12$action2 = _ref12$action === void 0 ? {} : _ref12$action, _ref12$action2$enable = _ref12$action2.enableSignAgreement, enableSignAgreement = _ref12$action2$enable === void 0 ? false : _ref12$action2$enable, _ref12$action2$autoDe = _ref12$action2.autoDebitWithToken, autoDebitWithToken = _ref12$action2$autoDe === void 0 ? false : _ref12$action2$autoDe;
715
683
  if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken) {
716
684
  ///EasyPay 2.0 首次传signAgreement字段
717
685
  params['signAgreement'] = enableSignAgreement;
@@ -720,14 +688,14 @@ var ComponentApp = /*#__PURE__*/function () {
720
688
  // 带上标记告知WebCheckOut SDK已发送submitpay请求
721
689
  _this6._allowSubmitPayCallAhead = !shouldSkipSubmitPayInSDK;
722
690
  if (!shouldSkipSubmitPayInSDK) {
723
- _context3.next = 8;
691
+ _context3.next = 6;
724
692
  break;
725
693
  }
726
694
  return _context3.abrupt("return", resolve({
727
695
  message: 'sdk no need to make submitPay request',
728
696
  success: true
729
697
  }));
730
- case 8:
698
+ case 6:
731
699
  _this6.AMSSDK.logger.logInfo({
732
700
  title: 'sdk_event_submitPay'
733
701
  }, {
@@ -746,9 +714,9 @@ var ComponentApp = /*#__PURE__*/function () {
746
714
  _context3.t0 = submitPayInfo;
747
715
  _context3.t1 = params;
748
716
  _context3.t2 = _this6.AMSSDK.options.env.environment;
749
- _context3.next = 16;
717
+ _context3.next = 14;
750
718
  return _this6.getDeviceIdAndLog();
751
- case 16:
719
+ case 14:
752
720
  _context3.t3 = _context3.sent;
753
721
  _context3.t4 = {
754
722
  deviceId: _context3.t3
@@ -782,14 +750,14 @@ var ComponentApp = /*#__PURE__*/function () {
782
750
  success: false
783
751
  });
784
752
  });
785
- case 21:
753
+ case 19:
786
754
  case "end":
787
755
  return _context3.stop();
788
756
  }
789
757
  }, _callee3);
790
758
  }));
791
759
  return function (_x3) {
792
- return _ref9.apply(this, arguments);
760
+ return _ref10.apply(this, arguments);
793
761
  };
794
762
  }());
795
763
  }
@@ -830,17 +798,19 @@ var ComponentApp = /*#__PURE__*/function () {
830
798
  value: function createPreloadApp(componentSign) {
831
799
  var productSceneVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1.0';
832
800
  var preloadIframe = createPreloadIframe(componentSign, productSceneVersion);
833
- var productScene = componentSign.split(/_(?=[^_]*$)/)[0];
834
801
  var _getIframeUrl = getIframeUrl({
835
802
  renderDisplayType: renderDisplayTypeEnum.popup,
836
803
  componentSign: componentSign,
837
804
  analytics: {
838
805
  enabled: false
839
806
  },
840
- productScene: productScene,
807
+ productScene: componentSign,
841
808
  productSceneVersion: productSceneVersion,
842
809
  environment: this.AMSSDK.options.env.environment,
810
+ // TODO 确定一下这个参数是干啥的
843
811
  appVersion: this._appVersion,
812
+ extendInfo: '',
813
+ locale: '',
844
814
  instanceId: '',
845
815
  isPreload: 'true',
846
816
  mid: ''
@@ -964,7 +934,7 @@ var ComponentApp = /*#__PURE__*/function () {
964
934
  key: "createDialog",
965
935
  value: function () {
966
936
  var _createDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
967
- var pageUrl, _data$device, isLoad, timeout, logTimeout;
937
+ var pageUrl, isLoad, timeout, logTimeout;
968
938
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
969
939
  while (1) switch (_context4.prev = _context4.next) {
970
940
  case 0:
@@ -974,8 +944,8 @@ var ComponentApp = /*#__PURE__*/function () {
974
944
  _context4.next = 5;
975
945
  return createModal({
976
946
  widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
977
- device: (_data$device = data === null || data === void 0 ? void 0 : data.device) !== null && _data$device !== void 0 ? _data$device : this.platform,
978
- loadingConfig: data === null || data === void 0 ? void 0 : data.loadingConfig,
947
+ heightPadding: data === null || data === void 0 ? void 0 : data.heightPadding,
948
+ device: this.platform,
979
949
  url: pageUrl
980
950
  });
981
951
  case 5:
@@ -994,7 +964,6 @@ var ComponentApp = /*#__PURE__*/function () {
994
964
  }, POPUP_LOADTIME_LOG_LIMIT);
995
965
  this.popupApp.onload = function () {
996
966
  isLoad = true;
997
- removePopupLoading();
998
967
  clearTimeout(timeout);
999
968
  clearTimeout(logTimeout);
1000
969
  };
@@ -1306,8 +1275,9 @@ var ComponentApp = /*#__PURE__*/function () {
1306
1275
 
1307
1276
  // 此style用于弹窗出现和高度变化时动画,动画不同,属性不同
1308
1277
  this.app.style.height = parseInt(this.app.style.height) > 0 ? '100%' : "".concat(data.context.data.height, "px");
1278
+
1309
1279
  // 弹出和弹入动画
1310
- var runkeyframes = slideInAndOutKeyframes(COMPONENT_CONTAINER_ID, data.context.data.height);
1280
+ var runkeyframes = "@keyframes ".concat(COMPONENT_CONTAINER_ID, "-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(data.context.data.height, "px;\n }\n }\n @keyframes ").concat(COMPONENT_CONTAINER_ID, "-slide-out {\n 0% {\n height: ").concat(data.context.data.height, "px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }");
1311
1281
  // 创建style标签
1312
1282
  var style = document.createElement('style');
1313
1283
  style.id = animationStyleId;
@@ -1317,6 +1287,7 @@ var ComponentApp = /*#__PURE__*/function () {
1317
1287
  style.innerHTML = runkeyframes;
1318
1288
  // 将style样式存放到head标签
1319
1289
  document.getElementsByTagName('head')[0].appendChild(style);
1290
+
1320
1291
  // size变动时动画
1321
1292
  setTimeout(function () {
1322
1293
  cashier.style.transition = 'height 0.28s ease-in-out';
@@ -1436,9 +1407,9 @@ var ComponentApp = /*#__PURE__*/function () {
1436
1407
  }
1437
1408
  }, {
1438
1409
  key: "handleDeclareInfo",
1439
- value: function handleDeclareInfo(_ref12) {
1440
- var _ref12$closeDialogDat = _ref12.closeDialogData,
1441
- closeDialogData = _ref12$closeDialogDat === void 0 ? {} : _ref12$closeDialogDat;
1410
+ value: function handleDeclareInfo(_ref13) {
1411
+ var _ref13$closeDialogDat = _ref13.closeDialogData,
1412
+ closeDialogData = _ref13$closeDialogDat === void 0 ? {} : _ref13$closeDialogDat;
1442
1413
  _handleDeclareInfo({
1443
1414
  closeDialogData: closeDialogData
1444
1415
  });
@@ -1579,25 +1550,24 @@ var ComponentApp = /*#__PURE__*/function () {
1579
1550
  key: "sendRenderEvent",
1580
1551
  value: (function () {
1581
1552
  var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1582
- var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$AMSSDK$logger, _this$_renderParams24, _this$_renderParams25, _this$_renderParams26, _this$AMSSDK, _this$_renderParams27, isAddressElement, res, submitRes;
1553
+ var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _this$AMSSDK$logger, _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$AMSSDK, _this$_renderParams24, res, submitRes;
1583
1554
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1584
1555
  while (1) switch (_context8.prev = _context8.next) {
1585
1556
  case 0:
1586
1557
  _context8.prev = 0;
1587
- isAddressElement = this.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS;
1588
- if (!((!this._actionQueryPromise || !this._actionSubmitPromise) && !isAddressElement)) {
1589
- _context8.next = 4;
1558
+ if (!(!this._actionQueryPromise || !this._actionSubmitPromise)) {
1559
+ _context8.next = 3;
1590
1560
  break;
1591
1561
  }
1592
1562
  return _context8.abrupt("return");
1593
- case 4:
1594
- _context8.next = 6;
1563
+ case 3:
1564
+ _context8.next = 5;
1595
1565
  return this._actionQueryPromise;
1596
- case 6:
1566
+ case 5:
1597
1567
  res = _context8.sent;
1598
- _context8.next = 9;
1568
+ _context8.next = 8;
1599
1569
  return this._actionSubmitPromise;
1600
- case 9:
1570
+ case 8:
1601
1571
  submitRes = _context8.sent;
1602
1572
  this._performanceData.push({
1603
1573
  key: 'sdk_render_component',
@@ -1617,25 +1587,21 @@ var ComponentApp = /*#__PURE__*/function () {
1617
1587
  notRedirectAfterComplete: ((_this$_renderParams19 = this._renderParams) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.notRedirectAfterComplete) === true,
1618
1588
  merchantAppointParam: this._merchantAppointParam,
1619
1589
  allowSubmitPayCallAhead: this._allowSubmitPayCallAhead,
1620
- /** 地址组件集成的参数 */
1621
- configParams: (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 ? void 0 : _this$_renderParams20.configParams,
1622
- prefillValue: (_this$_renderParams21 = this._renderParams) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.prefillValue,
1623
- componentSession: (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.componentSession,
1624
1590
  envInfo: {
1625
1591
  screenHeight: screen.height,
1626
1592
  screenWidth: screen.width
1627
1593
  },
1628
1594
  logMetaData: _objectSpread(_objectSpread({
1629
- trackId: (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 ? void 0 : _this$_renderParams23.sessionData,
1595
+ trackId: (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 ? void 0 : _this$_renderParams20.sessionData,
1630
1596
  platform: this.platform,
1631
1597
  firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
1632
- }, ((_this$_renderParams24 = this._renderParams) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentSessionMetaData) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.paymentSessionConfig) || {}), {}, {
1633
- renderDisplayType: (_this$_renderParams25 = this._renderParams) === null || _this$_renderParams25 === void 0 ? void 0 : _this$_renderParams25.renderDisplayType,
1598
+ }, ((_this$_renderParams21 = this._renderParams) === null || _this$_renderParams21 === void 0 || (_this$_renderParams21 = _this$_renderParams21.paymentSessionMetaData) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.paymentSessionConfig) || {}), {}, {
1599
+ renderDisplayType: (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.renderDisplayType,
1634
1600
  sdkVersion: this._appVersion,
1635
- merchantId: (_this$_renderParams26 = this._renderParams) === null || _this$_renderParams26 === void 0 || (_this$_renderParams26 = _this$_renderParams26.paymentSessionMetaData) === null || _this$_renderParams26 === void 0 ? void 0 : _this$_renderParams26.clientId,
1601
+ merchantId: (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 || (_this$_renderParams23 = _this$_renderParams23.paymentSessionMetaData) === null || _this$_renderParams23 === void 0 ? void 0 : _this$_renderParams23.clientId,
1636
1602
  instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
1637
1603
  performanceData: this._performanceData,
1638
- paymentMethodType: (_this$_renderParams27 = this._renderParams) === null || _this$_renderParams27 === void 0 || (_this$_renderParams27 = _this$_renderParams27.paymentSessionMetaData) === null || _this$_renderParams27 === void 0 || (_this$_renderParams27 = _this$_renderParams27.paymentMethodInfoView) === null || _this$_renderParams27 === void 0 ? void 0 : _this$_renderParams27.paymentMethodType
1604
+ paymentMethodType: (_this$_renderParams24 = this._renderParams) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentSessionMetaData) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentMethodInfoView) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.paymentMethodType
1639
1605
  })
1640
1606
  }
1641
1607
  }
@@ -1652,16 +1618,16 @@ var ComponentApp = /*#__PURE__*/function () {
1652
1618
  }
1653
1619
  });
1654
1620
  // eslint-disable-next-line no-empty
1655
- _context8.next = 18;
1621
+ _context8.next = 17;
1656
1622
  break;
1657
- case 16:
1658
- _context8.prev = 16;
1623
+ case 15:
1624
+ _context8.prev = 15;
1659
1625
  _context8.t0 = _context8["catch"](0);
1660
- case 18:
1626
+ case 17:
1661
1627
  case "end":
1662
1628
  return _context8.stop();
1663
1629
  }
1664
- }, _callee8, this, [[0, 16]]);
1630
+ }, _callee8, this, [[0, 15]]);
1665
1631
  }));
1666
1632
  function sendRenderEvent() {
1667
1633
  return _sendRenderEvent.apply(this, arguments);
@@ -1695,9 +1661,8 @@ var ComponentApp = /*#__PURE__*/function () {
1695
1661
  }, {
1696
1662
  key: "hideComponentAnimation",
1697
1663
  value: function hideComponentAnimation() {
1698
- var _container$style;
1699
1664
  var container = document.getElementById(COMPONENT_CONTAINER_ID);
1700
- if (this.app) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
1665
+ if (this.app) this.app.style.height = container.style.height;
1701
1666
  if (container) {
1702
1667
  // size变化动画取消
1703
1668
  container.style.transition = '';
@@ -1,11 +1,8 @@
1
- export declare const createCustomSheet: (curTheme?: 'dark' | 'light') => void;
2
- export declare const renderPopupLoading: (container: HTMLDivElement, curTheme: 'dark' | 'light') => void;
3
- export declare const removePopupLoading: (isShowMockup?: boolean) => void;
4
1
  export declare const insertStyleSheet: () => void;
5
- export declare const createModal: ({ device, url, widthPadding, loadingConfig }: {
2
+ export declare const createModal: ({ device, url, widthPadding, heightPadding }: {
6
3
  device: any;
7
4
  url: any;
8
5
  widthPadding: any;
9
- loadingConfig: any;
6
+ heightPadding: any;
10
7
  }) => Promise<HTMLIFrameElement>;
11
8
  export declare const destroyModal: () => void;