@conecli/cone-render 0.10.1-shop3.8 → 0.10.1-shop3.80
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/README.md +1 -1
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +24 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +274 -0
- package/dist/language/zh_CN.json +274 -0
- package/dist/language/zh_HK.json +274 -0
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +27 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +162 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
package/dist/utils/h5Utils.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
isApp,
|
|
3
2
|
isIOS,
|
|
4
3
|
getAppVersion,
|
|
5
4
|
version,
|
|
6
5
|
getUUID,
|
|
7
6
|
getUrlQuery,
|
|
8
7
|
assign,
|
|
9
8
|
isString,
|
|
10
9
|
isObject,
|
|
11
10
|
serialize,
|
|
12
11
|
isAndroid,
|
|
13
12
|
versionCompare,
|
|
14
13
|
isIPad,
|
|
15
14
|
isTablet,
|
|
16
15
|
CHANNEL_TYPE,
|
|
17
16
|
JDShopViewBusinessPathType,
|
|
18
17
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
19
18
|
SECTION_HOME_TAB_TYPE,
|
|
20
19
|
DraBuryPointFlags,
|
|
21
20
|
MPAAS_CONFIG_APP_VERSION,
|
|
22
21
|
new Promise((resolve, reject) => {
|
|
23
22
|
if (window?.__sgm__) {
|
|
24
23
|
resolve(true);
|
|
25
24
|
} else {
|
|
26
25
|
if (isSgmReadyError) {
|
|
27
26
|
console.log('当前sgm初始化失败');
|
|
28
27
|
reject(false);
|
|
29
28
|
} else {
|
|
30
29
|
ready('__sgm__', 2000)
|
|
31
30
|
.then(() => {
|
|
32
31
|
isSgmReadyError = false;
|
|
33
32
|
console.log('当前sgm初始化成功');
|
|
34
33
|
resolve(true);
|
|
35
34
|
})
|
|
36
35
|
.catch(() => {
|
|
37
36
|
isSgmReadyError = true;
|
|
38
37
|
console.log('当前sgm初始化失败');
|
|
39
38
|
reject(false);
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
console.log(message);
|
|
45
44
|
reject(new Error(message));
|
|
46
45
|
return ready('dra', 2000)
|
|
47
46
|
.then(() => {
|
|
48
47
|
isNewDraSdkReadyError = false;
|
|
49
48
|
console.log('当前新版烛龙sdk初始化成功');
|
|
50
49
|
return true;
|
|
51
50
|
})
|
|
52
51
|
.catch(() => {
|
|
53
52
|
isNewDraSdkReadyError = true;
|
|
54
53
|
throw new Error('当前新版烛龙sdk初始化失败');
|
|
55
54
|
});
|
|
56
55
|
return new Promise((resolve, reject) => {
|
|
57
56
|
if (window?.dra) {
|
|
58
57
|
resolve(true);
|
|
59
58
|
} else if (isNewDraSdkReadyError) {
|
|
60
59
|
logAndReject('当前新版烛龙sdk初始化失败', reject);
|
|
61
60
|
} else {
|
|
62
61
|
initializeDraSdk()
|
|
63
62
|
.then(resolve)
|
|
64
63
|
.catch((error) => logAndReject(error.message, reject));
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
66
|
if (window.screen?.orientation?.type) {
|
|
68
67
|
console.info(
|
|
69
68
|
'通过window.screen?.orientation?.type方式获取当前pad屏幕是否是横屏',
|
|
70
69
|
window.screen?.orientation?.type,
|
|
71
70
|
'测试低版本通过window?.orientation方式获取当前pad屏幕是否是横屏,角度[90, -90]',
|
|
72
71
|
window?.orientation,
|
|
73
72
|
);
|
|
74
73
|
return /landscape/i.test(window.screen.orientation.type);
|
|
75
74
|
} else if (window?.orientation) {
|
|
76
75
|
console.info(
|
|
77
76
|
'通过window?.orientation方式获取当前pad屏幕是否是横屏,角度[90, -90]',
|
|
78
77
|
window?.orientation,
|
|
79
78
|
);
|
|
80
79
|
return [90, -90].includes(window?.orientation);
|
|
81
80
|
} else {
|
|
82
81
|
console.info(
|
|
83
82
|
'通过window.matchMedia((orientation: landscape))?.matches方式获取当前pad屏幕是否是横屏',
|
|
84
83
|
window.matchMedia('(orientation: landscape)')?.matches,
|
|
85
84
|
);
|
|
86
85
|
return window.matchMedia('(orientation: landscape)')?.matches;
|
|
87
86
|
}
|
|
88
87
|
try {
|
|
89
88
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')));
|
|
90
89
|
} catch (e) {
|
|
91
90
|
return {};
|
|
92
91
|
}
|
|
93
92
|
isJdApp &&
|
|
94
93
|
(parseQueryUrlObj['device'] === 'tablet' ||
|
|
95
94
|
Math.min(window.screen.width, window.screen.height) >= 720);
|
|
96
95
|
isTablet: isJdTabletDevice,
|
|
97
96
|
isLandscape: isJdTabletDevice && checkPadScreenOrientationIsLandscape(),
|
|
98
97
|
window.shopGlobalSwitch?.isH5AndJdShopViewH5ScrollVersion || '';
|
|
99
98
|
!!document.getElementById('mallType') &&
|
|
100
99
|
!!document.getElementById('pageInstance_id') &&
|
|
101
100
|
!!document.getElementById('pageInstance_appId');
|
|
102
101
|
isTjScence &&
|
|
103
102
|
isWxMiniH5View &&
|
|
104
103
|
(urlCookie['wxapp_type'] == '2' ||
|
|
105
104
|
cookie.get('wxapp_type') == '2' ||
|
|
106
105
|
parseQueryUrlObj['tjChannel'] === 'jxxcx');
|
|
107
106
|
isTjScence && isWxMiniH5View && parseQueryUrlObj['sourceApp'] === 'haowujie';
|
|
108
107
|
isTjScence &&
|
|
109
108
|
(parseQueryUrlObj['appCode'] === 'ms27cba806' ||
|
|
110
109
|
document.referrer?.match(/(?:https?:)?\/\/(?:kpl\.m|css|cs)\.jd\.com/i)?.length ||
|
|
111
110
|
(parseQueryUrlObj['sourceApp'] == 'jsb-m' && parseQueryUrlObj['appCode'] === '') ||
|
|
112
111
|
parseQueryUrlObj['tjChannel'] === 'tjm');
|
|
113
112
|
if (isH5AdnJxMini) {
|
|
114
113
|
return 'jxxcx';
|
|
115
114
|
} else if (isTJApp) {
|
|
116
115
|
return 'tjapp';
|
|
117
116
|
} else if (isTjM) {
|
|
118
117
|
return 'tjm';
|
|
119
118
|
} else if (isTjJxM) {
|
|
120
119
|
return 'jxh5';
|
|
121
120
|
}
|
|
122
121
|
return '';
|
|
123
122
|
START: 'start',
|
|
124
123
|
MOVE: 'move',
|
|
125
124
|
END: 'end',
|
|
126
125
|
x: 0,
|
|
127
126
|
y: 0,
|
|
128
127
|
const startX = startPos.x;
|
|
129
128
|
const startY = startPos.y;
|
|
130
129
|
const endX = touchEvent.clientX;
|
|
131
130
|
const endY = touchEvent.clientY;
|
|
132
131
|
const dy = startY - endY;
|
|
133
132
|
const dx = endX - startX;
|
|
134
133
|
let result = 0;
|
|
135
134
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
136
135
|
return result;
|
|
137
136
|
}
|
|
138
137
|
const angle = (Math.atan2(dy, dx) * 180) / Math.PI;
|
|
139
138
|
if (angle >= -45 && angle < 45) {
|
|
140
139
|
result = 4;
|
|
141
140
|
} else if (angle >= 45 && angle < 135) {
|
|
142
141
|
result = 1;
|
|
143
142
|
} else if (angle >= -135 && angle < -45) {
|
|
144
143
|
result = 2;
|
|
145
144
|
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
146
145
|
result = 3;
|
|
147
146
|
}
|
|
148
147
|
return result;
|
|
149
148
|
e: Event,
|
|
150
149
|
touchType = TouchType.START,
|
|
151
150
|
stopTouchDocumentScrollState = false,
|
|
152
151
|
if (isJdApp && e) {
|
|
153
152
|
const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
|
|
154
153
|
let _touchState = touchType;
|
|
155
154
|
let _getDirectionState = false;
|
|
156
155
|
if (touchType === TouchType.START) {
|
|
157
156
|
StopNativeScrollEventPos.x = touchEvent.clientX;
|
|
158
157
|
StopNativeScrollEventPos.y = touchEvent.clientY;
|
|
159
158
|
} else if (touchType === TouchType.MOVE) {
|
|
160
159
|
_getDirectionState = [1, 2].includes(
|
|
161
160
|
touchMoveGetSlideDirection(StopNativeScrollEventPos, touchEvent),
|
|
162
161
|
);
|
|
163
162
|
if (_getDirectionState) {
|
|
164
163
|
_touchState = TouchType.END;
|
|
165
164
|
}
|
|
166
165
|
console.log(
|
|
167
166
|
'对外提供阻止横滑方法,当前touchType为move,设定1、2向上或向下方向,当前计算后的滑动是否为纵向',
|
|
168
167
|
_getDirectionState,
|
|
169
168
|
);
|
|
170
169
|
} else if (touchType === TouchType.END) {
|
|
171
170
|
StopNativeScrollEventPos.x = 0;
|
|
172
171
|
StopNativeScrollEventPos.y = 0;
|
|
173
172
|
}
|
|
174
173
|
isIosDevice
|
|
175
174
|
? iosDeviceStopNativeScrollEvent(e, _touchState, stopTouchDocumentScrollState)
|
|
176
175
|
: androidDeviceStopNativeScrollEvent(_touchState, stopTouchDocumentScrollState);
|
|
177
176
|
if (
|
|
178
177
|
!isAppHomeForMarketPage &&
|
|
179
178
|
stopTouchDocumentScrollState &&
|
|
180
179
|
_touchState === TouchType.START
|
|
181
180
|
) {
|
|
182
181
|
rootEleNode && rootEleNode.classList.add('over-hidden');
|
|
183
182
|
}
|
|
184
183
|
if (_touchState === TouchType.MOVE && _getDirectionState) {
|
|
185
184
|
rootEleNode &&
|
|
186
185
|
rootEleNode.classList.contains('over-hidden') &&
|
|
187
186
|
rootEleNode.classList.remove('over-hidden');
|
|
188
187
|
} else if (_touchState === TouchType.END) {
|
|
189
188
|
setTimeout(
|
|
190
189
|
() => {
|
|
191
190
|
rootEleNode &&
|
|
192
191
|
rootEleNode.classList.contains('over-hidden') &&
|
|
193
192
|
rootEleNode.classList.remove('over-hidden');
|
|
194
193
|
},
|
|
195
194
|
isAppHomeForMarketPage || _getDirectionState ? 0 : 200,
|
|
196
195
|
);
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
touchType = TouchType.START,
|
|
200
199
|
stopTouchDocumentScrollState = false,
|
|
201
200
|
isJdApp &&
|
|
202
201
|
touchType !== TouchType.MOVE &&
|
|
203
202
|
isAndroidDevice &&
|
|
204
203
|
window?.JdAndroid &&
|
|
205
204
|
window?.JdAndroid?.requestEvent &&
|
|
206
205
|
window.JdAndroid.requestEvent(touchType === TouchType.START);
|
|
207
206
|
console.log(
|
|
208
207
|
'对外提供阻止安卓横滑方法,true-禁止外部事件H5可滑动,false-外部拦截h5事件,当前touchType为',
|
|
209
208
|
touchType,
|
|
210
209
|
'当前非move触发requestEvent状态为',
|
|
211
210
|
touchType === TouchType.START,
|
|
212
211
|
'当前stopTouchDocumentScrollState为',
|
|
213
212
|
stopTouchDocumentScrollState,
|
|
214
213
|
);
|
|
215
214
|
e,
|
|
216
215
|
touchType = TouchType.START,
|
|
217
216
|
stopTouchDocumentScrollState = false,
|
|
218
217
|
e && e.stopPropagation();
|
|
219
218
|
console.log(
|
|
220
219
|
'对外提供阻止ios横滑方法,当前touchType为',
|
|
221
220
|
touchType,
|
|
222
221
|
'当前stopTouchDocumentScrollState为',
|
|
223
222
|
stopTouchDocumentScrollState,
|
|
224
223
|
);
|
|
225
224
|
window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
|
|
226
225
|
method: 'callRouterModuleWithParams',
|
|
227
226
|
params: {
|
|
228
227
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
229
228
|
routerParam: {
|
|
230
229
|
slideDirection: 'horizontal',
|
|
231
230
|
state: touchType,
|
|
232
231
|
},
|
|
233
232
|
callBackId: new Date().getTime(),
|
|
234
233
|
},
|
|
235
234
|
});
|
|
236
235
|
if (isH5AndJdShopView) {
|
|
237
236
|
return CHANNEL_TYPE[currentChannel] || CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
|
|
238
237
|
}
|
|
239
238
|
return null;
|
|
240
239
|
isH5 &&
|
|
241
240
|
isJdApp &&
|
|
242
241
|
['/app/home', '/app/classify', '/member/shopcard', '/favorite/home'].includes(urlPathname);
|
|
243
242
|
isH5 && isJdApp && !['/app/home'].includes(urlPathname);
|
|
244
243
|
['/app/home'].includes(urlPathname) &&
|
|
245
244
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_PROMOTION &&
|
|
246
245
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_MEMBER;
|
|
247
246
|
isAppHomePage && parseQueryUrlObj['source'] === 'app-marketing';
|
|
248
247
|
isH5 &&
|
|
249
248
|
isAppHomePage &&
|
|
250
249
|
versionCompare(jdAppVersion?.full ? jdAppVersion.full : '', isH5AndJdShopViewH5ScrollVersion) >=
|
|
251
250
|
0;
|
|
252
251
|
return isJdApp ? versionCompare(nowVersion, compareVersion) : -2;
|
|
253
252
|
getSgmReadyPromise()
|
|
254
253
|
.then(() => {
|
|
255
254
|
if (
|
|
256
255
|
customObj.hasOwnProperty('code') &&
|
|
257
256
|
customObj.code.indexOf(NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG) !== -1
|
|
258
257
|
) {
|
|
259
258
|
const originCode = customObj.code.substring(
|
|
260
259
|
NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG.length,
|
|
261
260
|
customObj.code.length,
|
|
262
261
|
);
|
|
263
262
|
customObj['code'] = getSgmCustomCode(handleSgmCodeTaroVersion(originCode));
|
|
264
263
|
}
|
|
265
264
|
const getCustomObj = {
|
|
266
265
|
type: 1,
|
|
267
266
|
code: 'all',
|
|
268
267
|
cost1: 1,
|
|
269
268
|
...customObj,
|
|
270
269
|
};
|
|
271
270
|
try {
|
|
272
271
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT');
|
|
273
272
|
} catch (e) {
|
|
274
273
|
console.log('当前sgm上报异常, 原始数据为', JSON.stringify(customObj));
|
|
275
274
|
}
|
|
276
275
|
})
|
|
277
276
|
.catch(() => {
|
|
278
277
|
console.error('当前页面sgm加载异常,无法进行异常上报, 原始数据为', JSON.stringify(customObj));
|
|
279
278
|
});
|
|
280
279
|
try {
|
|
281
280
|
await getNewDraSdkReadyPromise();
|
|
282
281
|
const draBurypointFlag = name ?? DraBuryPointFlags.BUSINESS;
|
|
283
282
|
const commonObj = {
|
|
284
283
|
shopId: `${global.info.queryInfo.shopId || ''}`,
|
|
285
284
|
venderId: `${global.info.queryInfo.venderId || ''}`,
|
|
286
285
|
taroRenderVersion: window?.taroRenderVersion,
|
|
287
286
|
environmentType: getEnvironmentType(),
|
|
288
287
|
pageType: getPageType(),
|
|
289
288
|
};
|
|
290
289
|
try {
|
|
291
290
|
window.dra.sendCustomEvent(
|
|
292
291
|
{
|
|
293
292
|
name: draBurypointFlag,
|
|
294
293
|
metrics: {
|
|
295
294
|
timeStamp: Date.now(),
|
|
296
295
|
...customMetricsObj,
|
|
297
296
|
},
|
|
298
297
|
context: {
|
|
299
298
|
...commonObj,
|
|
300
299
|
...customContextObj,
|
|
301
300
|
},
|
|
302
301
|
},
|
|
303
302
|
true,
|
|
304
303
|
);
|
|
305
304
|
} catch (e) {
|
|
306
305
|
console.error(
|
|
307
306
|
'当前新版烛龙sdk上报异常, 原始数据为',
|
|
308
307
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
309
308
|
'e',
|
|
310
309
|
e,
|
|
311
310
|
);
|
|
312
311
|
}
|
|
313
312
|
} catch (e) {
|
|
314
313
|
console.error(
|
|
315
314
|
'当前页面新版烛龙sdk加载异常,无法进行异常上报, 原始数据为',
|
|
316
315
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
317
316
|
'e',
|
|
318
317
|
e,
|
|
319
318
|
);
|
|
320
319
|
}
|
|
321
320
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.REMOTE);
|
|
322
321
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.INTERFACE);
|
|
323
322
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.BUSINESS);
|
|
324
323
|
if (isJdAndAndroidDevice && typeof displayObj === 'object') {
|
|
325
324
|
const deviceRatio = window?.devicePixelRatio ?? 2;
|
|
326
325
|
Object.keys(displayObj).forEach((key) => {
|
|
327
326
|
if (key === 'nativeHeaderHeight') {
|
|
328
327
|
displayObj[key] = Math.ceil(displayObj[key] / (deviceRatio * deviceRatio) - 2);
|
|
329
328
|
} else {
|
|
330
329
|
displayObj[key] = Math.ceil(displayObj[key] / deviceRatio);
|
|
331
330
|
}
|
|
332
331
|
});
|
|
333
332
|
}
|
|
334
333
|
return displayObj;
|
|
335
334
|
isJdAndAndroidDevice && /TBS\/\d+/.test(window?.navigator?.userAgent);
|
|
336
335
|
customContextObj = {},
|
|
337
336
|
customMetricsObj = {},
|
|
338
337
|
name?,
|
|
339
338
|
try {
|
|
340
339
|
const draBurypointFlag = name ?? DraBuryPointFlags.DECOSDM;
|
|
341
340
|
try {
|
|
342
341
|
let dra = null;
|
|
343
342
|
const iframe = window?.top?.document?.getElementsByTagName('iframe')[0];
|
|
344
343
|
if (iframe && iframe.contentWindow) {
|
|
345
344
|
dra = iframe.contentWindow?.dra;
|
|
346
345
|
}
|
|
347
346
|
if (window.dra) {
|
|
348
347
|
dra = window.dra;
|
|
349
348
|
}
|
|
350
349
|
dra &&
|
|
351
350
|
dra.sendCustomEvent(
|
|
352
351
|
{
|
|
353
352
|
name: draBurypointFlag,
|
|
354
353
|
metrics: {
|
|
355
354
|
timeStamp: Date.now(),
|
|
356
355
|
},
|
|
357
356
|
context: {
|
|
358
357
|
...customContextObj,
|
|
359
358
|
},
|
|
360
359
|
},
|
|
361
360
|
true,
|
|
362
361
|
);
|
|
363
362
|
} catch (e) {
|
|
364
363
|
console.error(
|
|
365
364
|
'当前新版烛龙sdk上报异常, 原始数据为',
|
|
366
365
|
JSON.stringify({ ...customContextObj }),
|
|
367
366
|
'e',
|
|
368
367
|
e,
|
|
369
368
|
);
|
|
370
369
|
}
|
|
371
370
|
} catch (e) {
|
|
372
371
|
console.error(
|
|
373
372
|
'当前页面新版烛龙sdk加载异常,无法进行异常上报, 原始数据为',
|
|
374
373
|
JSON.stringify({ ...customContextObj }),
|
|
375
374
|
'e',
|
|
376
375
|
e,
|
|
377
376
|
);
|
|
378
377
|
}
|
|
378
|
+
import {
|
|
379
379
|
isApp,
|
|
380
380
|
isIOS,
|
|
381
381
|
getAppVersion,
|
|
382
382
|
version,
|
|
383
383
|
getUrlQuery,
|
|
384
384
|
assign,
|
|
385
385
|
isString,
|
|
386
386
|
isObject,
|
|
387
387
|
serialize,
|
|
388
388
|
isAndroid,
|
|
389
389
|
versionCompare,
|
|
390
390
|
isIPad,
|
|
391
391
|
isTablet,
|
|
392
392
|
CHANNEL_TYPE,
|
|
393
393
|
JDShopViewBusinessPathType,
|
|
394
394
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
395
395
|
SECTION_HOME_TAB_TYPE,
|
|
396
396
|
DraBuryPointFlags,
|
|
397
397
|
MPAAS_CONFIG_APP_VERSION,
|
|
398
398
|
BUILD_TYPE,
|
|
399
399
|
console.log(message);
|
|
400
400
|
reject(new Error(message));
|
|
401
401
|
return ready('dra', 2000)
|
|
402
402
|
.then(() => {
|
|
403
403
|
isNewDraSdkReadyError = false;
|
|
404
404
|
console.log('当前新版烛龙sdk初始化成功');
|
|
405
405
|
return true;
|
|
406
406
|
})
|
|
407
407
|
.catch(() => {
|
|
408
408
|
isNewDraSdkReadyError = true;
|
|
409
409
|
throw new Error('当前新版烛龙sdk初始化失败');
|
|
410
410
|
});
|
|
411
411
|
return new Promise((resolve, reject) => {
|
|
412
412
|
if (window?.dra) {
|
|
413
413
|
resolve(true);
|
|
414
414
|
} else if (isNewDraSdkReadyError) {
|
|
415
415
|
logAndReject('当前新版烛龙sdk初始化失败', reject);
|
|
416
416
|
} else {
|
|
417
417
|
initializeDraSdk()
|
|
418
418
|
.then(resolve)
|
|
419
419
|
.catch((error) => logAndReject(error.message, reject));
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
422
|
rootEleInitWidth = 0,
|
|
423
423
|
screenWidth = 0,
|
|
424
424
|
screenHeight = 0,
|
|
425
425
|
if (rootEleInitWidth > 0 && screenWidth > 0 && screenHeight > 0) {
|
|
426
426
|
const isRootEleWidthEqScreenWidth = Math.abs(rootEleInitWidth - screenWidth) < 60;
|
|
427
427
|
const getThisWinWidth = rootEleInitWidth;
|
|
428
428
|
const getThisWinHeight = isRootEleWidthEqScreenWidth ? screenHeight : screenWidth;
|
|
429
429
|
console.info(
|
|
430
430
|
'通过rootEleInitWidth对比屏幕宽高确认横竖屏幕方式',
|
|
431
431
|
'rootEleInitWidth',
|
|
432
432
|
rootEleInitWidth,
|
|
433
433
|
'screenWidth',
|
|
434
434
|
screenWidth,
|
|
435
435
|
'screenHeight',
|
|
436
436
|
screenHeight,
|
|
437
437
|
'isRootEleWidthEqScreenWidth(根元素宽度是否与屏幕本身宽度接近,主要是ios屏幕宽高不变)',
|
|
438
438
|
isRootEleWidthEqScreenWidth,
|
|
439
439
|
'getThisWinWidth',
|
|
440
440
|
getThisWinWidth,
|
|
441
441
|
'getThisWinHeight',
|
|
442
442
|
getThisWinHeight,
|
|
443
443
|
'是否是横屏',
|
|
444
444
|
getThisWinWidth > getThisWinHeight,
|
|
445
445
|
'通过window.screen?.orientation?.type方式获取当前pad屏幕是否是横屏,带有landscape为横屏',
|
|
446
446
|
window.screen?.orientation?.type,
|
|
447
447
|
);
|
|
448
448
|
return getThisWinWidth > getThisWinHeight;
|
|
449
449
|
} else {
|
|
450
450
|
if (window.screen?.orientation?.type) {
|
|
451
451
|
console.info(
|
|
452
452
|
'通过window.screen?.orientation?.type方式获取当前pad屏幕是否是横屏',
|
|
453
453
|
window.screen?.orientation?.type,
|
|
454
454
|
'测试低版本通过window?.orientation方式获取当前pad屏幕是否是横屏,角度[90, -90]',
|
|
455
455
|
window?.orientation,
|
|
456
456
|
);
|
|
457
457
|
return /landscape/i.test(window.screen.orientation.type);
|
|
458
458
|
} else if (window?.orientation) {
|
|
459
459
|
console.info(
|
|
460
460
|
'通过window?.orientation方式获取当前pad屏幕是否是横屏,角度[90, -90]',
|
|
461
461
|
window?.orientation,
|
|
462
462
|
);
|
|
463
463
|
return [90, -90].includes(window?.orientation);
|
|
464
464
|
} else {
|
|
465
465
|
console.info(
|
|
466
466
|
'通过window.matchMedia((orientation: landscape))?.matches方式获取当前pad屏幕是否是横屏',
|
|
467
467
|
window.matchMedia('(orientation: landscape)')?.matches,
|
|
468
468
|
);
|
|
469
469
|
return window.matchMedia('(orientation: landscape)')?.matches;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
try {
|
|
473
473
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')));
|
|
474
474
|
} catch (e) {
|
|
475
475
|
return {};
|
|
476
476
|
}
|
|
477
477
|
window.shopGlobalSwitch?.jdAppForNotMainCheckUaList,
|
|
478
478
|
? new RegExp(window.shopGlobalSwitch?.jdAppForNotMainCheckUaList.join('|'), 'i')
|
|
479
479
|
: false
|
|
480
480
|
isWxMiniH5View && (/wx91d27dbf599dff74/i.test(userAgent) || urlCookie['wxapp_type'] == '1');
|
|
481
481
|
'harmony' === (userAgent.split(';')[1] || '').toLowerCase() || /arkweb/i.test(userAgent);
|
|
482
482
|
versionCompare(jdAppVersionStr, window.PAGE_DATA.businessData.jdHarmonyNativeVersion || '') >= 0 && isJdAndHarmonyDevice;
|
|
483
483
|
? setJdAppForNotMainUaFilterReg.test(userAgent)
|
|
484
484
|
: false) || (isJdAndHarmonyDevice && !isNewHarmonyShop));
|
|
485
485
|
window.shopGlobalSwitch?.isH5AndJdShopViewH5ScrollVersion || '';
|
|
486
486
|
!!document.getElementById('mallType') &&
|
|
487
487
|
!!document.getElementById('pageInstance_id') &&
|
|
488
488
|
!!document.getElementById('pageInstance_appId');
|
|
489
489
|
BUILD_TYPE.PC_CLASSIFY1 === buildType || BUILD_TYPE.PC_CLASSIFY2 === buildType;
|
|
490
490
|
isTjScence &&
|
|
491
491
|
isWxMiniH5View &&
|
|
492
492
|
(urlCookie['wxapp_type'] == '2' ||
|
|
493
493
|
cookie.get('wxapp_type') == '2' ||
|
|
494
494
|
parseQueryUrlObj['tjChannel'] === 'jxxcx');
|
|
495
495
|
isTjScence && isWxMiniH5View && parseQueryUrlObj['sourceApp'] === 'haowujie';
|
|
496
496
|
isTjScence &&
|
|
497
497
|
(parseQueryUrlObj['appCode'] === 'ms27cba806' ||
|
|
498
498
|
document.referrer?.match(/(?:https?:)?\/\/(?:kpl\.m|css|cs)\.jd\.com/i)?.length ||
|
|
499
499
|
(parseQueryUrlObj['sourceApp'] == 'jsb-m' && parseQueryUrlObj['appCode'] === '') ||
|
|
500
500
|
parseQueryUrlObj['tjChannel'] === 'tjm');
|
|
501
501
|
if (isH5AdnJxMini) {
|
|
502
502
|
return 'jxxcx';
|
|
503
503
|
} else if (isTJApp) {
|
|
504
504
|
return 'tjapp';
|
|
505
505
|
} else if (isTjM) {
|
|
506
506
|
return 'tjm';
|
|
507
507
|
} else if (isTjJxM) {
|
|
508
508
|
return 'jxh5';
|
|
509
509
|
}
|
|
510
510
|
return '';
|
|
511
511
|
START: 'start',
|
|
512
512
|
MOVE: 'move',
|
|
513
513
|
END: 'end',
|
|
514
514
|
x: 0,
|
|
515
515
|
y: 0,
|
|
516
516
|
const startX = startPos.x;
|
|
517
517
|
const startY = startPos.y;
|
|
518
518
|
const endX = touchEvent.clientX;
|
|
519
519
|
const endY = touchEvent.clientY;
|
|
520
520
|
const dy = startY - endY;
|
|
521
521
|
const dx = endX - startX;
|
|
522
522
|
let result = 0;
|
|
523
523
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
524
524
|
return result;
|
|
525
525
|
}
|
|
526
526
|
const angle = (Math.atan2(dy, dx) * 180) / Math.PI;
|
|
527
527
|
if (angle >= -45 && angle < 45) {
|
|
528
528
|
result = 4;
|
|
529
529
|
} else if (angle >= 45 && angle < 135) {
|
|
530
530
|
result = 1;
|
|
531
531
|
} else if (angle >= -135 && angle < -45) {
|
|
532
532
|
result = 2;
|
|
533
533
|
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
534
534
|
result = 3;
|
|
535
535
|
}
|
|
536
536
|
return result;
|
|
537
537
|
e: Event,
|
|
538
538
|
touchType = TouchType.START,
|
|
539
539
|
stopTouchDocumentScrollState = false,
|
|
540
540
|
if (isJdApp && e) {
|
|
541
541
|
const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
|
|
542
542
|
let _touchState = touchType;
|
|
543
543
|
let _getDirectionState = false;
|
|
544
544
|
if (touchType === TouchType.START) {
|
|
545
545
|
StopNativeScrollEventPos.x = touchEvent.clientX;
|
|
546
546
|
StopNativeScrollEventPos.y = touchEvent.clientY;
|
|
547
547
|
} else if (touchType === TouchType.MOVE) {
|
|
548
548
|
_getDirectionState = [1, 2].includes(
|
|
549
549
|
touchMoveGetSlideDirection(StopNativeScrollEventPos, touchEvent),
|
|
550
550
|
);
|
|
551
551
|
if (_getDirectionState) {
|
|
552
552
|
_touchState = TouchType.END;
|
|
553
553
|
}
|
|
554
554
|
console.log(
|
|
555
555
|
'对外提供阻止横滑方法,当前touchType为move,设定1、2向上或向下方向,当前计算后的滑动是否为纵向',
|
|
556
556
|
_getDirectionState,
|
|
557
557
|
);
|
|
558
558
|
} else if (touchType === TouchType.END) {
|
|
559
559
|
StopNativeScrollEventPos.x = 0;
|
|
560
560
|
StopNativeScrollEventPos.y = 0;
|
|
561
561
|
}
|
|
562
562
|
isIosDevice
|
|
563
563
|
? iosDeviceStopNativeScrollEvent(e, _touchState, stopTouchDocumentScrollState)
|
|
564
564
|
: androidDeviceStopNativeScrollEvent(_touchState, stopTouchDocumentScrollState);
|
|
565
565
|
if (
|
|
566
566
|
!isAppHomeForMarketPage &&
|
|
567
567
|
stopTouchDocumentScrollState &&
|
|
568
568
|
_touchState === TouchType.START
|
|
569
569
|
) {
|
|
570
570
|
rootEleNode && rootEleNode.classList.add('over-hidden');
|
|
571
571
|
}
|
|
572
572
|
if (_touchState === TouchType.MOVE && _getDirectionState) {
|
|
573
573
|
rootEleNode &&
|
|
574
574
|
rootEleNode.classList.contains('over-hidden') &&
|
|
575
575
|
rootEleNode.classList.remove('over-hidden');
|
|
576
576
|
} else if (_touchState === TouchType.END) {
|
|
577
577
|
setTimeout(
|
|
578
578
|
() => {
|
|
579
579
|
rootEleNode &&
|
|
580
580
|
rootEleNode.classList.contains('over-hidden') &&
|
|
581
581
|
rootEleNode.classList.remove('over-hidden');
|
|
582
582
|
},
|
|
583
583
|
isAppHomeForMarketPage || _getDirectionState ? 0 : 200,
|
|
584
584
|
);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
touchType = TouchType.START,
|
|
588
588
|
stopTouchDocumentScrollState = false,
|
|
589
589
|
isJdApp &&
|
|
590
590
|
touchType !== TouchType.MOVE &&
|
|
591
591
|
isAndroidDevice &&
|
|
592
592
|
window?.JdAndroid &&
|
|
593
593
|
window?.JdAndroid?.requestEvent &&
|
|
594
594
|
window.JdAndroid.requestEvent(touchType === TouchType.START);
|
|
595
595
|
console.log(
|
|
596
596
|
'对外提供阻止安卓横滑方法,true-禁止外部事件H5可滑动,false-外部拦截h5事件,当前touchType为',
|
|
597
597
|
touchType,
|
|
598
598
|
'当前非move触发requestEvent状态为',
|
|
599
599
|
touchType === TouchType.START,
|
|
600
600
|
'当前stopTouchDocumentScrollState为',
|
|
601
601
|
stopTouchDocumentScrollState,
|
|
602
602
|
);
|
|
603
603
|
e,
|
|
604
604
|
touchType = TouchType.START,
|
|
605
605
|
stopTouchDocumentScrollState = false,
|
|
606
606
|
e && e.stopPropagation();
|
|
607
607
|
console.log(
|
|
608
608
|
'对外提供阻止ios横滑方法,当前touchType为',
|
|
609
609
|
touchType,
|
|
610
610
|
'当前stopTouchDocumentScrollState为',
|
|
611
611
|
stopTouchDocumentScrollState,
|
|
612
612
|
);
|
|
613
613
|
window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
|
|
614
614
|
method: 'callRouterModuleWithParams',
|
|
615
615
|
params: {
|
|
616
616
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
617
617
|
routerParam: {
|
|
618
618
|
slideDirection: 'horizontal',
|
|
619
619
|
state: touchType,
|
|
620
620
|
},
|
|
621
621
|
callBackId: new Date().getTime(),
|
|
622
622
|
},
|
|
623
623
|
});
|
|
624
624
|
if (isH5AndJdShopView) {
|
|
625
625
|
return CHANNEL_TYPE[currentChannel] || CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
|
|
626
626
|
}
|
|
627
627
|
return null;
|
|
628
628
|
isH5 &&
|
|
629
629
|
isJdApp &&
|
|
630
630
|
[
|
|
631
631
|
'/app/home',
|
|
632
632
|
'/app/homeV2',
|
|
633
633
|
'/app/classify',
|
|
634
634
|
'/app/classifyV2',
|
|
635
635
|
'/member/shopcard',
|
|
636
636
|
'/favorite/home',
|
|
637
637
|
].includes(urlPathname);
|
|
638
638
|
isH5 && isJdApp && !['/app/home', '/app/homeV2'].includes(urlPathname);
|
|
639
639
|
['/app/home', '/app/homeV2'].includes(urlPathname) &&
|
|
640
640
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_PROMOTION &&
|
|
641
641
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_MEMBER;
|
|
642
642
|
isAppHomePage && parseQueryUrlObj['source'] === 'app-marketing';
|
|
643
643
|
isH5 &&
|
|
644
644
|
isAppHomePage &&
|
|
645
645
|
versionCompare(jdAppVersion?.full ? jdAppVersion.full : '', isH5AndJdShopViewH5ScrollVersion) >=
|
|
646
646
|
0;
|
|
647
647
|
return isJdApp ? versionCompare(nowVersion, compareVersion) : -2;
|
|
648
648
|
try {
|
|
649
649
|
await getNewDraSdkReadyPromise();
|
|
650
650
|
const draBurypointFlag = name ?? DraBuryPointFlags.BUSINESS;
|
|
651
651
|
const commonObj = {
|
|
652
652
|
shopId: `${global.info.queryInfo.shopId || ''}`,
|
|
653
653
|
venderId: `${global.info.queryInfo.venderId || ''}`,
|
|
654
654
|
taroRenderVersion: window?.taroRenderVersion,
|
|
655
655
|
environmentType: getEnvironmentType(),
|
|
656
656
|
pageType: getPageType(),
|
|
657
657
|
};
|
|
658
658
|
try {
|
|
659
659
|
window.dra.sendCustomEvent(
|
|
660
660
|
{
|
|
661
661
|
name: draBurypointFlag,
|
|
662
662
|
metrics: {
|
|
663
663
|
timeStamp: Date.now(),
|
|
664
664
|
...customMetricsObj,
|
|
665
665
|
},
|
|
666
666
|
context: {
|
|
667
667
|
...commonObj,
|
|
668
668
|
...customContextObj,
|
|
669
669
|
},
|
|
670
670
|
},
|
|
671
671
|
true,
|
|
672
672
|
);
|
|
673
673
|
} catch (e) {
|
|
674
674
|
console.info(
|
|
675
675
|
'当前新版烛龙sdk上报异常, 原始数据为',
|
|
676
676
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
677
677
|
'e',
|
|
678
678
|
e,
|
|
679
679
|
);
|
|
680
680
|
}
|
|
681
681
|
} catch (e) {
|
|
682
682
|
console.info(
|
|
683
683
|
'当前页面新版烛龙sdk加载异常,无法进行异常上报, 原始数据为',
|
|
684
684
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
685
685
|
'e',
|
|
686
686
|
e,
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
689
|
try {
|
|
690
690
|
await getNewDraSdkReadyPromise();
|
|
691
691
|
const commonObj = {
|
|
692
692
|
shopId: `${global.info.queryInfo?.shopId || ''}`,
|
|
693
693
|
venderId: `${global.info.queryInfo?.venderId || ''}`,
|
|
694
694
|
taroRenderVersion: window?.taroRenderVersion,
|
|
695
695
|
environmentType: getEnvironmentType(),
|
|
696
696
|
pageType: getPageType(),
|
|
697
697
|
url: encodeURIComponent(window?.location?.href),
|
|
698
698
|
};
|
|
699
699
|
try {
|
|
700
700
|
window.dra.sendCustomLogEvent({
|
|
701
701
|
level,
|
|
702
702
|
content: logContent || '日志上报',
|
|
703
703
|
extra: JSON.stringify(commonObj),
|
|
704
704
|
timeStamp: Date.now(),
|
|
705
705
|
});
|
|
706
706
|
} catch (e) {
|
|
707
707
|
console.info('日志等级', level, '当前新版烛龙sdk上报异常, 原始数据为', logContent, 'e', e);
|
|
708
708
|
}
|
|
709
709
|
} catch (e2) {
|
|
710
710
|
console.info('日志等级', level, '当前新版烛龙sdk上报异常, 原始数据为', logContent, 'e', e2);
|
|
711
711
|
}
|
|
712
712
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.REMOTE);
|
|
713
713
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.INTERFACE);
|
|
714
714
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.BUSINESS);
|
|
715
715
|
const deviceRatio = window?.devicePixelRatio ?? 2;
|
|
716
716
|
if (isJdAndAndroidDevice && typeof displayObj === 'object') {
|
|
717
717
|
Object.keys(displayObj).forEach((key) => {
|
|
718
718
|
if (key === 'nativeHeaderHeight') {
|
|
719
719
|
displayObj[key] = Math.ceil(displayObj[key] / (deviceRatio * deviceRatio) - 2);
|
|
720
720
|
} else {
|
|
721
721
|
displayObj[key] = Math.ceil(displayObj[key] / deviceRatio);
|
|
722
722
|
}
|
|
723
723
|
});
|
|
724
724
|
} else if (isJdAndHarmonyDevice && isNewHarmonyShop && typeof displayObj === 'object') {
|
|
725
725
|
if (displayObj['bottomBarHeight'] && typeof displayObj['bottomBarHeight'] === 'number') {
|
|
726
726
|
displayObj['bottomBarHeight'] = Math.ceil(displayObj['bottomBarHeight'] / deviceRatio);
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
return displayObj;
|
|
730
730
|
isJdAndAndroidDevice && /TBS\/\d+/.test(window?.navigator?.userAgent);
|
|
731
731
|
rootEleNode &&
|
|
732
732
|
!rootEleNode.classList.contains('d-shop-lang-for-en') &&
|
|
733
733
|
rootEleNode.classList.add('d-shop-lang-for-en');
|
|
734
734
|
rootEleNode &&
|
|
735
735
|
!rootEleNode.classList.contains('d-shop-lang-for-hk') &&
|
|
736
736
|
rootEleNode.classList.add('d-shop-lang-for-hk');
|