@conecli/cone-render 0.10.1-beta.5 → 0.10.1-beta.7
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/api/index.ts +1 -1
- package/dist/common/const.ts +1 -1
- package/dist/common/environmentType.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/pageType.ts +1 -1
- package/dist/common/sgmCustomCode.ts +1 -1
- package/dist/components/base/CountDown/index.module.scss +49 -44
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomVideo/common.ts +1 -0
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -6
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +8 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +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/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.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -1
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjapp.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/sass/base.scss +142 -141
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/colorSign.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -0
- package/dist/service/http/index.h5.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- 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/utils.ts +1 -1
- package/package.json +35 -29
- package/dist/utils/memberFormatUtils.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
console.log('PageScrollEnd fire')
|
|
3
2
|
Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END, options)
|
|
4
3
|
Taro.eventCenter.trigger(TaroEventType.PAGE_INIT_EXPOSURE, options)
|
|
4
|
+
import Taro from '@tarojs/taro'
|
|
5
5
|
console.log('PageScrollEnd fire')
|
|
6
6
|
Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END, options)
|
|
7
7
|
Taro.eventCenter.trigger(TaroEventType.PAGE_INIT_EXPOSURE, options)
|
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
|
CHANNEL_TYPE,
|
|
15
14
|
JDShopViewBusinessPathType,
|
|
16
15
|
JDShopViewBusinessPathList,
|
|
17
16
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
18
17
|
SECTION_HOME_TAB_TYPE,
|
|
19
18
|
parseQueryUrlObj,
|
|
20
19
|
if (window?.__sgm__) {
|
|
21
20
|
resolve(true)
|
|
22
21
|
} else {
|
|
23
22
|
if (isSgmReadyError) {
|
|
24
23
|
console.log("当前sgm初始化失败")
|
|
25
24
|
reject(false)
|
|
26
25
|
} else {
|
|
27
26
|
ready('__sgm__', 2000).then(() => {
|
|
28
27
|
isSgmReadyError = false
|
|
29
28
|
console.log("当前sgm初始化成功")
|
|
30
29
|
resolve(true)
|
|
31
30
|
}).catch(() => {
|
|
32
31
|
isSgmReadyError = true
|
|
33
32
|
console.log("当前sgm初始化失败")
|
|
34
33
|
reject(false)
|
|
35
34
|
})
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
try {
|
|
39
38
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
40
39
|
} catch (e) {
|
|
41
40
|
return {}
|
|
42
41
|
}
|
|
43
42
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
44
43
|
if (isH5AdnJxMini) {
|
|
45
44
|
return 'jxxcx'
|
|
46
45
|
} else if (isTJApp) {
|
|
47
46
|
return 'tjapp'
|
|
48
47
|
} else if (isTjM) {
|
|
49
48
|
return 'tjm'
|
|
50
49
|
} else if (isTjJxM) {
|
|
51
50
|
return 'jxh5'
|
|
52
51
|
}
|
|
53
52
|
return ''
|
|
54
53
|
START: 'start',
|
|
55
54
|
MOVE: 'move',
|
|
56
55
|
END: 'end',
|
|
57
56
|
x: 0,
|
|
58
57
|
y: 0
|
|
59
58
|
const startX = startPos.x
|
|
60
59
|
const startY = startPos.y
|
|
61
60
|
const endX = touchEvent.clientX
|
|
62
61
|
const endY = touchEvent.clientY
|
|
63
62
|
const dy = startY - endY
|
|
64
63
|
const dx = endX - startX
|
|
65
64
|
let result = 0
|
|
66
65
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
67
66
|
return result
|
|
68
67
|
}
|
|
69
68
|
const angle = Math.atan2(dy,dx) * 180 / Math.PI
|
|
70
69
|
if (angle >= -45 && angle < 45) {
|
|
71
70
|
result = 4
|
|
72
71
|
} else if (angle >= 45 && angle < 135) {
|
|
73
72
|
result = 1
|
|
74
73
|
} else if (angle >= -135 && angle < -45) {
|
|
75
74
|
result = 2
|
|
76
75
|
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
77
76
|
result = 3
|
|
78
77
|
}
|
|
79
78
|
return result
|
|
80
79
|
if (isJdApp && e) {
|
|
81
80
|
const touchEvent =
|
|
82
81
|
e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
|
|
83
82
|
let _touchState = touchType
|
|
84
83
|
let _getDirectionState = false
|
|
85
84
|
if(touchType === TouchType.START){
|
|
86
85
|
StopNativeScrollEventPos.x = touchEvent.clientX
|
|
87
86
|
StopNativeScrollEventPos.y = touchEvent.clientY
|
|
88
87
|
}else if(touchType === TouchType.MOVE){
|
|
89
88
|
_getDirectionState = [1,2].includes(touchMoveGetSlideDirection(StopNativeScrollEventPos,touchEvent))
|
|
90
89
|
if(_getDirectionState){
|
|
91
90
|
_touchState = TouchType.END
|
|
92
91
|
}
|
|
93
92
|
console.log("对外提供阻止横滑方法,当前touchType为move,设定1、2向上或向下方向,当前计算后的滑动是否为纵向", _getDirectionState)
|
|
94
93
|
}else if(touchType === TouchType.END){
|
|
95
94
|
StopNativeScrollEventPos.x = 0
|
|
96
95
|
StopNativeScrollEventPos.y = 0
|
|
97
96
|
}
|
|
98
97
|
isIosDevice
|
|
99
98
|
? iosDeviceStopNativeScrollEvent(e, _touchState, stopTouchDocumentScrollState)
|
|
100
99
|
: androidDeviceStopNativeScrollEvent(_touchState, stopTouchDocumentScrollState)
|
|
101
100
|
if(!isAppHomeForMarketPage && stopTouchDocumentScrollState && _touchState === TouchType.START){
|
|
102
101
|
rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
103
102
|
}
|
|
104
103
|
if(_touchState === TouchType.MOVE && _getDirectionState){
|
|
105
104
|
rootEleNode && rootEleNode.classList.contains('over-hidden') && rootEleNode.classList.remove('over-hidden')
|
|
106
105
|
}else if (_touchState === TouchType.END) {
|
|
107
106
|
setTimeout(() => {
|
|
108
107
|
rootEleNode && rootEleNode.classList.contains('over-hidden') && rootEleNode.classList.remove('over-hidden')
|
|
109
108
|
},isAppHomeForMarketPage || _getDirectionState ? 0 : 200)
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
isJdApp &&
|
|
113
112
|
touchType !== TouchType.MOVE &&
|
|
114
113
|
isAndroidDevice &&
|
|
115
114
|
window?.JdAndroid &&
|
|
116
115
|
window?.JdAndroid.requestEvent(touchType === TouchType.START)
|
|
117
116
|
console.log("对外提供阻止安卓横滑方法,true-禁止外部事件H5可滑动,false-外部拦截h5事件,当前touchType为",touchType,"当前非move触发requestEvent状态为",touchType === TouchType.START,"当前stopTouchDocumentScrollState为",stopTouchDocumentScrollState)
|
|
118
117
|
e && e.stopPropagation();
|
|
119
118
|
console.log("对外提供阻止ios横滑方法,当前touchType为", touchType, "当前stopTouchDocumentScrollState为",stopTouchDocumentScrollState)
|
|
120
119
|
window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
|
|
121
120
|
method: 'callRouterModuleWithParams',
|
|
122
121
|
params: {
|
|
123
122
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
124
123
|
routerParam: {
|
|
125
124
|
slideDirection: 'horizontal',
|
|
126
125
|
state: touchType,
|
|
127
126
|
},
|
|
128
127
|
callBackId: new Date().getTime(),
|
|
129
128
|
},
|
|
130
129
|
})
|
|
131
130
|
if (isH5AndJdShopView) {
|
|
132
131
|
return (
|
|
133
132
|
CHANNEL_TYPE[currentChannel] ||
|
|
134
133
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
135
134
|
)
|
|
136
135
|
}
|
|
137
136
|
return null
|
|
138
137
|
isH5 && isJdApp && ['/app/home', '/app/classify', '/member/shopcard','/favorite/list', '/favorite/home'].includes(urlPathname)
|
|
139
138
|
isH5 && isJdApp && !['/app/home'].includes(urlPathname)
|
|
140
139
|
return isJdApp ? versionCompare(nowVersion, compareVersion) : -2
|
|
141
140
|
getSgmReadyPromise().then(() => {
|
|
142
141
|
if (
|
|
143
142
|
customObj.hasOwnProperty('code') &&
|
|
144
143
|
customObj.code.indexOf(NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG) !== -1
|
|
145
144
|
) {
|
|
146
145
|
const originCode = customObj.code.substring(
|
|
147
146
|
NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG.length,
|
|
148
147
|
customObj.code.length,
|
|
149
148
|
)
|
|
150
149
|
customObj['code'] = getSgmCustomCode(handleSgmCodeTaroVersion(originCode))
|
|
151
150
|
}
|
|
152
151
|
const getCustomObj = {
|
|
153
152
|
type: 1,
|
|
154
153
|
code: 'all',
|
|
155
154
|
cost1: 1,
|
|
156
155
|
...customObj
|
|
157
156
|
}
|
|
158
157
|
try {
|
|
159
158
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
160
159
|
} catch (e) {
|
|
161
160
|
console.log("当前sgm上报异常, 原始数据为",JSON.stringify(customObj))
|
|
162
161
|
}
|
|
163
162
|
}).catch(() => {
|
|
164
163
|
console.error("当前页面sgm加载异常,无法进行异常上报, 原始数据为",JSON.stringify(customObj))
|
|
165
164
|
})
|
|
166
165
|
if(isJdAndAndroidDevice && typeof displayObj === 'object'){
|
|
167
166
|
const deviceRatio = window?.devicePixelRatio
|
|
168
167
|
Object.keys(displayObj).forEach(key => {
|
|
169
168
|
if(key === 'nativeHeaderHeight'){
|
|
170
169
|
displayObj[key] = Math.ceil(displayObj[key] / (deviceRatio * deviceRatio) - 2)
|
|
171
170
|
}else {
|
|
172
171
|
displayObj[key] = Math.ceil(displayObj[key] / deviceRatio)
|
|
173
172
|
}
|
|
174
173
|
})
|
|
175
174
|
}
|
|
176
175
|
return displayObj
|
|
176
|
+
import {
|
|
177
177
|
isApp,
|
|
178
178
|
isIOS,
|
|
179
179
|
getAppVersion,
|
|
180
180
|
version,
|
|
181
181
|
getUUID,
|
|
182
182
|
getUrlQuery,
|
|
183
183
|
assign,
|
|
184
184
|
isString,
|
|
185
185
|
isObject,
|
|
186
186
|
serialize,
|
|
187
187
|
isAndroid,
|
|
188
188
|
versionCompare,
|
|
189
189
|
isIPad,
|
|
190
190
|
CHANNEL_TYPE,
|
|
191
191
|
JDShopViewBusinessPathType,
|
|
192
192
|
JDShopViewBusinessPathList,
|
|
193
193
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
194
194
|
SECTION_HOME_TAB_TYPE,
|
|
195
195
|
DraBuryPointFlags,
|
|
196
196
|
MPAAS_CONFIG_APP_VERSION,
|
|
197
197
|
window?.location?.href ?? '',
|
|
198
198
|
new Promise((resolve, reject) => {
|
|
199
199
|
if (window?.__sgm__) {
|
|
200
200
|
resolve(true)
|
|
201
201
|
} else {
|
|
202
202
|
if (isSgmReadyError) {
|
|
203
203
|
console.log('当前sgm初始化失败')
|
|
204
204
|
reject(false)
|
|
205
205
|
} else {
|
|
206
206
|
ready('__sgm__', 2000)
|
|
207
207
|
.then(() => {
|
|
208
208
|
isSgmReadyError = false
|
|
209
209
|
console.log('当前sgm初始化成功')
|
|
210
210
|
resolve(true)
|
|
211
211
|
})
|
|
212
212
|
.catch(() => {
|
|
213
213
|
isSgmReadyError = true
|
|
214
214
|
console.log('当前sgm初始化失败')
|
|
215
215
|
reject(false)
|
|
216
216
|
})
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
})
|
|
220
220
|
console.log(message)
|
|
221
221
|
reject(new Error(message))
|
|
222
222
|
return ready('dra', 2000)
|
|
223
223
|
.then(() => {
|
|
224
224
|
isNewDraSdkReadyError = false
|
|
225
225
|
console.log('当前新版烛龙sdk初始化成功')
|
|
226
226
|
return true
|
|
227
227
|
})
|
|
228
228
|
.catch(() => {
|
|
229
229
|
isNewDraSdkReadyError = true
|
|
230
230
|
throw new Error('当前新版烛龙sdk初始化失败')
|
|
231
231
|
})
|
|
232
232
|
return new Promise((resolve, reject) => {
|
|
233
233
|
if (window?.dra) {
|
|
234
234
|
resolve(true)
|
|
235
235
|
} else if (isNewDraSdkReadyError) {
|
|
236
236
|
logAndReject('当前新版烛龙sdk初始化失败', reject)
|
|
237
237
|
} else {
|
|
238
238
|
initializeDraSdk()
|
|
239
239
|
.then(resolve)
|
|
240
240
|
.catch((error) => logAndReject(error.message, reject))
|
|
241
241
|
}
|
|
242
242
|
})
|
|
243
243
|
try {
|
|
244
244
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
245
245
|
} catch (e) {
|
|
246
246
|
return {}
|
|
247
247
|
}
|
|
248
248
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
249
249
|
window.shopGlobalSwitch?.isH5AndJdShopViewH5ScrollVersion || ''
|
|
250
250
|
!!document.getElementById('mallType') &&
|
|
251
251
|
!!document.getElementById('pageInstance_id') &&
|
|
252
252
|
!!document.getElementById('pageInstance_appId')
|
|
253
253
|
isTjScence &&
|
|
254
254
|
isWxMiniH5View &&
|
|
255
255
|
(urlCookie['wxapp_type'] == '2' ||
|
|
256
256
|
cookie.get('wxapp_type') == '2' ||
|
|
257
257
|
parseQueryUrlObj['tjChannel'] === 'jxxcx')
|
|
258
258
|
isTjScence && isWxMiniH5View && parseQueryUrlObj['sourceApp'] === 'haowujie'
|
|
259
259
|
isTjScence &&
|
|
260
260
|
(parseQueryUrlObj['appCode'] === 'ms27cba806' ||
|
|
261
261
|
document.referrer?.match(/(?:https?:)?\/\/(?:kpl\.m|css|cs)\.jd\.com/i)
|
|
262
262
|
?.length ||
|
|
263
263
|
(parseQueryUrlObj['sourceApp'] == 'jsb-m' &&
|
|
264
264
|
parseQueryUrlObj['appCode'] === '') ||
|
|
265
265
|
parseQueryUrlObj['tjChannel'] === 'tjm')
|
|
266
266
|
if (isH5AdnJxMini) {
|
|
267
267
|
return 'jxxcx'
|
|
268
268
|
} else if (isTJApp) {
|
|
269
269
|
return 'tjapp'
|
|
270
270
|
} else if (isTjM) {
|
|
271
271
|
return 'tjm'
|
|
272
272
|
} else if (isTjJxM) {
|
|
273
273
|
return 'jxh5'
|
|
274
274
|
}
|
|
275
275
|
return ''
|
|
276
276
|
START: 'start',
|
|
277
277
|
MOVE: 'move',
|
|
278
278
|
END: 'end',
|
|
279
279
|
x: 0,
|
|
280
280
|
y: 0,
|
|
281
281
|
const startX = startPos.x
|
|
282
282
|
const startY = startPos.y
|
|
283
283
|
const endX = touchEvent.clientX
|
|
284
284
|
const endY = touchEvent.clientY
|
|
285
285
|
const dy = startY - endY
|
|
286
286
|
const dx = endX - startX
|
|
287
287
|
let result = 0
|
|
288
288
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
289
289
|
return result
|
|
290
290
|
}
|
|
291
291
|
const angle = (Math.atan2(dy, dx) * 180) / Math.PI
|
|
292
292
|
if (angle >= -45 && angle < 45) {
|
|
293
293
|
result = 4
|
|
294
294
|
} else if (angle >= 45 && angle < 135) {
|
|
295
295
|
result = 1
|
|
296
296
|
} else if (angle >= -135 && angle < -45) {
|
|
297
297
|
result = 2
|
|
298
298
|
} else if (
|
|
299
299
|
(angle >= 135 && angle <= 180) ||
|
|
300
300
|
(angle >= -180 && angle < -135)
|
|
301
301
|
) {
|
|
302
302
|
result = 3
|
|
303
303
|
}
|
|
304
304
|
return result
|
|
305
305
|
e: Event,
|
|
306
306
|
touchType = TouchType.START,
|
|
307
307
|
stopTouchDocumentScrollState = false,
|
|
308
308
|
if (isJdApp && e) {
|
|
309
309
|
const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
|
|
310
310
|
let _touchState = touchType
|
|
311
311
|
let _getDirectionState = false
|
|
312
312
|
if (touchType === TouchType.START) {
|
|
313
313
|
StopNativeScrollEventPos.x = touchEvent.clientX
|
|
314
314
|
StopNativeScrollEventPos.y = touchEvent.clientY
|
|
315
315
|
} else if (touchType === TouchType.MOVE) {
|
|
316
316
|
_getDirectionState = [1, 2].includes(
|
|
317
317
|
touchMoveGetSlideDirection(StopNativeScrollEventPos, touchEvent),
|
|
318
318
|
)
|
|
319
319
|
if (_getDirectionState) {
|
|
320
320
|
_touchState = TouchType.END
|
|
321
321
|
}
|
|
322
322
|
console.log(
|
|
323
323
|
'对外提供阻止横滑方法,当前touchType为move,设定1、2向上或向下方向,当前计算后的滑动是否为纵向',
|
|
324
324
|
_getDirectionState,
|
|
325
325
|
)
|
|
326
326
|
} else if (touchType === TouchType.END) {
|
|
327
327
|
StopNativeScrollEventPos.x = 0
|
|
328
328
|
StopNativeScrollEventPos.y = 0
|
|
329
329
|
}
|
|
330
330
|
isIosDevice
|
|
331
331
|
? iosDeviceStopNativeScrollEvent(
|
|
332
332
|
e,
|
|
333
333
|
_touchState,
|
|
334
334
|
stopTouchDocumentScrollState,
|
|
335
335
|
)
|
|
336
336
|
: androidDeviceStopNativeScrollEvent(
|
|
337
337
|
_touchState,
|
|
338
338
|
stopTouchDocumentScrollState,
|
|
339
339
|
)
|
|
340
340
|
if (
|
|
341
341
|
!isAppHomeForMarketPage &&
|
|
342
342
|
stopTouchDocumentScrollState &&
|
|
343
343
|
_touchState === TouchType.START
|
|
344
344
|
) {
|
|
345
345
|
rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
346
346
|
}
|
|
347
347
|
if (_touchState === TouchType.MOVE && _getDirectionState) {
|
|
348
348
|
rootEleNode &&
|
|
349
349
|
rootEleNode.classList.contains('over-hidden') &&
|
|
350
350
|
rootEleNode.classList.remove('over-hidden')
|
|
351
351
|
} else if (_touchState === TouchType.END) {
|
|
352
352
|
setTimeout(
|
|
353
353
|
() => {
|
|
354
354
|
rootEleNode &&
|
|
355
355
|
rootEleNode.classList.contains('over-hidden') &&
|
|
356
356
|
rootEleNode.classList.remove('over-hidden')
|
|
357
357
|
},
|
|
358
358
|
isAppHomeForMarketPage || _getDirectionState ? 0 : 200,
|
|
359
359
|
)
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
touchType = TouchType.START,
|
|
363
363
|
stopTouchDocumentScrollState = false,
|
|
364
364
|
isJdApp &&
|
|
365
365
|
touchType !== TouchType.MOVE &&
|
|
366
366
|
isAndroidDevice &&
|
|
367
367
|
window?.JdAndroid &&
|
|
368
368
|
window?.JdAndroid.requestEvent(touchType === TouchType.START)
|
|
369
369
|
console.log(
|
|
370
370
|
'对外提供阻止安卓横滑方法,true-禁止外部事件H5可滑动,false-外部拦截h5事件,当前touchType为',
|
|
371
371
|
touchType,
|
|
372
372
|
'当前非move触发requestEvent状态为',
|
|
373
373
|
touchType === TouchType.START,
|
|
374
374
|
'当前stopTouchDocumentScrollState为',
|
|
375
375
|
stopTouchDocumentScrollState,
|
|
376
376
|
)
|
|
377
377
|
e,
|
|
378
378
|
touchType = TouchType.START,
|
|
379
379
|
stopTouchDocumentScrollState = false,
|
|
380
380
|
e && e.stopPropagation()
|
|
381
381
|
console.log(
|
|
382
382
|
'对外提供阻止ios横滑方法,当前touchType为',
|
|
383
383
|
touchType,
|
|
384
384
|
'当前stopTouchDocumentScrollState为',
|
|
385
385
|
stopTouchDocumentScrollState,
|
|
386
386
|
)
|
|
387
387
|
window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
|
|
388
388
|
method: 'callRouterModuleWithParams',
|
|
389
389
|
params: {
|
|
390
390
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
391
391
|
routerParam: {
|
|
392
392
|
slideDirection: 'horizontal',
|
|
393
393
|
state: touchType,
|
|
394
394
|
},
|
|
395
395
|
callBackId: new Date().getTime(),
|
|
396
396
|
},
|
|
397
397
|
})
|
|
398
398
|
if (isH5AndJdShopView) {
|
|
399
399
|
return (
|
|
400
400
|
CHANNEL_TYPE[currentChannel] ||
|
|
401
401
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
402
402
|
)
|
|
403
403
|
}
|
|
404
404
|
return null
|
|
405
405
|
isH5 &&
|
|
406
406
|
isJdApp &&
|
|
407
407
|
[
|
|
408
408
|
'/app/home',
|
|
409
409
|
'/app/classify',
|
|
410
410
|
'/member/shopcard',
|
|
411
411
|
'/favorite/list',
|
|
412
412
|
'/favorite/home',
|
|
413
413
|
].includes(urlPathname)
|
|
414
414
|
isH5 && isJdApp && !['/app/home'].includes(urlPathname)
|
|
415
415
|
['/app/home'].includes(urlPathname) &&
|
|
416
416
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_PROMOTION &&
|
|
417
417
|
menuObj.tabActiveType != SECTION_HOME_TAB_TYPE.HOME_MEMBER
|
|
418
418
|
isAppHomePage && parseQueryUrlObj['source'] === 'app-marketing'
|
|
419
419
|
isH5 &&
|
|
420
420
|
isAppHomePage &&
|
|
421
421
|
versionCompare(
|
|
422
422
|
jdAppVersion?.full ? jdAppVersion.full : '',
|
|
423
423
|
isH5AndJdShopViewH5ScrollVersion,
|
|
424
424
|
) >= 0
|
|
425
425
|
compareVersion,
|
|
426
426
|
nowVersion = jdAppVersionStr,
|
|
427
427
|
return isJdApp ? versionCompare(nowVersion, compareVersion) : -2
|
|
428
428
|
getSgmReadyPromise()
|
|
429
429
|
.then(() => {
|
|
430
430
|
if (
|
|
431
431
|
customObj.hasOwnProperty('code') &&
|
|
432
432
|
customObj.code.indexOf(NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG) !== -1
|
|
433
433
|
) {
|
|
434
434
|
const originCode = customObj.code.substring(
|
|
435
435
|
NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG.length,
|
|
436
436
|
customObj.code.length,
|
|
437
437
|
)
|
|
438
438
|
customObj['code'] = getSgmCustomCode(
|
|
439
439
|
handleSgmCodeTaroVersion(originCode),
|
|
440
440
|
)
|
|
441
441
|
}
|
|
442
442
|
const getCustomObj = {
|
|
443
443
|
type: 1,
|
|
444
444
|
code: 'all',
|
|
445
445
|
cost1: 1,
|
|
446
446
|
...customObj,
|
|
447
447
|
}
|
|
448
448
|
try {
|
|
449
449
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
450
450
|
} catch (e) {
|
|
451
451
|
console.log('当前sgm上报异常, 原始数据为', JSON.stringify(customObj))
|
|
452
452
|
}
|
|
453
453
|
})
|
|
454
454
|
.catch(() => {
|
|
455
455
|
console.error(
|
|
456
456
|
'当前页面sgm加载异常,无法进行异常上报, 原始数据为',
|
|
457
457
|
JSON.stringify(customObj),
|
|
458
458
|
)
|
|
459
459
|
})
|
|
460
460
|
customContextObj = {},
|
|
461
461
|
customMetricsObj = {},
|
|
462
462
|
name?,
|
|
463
463
|
try {
|
|
464
464
|
await getNewDraSdkReadyPromise()
|
|
465
465
|
const draBurypointFlag = name ?? DraBuryPointFlags.BUSINESS
|
|
466
466
|
const commonObj = {
|
|
467
467
|
shopId: `${global.info.queryInfo.shopId || ''}`,
|
|
468
468
|
venderId: `${global.info.queryInfo.venderId || ''}`,
|
|
469
469
|
taroRenderVersion: window?.taroRenderVersion,
|
|
470
470
|
environmentType: getEnvironmentType(),
|
|
471
471
|
pageType: getPageType(),
|
|
472
472
|
}
|
|
473
473
|
try {
|
|
474
474
|
window.dra.sendCustomEvent(
|
|
475
475
|
{
|
|
476
476
|
name: draBurypointFlag,
|
|
477
477
|
metrics: {
|
|
478
478
|
timeStamp: Date.now(),
|
|
479
479
|
...customMetricsObj,
|
|
480
480
|
},
|
|
481
481
|
context: {
|
|
482
482
|
...commonObj,
|
|
483
483
|
...customContextObj,
|
|
484
484
|
},
|
|
485
485
|
},
|
|
486
486
|
true,
|
|
487
487
|
)
|
|
488
488
|
} catch (e) {
|
|
489
489
|
console.error(
|
|
490
490
|
'当前新版烛龙sdk上报异常, 原始数据为',
|
|
491
491
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
492
492
|
'e',
|
|
493
493
|
e,
|
|
494
494
|
)
|
|
495
495
|
}
|
|
496
496
|
} catch (e) {
|
|
497
497
|
console.error(
|
|
498
498
|
'当前页面新版烛龙sdk加载异常,无法进行异常上报, 原始数据为',
|
|
499
499
|
JSON.stringify({ ...customContextObj, ...customMetricsObj }),
|
|
500
500
|
'e',
|
|
501
501
|
e,
|
|
502
502
|
)
|
|
503
503
|
}
|
|
504
504
|
customContextObj = {},
|
|
505
505
|
customMetricsObj = {},
|
|
506
506
|
draCustomReport(customContextObj, customMetricsObj, DraBuryPointFlags.REMOTE)
|
|
507
507
|
customContextObj = {},
|
|
508
508
|
customMetricsObj = {},
|
|
509
509
|
draCustomReport(
|
|
510
510
|
customContextObj,
|
|
511
511
|
customMetricsObj,
|
|
512
512
|
DraBuryPointFlags.INTERFACE,
|
|
513
513
|
)
|
|
514
514
|
customContextObj = {},
|
|
515
515
|
customMetricsObj = {},
|
|
516
516
|
draCustomReport(
|
|
517
517
|
customContextObj,
|
|
518
518
|
customMetricsObj,
|
|
519
519
|
DraBuryPointFlags.BUSINESS,
|
|
520
520
|
)
|
|
521
521
|
if (isJdAndAndroidDevice && typeof displayObj === 'object') {
|
|
522
522
|
const deviceRatio = window?.devicePixelRatio
|
|
523
523
|
Object.keys(displayObj).forEach((key) => {
|
|
524
524
|
if (key === 'nativeHeaderHeight') {
|
|
525
525
|
displayObj[key] = Math.ceil(
|
|
526
526
|
displayObj[key] / (deviceRatio * deviceRatio) - 2,
|
|
527
527
|
)
|
|
528
528
|
} else {
|
|
529
529
|
displayObj[key] = Math.ceil(displayObj[key] / deviceRatio)
|
|
530
530
|
}
|
|
531
531
|
})
|
|
532
532
|
}
|
|
533
533
|
return displayObj
|
|
534
534
|
isJdAndAndroidDevice && /TBS\/\d+/.test(window?.navigator?.userAgent)
|
|
535
535
|
jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0
|