@alipay/ams-checkout 0.0.1726734012-dev.13 → 0.0.1726734012-dev.15
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.
@@ -5,14 +5,13 @@ export declare const getComponentSign: (params: IPaymentSessionMetaData) => Comp
|
|
5
5
|
export declare const parseSessionData: (sessionData: string) => [IPaymentSessionMetaData, string];
|
6
6
|
export type IAMSComponentOptions = IoptionsParams & {
|
7
7
|
appVersion: string;
|
8
|
-
isPreload?: boolean;
|
9
8
|
};
|
10
9
|
export declare class AMSComponent extends CoreInstance {
|
11
10
|
_componentApp: ComponentApp;
|
12
11
|
channelType: ComponentSignEnum[];
|
13
12
|
productSceneVersion: string;
|
14
13
|
timer: any;
|
15
|
-
isSuccessfullyPreloaded: boolean;
|
14
|
+
static isSuccessfullyPreloaded: boolean;
|
16
15
|
constructor(options: IAMSComponentOptions);
|
17
16
|
private parameterInitAndCheck;
|
18
17
|
private pluginAppendIframe;
|
@@ -140,7 +140,6 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
140
140
|
_defineProperty(_assertThisInitialized(_this2), "channelType", void 0);
|
141
141
|
_defineProperty(_assertThisInitialized(_this2), "productSceneVersion", void 0);
|
142
142
|
_defineProperty(_assertThisInitialized(_this2), "timer", void 0);
|
143
|
-
_defineProperty(_assertThisInitialized(_this2), "isSuccessfullyPreloaded", void 0);
|
144
143
|
var ComponentPlugin = new ComponentApp({
|
145
144
|
appVersion: options.appVersion
|
146
145
|
});
|
@@ -150,7 +149,6 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
150
149
|
_this2._registerPlugin(COMPONENTPLUGINID, ComponentPlugin);
|
151
150
|
_this2._componentApp = _this2._getPlugin(COMPONENTPLUGINID);
|
152
151
|
_this2.registerBusAbility();
|
153
|
-
_this2.isSuccessfullyPreloaded = options.isPreload;
|
154
152
|
return _this2;
|
155
153
|
}
|
156
154
|
_createClass(AMSComponent, [{
|
@@ -392,14 +390,12 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
392
390
|
key: "preloadComponent",
|
393
391
|
value: function preloadComponent(channelType, productSceneVersion) {
|
394
392
|
var _this6 = this;
|
395
|
-
if (this.isSuccessfullyPreloaded) return;
|
396
393
|
this.channelType = channelType;
|
397
394
|
this.productSceneVersion = productSceneVersion;
|
398
395
|
var MAX_CLEAR_TIME = 10000;
|
399
396
|
if (Array.isArray(channelType)) {
|
400
397
|
for (var i = 0; i < channelType.length; i++) {
|
401
398
|
this._componentApp.appendPreloadIframeNodes(channelType[i], productSceneVersion);
|
402
|
-
this.isSuccessfullyPreloaded = true;
|
403
399
|
}
|
404
400
|
} else {
|
405
401
|
this.logger.logError({
|
@@ -535,10 +531,9 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
535
531
|
value: function preload(_options) {
|
536
532
|
try {
|
537
533
|
var _currentCompoentApp$c;
|
538
|
-
var currentCompoentApp = new AMSComponent(_objectSpread(
|
539
|
-
isPreload: true
|
540
|
-
}));
|
534
|
+
var currentCompoentApp = new AMSComponent(_objectSpread({}, _options));
|
541
535
|
currentCompoentApp.preloadComponent(_options.channelType, _options.productSceneVersion || '1.0');
|
536
|
+
AMSComponent.isSuccessfullyPreloaded = true;
|
542
537
|
if (currentCompoentApp.channelType && (_currentCompoentApp$c = currentCompoentApp.channelType) !== null && _currentCompoentApp$c !== void 0 && _currentCompoentApp$c.some(function (val) {
|
543
538
|
return val === ComponentSignEnum.EASY_PAY_WALLET || val === ComponentSignEnum.EASY_PAY_APM;
|
544
539
|
})) return;
|
@@ -552,4 +547,5 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
552
547
|
}
|
553
548
|
}]);
|
554
549
|
return AMSComponent;
|
555
|
-
}(CoreInstance);
|
550
|
+
}(CoreInstance);
|
551
|
+
_defineProperty(AMSComponent, "isSuccessfullyPreloaded", void 0);
|
package/esm/index.js
CHANGED
@@ -43,12 +43,9 @@ export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
|
43
43
|
_this = _super.call(this, _objectSpread({
|
44
44
|
appVersion: AMSCheckoutAppVersion
|
45
45
|
}, _options));
|
46
|
-
|
47
|
-
if (!_this.isSuccessfullyPreloaded) {
|
46
|
+
if (!AMSComponent.isSuccessfullyPreloaded) {
|
48
47
|
_this.preloadComponent(channelType, productSceneVersion);
|
49
48
|
}
|
50
|
-
// this.channelType = channelType;
|
51
|
-
// this.productSceneVersion = productSceneVersion;
|
52
49
|
return _this;
|
53
50
|
}
|
54
51
|
_createClass(AMSCheckout, null, [{
|