@conecli/cone-render 0.8.20-shop.54 → 0.8.20-shop.55
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, {useRef, useEffect} from 'react'
|
|
2
1
|
isH5AndJdShopView,
|
|
3
2
|
isAndroidDevice,
|
|
4
3
|
isIosDevice,
|
|
5
4
|
isJdApp,
|
|
6
5
|
isWxMin,
|
|
7
6
|
isH5AndJdShopViewH5Scroll,
|
|
8
7
|
isH5,
|
|
9
8
|
const rootEleNode = isH5 && document ? document.querySelector('body') : null
|
|
10
9
|
const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
|
|
11
10
|
e && e.stopPropagation()
|
|
12
11
|
if(!verticalScrolling) {
|
|
13
12
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
14
13
|
}
|
|
15
14
|
e && e.stopPropagation()
|
|
16
15
|
e && e.stopPropagation()
|
|
17
16
|
if(!verticalScrolling) {
|
|
18
17
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
19
18
|
}
|
|
20
19
|
if(!verticalScrolling) {
|
|
21
20
|
needShowHighVersion && rootEleNode && rootEleNode.classList.remove('over-hidden')
|
|
22
21
|
}
|
|
23
22
|
<ScrollView
|
|
24
23
|
scrollX
|
|
25
24
|
onTouchStart={changeTouchStart}
|
|
26
25
|
onTouchEnd={changeTouchEnd}
|
|
27
26
|
onTouchCancel={changeTouchEnd}
|
|
28
27
|
onTouchMove={changeTouchMove}
|
|
29
28
|
enhanced
|
|
30
29
|
showScrollbar={false}
|
|
31
30
|
style={style}
|
|
32
31
|
className={classNames(className, {
|
|
33
32
|
[customScrollViewStyle[
|
|
34
33
|
'd-custom-ios-h5-extend-border-radius'
|
|
35
34
|
]]: isIosDevice,
|
|
36
35
|
},'J_customScroll')}
|
|
37
36
|
{...otherProps}
|
|
38
37
|
>
|
|
39
38
|
{children}
|
|
40
39
|
</ScrollView>
|
|
41
40
|
verticalScrolling: false,
|
|
41
|
+
import React, {useRef, useEffect} from 'react'
|
|
42
42
|
isH5AndJdShopView,
|
|
43
43
|
isAndroidDevice,
|
|
44
44
|
isIosDevice,
|
|
45
45
|
isJdApp,
|
|
46
46
|
isWxMin,
|
|
47
47
|
isH5AndJdShopViewH5Scroll,
|
|
48
48
|
isH5,
|
|
49
49
|
const rootEleNode = isH5 && document ? document.querySelector('body') : null
|
|
50
50
|
const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
|
|
51
51
|
!isAppClassifyPage && e && e.stopPropagation()
|
|
52
52
|
if(!verticalScrolling) {
|
|
53
53
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
54
54
|
}
|
|
55
55
|
!isAppClassifyPage && e && e.stopPropagation()
|
|
56
56
|
!isAppClassifyPage && e && e.stopPropagation()
|
|
57
57
|
if(!verticalScrolling) {
|
|
58
58
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
59
59
|
}
|
|
60
60
|
if(!verticalScrolling) {
|
|
61
61
|
needShowHighVersion && rootEleNode && rootEleNode.classList.remove('over-hidden')
|
|
62
62
|
}
|
|
63
63
|
<ScrollView
|
|
64
64
|
scrollX
|
|
65
65
|
onTouchStart={changeTouchStart}
|
|
66
66
|
onTouchEnd={changeTouchEnd}
|
|
67
67
|
onTouchCancel={changeTouchEnd}
|
|
68
68
|
onTouchMove={changeTouchMove}
|
|
69
69
|
enhanced
|
|
70
70
|
showScrollbar={false}
|
|
71
71
|
style={style}
|
|
72
72
|
className={classNames(className, {
|
|
73
73
|
[customScrollViewStyle[
|
|
74
74
|
'd-custom-ios-h5-extend-border-radius'
|
|
75
75
|
]]: isIosDevice,
|
|
76
76
|
},'J_customScroll')}
|
|
77
77
|
{...otherProps}
|
|
78
78
|
>
|
|
79
79
|
{children}
|
|
80
80
|
</ScrollView>
|
|
81
81
|
verticalScrolling: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
TaroEventType,
|
|
3
2
|
WEBVIEW_STATE,
|
|
4
3
|
M_H5_ROOT_ELE_NODE,
|
|
5
4
|
latestFromNativeMsgStorage,
|
|
6
5
|
getNativePageScrollRes,
|
|
7
6
|
props: ComponentInterFace.InOrOutViewObserverProps,
|
|
8
7
|
const {
|
|
9
8
|
children,
|
|
10
9
|
style,
|
|
11
10
|
inViewCallback,
|
|
12
11
|
outViewCallback,
|
|
13
12
|
threshold = 0,
|
|
14
13
|
} = props
|
|
15
14
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
16
15
|
const componentObserverRef = useRef<HTMLElement | null>(null)
|
|
17
16
|
const componentShowStateRef = useRef(false)
|
|
18
17
|
const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
|
|
19
18
|
const rootDom = isH5AndJdShopView && needShowHighVersion ? null : document.querySelector(`${M_H5_ROOT_ELE_NODE}`)
|
|
20
19
|
if (isH5AndJdShopView && !needShowHighVersion) {
|
|
21
20
|
useEffect(() => {
|
|
22
21
|
const latestRes =
|
|
23
22
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
24
23
|
dealPageScrollInfo(latestRes)
|
|
25
24
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
26
25
|
dealPageScrollInfo(res)
|
|
27
26
|
})
|
|
28
27
|
Taro.eventCenter.on(
|
|
29
28
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
30
29
|
(state) => {
|
|
31
30
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
32
31
|
},
|
|
33
32
|
)
|
|
34
33
|
return function cleanup() {
|
|
35
34
|
Taro.eventCenter.off(TaroEventType.PAGE_SCROLL, (res) => {
|
|
36
35
|
dealPageScrollInfo(res)
|
|
37
36
|
})
|
|
38
37
|
Taro.eventCenter.off(
|
|
39
38
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
40
39
|
(state) => {
|
|
41
40
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
42
41
|
},
|
|
43
42
|
)
|
|
44
43
|
}
|
|
45
44
|
}, [])
|
|
46
45
|
useEffect(() => {
|
|
47
46
|
if (componentShowState) {
|
|
48
47
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
49
48
|
console.log('app=>in可视区域')
|
|
50
49
|
} else {
|
|
51
50
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
52
51
|
console.log('app=>out可视区域')
|
|
53
52
|
}
|
|
54
53
|
}, [componentShowState])
|
|
55
54
|
|
|
56
55
|
const handleInOrOutView = (type: boolean) => {
|
|
57
56
|
componentShowStateRef.current = type
|
|
58
57
|
setComponentShowState(type)
|
|
59
58
|
console.log('handleInOrOutView', type)
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
const dealPageScrollInfo = (res) => {
|
|
63
62
|
console.log('dealPageScrollInfo===', res)
|
|
64
63
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
|
|
65
64
|
if (
|
|
66
65
|
typeof displayHeight === 'undefined' ||
|
|
67
66
|
typeof offSetY === 'undefined'
|
|
68
67
|
)
|
|
69
68
|
return
|
|
70
69
|
console.log(
|
|
71
70
|
'处理后dealPageScrollInfo===displayHeight=offSetY',
|
|
72
71
|
displayHeight,
|
|
73
72
|
offSetY,
|
|
74
73
|
)
|
|
75
74
|
if (componentObserverRef.current) {
|
|
76
75
|
const eleClientRect =
|
|
77
76
|
componentObserverRef.current.getBoundingClientRect()
|
|
78
77
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
79
78
|
const eleHeight = Math.ceil(eleClientRect.height)
|
|
80
79
|
console.log(
|
|
81
80
|
'==========================eleOffsetTop, eleHeight',
|
|
82
81
|
eleOffsetTop,
|
|
83
82
|
eleHeight,
|
|
84
83
|
)
|
|
85
84
|
if (eleOffsetTop >= 0 && eleOffsetTop < displayHeight) {
|
|
86
85
|
const isOutView =
|
|
87
86
|
offSetY > eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)) ||
|
|
88
87
|
displayHeight - (eleOffsetTop - offSetY) <
|
|
89
88
|
Math.ceil(eleHeight * threshold)
|
|
90
89
|
console.log(
|
|
91
90
|
'比较isOutView',
|
|
92
91
|
isOutView,
|
|
93
92
|
offSetY,
|
|
94
93
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
95
94
|
displayHeight - (eleOffsetTop - offSetY),
|
|
96
95
|
Math.ceil(eleHeight * threshold),
|
|
97
96
|
)
|
|
98
97
|
handleInOrOutView(!isOutView)
|
|
99
98
|
} else {
|
|
100
99
|
const isInView =
|
|
101
100
|
offSetY >
|
|
102
101
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold) &&
|
|
103
102
|
offSetY < eleOffsetTop + Math.ceil(eleHeight * (1 - threshold))
|
|
104
103
|
console.log(
|
|
105
104
|
'比较isInView',
|
|
106
105
|
isInView,
|
|
107
106
|
offSetY,
|
|
108
107
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold),
|
|
109
108
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
110
109
|
)
|
|
111
110
|
handleInOrOutView(isInView)
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
114
|
return (
|
|
116
115
|
<View ref={componentObserverRef} style={style}>
|
|
117
116
|
{children}
|
|
118
117
|
</View>
|
|
119
118
|
)
|
|
120
119
|
} else {
|
|
121
120
|
const { ref, inView } = useInView({
|
|
122
121
|
threshold,
|
|
123
122
|
triggerOnce: false,
|
|
124
123
|
root: rootDom || null,
|
|
125
124
|
rootMargin: `0px 0px 0px 0px`,
|
|
126
125
|
})
|
|
127
126
|
useEffect(() => {
|
|
128
127
|
if (inView) {
|
|
129
128
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
130
129
|
console.log('其他h5=>in可视区域')
|
|
131
130
|
} else {
|
|
132
131
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
133
132
|
console.log('其他h5=>out可视区域')
|
|
134
133
|
}
|
|
135
134
|
}, [inView])
|
|
136
135
|
return (
|
|
137
136
|
<View ref={ref} style={style}>
|
|
138
137
|
{children}
|
|
139
138
|
</View>
|
|
140
139
|
)
|
|
141
140
|
}
|
|
142
141
|
children: null,
|
|
143
142
|
style: {},
|
|
144
143
|
className: '',
|
|
145
144
|
inViewCallback: null,
|
|
146
145
|
outViewCallback: null,
|
|
147
146
|
threshold: 0,
|
|
147
|
+
import Taro from '@tarojs/taro'
|
|
148
148
|
TaroEventType,
|
|
149
149
|
WEBVIEW_STATE,
|
|
150
150
|
M_H5_ROOT_ELE_NODE,
|
|
151
151
|
latestFromNativeMsgStorage,
|
|
152
152
|
getNativePageScrollRes,
|
|
153
153
|
props: ComponentInterFace.InOrOutViewObserverProps,
|
|
154
154
|
const {
|
|
155
155
|
children,
|
|
156
156
|
style,
|
|
157
157
|
inViewCallback,
|
|
158
158
|
outViewCallback,
|
|
159
159
|
threshold = 0,
|
|
160
160
|
} = props
|
|
161
161
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
162
162
|
const componentObserverRef = useRef<HTMLElement | null>(null)
|
|
163
163
|
const componentShowStateRef = useRef(false)
|
|
164
164
|
const needShowHighVersion = isAppClassifyPage || (isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true"))
|
|
165
165
|
const rootDom = isH5AndJdShopView && needShowHighVersion ? null : document.querySelector(`${M_H5_ROOT_ELE_NODE}`)
|
|
166
166
|
if (isH5AndJdShopView && !needShowHighVersion) {
|
|
167
167
|
console.log('视频========属于app原生滚动')
|
|
168
168
|
useEffect(() => {
|
|
169
169
|
const latestRes =
|
|
170
170
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
171
171
|
dealPageScrollInfo(latestRes)
|
|
172
172
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
173
173
|
dealPageScrollInfo(res)
|
|
174
174
|
})
|
|
175
175
|
Taro.eventCenter.on(
|
|
176
176
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
177
177
|
(state) => {
|
|
178
178
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
179
179
|
},
|
|
180
180
|
)
|
|
181
181
|
return function cleanup() {
|
|
182
182
|
Taro.eventCenter.off(TaroEventType.PAGE_SCROLL, (res) => {
|
|
183
183
|
dealPageScrollInfo(res)
|
|
184
184
|
})
|
|
185
185
|
Taro.eventCenter.off(
|
|
186
186
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
187
187
|
(state) => {
|
|
188
188
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
189
189
|
},
|
|
190
190
|
)
|
|
191
191
|
}
|
|
192
192
|
}, [])
|
|
193
193
|
useEffect(() => {
|
|
194
194
|
if (componentShowState) {
|
|
195
195
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
196
196
|
console.log('app=>in可视区域')
|
|
197
197
|
} else {
|
|
198
198
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
199
199
|
console.log('app=>out可视区域')
|
|
200
200
|
}
|
|
201
201
|
}, [componentShowState])
|
|
202
202
|
|
|
203
203
|
const handleInOrOutView = (type: boolean) => {
|
|
204
204
|
componentShowStateRef.current = type
|
|
205
205
|
setComponentShowState(type)
|
|
206
206
|
console.log('handleInOrOutView', type)
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
const dealPageScrollInfo = (res) => {
|
|
210
210
|
console.log('dealPageScrollInfo===', res)
|
|
211
211
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
|
|
212
212
|
if (
|
|
213
213
|
typeof displayHeight === 'undefined' ||
|
|
214
214
|
typeof offSetY === 'undefined'
|
|
215
215
|
)
|
|
216
216
|
return
|
|
217
217
|
console.log(
|
|
218
218
|
'处理后dealPageScrollInfo===displayHeight=offSetY',
|
|
219
219
|
displayHeight,
|
|
220
220
|
offSetY,
|
|
221
221
|
)
|
|
222
222
|
if (componentObserverRef.current) {
|
|
223
223
|
const eleClientRect =
|
|
224
224
|
componentObserverRef.current.getBoundingClientRect()
|
|
225
225
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
226
226
|
const eleHeight = Math.ceil(eleClientRect.height)
|
|
227
227
|
console.log(
|
|
228
228
|
'==========================eleOffsetTop, eleHeight',
|
|
229
229
|
eleOffsetTop,
|
|
230
230
|
eleHeight,
|
|
231
231
|
)
|
|
232
232
|
if (eleOffsetTop >= 0 && eleOffsetTop < displayHeight) {
|
|
233
233
|
const isOutView =
|
|
234
234
|
offSetY > eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)) ||
|
|
235
235
|
displayHeight - (eleOffsetTop - offSetY) <
|
|
236
236
|
Math.ceil(eleHeight * threshold)
|
|
237
237
|
console.log(
|
|
238
238
|
'比较isOutView',
|
|
239
239
|
isOutView,
|
|
240
240
|
offSetY,
|
|
241
241
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
242
242
|
displayHeight - (eleOffsetTop - offSetY),
|
|
243
243
|
Math.ceil(eleHeight * threshold),
|
|
244
244
|
)
|
|
245
245
|
handleInOrOutView(!isOutView)
|
|
246
246
|
} else {
|
|
247
247
|
const isInView =
|
|
248
248
|
offSetY >
|
|
249
249
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold) &&
|
|
250
250
|
offSetY < eleOffsetTop + Math.ceil(eleHeight * (1 - threshold))
|
|
251
251
|
console.log(
|
|
252
252
|
'比较isInView',
|
|
253
253
|
isInView,
|
|
254
254
|
offSetY,
|
|
255
255
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold),
|
|
256
256
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
257
257
|
)
|
|
258
258
|
handleInOrOutView(isInView)
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
return (
|
|
263
263
|
<View ref={componentObserverRef} style={style}>
|
|
264
264
|
{children}
|
|
265
265
|
</View>
|
|
266
266
|
)
|
|
267
267
|
} else {
|
|
268
268
|
console.log('视频========h5滚动')
|
|
269
269
|
const { ref, inView } = useInView({
|
|
270
270
|
threshold,
|
|
271
271
|
triggerOnce: false,
|
|
272
272
|
root: rootDom || null,
|
|
273
273
|
rootMargin: `0px 0px 0px 0px`,
|
|
274
274
|
})
|
|
275
275
|
useEffect(() => {
|
|
276
276
|
if (inView) {
|
|
277
277
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
278
278
|
console.log('其他h5=>in可视区域')
|
|
279
279
|
} else {
|
|
280
280
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
281
281
|
console.log('其他h5=>out可视区域')
|
|
282
282
|
}
|
|
283
283
|
}, [inView])
|
|
284
284
|
return (
|
|
285
285
|
<View ref={ref} style={style}>
|
|
286
286
|
{children}
|
|
287
287
|
</View>
|
|
288
288
|
)
|
|
289
289
|
}
|
|
290
290
|
children: null,
|
|
291
291
|
style: {},
|
|
292
292
|
className: '',
|
|
293
293
|
inViewCallback: null,
|
|
294
294
|
outViewCallback: null,
|
|
295
295
|
threshold: 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, versionCompare,
|
|
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) {}
|
package/dist/utils/index.h5.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
nativePageShowToast, ToastAndroidType,
|
|
3
2
|
ToastIosType,
|
|
4
3
|
getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
|
|
5
4
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
6
5
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
|
|
7
6
|
sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll
|
|
8
7
|
addHttps,
|
|
9
8
|
clearTaroStorageKey,
|
|
10
9
|
countStringify,
|
|
11
10
|
dateFormat,
|
|
12
11
|
dealAddress,
|
|
13
12
|
dealShopContentData as originDealShopContentData,
|
|
14
13
|
debounce,
|
|
15
14
|
filterUrlQueryData,
|
|
16
15
|
formatTabActiveMenuType,
|
|
17
16
|
getQualityImage,
|
|
18
17
|
getTaroStorageKeyValue,
|
|
19
18
|
getWxAppCookieStr,
|
|
20
19
|
isH5,
|
|
21
20
|
isJdMin,
|
|
22
21
|
isWxMin,
|
|
23
22
|
isWxMinAndWxapp,
|
|
24
23
|
lodashThrottle,
|
|
25
24
|
objectToUrlEncode,
|
|
26
25
|
parseQueryUrlString,
|
|
27
26
|
removeTaroStorageKey,
|
|
28
27
|
setLowSmallPicUrl,
|
|
29
28
|
setTaroStorage,
|
|
30
29
|
showFailToast,
|
|
31
30
|
showNormalToast,
|
|
32
31
|
showSuccessToast,
|
|
33
32
|
sliceArrToChunkList,
|
|
34
33
|
throttle,
|
|
35
34
|
windowWidth: window.innerWidth,
|
|
36
35
|
containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
|
|
37
36
|
screenWidth: window.innerWidth,
|
|
38
37
|
platform: '',
|
|
39
38
|
model: '',
|
|
40
39
|
system: '',
|
|
41
40
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
42
41
|
const params = Object.assign(
|
|
43
42
|
{},
|
|
44
43
|
{
|
|
45
44
|
title: '',
|
|
46
45
|
duration: 1500,
|
|
47
46
|
},
|
|
48
47
|
options,
|
|
49
48
|
)
|
|
50
49
|
params.duration = params.duration / 1000
|
|
51
50
|
if (isJdApp && isH5AndJdShopView) {
|
|
52
51
|
const showSuccessType = isIosDevice
|
|
53
52
|
? ToastIosType.SUCCESS
|
|
54
53
|
: ToastAndroidType.SUCCESS
|
|
55
54
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
56
55
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
57
56
|
console.log('执行原生toast success')
|
|
58
57
|
} else {
|
|
59
58
|
showSuccessToast(options)
|
|
60
59
|
}
|
|
61
60
|
const params = Object.assign(
|
|
62
61
|
{},
|
|
63
62
|
{
|
|
64
63
|
title: '',
|
|
65
64
|
duration: 1500,
|
|
66
65
|
},
|
|
67
66
|
options,
|
|
68
67
|
)
|
|
69
68
|
params.duration = params.duration / 1000
|
|
70
69
|
console.log(`isJdApp${isJdApp}`)
|
|
71
70
|
if (isJdApp && isH5AndJdShopView) {
|
|
72
71
|
const showSuccessType = isIosDevice
|
|
73
72
|
? ToastIosType.FAIL
|
|
74
73
|
: ToastAndroidType.FAIL
|
|
75
74
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
76
75
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
77
76
|
console.log('执行原生toast fail')
|
|
78
77
|
} else {
|
|
79
78
|
console.log('执行H5 toast fail')
|
|
80
79
|
showFailToast(options)
|
|
81
80
|
}
|
|
82
81
|
const params = Object.assign(
|
|
83
82
|
{},
|
|
84
83
|
{
|
|
85
84
|
title: '',
|
|
86
85
|
duration: 1500,
|
|
87
86
|
},
|
|
88
87
|
options,
|
|
89
88
|
)
|
|
90
89
|
params.duration = params.duration / 1000
|
|
91
90
|
if (isJdApp) {
|
|
92
91
|
const showSuccessType = isIosDevice
|
|
93
92
|
? ToastIosType.NORMAL
|
|
94
93
|
: ToastAndroidType.NORMAL
|
|
95
94
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
96
95
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
97
96
|
} else {
|
|
98
97
|
showNormalToast(options)
|
|
99
98
|
}
|
|
100
99
|
const createLoadingEle = document.createElement('div')
|
|
101
100
|
createLoadingEle.id = 'J_shopLoading'
|
|
102
101
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
103
102
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
104
103
|
<span class='d-shop-loading-icon'></span>
|
|
105
104
|
<p class='d-shop-text'>${text}</p>
|
|
106
105
|
</div>`
|
|
107
106
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
108
107
|
console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
|
|
109
108
|
getEle.appendChild(createLoadingEle)
|
|
110
109
|
const getEle = document.getElementById('J_shopLoading')
|
|
111
110
|
getEle && getEle.remove()
|
|
112
111
|
num,
|
|
113
112
|
widthSize = 375,
|
|
114
113
|
layoutWidth = getSystemInfo.windowWidth,
|
|
115
114
|
const getNum = Number(num)
|
|
116
115
|
return Math.round((getNum / widthSize) * layoutWidth)
|
|
117
116
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
|
|
118
117
|
if (!systemInfo.system && window) {
|
|
119
118
|
systemInfo.system = window.navigator.userAgent
|
|
120
119
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
121
120
|
}
|
|
122
121
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
123
122
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
124
123
|
systemInfo.navBarHeight = 0
|
|
125
124
|
systemInfo.statusBarHeight = 0
|
|
126
125
|
systemInfo.capsulePosition = null
|
|
127
126
|
systemInfo.isIOS = isIOS
|
|
128
127
|
systemInfo.isAndroid = isAndroid
|
|
129
128
|
return systemInfo
|
|
130
129
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
131
130
|
isJdApp,
|
|
132
131
|
isWxApp,
|
|
133
132
|
isIosDevice,
|
|
134
133
|
isAndroidDevice,
|
|
135
134
|
isJdAndIosDevice,
|
|
136
135
|
isJdAndAndroidDevice,
|
|
137
136
|
isWxMin,
|
|
138
137
|
isWxMinAndWxapp,
|
|
139
138
|
isJdMin,
|
|
140
139
|
isH5,
|
|
141
140
|
isH5AndJdShopView,
|
|
142
141
|
isChartH5,
|
|
143
142
|
isH5AndJdShopViewNativeScroll,
|
|
144
143
|
isH5AndJdShopViewH5Scroll,
|
|
145
144
|
isH5AndJingGouMini,
|
|
146
145
|
isWxMiniH5View,
|
|
147
146
|
urlCookie,
|
|
148
147
|
sliceArrToChunkList,
|
|
149
148
|
dealAddress,
|
|
150
149
|
objectToUrlEncode,
|
|
151
150
|
parseQueryUrlString,
|
|
152
151
|
setLowSmallPicUrl,
|
|
153
152
|
setTaroStorage,
|
|
154
153
|
getTaroStorageKeyValue,
|
|
155
154
|
removeTaroStorageKey,
|
|
156
155
|
clearTaroStorageKey,
|
|
157
156
|
getQualityImage,
|
|
158
157
|
countStringify,
|
|
159
158
|
getWxAppCookieStr,
|
|
160
159
|
getSystemInfos,
|
|
161
160
|
pxTransformFromData,
|
|
162
161
|
dealShopContentDataAndReport as dealShopContentData,
|
|
163
162
|
dateFormat,
|
|
164
163
|
throttle,
|
|
165
164
|
lodashThrottle,
|
|
166
165
|
debounce,
|
|
167
166
|
addHttps,
|
|
168
167
|
commonShowSuccessToast as showSuccessToast,
|
|
169
168
|
commonShowFailToast as showFailToast,
|
|
170
169
|
commonShowNormalToast as showNormalToast,
|
|
171
170
|
showShopLoading,
|
|
172
171
|
hideShopLoading,
|
|
173
172
|
getAppChannelType,
|
|
174
173
|
formatTabActiveMenuType,
|
|
175
174
|
filterUrlQueryData,
|
|
176
175
|
sgmCustomReport,
|
|
177
176
|
isMemberPage,
|
|
178
177
|
memberFormatUtils,
|
|
179
178
|
getFloorDataToDataDefines
|
|
179
|
+
import Taro from '@tarojs/taro'
|
|
180
180
|
nativePageShowToast, ToastAndroidType,
|
|
181
181
|
ToastIosType,
|
|
182
182
|
getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
|
|
183
183
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
184
184
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
|
|
185
185
|
sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage
|
|
186
186
|
addHttps,
|
|
187
187
|
clearTaroStorageKey,
|
|
188
188
|
countStringify,
|
|
189
189
|
dateFormat,
|
|
190
190
|
dealAddress,
|
|
191
191
|
dealShopContentData as originDealShopContentData,
|
|
192
192
|
debounce,
|
|
193
193
|
filterUrlQueryData,
|
|
194
194
|
formatTabActiveMenuType,
|
|
195
195
|
getQualityImage,
|
|
196
196
|
getTaroStorageKeyValue,
|
|
197
197
|
getWxAppCookieStr,
|
|
198
198
|
isH5,
|
|
199
199
|
isJdMin,
|
|
200
200
|
isWxMin,
|
|
201
201
|
isWxMinAndWxapp,
|
|
202
202
|
lodashThrottle,
|
|
203
203
|
objectToUrlEncode,
|
|
204
204
|
parseQueryUrlString,
|
|
205
205
|
removeTaroStorageKey,
|
|
206
206
|
setLowSmallPicUrl,
|
|
207
207
|
setTaroStorage,
|
|
208
208
|
showFailToast,
|
|
209
209
|
showNormalToast,
|
|
210
210
|
showSuccessToast,
|
|
211
211
|
sliceArrToChunkList,
|
|
212
212
|
throttle,
|
|
213
213
|
windowWidth: window.innerWidth,
|
|
214
214
|
containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
|
|
215
215
|
screenWidth: window.innerWidth,
|
|
216
216
|
platform: '',
|
|
217
217
|
model: '',
|
|
218
218
|
system: '',
|
|
219
219
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
220
220
|
getSystemInfo['containerWidth'] = buildType === BUILD_TYPE.CLASSIFY ? getSystemInfo.screenWidth - 100 : getSystemInfo.screenWidth
|
|
221
221
|
const params = Object.assign(
|
|
222
222
|
{},
|
|
223
223
|
{
|
|
224
224
|
title: '',
|
|
225
225
|
duration: 1500,
|
|
226
226
|
},
|
|
227
227
|
options,
|
|
228
228
|
)
|
|
229
229
|
params.duration = params.duration / 1000
|
|
230
230
|
if (isJdApp && isH5AndJdShopView) {
|
|
231
231
|
const showSuccessType = isIosDevice
|
|
232
232
|
? ToastIosType.SUCCESS
|
|
233
233
|
: ToastAndroidType.SUCCESS
|
|
234
234
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
235
235
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
236
236
|
console.log('执行原生toast success')
|
|
237
237
|
} else {
|
|
238
238
|
showSuccessToast(options)
|
|
239
239
|
}
|
|
240
240
|
const params = Object.assign(
|
|
241
241
|
{},
|
|
242
242
|
{
|
|
243
243
|
title: '',
|
|
244
244
|
duration: 1500,
|
|
245
245
|
},
|
|
246
246
|
options,
|
|
247
247
|
)
|
|
248
248
|
params.duration = params.duration / 1000
|
|
249
249
|
console.log(`isJdApp${isJdApp}`)
|
|
250
250
|
if (isJdApp && isH5AndJdShopView) {
|
|
251
251
|
const showSuccessType = isIosDevice
|
|
252
252
|
? ToastIosType.FAIL
|
|
253
253
|
: ToastAndroidType.FAIL
|
|
254
254
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
255
255
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
256
256
|
console.log('执行原生toast fail')
|
|
257
257
|
} else {
|
|
258
258
|
console.log('执行H5 toast fail')
|
|
259
259
|
showFailToast(options)
|
|
260
260
|
}
|
|
261
261
|
const params = Object.assign(
|
|
262
262
|
{},
|
|
263
263
|
{
|
|
264
264
|
title: '',
|
|
265
265
|
duration: 1500,
|
|
266
266
|
},
|
|
267
267
|
options,
|
|
268
268
|
)
|
|
269
269
|
params.duration = params.duration / 1000
|
|
270
270
|
if (isJdApp) {
|
|
271
271
|
const showSuccessType = isIosDevice
|
|
272
272
|
? ToastIosType.NORMAL
|
|
273
273
|
: ToastAndroidType.NORMAL
|
|
274
274
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
275
275
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
276
276
|
} else {
|
|
277
277
|
showNormalToast(options)
|
|
278
278
|
}
|
|
279
279
|
const createLoadingEle = document.createElement('div')
|
|
280
280
|
createLoadingEle.id = 'J_shopLoading'
|
|
281
281
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
282
282
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
283
283
|
<span class='d-shop-loading-icon'></span>
|
|
284
284
|
<p class='d-shop-text'>${text}</p>
|
|
285
285
|
</div>`
|
|
286
286
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
287
287
|
console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
|
|
288
288
|
getEle.appendChild(createLoadingEle)
|
|
289
289
|
const getEle = document.getElementById('J_shopLoading')
|
|
290
290
|
getEle && getEle.remove()
|
|
291
291
|
num,
|
|
292
292
|
widthSize = 375,
|
|
293
293
|
layoutWidth = getSystemInfo.windowWidth,
|
|
294
294
|
const getNum = Number(num)
|
|
295
295
|
return Math.round((getNum / widthSize) * layoutWidth)
|
|
296
296
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
|
|
297
297
|
if (!systemInfo.system && window) {
|
|
298
298
|
systemInfo.system = window.navigator.userAgent
|
|
299
299
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
300
300
|
}
|
|
301
301
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
302
302
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
303
303
|
systemInfo.navBarHeight = 0
|
|
304
304
|
systemInfo.statusBarHeight = 0
|
|
305
305
|
systemInfo.capsulePosition = null
|
|
306
306
|
systemInfo.isIOS = isIOS
|
|
307
307
|
systemInfo.isAndroid = isAndroid
|
|
308
308
|
return systemInfo
|
|
309
309
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
310
310
|
isJdApp,
|
|
311
311
|
isWxApp,
|
|
312
312
|
isIosDevice,
|
|
313
313
|
isAndroidDevice,
|
|
314
314
|
isJdAndIosDevice,
|
|
315
315
|
isJdAndAndroidDevice,
|
|
316
316
|
isWxMin,
|
|
317
317
|
isWxMinAndWxapp,
|
|
318
318
|
isJdMin,
|
|
319
319
|
isH5,
|
|
320
320
|
isH5AndJdShopView,
|
|
321
321
|
isChartH5,
|
|
322
322
|
isH5AndJdShopViewNativeScroll,
|
|
323
323
|
isH5AndJdShopViewH5Scroll,
|
|
324
324
|
isH5AndJingGouMini,
|
|
325
325
|
isWxMiniH5View,
|
|
326
326
|
urlCookie,
|
|
327
327
|
sliceArrToChunkList,
|
|
328
328
|
dealAddress,
|
|
329
329
|
objectToUrlEncode,
|
|
330
330
|
parseQueryUrlString,
|
|
331
331
|
setLowSmallPicUrl,
|
|
332
332
|
setTaroStorage,
|
|
333
333
|
getTaroStorageKeyValue,
|
|
334
334
|
removeTaroStorageKey,
|
|
335
335
|
clearTaroStorageKey,
|
|
336
336
|
getQualityImage,
|
|
337
337
|
countStringify,
|
|
338
338
|
getWxAppCookieStr,
|
|
339
339
|
getSystemInfos,
|
|
340
340
|
pxTransformFromData,
|
|
341
341
|
dealShopContentDataAndReport as dealShopContentData,
|
|
342
342
|
dateFormat,
|
|
343
343
|
throttle,
|
|
344
344
|
lodashThrottle,
|
|
345
345
|
debounce,
|
|
346
346
|
addHttps,
|
|
347
347
|
commonShowSuccessToast as showSuccessToast,
|
|
348
348
|
commonShowFailToast as showFailToast,
|
|
349
349
|
commonShowNormalToast as showNormalToast,
|
|
350
350
|
showShopLoading,
|
|
351
351
|
hideShopLoading,
|
|
352
352
|
getAppChannelType,
|
|
353
353
|
formatTabActiveMenuType,
|
|
354
354
|
filterUrlQueryData,
|
|
355
355
|
sgmCustomReport,
|
|
356
356
|
isMemberPage,
|
|
357
357
|
memberFormatUtils,
|
|
358
358
|
getFloorDataToDataDefines,
|
|
359
359
|
isAppClassifyPage
|
package/dist/utils/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
isChartH5,
|
|
3
2
|
isH5AndJdShopViewH5Scroll,
|
|
4
3
|
isMemberPage,
|
|
5
4
|
sgmCustomReport
|
|
6
5
|
isChartH5,
|
|
7
6
|
isH5AndJdShopViewH5Scroll,
|
|
8
7
|
isH5AndJingGouMini,
|
|
9
8
|
urlCookie,
|
|
10
9
|
isMemberPage,
|
|
10
|
+
import {
|
|
11
11
|
isChartH5,
|
|
12
12
|
isH5AndJdShopViewH5Scroll,
|
|
13
13
|
isMemberPage,
|
|
14
14
|
isChartH5,
|
|
15
15
|
isH5AndJdShopViewH5Scroll,
|
|
16
16
|
isH5AndJingGouMini,
|
|
17
17
|
urlCookie,
|
|
18
18
|
isMemberPage,
|
package/dist/utils/utils.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
const getValue = `${obj[key]}`.replace(/undefined/,'').replace(/null/,'')
|
|
3
2
|
paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`
|
|
4
3
|
if(!imgUrl.includes('360buyimg.com')){
|
|
5
4
|
imgUrl = '//m.360buyimg.com/cms/' + imgUrl
|
|
6
5
|
}
|
|
7
6
|
if(quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
|
|
8
7
|
pin?: string
|
|
9
8
|
visitkey?: string
|
|
10
9
|
[key: string]: any
|
|
11
10
|
}
|
|
12
11
|
jdpin,
|
|
13
12
|
pinStatus,
|
|
14
13
|
visitkey,
|
|
15
14
|
unionid,
|
|
16
15
|
skey,
|
|
17
16
|
__jda,
|
|
18
17
|
__jdv,
|
|
19
18
|
__wga,
|
|
20
19
|
wxapp_type,
|
|
21
20
|
appType
|
|
22
21
|
} = cookie
|
|
23
22
|
const getUserCookieObj = {}
|
|
24
23
|
jdpin,
|
|
25
24
|
pinStatus,
|
|
26
25
|
visitkey,
|
|
27
26
|
unionid,
|
|
28
27
|
skey,
|
|
29
28
|
__jda,
|
|
30
29
|
__jdv,
|
|
31
30
|
__wga,
|
|
32
31
|
wid,
|
|
33
32
|
wq_skey,
|
|
34
33
|
wq_uin,
|
|
35
34
|
wq_auth_token,
|
|
36
35
|
wxapp_scene,
|
|
37
36
|
wq_unionid,
|
|
38
37
|
wxapp_openid,
|
|
39
38
|
wxapp_version,
|
|
40
39
|
wxapp_type,
|
|
41
40
|
appType
|
|
42
41
|
name = name === 'jdpin' ? 'pin' : name;
|
|
43
42
|
name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
|
|
44
43
|
ret.push(`${name}=${encodeURIComponent(value)}`)
|
|
45
44
|
getUserCookieObj[name] = value
|
|
46
45
|
}
|
|
47
46
|
wqCookie: getUserCookieObj
|
|
48
47
|
exceptionReportFn
|
|
49
48
|
const isIsvContainer = (containerId, floorListData, containerListData) => {
|
|
50
49
|
const objContainer = containerListData.find(item => item.containerId === containerId)
|
|
51
50
|
(itemUid) => {
|
|
52
51
|
const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
|
|
53
52
|
return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
|
|
54
53
|
}
|
|
55
54
|
)?? false
|
|
56
55
|
isChartH5,
|
|
57
56
|
isH5AndJdShopViewH5Scroll,
|
|
58
57
|
isMemberPage,
|
|
59
58
|
sgmCustomReport
|
|
59
|
+
import Taro from '@tarojs/taro'
|
|
60
60
|
const getValue = `${obj[key]}`.replace(/undefined/,'').replace(/null/,'')
|
|
61
61
|
paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`
|
|
62
62
|
if(!imgUrl.includes('360buyimg.com')){
|
|
63
63
|
imgUrl = '//m.360buyimg.com/cms/' + imgUrl
|
|
64
64
|
}
|
|
65
65
|
if(quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
|
|
66
66
|
pin?: string
|
|
67
67
|
visitkey?: string
|
|
68
68
|
[key: string]: any
|
|
69
69
|
}
|
|
70
70
|
jdpin,
|
|
71
71
|
pinStatus,
|
|
72
72
|
visitkey,
|
|
73
73
|
unionid,
|
|
74
74
|
skey,
|
|
75
75
|
__jda,
|
|
76
76
|
__jdv,
|
|
77
77
|
__wga,
|
|
78
78
|
wxapp_type,
|
|
79
79
|
appType
|
|
80
80
|
} = cookie
|
|
81
81
|
const getUserCookieObj = {}
|
|
82
82
|
jdpin,
|
|
83
83
|
pinStatus,
|
|
84
84
|
visitkey,
|
|
85
85
|
unionid,
|
|
86
86
|
skey,
|
|
87
87
|
__jda,
|
|
88
88
|
__jdv,
|
|
89
89
|
__wga,
|
|
90
90
|
wid,
|
|
91
91
|
wq_skey,
|
|
92
92
|
wq_uin,
|
|
93
93
|
wq_auth_token,
|
|
94
94
|
wxapp_scene,
|
|
95
95
|
wq_unionid,
|
|
96
96
|
wxapp_openid,
|
|
97
97
|
wxapp_version,
|
|
98
98
|
wxapp_type,
|
|
99
99
|
appType
|
|
100
100
|
name = name === 'jdpin' ? 'pin' : name;
|
|
101
101
|
name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
|
|
102
102
|
ret.push(`${name}=${encodeURIComponent(value)}`)
|
|
103
103
|
getUserCookieObj[name] = value
|
|
104
104
|
}
|
|
105
105
|
wqCookie: getUserCookieObj
|
|
106
106
|
exceptionReportFn
|
|
107
107
|
const isIsvContainer = (containerId, floorListData, containerListData) => {
|
|
108
108
|
const objContainer = containerListData.find(item => item.containerId === containerId)
|
|
109
109
|
(itemUid) => {
|
|
110
110
|
const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
|
|
111
111
|
return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
|
|
112
112
|
}
|
|
113
113
|
)?? false
|
|
114
114
|
isChartH5,
|
|
115
115
|
isH5AndJdShopViewH5Scroll,
|
|
116
116
|
isMemberPage,
|