@alipay/ams-checkout 0.0.1744283958-dev.4 → 0.0.1744283958-dev.5
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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/core/component/element/elementContainerService/containerService.d.ts +1 -0
- package/esm/core/component/element/elementContainerService/containerService.js +6 -0
- package/esm/core/component/element/elementContainerService/index.js +3 -0
- package/esm/core/component/element/elementController/index.d.ts +1 -0
- package/esm/core/component/element/elementController/index.js +16 -8
- package/package.json +1 -1
@@ -103,6 +103,12 @@ export var ContainerController = /*#__PURE__*/function () {
|
|
103
103
|
value: function getEventService() {
|
104
104
|
return this.eventService;
|
105
105
|
}
|
106
|
+
}, {
|
107
|
+
key: "destroy",
|
108
|
+
value: function destroy() {
|
109
|
+
this.eventService.destroy();
|
110
|
+
this.containerElement.remove();
|
111
|
+
}
|
106
112
|
}, {
|
107
113
|
key: "getContainerService",
|
108
114
|
value: function getContainerService() {
|
@@ -164,9 +164,9 @@ var ElementController = /*#__PURE__*/function () {
|
|
164
164
|
function readyCallback(payload) {
|
165
165
|
var _this2 = this;
|
166
166
|
var resultData = _objectSpread({
|
167
|
-
getValue: this.elementProcessors[renderOptions.type].getValue.bind(this.elementProcessors[renderOptions.type]),
|
167
|
+
getValue: this === null || this === void 0 ? void 0 : this.elementProcessors[renderOptions.type].getValue.bind(this === null || this === void 0 ? void 0 : this.elementProcessors[renderOptions.type]),
|
168
168
|
on: function on(event, callback) {
|
169
|
-
_this2.elementProcessors[renderOptions.type].registerEventListener(event, callback);
|
169
|
+
_this2 === null || _this2 === void 0 || _this2.elementProcessors[renderOptions.type].registerEventListener(event, callback);
|
170
170
|
}
|
171
171
|
}, payload);
|
172
172
|
resolve(resultData);
|
@@ -297,6 +297,10 @@ var ElementController = /*#__PURE__*/function () {
|
|
297
297
|
this.serviceMap.EventCenter.listen(EVENT.redirect.name, function (data) {
|
298
298
|
handleRedirect(data);
|
299
299
|
});
|
300
|
+
this.serviceMap.EventCenter.listen(EVENT.destroy.name, function () {
|
301
|
+
_this4.elementContainer.setStatus(IContainerStatus.READY);
|
302
|
+
_this4.destroyHandle();
|
303
|
+
});
|
300
304
|
this.serviceMap.EventCenter.listen(EVENT.webAppReady.name, function (data) {
|
301
305
|
if (_this4.elementContainerService.getContainerService(data.source)) {
|
302
306
|
renderCallback({
|
@@ -418,17 +422,21 @@ var ElementController = /*#__PURE__*/function () {
|
|
418
422
|
return updatePayment;
|
419
423
|
}()
|
420
424
|
}, {
|
421
|
-
key: "
|
422
|
-
value: function
|
425
|
+
key: "destroyHandle",
|
426
|
+
value: function destroyHandle() {
|
423
427
|
this.elementContainer.destroy();
|
424
|
-
this.
|
428
|
+
this.elementContainerService.destroy();
|
429
|
+
this.serviceMap.EventCenter.cleanIFrames();
|
425
430
|
// popup未注册会报错,但element不需要感知popup是否被注册
|
426
431
|
try {
|
427
432
|
destroyModal(); // 关闭popup弹窗
|
428
433
|
} catch (error) {}
|
429
|
-
|
430
|
-
|
431
|
-
|
434
|
+
}
|
435
|
+
}, {
|
436
|
+
key: "destroy",
|
437
|
+
value: function destroy() {
|
438
|
+
this.destroyHandle();
|
439
|
+
this.elementContainer.setStatus(IContainerStatus.DESTROYED);
|
432
440
|
}
|
433
441
|
}]);
|
434
442
|
return ElementController;
|