@alipay/ams-checkout 1.11.0 → 1.11.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.
@@ -12,8 +12,8 @@ var _queryParse = queryParse(),
12
12
  groupId = _queryParse.groupId,
13
13
  host = _queryParse.requestHost;
14
14
  export var requestHost = {
15
- local: 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
16
- dev: host || 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
15
+ local: 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
16
+ dev: host || 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
17
17
  sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
18
18
  pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
19
19
  prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -22,7 +22,7 @@ export var requestHost = {
22
22
  export var clientId = '5J5Y8X4E2Y25GR00690';
23
23
  export var tntInstId = 'ALIPW3SG';
24
24
  export var appId = 'ANTOM_PAYMENT_WEB';
25
- export var sofaId = groupId || 'GROUP_20231218150235';
25
+ export var sofaId = groupId || 'GROUP_20240304204929';
26
26
  export var hostSignMap = function hostSignMap(hostSign, env) {
27
27
  var map = {
28
28
  SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -7,6 +7,7 @@ export declare class AMSComponent extends CoreInstance {
7
7
  _componentApp: ComponentApp;
8
8
  channelType: componentSignEnum[];
9
9
  productSceneVersion: string;
10
+ timer: any;
10
11
  constructor(options: IoptionsParams);
11
12
  private parameterInitAndCheck;
12
13
  private pluginAppendIframe;
@@ -74,7 +74,7 @@ var handleSessionData = function handleSessionData(originSessionData) {
74
74
  parseData = _parseSessionData2[0],
75
75
  sessionData = _parseSessionData2[1];
76
76
  resetEasyPaySceneVersion(parseData);
77
- return [parseData, sessionData];
77
+ return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
78
78
  };
79
79
  var handleParams = function handleParams(params) {
80
80
  var _params = Object.assign({
@@ -116,6 +116,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
116
116
  _defineProperty(_assertThisInitialized(_this), "_componentApp", void 0);
117
117
  _defineProperty(_assertThisInitialized(_this), "channelType", void 0);
118
118
  _defineProperty(_assertThisInitialized(_this), "productSceneVersion", void 0);
119
+ _defineProperty(_assertThisInitialized(_this), "timer", void 0);
119
120
  var ComponentPlugin = new ComponentApp();
120
121
  ComponentPlugin.setRender(createIframeNode);
121
122
  ComponentPlugin.setPreloadRender(createPreloadIframeNode);
@@ -361,7 +362,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
361
362
  channelType: channelType
362
363
  });
363
364
  }
364
- setTimeout(function () {
365
+ this.timer = setTimeout(function () {
365
366
  _this5.clearPreloadIframe(true);
366
367
  }, MAX_CLEAR_TIME);
367
368
  }
@@ -369,6 +370,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
369
370
  key: "clearPreloadIframe",
370
371
  value: function clearPreloadIframe() {
371
372
  var isTimeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
373
+ !isTimeOut && clearTimeout(this.timer);
372
374
  if (Array.isArray(this.channelType)) {
373
375
  for (var i = 0; i < this.channelType.length; i++) {
374
376
  var iframe = document.getElementById("ams-checkout-component-".concat(this.channelType[i], "-").concat(this.productSceneVersion));
@@ -56,7 +56,7 @@ var AMSSDK = /*#__PURE__*/function () {
56
56
  this._storageId = _storageId;
57
57
 
58
58
  // TODO Consumption data analysis control parameters
59
- this.logger = new Logger(LogConfig, (options === null || options === void 0 ? void 0 : options.environment) !== environmentEnum.prod);
59
+ this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
60
60
  this.logger.setMedta({
61
61
  instanceId: this._instanceId
62
62
  });
@@ -65,14 +65,15 @@ var AMSSDK = /*#__PURE__*/function () {
65
65
  title: 'NEW_AMSSDK_BY_MECHANT',
66
66
  msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale, "}")
67
67
  }).send();
68
- this.preInitSecurity();
68
+ this.preInitSecurity(options);
69
69
  }
70
70
  _createClass(AMSSDK, [{
71
71
  key: "preInitSecurity",
72
- value: function preInitSecurity() {
72
+ value: function preInitSecurity(options) {
73
73
  var _this$options;
74
74
  var antomSDKConfigKey = 'antomSDKConfigKey';
75
75
  var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
76
+ if (![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
76
77
  if (checkTimeElapsed()) {
77
78
  antomConfig({
78
79
  env: this.options.env.environment
@@ -8,7 +8,7 @@
8
8
  import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
9
9
  import { platformEnum } from "../../types";
10
10
  import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
11
- var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
11
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -25,7 +25,6 @@ export default class ComponentApp {
25
25
  private _renderDisplayType;
26
26
  private _multipleCallbackEvents;
27
27
  _merchantAppointParam: IMerchantAppointParam;
28
- private _webAppHeartBeatTimeoutId;
29
28
  private _webAppHeartBeatTimeoutFn;
30
29
  constructor();
31
30
  /**
@@ -98,7 +97,7 @@ export default class ComponentApp {
98
97
  */
99
98
  dispatchToApp(payload: {
100
99
  context: eventPayloadContext;
101
- }, targetElement?: any): any;
100
+ }, targetElement?: any, sendLog?: boolean): any;
102
101
  /**
103
102
  * @description Subscribe to messages from SDK
104
103
  */
@@ -22,6 +22,7 @@ import { queryPaymentInfo, submitPayInfo } from "../../service";
22
22
  import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, targetEnum } from "../../types";
23
23
  import { getType, isJsonString, isPC } from "../../util";
24
24
  import { isLocalMock } from "../../util/mock";
25
+ import { matchVersion } from "../../util/versionCompare";
25
26
  import { createIframe, createPreloadIframe, getAppDomain, getIframeUrl } from "./cashierApp";
26
27
  import { addInlineLoading, createInlineBaseElement } from "./component.inline.style";
27
28
  import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup } from "./component.popup.style";
@@ -52,9 +53,8 @@ var ComponentApp = /*#__PURE__*/function () {
52
53
  _defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
53
54
  _defineProperty(this, "_multipleCallbackEvents", void 0);
54
55
  _defineProperty(this, "_merchantAppointParam", void 0);
55
- _defineProperty(this, "_webAppHeartBeatTimeoutId", void 0);
56
56
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
57
- this._appVersion = '1.11.0';
57
+ this._appVersion = '1.11.1';
58
58
  this._isInitComponent = false;
59
59
  this._selector = "#".concat(COMPONENT_SECTION_ID);
60
60
  this.createIframeNode = function () {
@@ -364,7 +364,7 @@ var ComponentApp = /*#__PURE__*/function () {
364
364
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
365
365
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
366
366
  var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5;
367
- var envInfo, params, _ref3, extendInfo, enableVaultingApiOptimize, enableEasypayApiOptimize, extendInfoData, _this5$_renderParams6, _this5$_renderParams7, _ref4, _ref4$productSceneVer, productSceneVersion, _ref4$productScene, productScene, _ref5, _ref5$action, _ref5$action2, _ref5$action2$autoDeb, autoDebitWithToken, _this5$_renderParams8, _action$web, _action$wap, action, signType;
367
+ var envInfo, params, _ref3, _ref3$extendInfo, extendInfo, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref4, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, _this5$_renderParams6, _this5$_renderParams7, _ref5, _ref5$productSceneVer, productSceneVersion, _ref5$productScene, productScene, _ref6, _ref6$action, _ref6$action2, _ref6$action2$autoDeb, autoDebitWithToken, _this5$_renderParams8, _action$web, _action$wap, action, signType;
368
368
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
369
369
  while (1) switch (_context2.prev = _context2.next) {
370
370
  case 0:
@@ -380,9 +380,10 @@ var ComponentApp = /*#__PURE__*/function () {
380
380
  /**
381
381
  * @description Simulated or unnecessary scenarios
382
382
  */
383
- _ref3 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, extendInfo = _ref3.extendInfo;
383
+ _ref3 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, _ref3$extendInfo = _ref3.extendInfo, extendInfo = _ref3$extendInfo === void 0 ? '' : _ref3$extendInfo;
384
384
  enableVaultingApiOptimize = false;
385
385
  enableEasypayApiOptimize = false;
386
+ _ref4 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.action) || {}, skipSdkQuery = _ref4.skipSdkQuery, skipSdkQueryForm = _ref4.skipSdkQueryForm;
386
387
  try {
387
388
  extendInfoData = JSON.parse(extendInfo);
388
389
  enableVaultingApiOptimize = extendInfoData.enableVaultingApiOptimize || false;
@@ -391,95 +392,123 @@ var ComponentApp = /*#__PURE__*/function () {
391
392
  console.log(error);
392
393
  }
393
394
  if (!isLocalMock()) {
394
- _context2.next = 8;
395
+ _context2.next = 9;
395
396
  break;
396
397
  }
397
398
  return _context2.abrupt("return", resolve({
398
399
  message: 'sdk no need to make query request',
399
400
  success: true
400
401
  }));
401
- case 8:
402
- if (!(componentSignEnum.VAULTING_CARD === _this5._componentSign && (_this5$_renderParams5 = _this5._renderParams) !== null && _this5$_renderParams5 !== void 0 && (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) !== null && _this5$_renderParams5 !== void 0 && (_this5$_renderParams5 = _this5$_renderParams5.action) !== null && _this5$_renderParams5 !== void 0 && _this5$_renderParams5.skipSdkQuery && enableVaultingApiOptimize)) {
403
- _context2.next = 10;
402
+ case 9:
403
+ if (!(componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
404
+ _context2.next = 21;
404
405
  break;
405
406
  }
406
- return _context2.abrupt("return", resolve({
407
+ if (!enableVaultingApiOptimize) {
408
+ _context2.next = 21;
409
+ break;
410
+ }
411
+ if (!skipSdkQueryForm) {
412
+ _context2.next = 18;
413
+ break;
414
+ }
415
+ // 优先判断 skipSdkQueryForm
416
+ ifSkip = matchVersion(skipSdkQueryForm, _this5._appVersion);
417
+ if (!ifSkip) {
418
+ _context2.next = 16;
419
+ break;
420
+ }
421
+ resolve({
407
422
  message: 'sdk no need to make query request',
408
423
  success: true
409
- }));
410
- case 10:
424
+ });
425
+ return _context2.abrupt("return");
426
+ case 16:
427
+ _context2.next = 21;
428
+ break;
429
+ case 18:
430
+ if (!skipSdkQuery) {
431
+ _context2.next = 21;
432
+ break;
433
+ }
434
+ resolve({
435
+ message: 'sdk no need to make query request',
436
+ success: true
437
+ });
438
+ return _context2.abrupt("return");
439
+ case 21:
411
440
  if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
412
- _context2.next = 16;
441
+ _context2.next = 27;
413
442
  break;
414
443
  }
415
444
  params.paymentMethodType = 'CARD';
416
- _context2.next = 14;
445
+ _context2.next = 25;
417
446
  return _this5.getDeviceIdAndLog();
418
- case 14:
447
+ case 25:
419
448
  envInfo.deviceId = _context2.sent;
420
449
  if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
421
450
  envInfo.extendInfo = {
422
451
  WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
423
452
  };
424
453
  }
425
- case 16:
454
+ case 27:
426
455
  if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
427
- _context2.next = 26;
456
+ _context2.next = 37;
428
457
  break;
429
458
  }
430
- _ref4 = params.paymentSessionConfig || {}, _ref4$productSceneVer = _ref4.productSceneVersion, productSceneVersion = _ref4$productSceneVer === void 0 ? '' : _ref4$productSceneVer, _ref4$productScene = _ref4.productScene, productScene = _ref4$productScene === void 0 ? '' : _ref4$productScene;
431
- _ref5 = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData) || {}, _ref5$action = _ref5.action, _ref5$action2 = _ref5$action === void 0 ? {} : _ref5$action, _ref5$action2$autoDeb = _ref5$action2.autoDebitWithToken, autoDebitWithToken = _ref5$action2$autoDeb === void 0 ? false : _ref5$action2$autoDeb;
459
+ _ref5 = params.paymentSessionConfig || {}, _ref5$productSceneVer = _ref5.productSceneVersion, productSceneVersion = _ref5$productSceneVer === void 0 ? '' : _ref5$productSceneVer, _ref5$productScene = _ref5.productScene, productScene = _ref5$productScene === void 0 ? '' : _ref5$productScene;
460
+ _ref6 = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData) || {}, _ref6$action = _ref6.action, _ref6$action2 = _ref6$action === void 0 ? {} : _ref6$action, _ref6$action2$autoDeb = _ref6$action2.autoDebitWithToken, autoDebitWithToken = _ref6$action2$autoDeb === void 0 ? false : _ref6$action2$autoDeb;
432
461
  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)) {
433
- _context2.next = 21;
462
+ _context2.next = 32;
434
463
  break;
435
464
  }
436
465
  return _context2.abrupt("return", resolve({
437
466
  message: 'sdk no need to make query request',
438
467
  success: true
439
468
  }));
440
- case 21:
469
+ case 32:
441
470
  if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
442
- _context2.next = 23;
471
+ _context2.next = 34;
443
472
  break;
444
473
  }
445
474
  return _context2.abrupt("return", resolve({
446
475
  message: 'sdk no need to make query request',
447
476
  success: true
448
477
  }));
449
- case 23:
450
- _context2.next = 25;
478
+ case 34:
479
+ _context2.next = 36;
451
480
  return _this5.getDeviceIdAndLog();
452
- case 25:
481
+ case 36:
453
482
  envInfo.deviceId = _context2.sent;
454
- case 26:
483
+ case 37:
455
484
  if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
456
- _context2.next = 36;
485
+ _context2.next = 47;
457
486
  break;
458
487
  }
459
488
  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) || {};
460
489
  signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
461
490
  if (!(signType === 'SMS')) {
462
- _context2.next = 31;
491
+ _context2.next = 42;
463
492
  break;
464
493
  }
465
494
  return _context2.abrupt("return", resolve({
466
495
  message: 'sdk no need to make query request',
467
496
  success: true
468
497
  }));
469
- case 31:
498
+ case 42:
470
499
  if (!(!signType || signType !== 'REDIRECT')) {
471
- _context2.next = 33;
500
+ _context2.next = 44;
472
501
  break;
473
502
  }
474
503
  return _context2.abrupt("return", resolve({
475
504
  success: false
476
505
  }));
477
- case 33:
478
- _context2.next = 35;
506
+ case 44:
507
+ _context2.next = 46;
479
508
  return _this5.getDeviceIdAndLog();
480
- case 35:
509
+ case 46:
481
510
  envInfo.deviceId = _context2.sent;
482
- case 36:
511
+ case 47:
483
512
  _this5.AMSSDK.logger.logInfo({
484
513
  title: 'sdk_event_sdkQuery'
485
514
  }, {
@@ -511,7 +540,7 @@ var ComponentApp = /*#__PURE__*/function () {
511
540
  paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
512
541
  }).send();
513
542
  });
514
- case 38:
543
+ case 49:
515
544
  case "end":
516
545
  return _context2.stop();
517
546
  }
@@ -542,7 +571,7 @@ var ComponentApp = /*#__PURE__*/function () {
542
571
 
543
572
  // eslint-disable-next-line no-async-promise-executor
544
573
  this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
545
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
574
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
546
575
  var _this6$_renderParams;
547
576
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
548
577
  while (1) switch (_context3.prev = _context3.next) {
@@ -605,7 +634,7 @@ var ComponentApp = /*#__PURE__*/function () {
605
634
  }, _callee3);
606
635
  }));
607
636
  return function (_x3) {
608
- return _ref6.apply(this, arguments);
637
+ return _ref7.apply(this, arguments);
609
638
  };
610
639
  }());
611
640
  }
@@ -1196,9 +1225,9 @@ var ComponentApp = /*#__PURE__*/function () {
1196
1225
  }
1197
1226
  }, {
1198
1227
  key: "handleDeclareInfo",
1199
- value: function handleDeclareInfo(_ref7) {
1200
- var _ref7$closeDialogData = _ref7.closeDialogData,
1201
- closeDialogData = _ref7$closeDialogData === void 0 ? {} : _ref7$closeDialogData;
1228
+ value: function handleDeclareInfo(_ref8) {
1229
+ var _ref8$closeDialogData = _ref8.closeDialogData,
1230
+ closeDialogData = _ref8$closeDialogData === void 0 ? {} : _ref8$closeDialogData;
1202
1231
  _handleDeclareInfo({
1203
1232
  closeDialogData: closeDialogData
1204
1233
  });
@@ -1235,12 +1264,12 @@ var ComponentApp = /*#__PURE__*/function () {
1235
1264
  }
1236
1265
  };
1237
1266
  }
1238
- if (this._webAppHeartBeatTimeoutId) {
1239
- clearTimeout(this._webAppHeartBeatTimeoutId);
1240
- this._webAppHeartBeatTimeoutId = null;
1267
+ if (window._webAppHeartBeatTimeoutId) {
1268
+ clearTimeout(window._webAppHeartBeatTimeoutId);
1269
+ window._webAppHeartBeatTimeoutId = null;
1241
1270
  }
1242
1271
  if (this._webAppHeartBeatTimeoutFn) {
1243
- this._webAppHeartBeatTimeoutId = setTimeout(this._webAppHeartBeatTimeoutFn, TIMEOUT_WEB_APP_HEART_BEAT);
1272
+ window._webAppHeartBeatTimeoutId = setTimeout(this._webAppHeartBeatTimeoutFn, TIMEOUT_WEB_APP_HEART_BEAT);
1244
1273
  }
1245
1274
  setTimeout(function () {
1246
1275
  if (_this8.isAppAttached()) {
@@ -1299,17 +1328,20 @@ var ComponentApp = /*#__PURE__*/function () {
1299
1328
  key: "dispatchToApp",
1300
1329
  value: function dispatchToApp(payload) {
1301
1330
  var targetElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1331
+ var sendLog = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1302
1332
  var data = Object.assign({}, payload, {
1303
1333
  name: messageName.SDK_TO_APP,
1304
1334
  mode: this.AMSSDK.options.mode,
1305
1335
  appId: COMPONENTPLUGINID,
1306
1336
  instanceId: this.AMSSDK._instanceId
1307
1337
  });
1308
- this.AMSSDK.logger.logInfo({
1309
- title: 'sdk_event_send_message_to_web'
1310
- }, {
1311
- event: data === null || data === void 0 ? void 0 : data.context.event
1312
- }).send();
1338
+ if (sendLog) {
1339
+ this.AMSSDK.logger.logInfo({
1340
+ title: 'sdk_event_send_message_to_web'
1341
+ }, {
1342
+ event: data === null || data === void 0 ? void 0 : data.context.event
1343
+ }).send();
1344
+ }
1313
1345
  if (targetElement && targetElement.contentWindow) {
1314
1346
  return targetElement.contentWindow.postMessage(JSON.stringify(data), '*');
1315
1347
  }
@@ -1386,7 +1418,7 @@ var ComponentApp = /*#__PURE__*/function () {
1386
1418
  }
1387
1419
  }
1388
1420
  }
1389
- });
1421
+ }, null, true);
1390
1422
  this.AMSSDK.logger.logInfo({
1391
1423
  title: 'sdk_event_renderComponent'
1392
1424
  });
@@ -50,8 +50,6 @@ function requestInstance(options) {
50
50
  withCredentials: (_options$withCredenti = options.withCredentials) !== null && _options$withCredenti !== void 0 ? _options$withCredenti : true,
51
51
  method: (options === null || options === void 0 ? void 0 : options.method) || 'POST'
52
52
  });
53
- console.log('baseURL', baseURL);
54
- console.log('_headers', _headers);
55
53
  return instance.request;
56
54
  }
57
55
 
@@ -99,25 +97,21 @@ function _request() {
99
97
  })];
100
98
  startTime = Date.now();
101
99
  _context.prev = 5;
102
- console.log('requestInstance options', options);
103
- console.log('requestInstance -data', _data);
104
100
  myRequest = requestInstance(options);
105
- _context.next = 11;
101
+ _context.next = 9;
106
102
  return myRequest({
107
103
  data: _data
108
104
  });
109
- case 11:
105
+ case 9:
110
106
  _yield$myRequest = _context.sent;
111
107
  data = _yield$myRequest.data;
112
108
  headers = _yield$myRequest.headers;
113
- console.log('requestInstance data', data);
114
- console.log('requestInstance headers', headers);
115
109
  resData = data || {};
116
110
  traceId = get(headers, 'Mgw-TraceId') || get(headers, 'mgw-traceid', '');
117
111
  resData.traceId = traceId || '';
118
112
  handleGetWayError = fomatGetwayError(headers, traceId);
119
113
  if (!(handleGetWayError !== null && handleGetWayError !== void 0 && handleGetWayError.errorCode)) {
120
- _context.next = 25;
114
+ _context.next = 21;
121
115
  break;
122
116
  }
123
117
  errorMessage = (resData === null || resData === void 0 ? void 0 : resData.errorMessage) || (handleGetWayError === null || handleGetWayError === void 0 ? void 0 : handleGetWayError.errorMessage);
@@ -136,7 +130,7 @@ function _request() {
136
130
  errorCode: errorCode,
137
131
  success: false
138
132
  }));
139
- case 25:
133
+ case 21:
140
134
  logger.reportRPC({
141
135
  name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
142
136
  label: 'request',
@@ -147,8 +141,8 @@ function _request() {
147
141
  traceId: traceId
148
142
  }).send();
149
143
  return _context.abrupt("return", resData);
150
- case 29:
151
- _context.prev = 29;
144
+ case 25:
145
+ _context.prev = 25;
152
146
  _context.t0 = _context["catch"](5);
153
147
  _error = safeJson(_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message, {
154
148
  success: false,
@@ -170,11 +164,11 @@ function _request() {
170
164
  errorCode: _errorCode,
171
165
  errorMessage: _error === null || _error === void 0 ? void 0 : _error.message
172
166
  }));
173
- case 36:
167
+ case 32:
174
168
  case "end":
175
169
  return _context.stop();
176
170
  }
177
- }, _callee, null, [[5, 29]]);
171
+ }, _callee, null, [[5, 25]]);
178
172
  }));
179
173
  return _request.apply(this, arguments);
180
174
  }
@@ -133,6 +133,11 @@ export interface IpaymentSessionMetaData {
133
133
  action?: {
134
134
  autoDebitWithToken: boolean;
135
135
  skipSdkQuery: boolean;
136
+ skipSdkQueryForm?: {
137
+ value: boolean;
138
+ version: string;
139
+ platform: string;
140
+ };
136
141
  };
137
142
  paymentSessionFactor?: {
138
143
  extendInfo?: {
@@ -4,3 +4,5 @@
4
4
  * @param v2
5
5
  */
6
6
  export declare function compareVersion(v1: string, v2: string): 1 | 0 | -1;
7
+ export declare function isVersionInRange(currentVersion: any, minVersion: any, maxVersion: any): boolean;
8
+ export declare function matchVersion(config: any, currentVersion: any): boolean;
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
7
  /**
2
8
  * 返回值0标识一样大,1表示v1大,-1表示v2大
3
9
  * @param v1
@@ -42,4 +48,73 @@ export function compareVersion(v1, v2) {
42
48
  } else {
43
49
  return 1;
44
50
  }
51
+ }
52
+ export function isVersionInRange(currentVersion, minVersion, maxVersion) {
53
+ function splitVersion(version) {
54
+ return version.split('.').map(function (num) {
55
+ return parseInt(num, 10);
56
+ });
57
+ }
58
+ function compareVersions(v1, v2) {
59
+ for (var i = 0; i < Math.max(v1.length, v2.length); i++) {
60
+ var num1 = v1[i] === undefined ? 0 : v1[i];
61
+ var num2 = v2[i] === undefined ? 0 : v2[i];
62
+ if (num1 > num2) return 1;
63
+ if (num1 < num2) return -1;
64
+ }
65
+ return 0;
66
+ }
67
+ var current = splitVersion(currentVersion);
68
+ var min = minVersion ? splitVersion(minVersion) : null;
69
+ var max = maxVersion ? splitVersion(maxVersion) : null;
70
+ if (min && compareVersions(current, min) < 0) {
71
+ // 当前版本小于最小允许版本
72
+ return false;
73
+ }
74
+ if (max && compareVersions(current, max) > 0) {
75
+ // 当前版本大于最大允许版本
76
+ return false;
77
+ }
78
+ // 当前版本在允许的版本范围内
79
+ return true;
80
+ }
81
+ export function matchVersion(config, currentVersion) {
82
+ var value = config.value,
83
+ version = config.version,
84
+ platform = config.platform;
85
+ var CURRENT_PLATFORM = 'WEB';
86
+ var isMatchVersion = false;
87
+ var isMatchPlatform = false;
88
+
89
+ // 平台判断
90
+ if (platform) {
91
+ var platformList = platform.split('|').map(function (platform) {
92
+ return platform.toLocaleUpperCase();
93
+ });
94
+ isMatchPlatform = platformList.includes(CURRENT_PLATFORM);
95
+ } else {
96
+ // 没有表示平台全匹配
97
+ isMatchPlatform = true;
98
+ }
99
+ // 版本判断
100
+ if (!version) {
101
+ // 为空全匹配
102
+ isMatchVersion = true;
103
+ } else if (version.indexOf('|') !== -1) {
104
+ // | 范围匹配
105
+ var _version$split = version.split('|'),
106
+ _version$split2 = _slicedToArray(_version$split, 2),
107
+ _version$split2$ = _version$split2[0],
108
+ minVersion = _version$split2$ === void 0 ? '' : _version$split2$,
109
+ _version$split2$2 = _version$split2[1],
110
+ maxVersion = _version$split2$2 === void 0 ? '' : _version$split2$2;
111
+ isMatchVersion = isVersionInRange(currentVersion, minVersion, maxVersion);
112
+ } else if (version.indexOf(',') !== -1) {
113
+ // , 枚举匹配
114
+ var versionList = version.split(',');
115
+ isMatchVersion = versionList.includes(currentVersion);
116
+ } else {
117
+ isMatchVersion = version === currentVersion;
118
+ }
119
+ return value && isMatchPlatform && isMatchVersion;
45
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",