@alipay/ams-checkout 0.0.1726734012-dev.12 → 0.0.1726734012-dev.14
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,6 +5,7 @@ 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;
|
8
9
|
};
|
9
10
|
export declare class AMSComponent extends CoreInstance {
|
10
11
|
_componentApp: ComponentApp;
|
@@ -150,6 +150,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
150
150
|
_this2._registerPlugin(COMPONENTPLUGINID, ComponentPlugin);
|
151
151
|
_this2._componentApp = _this2._getPlugin(COMPONENTPLUGINID);
|
152
152
|
_this2.registerBusAbility();
|
153
|
+
_this2.isSuccessfullyPreloaded = options.isPreload;
|
153
154
|
return _this2;
|
154
155
|
}
|
155
156
|
_createClass(AMSComponent, [{
|
@@ -391,8 +392,6 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
391
392
|
key: "preloadComponent",
|
392
393
|
value: function preloadComponent(channelType, productSceneVersion) {
|
393
394
|
var _this6 = this;
|
394
|
-
console.log('isSuccessfullyPreloaded', this.isSuccessfullyPreloaded);
|
395
|
-
if (this.isSuccessfullyPreloaded) return;
|
396
395
|
this.channelType = channelType;
|
397
396
|
this.productSceneVersion = productSceneVersion;
|
398
397
|
var MAX_CLEAR_TIME = 10000;
|
@@ -535,9 +534,10 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
535
534
|
value: function preload(_options) {
|
536
535
|
try {
|
537
536
|
var _currentCompoentApp$c;
|
538
|
-
var currentCompoentApp = new AMSComponent(_options)
|
539
|
-
|
540
|
-
|
537
|
+
var currentCompoentApp = new AMSComponent(_objectSpread(_objectSpread({}, _options), {}, {
|
538
|
+
isPreload: true
|
539
|
+
}));
|
540
|
+
currentCompoentApp.preloadComponent(_options.channelType, _options.productSceneVersion || '1.0');
|
541
541
|
if (currentCompoentApp.channelType && (_currentCompoentApp$c = currentCompoentApp.channelType) !== null && _currentCompoentApp$c !== void 0 && _currentCompoentApp$c.some(function (val) {
|
542
542
|
return val === ComponentSignEnum.EASY_PAY_WALLET || val === ComponentSignEnum.EASY_PAY_APM;
|
543
543
|
})) return;
|
@@ -546,7 +546,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
546
546
|
securityRegion: _options.securityRegion
|
547
547
|
});
|
548
548
|
} catch (err) {
|
549
|
-
console.log('web-sdk error', err);
|
549
|
+
console.log('web-sdk preload error', err);
|
550
550
|
}
|
551
551
|
}
|
552
552
|
}]);
|
package/esm/index.js
CHANGED
@@ -43,7 +43,10 @@ export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
|
43
43
|
_this = _super.call(this, _objectSpread({
|
44
44
|
appVersion: AMSCheckoutAppVersion
|
45
45
|
}, _options));
|
46
|
-
_this.
|
46
|
+
console.log(_this.isSuccessfullyPreloaded, 'isSuccessfullyPreloaded');
|
47
|
+
if (!_this.isSuccessfullyPreloaded) {
|
48
|
+
_this.preloadComponent(channelType, productSceneVersion);
|
49
|
+
}
|
47
50
|
// this.channelType = channelType;
|
48
51
|
// this.productSceneVersion = productSceneVersion;
|
49
52
|
return _this;
|