@conecli/cone-render 0.8.33 → 0.8.35-beta.0
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/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/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/const.ts +1 -0
- package/dist/components/base/ExposureSmart/index.h5.module.scss +18 -4
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.module.scss +20 -9
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +4 -1
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -0
- package/dist/interface/common.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- 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.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +10 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- 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/service/bMallConst.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/intersectionObserver.ts +1 -1
- package/dist/utils/jm-common.js +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
- /package/dist/service/{bMallConst.wxapp.ts → bMallConst.weapp.ts} +0 -0
- /package/dist/service/http/{colorSign.wxapp.ts → colorSign.weapp.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import { isAndroidDevice } from '../utils'
|
|
2
1
|
buId: '',
|
|
3
2
|
console.log('getBMallUserInfo')
|
|
4
3
|
if (!isApp('jdb')) {
|
|
5
4
|
return null
|
|
6
5
|
}
|
|
7
6
|
if (bMallUserInfo) {
|
|
8
7
|
return new Promise((resolve) => resolve(bMallUserInfo))
|
|
9
8
|
}
|
|
10
9
|
const requestTimeoutPromise = new Promise((resolve) => {
|
|
11
10
|
setTimeout(() => {
|
|
12
11
|
resolve({})
|
|
13
12
|
}, 3000)
|
|
14
13
|
})
|
|
15
14
|
const userInfoPromise = new Promise((resolve) => {
|
|
16
15
|
let result: any = {}
|
|
17
16
|
try {
|
|
18
17
|
if (isAndroidDevice) {
|
|
19
18
|
result = JSON.parse(
|
|
20
19
|
window.WebViewCommon && window.WebViewCommon.getUserInfo(),
|
|
21
20
|
)
|
|
22
21
|
bMallUserInfo = result
|
|
23
22
|
commonParam.buId = result?.data?.buId
|
|
24
23
|
resolve(result)
|
|
25
24
|
} else {
|
|
26
25
|
window.getUserInfoCallBack = null
|
|
27
26
|
window.getUserInfoCallBack = function (callBackJson) {
|
|
28
27
|
if (callBackJson) {
|
|
29
28
|
result.data = JSON.parse(callBackJson)
|
|
30
29
|
bMallUserInfo = result
|
|
31
30
|
commonParam.buId = result?.data?.buId
|
|
32
31
|
resolve(result)
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
window?.webkit?.messageHandlers?.WebViewCommon?.postMessage({
|
|
36
35
|
businessType: 'router://com.jd.jlstudio/getUserInfo',
|
|
37
36
|
params: {},
|
|
38
37
|
callBackName: 'getUserInfoCallBack',
|
|
39
38
|
method: 'callRouterModuleWithParams',
|
|
40
39
|
})
|
|
41
40
|
}
|
|
42
41
|
} catch (e) {
|
|
43
42
|
resolve(result)
|
|
44
43
|
}
|
|
45
44
|
})
|
|
46
45
|
return Promise.race([userInfoPromise, requestTimeoutPromise])
|
|
47
46
|
process.env.NODE_ENV === 'development'
|
|
48
47
|
? {
|
|
49
48
|
apolloId: '48ee955b0fb04d19b9f9fe8cb73d387f',
|
|
50
49
|
apolloSecret: '0d9c76ee66b0487da4e17d3cf1d7af7a',
|
|
51
50
|
}
|
|
52
51
|
: {
|
|
53
52
|
apolloId: '80c46fd06e4442998609d9f6a4ab96f0',
|
|
54
53
|
apolloSecret: 'f36bef08bcba4683b409732095793fb2',
|
|
55
54
|
}
|
|
56
55
|
if (typeof window.crypto === 'object') {
|
|
57
56
|
if (typeof (window.crypto as any).randomUUID === 'function') {
|
|
58
57
|
return (window.crypto as any).randomUUID()
|
|
59
58
|
}
|
|
60
59
|
if (
|
|
61
60
|
typeof (window.crypto as any).getRandomValues === 'function' &&
|
|
62
61
|
typeof Uint8Array === 'function'
|
|
63
62
|
) {
|
|
64
63
|
const callback = (c) => {
|
|
65
64
|
const num = Number(c)
|
|
66
65
|
return (
|
|
67
66
|
num ^
|
|
68
67
|
((window.crypto as any).getRandomValues(new Uint8Array(1))[0] &
|
|
69
68
|
(15 >> (num / 4)))
|
|
70
69
|
).toString(16)
|
|
71
70
|
}
|
|
72
71
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, callback)
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
let timestamp = new Date().getTime()
|
|
76
75
|
let perforNow =
|
|
77
76
|
(typeof window.performance !== 'undefined' &&
|
|
78
77
|
window.performance.now &&
|
|
79
78
|
window.performance.now() * 1000) ||
|
|
80
79
|
0
|
|
81
80
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
82
81
|
let random = Math.random() * 16
|
|
83
82
|
if (timestamp > 0) {
|
|
84
83
|
random = (timestamp + random) % 16 | 0
|
|
85
84
|
timestamp = Math.floor(timestamp / 16)
|
|
86
85
|
} else {
|
|
87
86
|
random = (perforNow + random) % 16 | 0
|
|
88
87
|
perforNow = Math.floor(perforNow / 16)
|
|
89
88
|
}
|
|
90
89
|
return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16)
|
|
91
90
|
})
|
|
92
91
|
skuId,
|
|
93
92
|
bMallTag = 1,
|
|
94
93
|
num,
|
|
95
94
|
skuUuid,
|
|
96
95
|
...otherGoodParams
|
|
97
96
|
let buId = commonParam.buId
|
|
98
97
|
if (!buId) {
|
|
99
98
|
const useInfo: any = await getBMallUserInfo()
|
|
100
99
|
buId = useInfo?.data?.buId
|
|
101
100
|
}
|
|
102
101
|
let params: any = {
|
|
103
102
|
uniformBizInfo: {
|
|
104
103
|
tenantId: 1024,
|
|
105
104
|
ua: 1,
|
|
106
105
|
buId: buId || 456,
|
|
107
106
|
bMallTag: bMallTag,
|
|
108
107
|
},
|
|
109
108
|
commonParam: {
|
|
110
109
|
pid: 100,
|
|
111
110
|
verticalCode: 'cn_retail_bmall',
|
|
112
111
|
ua: 1,
|
|
113
112
|
language: 'zh',
|
|
114
113
|
},
|
|
115
114
|
operations: [{ TheSkus: [{ Id: skuId, num: num ?? 1 }] }],
|
|
116
115
|
apolloId: APOLLO.apolloId,
|
|
117
116
|
apolloSecret: APOLLO.apolloSecret,
|
|
118
117
|
client: 'H5',
|
|
119
118
|
verticalTag: 'cn_retail_bmall',
|
|
120
119
|
carttype: bMallTag == 1 ? 21 : 22,
|
|
121
120
|
bMallTag: bMallTag,
|
|
122
121
|
traceId: getUuid(),
|
|
123
122
|
noResponse: true,
|
|
124
123
|
}
|
|
125
124
|
if (skuUuid) {
|
|
126
125
|
params.operations[0].TheSkus[0].skuUuid = skuUuid
|
|
127
126
|
}
|
|
128
127
|
if (otherGoodParams.buId) {
|
|
129
128
|
const uniformBizInfo = {
|
|
130
129
|
buId: otherGoodParams.buId,
|
|
131
130
|
}
|
|
132
131
|
params.operations[0].TheSkus[0].uniformBizInfo = uniformBizInfo
|
|
133
132
|
}
|
|
134
133
|
if (window?.siteTransResult?.gridInfoList) {
|
|
135
134
|
params = {
|
|
136
135
|
...params,
|
|
137
136
|
cartLocationList: [
|
|
138
137
|
{
|
|
139
138
|
gridInfos:
|
|
140
139
|
window?.siteTransResult?.gridInfoList &&
|
|
141
140
|
JSON.parse(window?.siteTransResult?.gridInfoList),
|
|
142
141
|
areaIdSet:
|
|
143
142
|
window?.siteTransResult?.area &&
|
|
144
143
|
window?.siteTransResult?.area?.split('-'),
|
|
145
144
|
},
|
|
146
145
|
],
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
return params
|
|
149
|
+
import { isAndroidDevice } from '../utils'
|
|
150
150
|
buId: '',
|
|
151
151
|
console.log('getBMallUserInfo')
|
|
152
152
|
if (!(isApp('jdb') || isApp('jdjch'))) {
|
|
153
153
|
return null
|
|
154
154
|
}
|
|
155
155
|
if (bMallUserInfo) {
|
|
156
156
|
return new Promise((resolve) => resolve(bMallUserInfo))
|
|
157
157
|
}
|
|
158
158
|
const requestTimeoutPromise = new Promise((resolve) => {
|
|
159
159
|
setTimeout(() => {
|
|
160
160
|
resolve({})
|
|
161
161
|
}, 3000)
|
|
162
162
|
})
|
|
163
163
|
const userInfoPromise = new Promise((resolve) => {
|
|
164
164
|
let result: any = {}
|
|
165
165
|
try {
|
|
166
166
|
if(isApp('jdjch')) {
|
|
167
167
|
const { user } = window['@jd/jdb-jssdk-b2b'] || {}
|
|
168
168
|
user && user.getUserInfo().then((res) => {
|
|
169
169
|
resolve(res?.data || {})
|
|
170
170
|
})
|
|
171
171
|
}else {
|
|
172
172
|
if (isAndroidDevice) {
|
|
173
173
|
result = JSON.parse(
|
|
174
174
|
window.WebViewCommon && window.WebViewCommon.getUserInfo(),
|
|
175
175
|
)
|
|
176
176
|
bMallUserInfo = result
|
|
177
177
|
commonParam.buId = result?.data?.buId
|
|
178
178
|
resolve(result)
|
|
179
179
|
} else {
|
|
180
180
|
window.getUserInfoCallBack = null
|
|
181
181
|
window.getUserInfoCallBack = function (callBackJson) {
|
|
182
182
|
if (callBackJson) {
|
|
183
183
|
result.data = JSON.parse(callBackJson)
|
|
184
184
|
bMallUserInfo = result
|
|
185
185
|
commonParam.buId = result?.data?.buId
|
|
186
186
|
resolve(result)
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
window?.webkit?.messageHandlers?.WebViewCommon?.postMessage({
|
|
190
190
|
businessType: 'router://com.jd.jlstudio/getUserInfo',
|
|
191
191
|
params: {},
|
|
192
192
|
callBackName: 'getUserInfoCallBack',
|
|
193
193
|
method: 'callRouterModuleWithParams',
|
|
194
194
|
})
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
} catch (e) {
|
|
198
198
|
resolve(result)
|
|
199
199
|
}
|
|
200
200
|
})
|
|
201
201
|
return Promise.race([userInfoPromise, requestTimeoutPromise])
|
|
202
202
|
process.env.NODE_ENV === 'development'
|
|
203
203
|
? {
|
|
204
204
|
apolloId: '48ee955b0fb04d19b9f9fe8cb73d387f',
|
|
205
205
|
apolloSecret: '0d9c76ee66b0487da4e17d3cf1d7af7a',
|
|
206
206
|
}
|
|
207
207
|
: {
|
|
208
208
|
apolloId: '80c46fd06e4442998609d9f6a4ab96f0',
|
|
209
209
|
apolloSecret: 'f36bef08bcba4683b409732095793fb2',
|
|
210
210
|
}
|
|
211
211
|
if (typeof window.crypto === 'object') {
|
|
212
212
|
if (typeof (window.crypto as any).randomUUID === 'function') {
|
|
213
213
|
return (window.crypto as any).randomUUID()
|
|
214
214
|
}
|
|
215
215
|
if (
|
|
216
216
|
typeof (window.crypto as any).getRandomValues === 'function' &&
|
|
217
217
|
typeof Uint8Array === 'function'
|
|
218
218
|
) {
|
|
219
219
|
const callback = (c) => {
|
|
220
220
|
const num = Number(c)
|
|
221
221
|
return (
|
|
222
222
|
num ^
|
|
223
223
|
((window.crypto as any).getRandomValues(new Uint8Array(1))[0] &
|
|
224
224
|
(15 >> (num / 4)))
|
|
225
225
|
).toString(16)
|
|
226
226
|
}
|
|
227
227
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, callback)
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
let timestamp = new Date().getTime()
|
|
231
231
|
let perforNow =
|
|
232
232
|
(typeof window.performance !== 'undefined' &&
|
|
233
233
|
window.performance.now &&
|
|
234
234
|
window.performance.now() * 1000) ||
|
|
235
235
|
0
|
|
236
236
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
237
237
|
let random = Math.random() * 16
|
|
238
238
|
if (timestamp > 0) {
|
|
239
239
|
random = (timestamp + random) % 16 | 0
|
|
240
240
|
timestamp = Math.floor(timestamp / 16)
|
|
241
241
|
} else {
|
|
242
242
|
random = (perforNow + random) % 16 | 0
|
|
243
243
|
perforNow = Math.floor(perforNow / 16)
|
|
244
244
|
}
|
|
245
245
|
return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16)
|
|
246
246
|
})
|
|
247
247
|
skuId,
|
|
248
248
|
bMallTag = 1,
|
|
249
249
|
num,
|
|
250
250
|
skuUuid,
|
|
251
251
|
...otherGoodParams
|
|
252
252
|
let buId = commonParam.buId
|
|
253
253
|
if (!buId) {
|
|
254
254
|
const useInfo: any = await getBMallUserInfo()
|
|
255
255
|
buId = useInfo?.data?.buId
|
|
256
256
|
}
|
|
257
257
|
let params: any = {
|
|
258
258
|
uniformBizInfo: {
|
|
259
259
|
tenantId: 1024,
|
|
260
260
|
ua: 1,
|
|
261
261
|
buId: buId || 456,
|
|
262
262
|
bMallTag: bMallTag,
|
|
263
263
|
},
|
|
264
264
|
commonParam: {
|
|
265
265
|
pid: 100,
|
|
266
266
|
verticalCode: 'cn_retail_bmall',
|
|
267
267
|
ua: 1,
|
|
268
268
|
language: 'zh',
|
|
269
269
|
},
|
|
270
270
|
operations: [{ TheSkus: [{ Id: skuId, num: num ?? 1 }] }],
|
|
271
271
|
apolloId: APOLLO.apolloId,
|
|
272
272
|
apolloSecret: APOLLO.apolloSecret,
|
|
273
273
|
client: 'H5',
|
|
274
274
|
verticalTag: 'cn_retail_bmall',
|
|
275
275
|
carttype: bMallTag == 1 ? 21 : 22,
|
|
276
276
|
bMallTag: bMallTag,
|
|
277
277
|
traceId: getUuid(),
|
|
278
278
|
noResponse: true,
|
|
279
279
|
}
|
|
280
280
|
if (skuUuid) {
|
|
281
281
|
params.operations[0].TheSkus[0].skuUuid = skuUuid
|
|
282
282
|
}
|
|
283
283
|
if (otherGoodParams.buId) {
|
|
284
284
|
const uniformBizInfo = {
|
|
285
285
|
buId: otherGoodParams.buId,
|
|
286
286
|
}
|
|
287
287
|
params.operations[0].TheSkus[0].uniformBizInfo = uniformBizInfo
|
|
288
288
|
}
|
|
289
289
|
if (window?.siteTransResult?.gridInfoList) {
|
|
290
290
|
params = {
|
|
291
291
|
...params,
|
|
292
292
|
cartLocationList: [
|
|
293
293
|
{
|
|
294
294
|
gridInfos:
|
|
295
295
|
window?.siteTransResult?.gridInfoList &&
|
|
296
296
|
JSON.parse(window?.siteTransResult?.gridInfoList),
|
|
297
297
|
areaIdSet:
|
|
298
298
|
window?.siteTransResult?.area &&
|
|
299
299
|
window?.siteTransResult?.area?.split('-'),
|
|
300
300
|
},
|
|
301
301
|
],
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
return params
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
3
2
|
displayHeight: 1920,
|
|
4
3
|
offSetY: 0
|
|
5
4
|
}
|
|
6
5
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
7
6
|
if(options){
|
|
8
7
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
9
8
|
}
|
|
10
9
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
11
10
|
PAGE_PV_PARAM: 'pagePvParam',
|
|
12
11
|
NATIVE_SCORLL_VIEW: 'nativeScrollControl',
|
|
13
12
|
OPEN: 'open',
|
|
14
13
|
const { displayHeight, offSetY } = res
|
|
15
14
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
16
15
|
if (isIosDevice) return res
|
|
17
16
|
if (isAndroidDevice) {
|
|
18
17
|
const deviceRatio = window.devicePixelRatio
|
|
19
18
|
const cssDisplayHeight = Math.ceil(displayHeight / deviceRatio)
|
|
20
19
|
const cssOffsetY = Math.ceil(offSetY / deviceRatio)
|
|
21
20
|
return {
|
|
22
21
|
displayHeight: cssDisplayHeight,
|
|
23
22
|
offSetY: cssOffsetY
|
|
24
23
|
}
|
|
25
24
|
}
|
|
25
|
+
import Taro from '@tarojs/taro'
|
|
26
26
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
27
27
|
displayHeight: 1920,
|
|
28
28
|
offSetY: 0
|
|
29
29
|
}
|
|
30
30
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
31
31
|
if(options){
|
|
32
32
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
33
33
|
}
|
|
34
34
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
35
35
|
const { shopHomeExtendInfo } = options
|
|
36
36
|
if(shopHomeExtendInfo) {
|
|
37
37
|
Taro.eventCenter.trigger(TaroEventType.UPDATE_SHOP_HOME_EXTEND_DATA,shopHomeExtendInfo)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
window && window.scrollTo(0, 0);
|
|
41
41
|
}
|
|
42
42
|
PAGE_PV_PARAM: 'pagePvParam',
|
|
43
43
|
NATIVE_SCORLL_VIEW: 'nativeScrollControl',
|
|
44
44
|
NATIVE_PUSH_NATIVE_PAGE: 'pushNativePage',
|
|
45
45
|
UPDATE_NATIVE_DATA: 'updateNativeData',
|
|
46
46
|
H5_TO_SCROLL_TOP: 'h5ToScrollTop',
|
|
47
47
|
OPEN: 'open',
|
|
48
48
|
newHomePage: true,
|
|
49
49
|
case Message_Type.UPDATE_NATIVE_DATA:
|
|
50
50
|
console.log('接收到原生通知 UPDATE_NATIVE_DATA',messageData)
|
|
51
51
|
console.log('接收到原生通知 UPDATE_NATIVE_DATA getSendJsonData',getSendJsonData)
|
|
52
52
|
taroEventUpdateNativeData(getSendJsonData)
|
|
53
53
|
break;
|
|
54
54
|
case Message_Type.H5_TO_SCROLL_TOP:
|
|
55
55
|
taroEventH5ToScrollTop()
|
|
56
56
|
nativePageRegisterMessage(Message_Type.NATIVE_PUSH_NATIVE_PAGE, {
|
|
57
57
|
data: params,
|
|
58
58
|
})
|
|
59
59
|
const { displayHeight, offSetY } = res
|
|
60
60
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
61
61
|
if (isIosDevice) return res
|
|
62
62
|
if (isAndroidDevice) {
|
|
63
63
|
const deviceRatio = window.devicePixelRatio
|
|
64
64
|
const cssDisplayHeight = Math.ceil(displayHeight / deviceRatio)
|
|
65
65
|
const cssOffsetY = Math.ceil(offSetY / deviceRatio)
|
|
66
66
|
return {
|
|
67
67
|
displayHeight: cssDisplayHeight,
|
|
68
68
|
offSetY: cssOffsetY
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from "@tarojs/taro";
|
|
1
|
+
import Taro from "@tarojs/taro";
|
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
|
CHANNEL_TYPE,
|
|
14
13
|
JDShopViewBusinessPathType,
|
|
15
14
|
JDShopViewBusinessPathList,
|
|
16
15
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
17
16
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
18
17
|
try {
|
|
19
18
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
20
19
|
} catch (e) {
|
|
21
20
|
return {}
|
|
22
21
|
}
|
|
23
22
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
24
23
|
if (isJdApp) {
|
|
25
24
|
isIosDevice
|
|
26
25
|
? e && e.stopPropagation()
|
|
27
26
|
: androidDeviceStopNativeScrollEvent(state)
|
|
28
27
|
}
|
|
29
28
|
isJdApp &&
|
|
30
29
|
isAndroidDevice &&
|
|
31
30
|
window?.JdAndroid &&
|
|
32
31
|
window?.JdAndroid.requestEvent(state)
|
|
33
32
|
if (isH5AndJdShopView) {
|
|
34
33
|
return (
|
|
35
34
|
CHANNEL_TYPE[currentChannel] ||
|
|
36
35
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
37
36
|
)
|
|
38
37
|
}
|
|
39
38
|
return null
|
|
40
39
|
isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
|
|
41
40
|
const getCustomObj = {
|
|
42
41
|
type: 1,
|
|
43
42
|
code: 'all',
|
|
44
43
|
cost1: 1,
|
|
45
44
|
...customObj
|
|
46
45
|
}
|
|
47
46
|
try {
|
|
48
47
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
49
48
|
} catch (e) {}
|
|
49
|
+
import {
|
|
50
50
|
isApp,
|
|
51
51
|
isIOS,
|
|
52
52
|
getAppVersion,
|
|
53
53
|
version,
|
|
54
54
|
getUUID,
|
|
55
55
|
getUrlQuery,
|
|
56
56
|
assign,
|
|
57
57
|
isString,
|
|
58
58
|
isObject,
|
|
59
59
|
serialize,
|
|
60
60
|
isAndroid, versionCompare,
|
|
61
61
|
CHANNEL_TYPE,
|
|
62
62
|
JDShopViewBusinessPathType,
|
|
63
63
|
JDShopViewBusinessPathList,
|
|
64
64
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
65
65
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
66
66
|
try {
|
|
67
67
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
68
68
|
} catch (e) {
|
|
69
69
|
return {}
|
|
70
70
|
}
|
|
71
71
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
72
72
|
if (isJdApp) {
|
|
73
73
|
isIosDevice
|
|
74
74
|
? e && e.stopPropagation()
|
|
75
75
|
: androidDeviceStopNativeScrollEvent(state)
|
|
76
76
|
}
|
|
77
77
|
isJdApp &&
|
|
78
78
|
isAndroidDevice &&
|
|
79
79
|
window?.JdAndroid &&
|
|
80
80
|
window?.JdAndroid.requestEvent(state)
|
|
81
81
|
if (isH5AndJdShopView) {
|
|
82
82
|
return (
|
|
83
83
|
CHANNEL_TYPE[currentChannel] ||
|
|
84
84
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
85
85
|
)
|
|
86
86
|
}
|
|
87
87
|
return null
|
|
88
88
|
isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
|
|
89
89
|
const getCustomObj = {
|
|
90
90
|
type: 1,
|
|
91
91
|
code: 'all',
|
|
92
92
|
cost1: 1,
|
|
93
93
|
...customObj
|
|
94
94
|
}
|
|
95
95
|
try {
|
|
96
96
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
97
97
|
} catch (e) {}
|