@alipay/ams-checkout 0.0.1726734012-dev.12 → 0.0.1726734012-dev.13

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,7 +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
395
  if (this.isSuccessfullyPreloaded) return;
396
396
  this.channelType = channelType;
397
397
  this.productSceneVersion = productSceneVersion;
@@ -535,9 +535,10 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
535
535
  value: function preload(_options) {
536
536
  try {
537
537
  var _currentCompoentApp$c;
538
- var currentCompoentApp = new AMSComponent(_options);
539
- currentCompoentApp.preloadComponent(_options.channelType, _options.productSceneVersion);
540
- currentCompoentApp.isSuccessfullyPreloaded = true;
538
+ var currentCompoentApp = new AMSComponent(_objectSpread(_objectSpread({}, _options), {}, {
539
+ isPreload: true
540
+ }));
541
+ currentCompoentApp.preloadComponent(_options.channelType, _options.productSceneVersion || '1.0');
541
542
  if (currentCompoentApp.channelType && (_currentCompoentApp$c = currentCompoentApp.channelType) !== null && _currentCompoentApp$c !== void 0 && _currentCompoentApp$c.some(function (val) {
542
543
  return val === ComponentSignEnum.EASY_PAY_WALLET || val === ComponentSignEnum.EASY_PAY_APM;
543
544
  })) return;
@@ -546,7 +547,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
546
547
  securityRegion: _options.securityRegion
547
548
  });
548
549
  } catch (err) {
549
- console.log('web-sdk error', err);
550
+ console.log('web-sdk preload error', err);
550
551
  }
551
552
  }
552
553
  }]);
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.preloadComponent(channelType, productSceneVersion);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1726734012-dev.12",
3
+ "version": "0.0.1726734012-dev.13",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",