@alipay/ams-checkout 0.0.1713146800-dev.0 → 0.0.1713838058-dev.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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/config/request.js +3 -3
- package/esm/core/bus/index.d.ts +1 -1
- package/esm/core/bus/interface.d.ts +5 -1
- package/esm/core/bus/interface.js +6 -1
- package/esm/core/component/index.d.ts +1 -0
- package/esm/core/component/index.js +14 -6
- package/esm/core/instance/index.d.ts +8 -1
- package/esm/core/instance/index.js +22 -14
- package/esm/plugin/applepay/component.d.ts +1 -1
- package/esm/plugin/applepay/component.js +5 -5
- package/esm/plugin/applepay/index.d.ts +1 -1
- package/esm/plugin/applepay/index.js +6 -6
- package/esm/plugin/component/cashierApp.d.ts +6 -2
- package/esm/plugin/component/cashierApp.js +68 -12
- package/esm/plugin/component/component.popup.style.js +1 -1
- package/esm/plugin/component/index.d.ts +1 -2
- package/esm/plugin/component/index.js +153 -89
- package/esm/plugin/const.js +18 -4
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/paypal/index.js +389 -0
- package/esm/plugin/type.d.ts +2 -2
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/plugin/utils.js +21 -0
- package/esm/request/index.js +8 -14
- package/esm/types/index.d.ts +58 -3
- package/esm/types/index.js +18 -0
- package/esm/util/debug.d.ts +1 -0
- package/esm/util/debug.js +9 -0
- package/esm/util/index.d.ts +2 -1
- package/esm/util/index.js +4 -2
- package/esm/util/logger.d.ts +8 -0
- package/esm/util/logger.js +34 -3
- package/esm/util/storage.d.ts +2 -0
- package/esm/util/storage.js +23 -0
- package/esm/util/upgrade.d.ts +39 -0
- package/esm/util/upgrade.js +115 -0
- package/esm/util/versionCompare.d.ts +10 -1
- package/esm/util/versionCompare.js +97 -0
- package/package.json +1 -1
package/esm/config/request.js
CHANGED
@@ -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-
|
16
|
-
dev: host || 'http://imgs-
|
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 || '
|
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',
|
package/esm/core/bus/index.d.ts
CHANGED
@@ -4,7 +4,11 @@ export declare enum PaymentActionEnum {
|
|
4
4
|
export declare enum ApplePayActionEnum {
|
5
5
|
canMakePayments = "plugin_CARD_APPLE_PAY_available",
|
6
6
|
createComponent = "plugin_CARD_APPLE_PAY_createComponent",
|
7
|
-
|
7
|
+
destroyComponent = "plugin_CARD_APPLE_PAY_destroyComponent"
|
8
|
+
}
|
9
|
+
export declare enum PaypalActionEnum {
|
10
|
+
mountComponent = "plugin_Paypal_mountComponent",
|
11
|
+
destroyComponent = "plugin_Paypal_destroyComponent"
|
8
12
|
}
|
9
13
|
export declare enum SDKCallbackActionEnum {
|
10
14
|
onEventCallback = "onEventCallback"
|
@@ -5,9 +5,14 @@ export var PaymentActionEnum = /*#__PURE__*/function (PaymentActionEnum) {
|
|
5
5
|
export var ApplePayActionEnum = /*#__PURE__*/function (ApplePayActionEnum) {
|
6
6
|
ApplePayActionEnum["canMakePayments"] = "plugin_CARD_APPLE_PAY_available";
|
7
7
|
ApplePayActionEnum["createComponent"] = "plugin_CARD_APPLE_PAY_createComponent";
|
8
|
-
ApplePayActionEnum["
|
8
|
+
ApplePayActionEnum["destroyComponent"] = "plugin_CARD_APPLE_PAY_destroyComponent";
|
9
9
|
return ApplePayActionEnum;
|
10
10
|
}({});
|
11
|
+
export var PaypalActionEnum = /*#__PURE__*/function (PaypalActionEnum) {
|
12
|
+
PaypalActionEnum["mountComponent"] = "plugin_Paypal_mountComponent";
|
13
|
+
PaypalActionEnum["destroyComponent"] = "plugin_Paypal_destroyComponent";
|
14
|
+
return PaypalActionEnum;
|
15
|
+
}({});
|
11
16
|
export var SDKCallbackActionEnum = /*#__PURE__*/function (SDKCallbackActionEnum) {
|
12
17
|
SDKCallbackActionEnum["onEventCallback"] = "onEventCallback";
|
13
18
|
return SDKCallbackActionEnum;
|
@@ -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;
|
@@ -29,18 +29,19 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
29
|
*/
|
30
30
|
import { v4 as uuid } from 'uuid';
|
31
31
|
import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
32
|
+
import { ApplePayBusSubscriber } from "../../plugin/applepay";
|
32
33
|
import ComponentApp from "../../plugin/component";
|
34
|
+
import { ExtendPlugin } from "../../plugin/const";
|
35
|
+
import { PaypalBusSubscriber } from "../../plugin/paypal";
|
33
36
|
import { componentSignEnum, environmentEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
|
34
37
|
import { getOrSetStorageId, isPC, parseBase64ToString } from "../../util";
|
35
38
|
import { createIframeNode, createPreloadIframeNode } from "../../util/createIframeNode";
|
36
39
|
import { getSecurityConfigStorageKey } from "../../util/security";
|
37
|
-
import CoreInstance from "../instance/index";
|
38
40
|
import { BusManager, BusMessage } from "../bus";
|
39
41
|
import { SDKCallbackBusSubscriber } from "../bus/ability/callback";
|
40
|
-
import { ApplePayBusSubscriber } from "../../plugin/applepay";
|
41
42
|
import { SecurityBusSubscriber } from "../bus/ability/security";
|
42
43
|
import { TrackerBusSubscriber } from "../bus/ability/tracker";
|
43
|
-
import
|
44
|
+
import CoreInstance from "../instance/index";
|
44
45
|
export var getComponentSign = function getComponentSign(params) {
|
45
46
|
var _params$paymentSessio = params.paymentSessionConfig,
|
46
47
|
_params$paymentSessio2 = _params$paymentSessio === void 0 ? {} : _params$paymentSessio,
|
@@ -74,7 +75,7 @@ var handleSessionData = function handleSessionData(originSessionData) {
|
|
74
75
|
parseData = _parseSessionData2[0],
|
75
76
|
sessionData = _parseSessionData2[1];
|
76
77
|
resetEasyPaySceneVersion(parseData);
|
77
|
-
return [parseData, sessionData];
|
78
|
+
return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
|
78
79
|
};
|
79
80
|
var handleParams = function handleParams(params) {
|
80
81
|
var _params = Object.assign({
|
@@ -116,6 +117,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
116
117
|
_defineProperty(_assertThisInitialized(_this), "_componentApp", void 0);
|
117
118
|
_defineProperty(_assertThisInitialized(_this), "channelType", void 0);
|
118
119
|
_defineProperty(_assertThisInitialized(_this), "productSceneVersion", void 0);
|
120
|
+
_defineProperty(_assertThisInitialized(_this), "timer", void 0);
|
119
121
|
var ComponentPlugin = new ComponentApp();
|
120
122
|
ComponentPlugin.setRender(createIframeNode);
|
121
123
|
ComponentPlugin.setPreloadRender(createPreloadIframeNode);
|
@@ -229,6 +231,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
229
231
|
BusManager.subscribe(new TrackerBusSubscriber(this.logger));
|
230
232
|
// subscribe plugin
|
231
233
|
BusManager.subscribe(new ApplePayBusSubscriber(this.logger));
|
234
|
+
BusManager.subscribe(new PaypalBusSubscriber(this.logger));
|
232
235
|
|
233
236
|
// register bus plugin
|
234
237
|
ExtendPlugin.forEach(function (item) {
|
@@ -264,7 +267,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
264
267
|
* only the channel described in the document will be called, and it will be returned as available by default
|
265
268
|
* @param paymentMethod - described in the document
|
266
269
|
* @param subPaymentMethod - described in the document
|
267
|
-
* @returns
|
270
|
+
* @returns
|
268
271
|
*/
|
269
272
|
}, {
|
270
273
|
key: "canMakePayments",
|
@@ -322,6 +325,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
322
325
|
_this4._eventCenter.emit(EVENT.error.name, error);
|
323
326
|
return Promise.reject(error);
|
324
327
|
}).then(function (appendParams) {
|
328
|
+
var iframeNodesParams = appendParams.iframeNodesParams;
|
329
|
+
_this4.logger.setTrackId(iframeNodesParams === null || iframeNodesParams === void 0 ? void 0 : iframeNodesParams.sessionData);
|
325
330
|
return _this4.createComponentProcess(appendParams);
|
326
331
|
});
|
327
332
|
}
|
@@ -361,7 +366,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
361
366
|
channelType: channelType
|
362
367
|
});
|
363
368
|
}
|
364
|
-
setTimeout(function () {
|
369
|
+
this.timer = setTimeout(function () {
|
365
370
|
_this5.clearPreloadIframe(true);
|
366
371
|
}, MAX_CLEAR_TIME);
|
367
372
|
}
|
@@ -369,6 +374,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
369
374
|
key: "clearPreloadIframe",
|
370
375
|
value: function clearPreloadIframe() {
|
371
376
|
var isTimeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
377
|
+
!isTimeOut && clearTimeout(this.timer);
|
372
378
|
if (Array.isArray(this.channelType)) {
|
373
379
|
for (var i = 0; i < this.channelType.length; i++) {
|
374
380
|
var iframe = document.getElementById("ams-checkout-component-".concat(this.channelType[i], "-").concat(this.productSceneVersion));
|
@@ -410,6 +416,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
410
416
|
_this6._eventCenter.emit(EVENT.error.name, error);
|
411
417
|
return Promise.reject(error);
|
412
418
|
}).then(function (appendParams) {
|
419
|
+
var iframeNodesParams = appendParams.iframeNodesParams;
|
420
|
+
_this6.logger.setTrackId(iframeNodesParams === null || iframeNodesParams === void 0 ? void 0 : iframeNodesParams.sessionData);
|
413
421
|
return _this6.mountComponentProcess(appendParams);
|
414
422
|
});
|
415
423
|
}
|
@@ -1,8 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
+
*
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
+
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
|
+
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
|
+
*/
|
8
|
+
import { ComponentActionNamesType } from 'src/plugin/type';
|
1
9
|
import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IoptionsParams } from '../../types/index';
|
2
10
|
import { EventCenter } from '../../util/index';
|
3
11
|
import { Logger } from '../../util/logger';
|
4
12
|
import { Security } from '../../util/security';
|
5
|
-
import { ComponentActionNamesType } from 'src/plugin/type';
|
6
13
|
export default class AMSSDK {
|
7
14
|
options: AMSCheckoutOptions;
|
8
15
|
originOptions: IoptionsParams;
|
@@ -16,6 +16,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
16
16
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
17
17
|
*/
|
18
18
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
19
|
+
|
19
20
|
import { v4 as uuid } from 'uuid';
|
20
21
|
import { sdkVersion } from "../../config/index";
|
21
22
|
import { ERRORMESSAGE, EVENT } from "../../constant";
|
@@ -24,8 +25,8 @@ import { environmentEnum, modeEnum, networkModeEnum, osTypeEnum, productSceneEnu
|
|
24
25
|
import { checkTimeElapsed, device, EventCenter, getOrSetStorageId, getType, queryParse, safeJson } from "../../util/index";
|
25
26
|
import CallApp from "../../util/intl-callapp/es/main";
|
26
27
|
import { LogConfig, Logger } from "../../util/logger";
|
27
|
-
import { compareVersion } from "../../util/versionCompare";
|
28
28
|
import { getSecurityConfigStorageKey, getSecurityHost, getSecurityScene, Security, SecurityRegionEnum } from "../../util/security";
|
29
|
+
import { compareVersion } from "../../util/versionCompare";
|
29
30
|
import { BusManager, BusMessage } from "../bus";
|
30
31
|
var AMSSDK = /*#__PURE__*/function () {
|
31
32
|
function AMSSDK(options) {
|
@@ -56,23 +57,27 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
56
57
|
this._storageId = _storageId;
|
57
58
|
|
58
59
|
// TODO Consumption data analysis control parameters
|
59
|
-
this.logger = new Logger(LogConfig, (options === null || options === void 0 ? void 0 : options.environment)
|
60
|
+
this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
|
61
|
+
Logger.setInstance(this.logger);
|
60
62
|
this.logger.setMedta({
|
61
63
|
instanceId: this._instanceId
|
62
64
|
});
|
63
65
|
this.logger.initTracker();
|
66
|
+
this.logger.setComponentStartTime(Date.now());
|
67
|
+
this.logger.setTrackId(this._instanceId);
|
64
68
|
this.logger.logInfo({
|
65
69
|
title: 'NEW_AMSSDK_BY_MECHANT',
|
66
|
-
msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale
|
70
|
+
msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale)
|
67
71
|
}).send();
|
68
|
-
this.preInitSecurity();
|
72
|
+
this.preInitSecurity(options);
|
69
73
|
}
|
70
74
|
_createClass(AMSSDK, [{
|
71
75
|
key: "preInitSecurity",
|
72
|
-
value: function preInitSecurity() {
|
76
|
+
value: function preInitSecurity(options) {
|
73
77
|
var _this$options;
|
74
78
|
var antomSDKConfigKey = 'antomSDKConfigKey';
|
75
79
|
var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
|
80
|
+
if (![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
|
76
81
|
if (checkTimeElapsed()) {
|
77
82
|
antomConfig({
|
78
83
|
env: this.options.env.environment
|
@@ -86,7 +91,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
86
91
|
var matchingConfig = config['pl_sec'].find(function (item) {
|
87
92
|
var _item$v, _item$v2, _item$platform;
|
88
93
|
var minVersion = item === null || item === void 0 || (_item$v = item.v) === null || _item$v === void 0 ? void 0 : _item$v.split('|')[0];
|
89
|
-
var maxVersion = (item === null || item === void 0 || (_item$v2 = item.v) === null || _item$v2 === void 0 ? void 0 : _item$v2.split('|')[1]) || '
|
94
|
+
var maxVersion = (item === null || item === void 0 || (_item$v2 = item.v) === null || _item$v2 === void 0 ? void 0 : _item$v2.split('|')[1]) || '999999.9.9';
|
90
95
|
var matchVersion = compareVersion(sdkVersion, minVersion) >= 0 && compareVersion(maxVersion, sdkVersion) >= 0;
|
91
96
|
return ((item === null || item === void 0 || (_item$platform = item.platform) === null || _item$platform === void 0 ? void 0 : _item$platform.includes('Web')) || (item === null || item === void 0 ? void 0 : item.platform) === '') && (item === null || item === void 0 ? void 0 : item.product) === product && (!(item !== null && item !== void 0 && item.v) || matchVersion);
|
92
97
|
});
|
@@ -109,11 +114,13 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
109
114
|
this.logger.logInfo({
|
110
115
|
title: 'sdk_event_apiOnDestroy'
|
111
116
|
}).send();
|
112
|
-
var actionName = (_this$getBusActionNam = this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.
|
117
|
+
var actionName = (_this$getBusActionNam = this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.destroyComponent;
|
113
118
|
if (actionName && BusManager.isSubscribed(actionName)) {
|
119
|
+
var _this$_appendParams;
|
114
120
|
// 执行出错了,在通用拦截器返回
|
115
121
|
BusManager.publish(new BusMessage(actionName, JSON.stringify({
|
116
|
-
options: this.originOptions
|
122
|
+
options: this.originOptions,
|
123
|
+
selector: (_this$_appendParams = this._appendParams) === null || _this$_appendParams === void 0 || (_this$_appendParams = _this$_appendParams.iframeNodesParams) === null || _this$_appendParams === void 0 ? void 0 : _this$_appendParams.selector
|
117
124
|
})));
|
118
125
|
}
|
119
126
|
var _iterator = _createForOfIteratorHelper(this.plugins.values()),
|
@@ -315,14 +322,14 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
315
322
|
key: "_registerPlugin",
|
316
323
|
value: function _registerPlugin(pluginId, plugin) {
|
317
324
|
this.plugins.set(pluginId, plugin);
|
318
|
-
|
319
|
-
|
325
|
+
if (plugin !== null && plugin !== void 0 && plugin.applyPlugin) {
|
326
|
+
try {
|
320
327
|
plugin.applyPlugin(this);
|
328
|
+
} catch (error) {
|
329
|
+
this.plugins.delete(pluginId);
|
330
|
+
if (getType(error) === 'error') throw error;
|
331
|
+
throw new Error("Failed to register plug-in\uFF1A".concat(pluginId, " Exception in the apply function of the plug-in"));
|
321
332
|
}
|
322
|
-
} catch (error) {
|
323
|
-
this.plugins.delete(pluginId);
|
324
|
-
if (getType(error) === 'error') throw error;
|
325
|
-
throw new Error("Failed to register plug-in\uFF1A".concat(pluginId, " Exception in the apply function of the plug-in"));
|
326
333
|
}
|
327
334
|
}
|
328
335
|
/**
|
@@ -337,6 +344,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
337
344
|
}
|
338
345
|
return this.plugins.get(pluginId);
|
339
346
|
}
|
347
|
+
|
340
348
|
/**
|
341
349
|
* @description Execute to open app or jump link
|
342
350
|
*/
|
@@ -14,7 +14,7 @@ export declare enum ApplePayComponentEvent {
|
|
14
14
|
sdk_event_appleOnvalidatemerchant = "sdk_event_appleOnvalidatemerchant",
|
15
15
|
sdk_event_appleSubmitToken = "sdk_event_appleSubmitToken",
|
16
16
|
sdk_event_applePaymentResult = "sdk_event_applePaymentResult",
|
17
|
-
|
17
|
+
sdk_event_appleDestroyComponent = "sdk_event_appleDestroyComponent"
|
18
18
|
}
|
19
19
|
/**
|
20
20
|
* Apple pay Component
|
@@ -27,7 +27,7 @@ export var ApplePayComponentEvent = /*#__PURE__*/function (ApplePayComponentEven
|
|
27
27
|
ApplePayComponentEvent["sdk_event_appleOnvalidatemerchant"] = "sdk_event_appleOnvalidatemerchant";
|
28
28
|
ApplePayComponentEvent["sdk_event_appleSubmitToken"] = "sdk_event_appleSubmitToken";
|
29
29
|
ApplePayComponentEvent["sdk_event_applePaymentResult"] = "sdk_event_applePaymentResult";
|
30
|
-
ApplePayComponentEvent["
|
30
|
+
ApplePayComponentEvent["sdk_event_appleDestroyComponent"] = "sdk_event_appleDestroyComponent";
|
31
31
|
return ApplePayComponentEvent;
|
32
32
|
}({});
|
33
33
|
|
@@ -55,8 +55,8 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
55
55
|
|
56
56
|
/**
|
57
57
|
* Is Apple Pay Enabled
|
58
|
-
* @param subTypeEnum
|
59
|
-
* @returns
|
58
|
+
* @param subTypeEnum
|
59
|
+
* @returns
|
60
60
|
*/
|
61
61
|
_createClass(ApplePayComponent, [{
|
62
62
|
key: "canMakePayments",
|
@@ -66,8 +66,8 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
66
66
|
|
67
67
|
/**
|
68
68
|
* Is Apple Pay Enabled
|
69
|
-
* @param subTypeEnum
|
70
|
-
* @returns
|
69
|
+
* @param subTypeEnum
|
70
|
+
* @returns
|
71
71
|
*/
|
72
72
|
}, {
|
73
73
|
key: "isAppPayEnabled",
|
@@ -12,6 +12,6 @@ export declare class ApplePayBusSubscriber extends BusSubscriber {
|
|
12
12
|
protected onOptionalInit(context: BusContext, message: BusMessage): void;
|
13
13
|
protected onCanMakePayments(context: BusContext, message: BusMessage): void;
|
14
14
|
protected onCreateComponent(context: BusContext, message: BusMessage): void;
|
15
|
-
protected
|
15
|
+
protected onDestroyComponent(context: BusContext, message: BusMessage): void;
|
16
16
|
onMessage(context: BusContext, message: BusMessage): void;
|
17
17
|
}
|
@@ -80,13 +80,13 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
80
80
|
this.applePay.submitPay(appendParams);
|
81
81
|
}
|
82
82
|
}, {
|
83
|
-
key: "
|
84
|
-
value: function
|
83
|
+
key: "onDestroyComponent",
|
84
|
+
value: function onDestroyComponent(context, message) {
|
85
85
|
this.applePay = null;
|
86
|
-
console.log('
|
86
|
+
console.log('onDestroyComponent', context, message);
|
87
87
|
this.logger.logInfo({
|
88
88
|
name: 'APPLE_PAY',
|
89
|
-
title: ApplePayComponentEvent.
|
89
|
+
title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
|
90
90
|
}, {
|
91
91
|
biz: 'sdk',
|
92
92
|
type: 'funnel'
|
@@ -105,8 +105,8 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
105
105
|
case ApplePayActionEnum.createComponent:
|
106
106
|
this.onCreateComponent(context, message);
|
107
107
|
break;
|
108
|
-
case ApplePayActionEnum.
|
109
|
-
this.
|
108
|
+
case ApplePayActionEnum.destroyComponent:
|
109
|
+
this.onDestroyComponent(context, message);
|
110
110
|
break;
|
111
111
|
default:
|
112
112
|
console.log("Unknown action: " + message.getAction());
|
@@ -1,15 +1,18 @@
|
|
1
|
-
import {
|
2
|
-
export declare const getAppPath: (environment: string, appVersion: string, componentSign: componentSignEnum, productSceneVersion: string, extendInfo: string) => any;
|
1
|
+
import { componentSignEnum, Ianalytics, renderDisplayTypeEnum } from '../../types';
|
2
|
+
export declare const getAppPath: (environment: string, appVersion: string, componentSign: componentSignEnum, productScene: string, productSceneVersion: string, extendInfo: string, mid: string) => any;
|
3
3
|
export declare const getAppDomain: (domainParams: {
|
4
4
|
environment: string;
|
5
5
|
appVersion: string;
|
6
6
|
componentSign: componentSignEnum;
|
7
|
+
productScene: string;
|
7
8
|
productSceneVersion: string;
|
8
9
|
extendInfo: string;
|
10
|
+
mid: string;
|
9
11
|
}) => string;
|
10
12
|
export declare const getIframeUrl: (iframeParams: {
|
11
13
|
componentSign: componentSignEnum;
|
12
14
|
analytics?: Ianalytics;
|
15
|
+
productScene: string;
|
13
16
|
productSceneVersion: string;
|
14
17
|
environment: string;
|
15
18
|
appVersion: string;
|
@@ -19,6 +22,7 @@ export declare const getIframeUrl: (iframeParams: {
|
|
19
22
|
renderDisplayType: renderDisplayTypeEnum;
|
20
23
|
isPreload?: string;
|
21
24
|
hostSign?: string;
|
25
|
+
mid: string;
|
22
26
|
}) => {
|
23
27
|
path: string;
|
24
28
|
locationSearch: string;
|
@@ -10,12 +10,40 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
10
10
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
11
11
|
*/
|
12
12
|
import { marmotMap, sdkVersion } from "../../config/index";
|
13
|
-
import { getViewPort, queryParse, serialize } from "../../util/index";
|
14
13
|
import { componentSignEnum } from "../../types";
|
15
|
-
|
14
|
+
import { isDebugLog } from "../../util/debug";
|
15
|
+
import { getViewPort, queryParse, serialize } from "../../util/index";
|
16
|
+
import { Logger } from "../../util/logger";
|
17
|
+
import { getLastAppVersion, getMatchAppVersion, setLastAppVersion } from "../../util/upgrade";
|
18
|
+
var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
16
19
|
try {
|
17
|
-
var
|
18
|
-
|
20
|
+
var _Logger$getInstance;
|
21
|
+
var appVersion = getMatchAppVersion(_extendInfo, {
|
22
|
+
sdkVersion: sdkVersion,
|
23
|
+
productScene: productScene,
|
24
|
+
mid: mid
|
25
|
+
});
|
26
|
+
// 有sessionData加载时
|
27
|
+
(_Logger$getInstance = Logger.getInstance()) === null || _Logger$getInstance === void 0 || _Logger$getInstance.logInfo({
|
28
|
+
title: 'sdk_event_appUpgradeInfo'
|
29
|
+
}, {
|
30
|
+
appUpgradeVersion: appVersion,
|
31
|
+
appUpgraded: appVersion ? true : false,
|
32
|
+
isPreload: _extendInfo ? false : true,
|
33
|
+
extendInfo: _extendInfo,
|
34
|
+
productScene: productScene,
|
35
|
+
mid: mid
|
36
|
+
});
|
37
|
+
// 没有匹配到版本,查询上次的加载版本
|
38
|
+
if (!appVersion) {
|
39
|
+
appVersion = getLastAppVersion(productScene);
|
40
|
+
return appVersion;
|
41
|
+
}
|
42
|
+
// 不为空时代表是有sessionData,因此要保存当前版本
|
43
|
+
if (_extendInfo) {
|
44
|
+
setLastAppVersion(productScene, appVersion);
|
45
|
+
}
|
46
|
+
return appVersion;
|
19
47
|
} catch (error) {
|
20
48
|
return '';
|
21
49
|
}
|
@@ -34,13 +62,26 @@ export var getAppPath = function getAppPath() {
|
|
34
62
|
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
|
35
63
|
var appVersion = arguments.length > 1 ? arguments[1] : undefined;
|
36
64
|
var componentSign = arguments.length > 2 ? arguments[2] : undefined;
|
37
|
-
var
|
38
|
-
var
|
65
|
+
var productScene = arguments.length > 3 ? arguments[3] : undefined;
|
66
|
+
var productSceneVersion = arguments.length > 4 ? arguments[4] : undefined;
|
67
|
+
var extendInfo = arguments.length > 5 ? arguments[5] : undefined;
|
68
|
+
var mid = arguments.length > 6 ? arguments[6] : undefined;
|
39
69
|
var _ref = queryParse() || {},
|
40
70
|
urlTestHost = _ref.host;
|
41
|
-
var
|
71
|
+
var upgradeAppVersion = getAppVersion(extendInfo, productScene, mid);
|
72
|
+
var finalAppVersion = upgradeAppVersion || appVersion;
|
73
|
+
// 当有升级版本时,更新到全局字段
|
74
|
+
if (upgradeAppVersion) {
|
75
|
+
var _Logger$getInstance2;
|
76
|
+
(_Logger$getInstance2 = Logger.getInstance()) === null || _Logger$getInstance2 === void 0 || _Logger$getInstance2.setMedta({
|
77
|
+
webAppVersion: finalAppVersion
|
78
|
+
});
|
79
|
+
}
|
80
|
+
if (isDebugLog()) {
|
81
|
+
console.log('appUpgrade#getAppPath#finalAppVersion', finalAppVersion);
|
82
|
+
console.log('appUpgrade#getAppPath#extendInfo', extendInfo, mid);
|
83
|
+
}
|
42
84
|
var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
|
43
|
-
|
44
85
|
// only for test while testurl?host=https://xxxxx.test.html
|
45
86
|
if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
|
46
87
|
return urlTestHost;
|
@@ -51,10 +92,12 @@ export var getAppDomain = function getAppDomain(domainParams) {
|
|
51
92
|
var environment = domainParams.environment,
|
52
93
|
appVersion = domainParams.appVersion,
|
53
94
|
componentSign = domainParams.componentSign,
|
95
|
+
productScene = domainParams.productScene,
|
54
96
|
productSceneVersion = domainParams.productSceneVersion,
|
55
|
-
extendInfo = domainParams.extendInfo
|
97
|
+
extendInfo = domainParams.extendInfo,
|
98
|
+
mid = domainParams.mid;
|
56
99
|
var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
|
57
|
-
var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo));
|
100
|
+
var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo, mid));
|
58
101
|
return macth && macth[0] || '';
|
59
102
|
};
|
60
103
|
export var getIframeUrl = function getIframeUrl(iframeParams) {
|
@@ -63,6 +106,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
63
106
|
analytics = _iframeParams$analyti === void 0 ? {
|
64
107
|
enabled: true
|
65
108
|
} : _iframeParams$analyti,
|
109
|
+
productScene = iframeParams.productScene,
|
66
110
|
productSceneVersion = iframeParams.productSceneVersion,
|
67
111
|
environment = iframeParams.environment,
|
68
112
|
appVersion = iframeParams.appVersion,
|
@@ -73,8 +117,15 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
73
117
|
_iframeParams$isPrelo = iframeParams.isPreload,
|
74
118
|
isPreload = _iframeParams$isPrelo === void 0 ? '' : _iframeParams$isPrelo,
|
75
119
|
_iframeParams$hostSig = iframeParams.hostSign,
|
76
|
-
hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig
|
77
|
-
|
120
|
+
hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig,
|
121
|
+
_iframeParams$mid = iframeParams.mid,
|
122
|
+
mid = _iframeParams$mid === void 0 ? '' : _iframeParams$mid;
|
123
|
+
var path = getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo || '', mid);
|
124
|
+
var appMatched = getMatchAppVersion(extendInfo, {
|
125
|
+
sdkVersion: sdkVersion,
|
126
|
+
productScene: productScene,
|
127
|
+
mid: mid
|
128
|
+
}) ? 'true' : 'false';
|
78
129
|
var initialScale = 1;
|
79
130
|
var scale = getViewPort('initial-scale') || initialScale;
|
80
131
|
var _queryParse = queryParse(),
|
@@ -91,6 +142,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
91
142
|
locale: locale,
|
92
143
|
scale: scale,
|
93
144
|
instanceId: instanceId,
|
145
|
+
appMatched: appMatched,
|
94
146
|
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
95
147
|
sdkVersion: sdkVersion,
|
96
148
|
refUrl: window.location.href,
|
@@ -106,6 +158,10 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
106
158
|
if (_displayType) urlParams.displayType = _displayType;
|
107
159
|
if (isPreload) urlParams.isPreload = isPreload;
|
108
160
|
var locationSearch = serialize(urlParams);
|
161
|
+
if (isDebugLog()) {
|
162
|
+
console.log('appUpgrade#getIframeUrl#appMatched', appMatched);
|
163
|
+
console.log('appUpgrade#getIframeUrl#url', path, locationSearch);
|
164
|
+
}
|
109
165
|
return {
|
110
166
|
path: path,
|
111
167
|
locationSearch: locationSearch
|
@@ -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
|
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
|
*/
|