@conecli/cone-render 0.8.22 → 0.8.24
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/components/base/CustomVideo/const.ts +1 -0
- package/dist/components/base/CustomVideo/index.module.scss +39 -64
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/package.json +1 -1
|
@@ -1,66 +1,41 @@
|
|
|
1
|
-
.d-video-wrap{
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.d-video-wrap {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
}
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
.d-video-play {
|
|
7
|
+
display: block;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
-webkit-backface-visibility: hidden;
|
|
13
|
+
-webkit-transform: translate3d(0, 0, 0);
|
|
14
|
+
object-fit: fill;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25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Dw/eHBhY2tldCBlbmQ9InIiPz459+FoAAABqElEQVRYhc2XPWsVQRSGnxPjF4oGRfxoRQKGWCU2Ft7CykrQWosEyf/If0hhIPgHDEmbNJZqCFxiQEgTUGxsBUVEHgvnyrjZZJO92V1fGIaZnTPvszPszNlQ6VIjnbr/DwCoDLMNak/dUVfUK0f2rQugnlcX/FevWgFQH6gf3autRgHUC+piiXHzAOmtPx9gXgug8itQx9SXwDpw47AGKXZWvXvQmNFCwE3gCXA2dY0Az4GrRzHONA9cU/vAbERsllEOyh31e8USV2mrMPdG9uyn+rDom2/BHHCm5puWKiKmgdtAnz+rvaxO5mNygEvHaZ5BfADuARvAaWBpP4DGFBHfgBngFzClTrUKkCDeA+9S837rAEnbqb7VFcCpVJ/oCmCw959aB1AfAROpudYqgDoOLKRmPyLelAF8bcD4pPoMeAtcB34AT4uDBqXXwFG8XXUU/72MIuK1OgE8Bs6l7mEvo8up7lN1Ge0n9aK6VHMFZvJTr9S3CiALaCQhqZOSvegMIAvu2UVSWpigLC1fbQ0gm6in7qpfLCQbhwGIYcyPQ53/G3YO8BtUtd35bvKcVwAAAABJRU5ErkJggg==");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.d-video-play-btn{
|
|
48
|
-
position: absolute;
|
|
49
|
-
width: 120px;
|
|
50
|
-
height: 120px;
|
|
51
|
-
background-repeat: no-repeat;
|
|
52
|
-
background-position: 50% 50%;
|
|
53
|
-
background-size: 50%;
|
|
54
|
-
top: 50%;
|
|
55
|
-
left: 50%;
|
|
56
|
-
transform: translateX(-50%) translateY(-50%);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.d-is-pause{
|
|
60
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAYAAAAy2w7YAAAAAXNSR0IArs4c6QAAAWhJREFUSA1j+P///0cgBoHjQGzCQCsAtgJB/AMy5wCxGNXtQ9iBwvoA5BUCMQvVLEQxHpNzDSjkRhXLMM3GKrIeKKpEkYVYjcUu+AMo3ALE3GRZiN1MvKKPgbIRJFuG10j8koeA0gZEW4jfLIKyf4EqpgOxMEELCRpFnIJ3QGU5QMyM00LizCFa1SWgSkeslhFtBGkKVwGVy6FYSJp+klR/A6quB2JOkIWMIK0oNlOf8xBoZDE9LAI7nYn6HsBq4l96WHQEaLUpAyiOaASeAM2NgvuPBpaACt82IEYtfKls0UagecpwXyAzqGTRdaA57sjmYrAptAjUsCkGYlYMg9EFyLQI1IiZB8Ti6Obh5JNh0QmgHlOcBuKSIMGi50C18UDMiMssvOJEWPQLqKYbiHnxGkRIkoBF24DyaoTMIEoeh0W3geI+RBlArCI0iz4D+RVAzEasfqLVAQ19AcSg5LoYiKWI1kiiQgCMBLnEEcfDSgAAAABJRU5ErkJggg==");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.d-not-pause{
|
|
64
|
-
background-image: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
17
|
+
.d-video-mute-btn {
|
|
18
|
+
position: absolute;
|
|
19
|
+
background-repeat: no-repeat;
|
|
20
|
+
background-position: center center;
|
|
21
|
+
background-size: 100%;
|
|
22
|
+
z-index: 20;
|
|
23
|
+
width: 24px;
|
|
24
|
+
height: 24px;
|
|
25
|
+
}
|
|
26
|
+
.d-mute-btn-topLeft {
|
|
27
|
+
left: 20px;
|
|
28
|
+
top: 20px;
|
|
29
|
+
}
|
|
30
|
+
.d-mute-btn-topRight {
|
|
31
|
+
right: 20px;
|
|
32
|
+
top: 20px;
|
|
33
|
+
}
|
|
34
|
+
.d-mute-btn-bottomLeft {
|
|
35
|
+
left: 20px;
|
|
36
|
+
bottom: 20px;
|
|
37
|
+
}
|
|
38
|
+
.d-mute-btn-bottomRight {
|
|
39
|
+
right: 20px;
|
|
40
|
+
bottom: 20px;
|
|
41
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
1
|
if (!isH5 || !ref.current) return
|
|
3
2
|
playVideo()
|
|
4
3
|
manualPauseStateRef.current = false
|
|
5
4
|
}
|
|
6
5
|
if (!isH5 || !ref.current) return
|
|
7
6
|
pauseVideo()
|
|
8
7
|
manualPauseStateRef.current = true
|
|
9
8
|
}
|
|
10
9
|
if (!isH5 || !ref.current) return
|
|
11
10
|
}, [])
|
|
11
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
12
12
|
isH5,
|
|
13
13
|
addHttps,
|
|
14
14
|
isH5AndJingGouMini,
|
|
15
15
|
isH5AndJdShopView,
|
|
16
16
|
(props: ComponentInterFace.CustomVideoProps, ref: any) => {
|
|
17
17
|
const {
|
|
18
18
|
style,
|
|
19
19
|
videoStyle,
|
|
20
20
|
src,
|
|
21
21
|
width,
|
|
22
22
|
height,
|
|
23
23
|
controls,
|
|
24
24
|
poster,
|
|
25
25
|
autoplay,
|
|
26
26
|
loop,
|
|
27
27
|
showMuteBtn,
|
|
28
28
|
muteButtonPostion,
|
|
29
29
|
showFullscreenBtn,
|
|
30
30
|
muteBtnPicSrcObj,
|
|
31
31
|
muteBtnClassName,
|
|
32
32
|
objectFit,
|
|
33
33
|
mockAutoplay,
|
|
34
34
|
threshold,
|
|
35
35
|
onPlayCallback,
|
|
36
36
|
onPauseCallback,
|
|
37
37
|
onVideoApiCall,
|
|
38
38
|
inViewCallback,
|
|
39
39
|
outViewCallback,
|
|
40
40
|
} = props
|
|
41
41
|
const [videoMutedState, setVideoMutedState] = useState(MUTED)
|
|
42
42
|
const manualPauseStateRef = useRef(false)
|
|
43
43
|
const initPlayStatusRef = useRef(false)
|
|
44
44
|
const isInViewStateRef = useRef(false)
|
|
45
45
|
const disposeRef = useRef<Function | null>()
|
|
46
46
|
ref === null && (ref = useRef<HTMLVideoElement | null>())
|
|
47
47
|
|
|
48
48
|
const playVideo = useCallback(() => {
|
|
49
49
|
if (ref && ref.current) {
|
|
50
50
|
const result = ref.current.play()
|
|
51
51
|
result &&
|
|
52
52
|
result
|
|
53
53
|
.then(() => {
|
|
54
54
|
console.log('播放成功')
|
|
55
55
|
})
|
|
56
56
|
.catch((e) => {
|
|
57
57
|
console.log('playVideo Error:', e.message)
|
|
58
58
|
})
|
|
59
59
|
}
|
|
60
60
|
}, [])
|
|
61
61
|
|
|
62
62
|
const pauseVideo = useCallback(() => {
|
|
63
63
|
if (ref && ref.current) {
|
|
64
64
|
console.log('pauseVideo')
|
|
65
65
|
ref.current.pause()
|
|
66
66
|
}
|
|
67
67
|
}, [])
|
|
68
68
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
if (!isH5 || !ref.current) return
|
|
71
71
|
if (autoplay && mockAutoplay) {
|
|
72
72
|
|
|
73
73
|
const callInitAutoplay = () => {
|
|
74
74
|
console.log(
|
|
75
75
|
'callInitAutoplay:',
|
|
76
76
|
autoplay,
|
|
77
77
|
'initPlayStatusRef:',
|
|
78
78
|
initPlayStatusRef.current,
|
|
79
79
|
'isInViewStateRef:',
|
|
80
80
|
isInViewStateRef.current,
|
|
81
81
|
'paused:',
|
|
82
82
|
ref.current.paused,
|
|
83
83
|
)
|
|
84
84
|
if (
|
|
85
85
|
autoplay &&
|
|
86
86
|
mockAutoplay &&
|
|
87
87
|
!initPlayStatusRef.current &&
|
|
88
88
|
isInViewStateRef.current &&
|
|
89
89
|
ref.current.paused
|
|
90
90
|
) {
|
|
91
91
|
console.log('callInitAutoplay playVideo')
|
|
92
92
|
playVideo()
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
const onWeixinJSBridgeReady = (e) => {
|
|
96
96
|
console.log('onWeixinJSBridgeReady:', e.type)
|
|
97
97
|
callInitAutoplay()
|
|
98
98
|
}
|
|
99
99
|
const onTouchstart = (e) => {
|
|
100
100
|
console.log('onTouchstart:', e.type)
|
|
101
101
|
callInitAutoplay()
|
|
102
102
|
}
|
|
103
103
|
const onScroll = (e) => {
|
|
104
104
|
console.log('onScroll:', e.type)
|
|
105
105
|
callInitAutoplay()
|
|
106
106
|
}
|
|
107
107
|
const onPlay = (e) => {
|
|
108
108
|
console.log('onPlay:', e.type)
|
|
109
109
|
if (!initPlayStatusRef.current) {
|
|
110
110
|
const dispose = disposeRef.current
|
|
111
111
|
console.log('onPlay dispose:', dispose)
|
|
112
112
|
dispose && dispose()
|
|
113
113
|
disposeRef.current = null
|
|
114
114
|
}
|
|
115
115
|
initPlayStatusRef.current = true
|
|
116
116
|
}
|
|
117
117
|
document?.addEventListener('WeixinJSBridgeReady', onWeixinJSBridgeReady)
|
|
118
118
|
document?.addEventListener('touchstart', onTouchstart)
|
|
119
119
|
document?.addEventListener('scroll', onScroll)
|
|
120
120
|
ref.current.addEventListener('play', onPlay)
|
|
121
121
|
const dispose = () => {
|
|
122
122
|
console.log('调用dispose')
|
|
123
123
|
document?.removeEventListener(
|
|
124
124
|
'WeixinJSBridgeReady',
|
|
125
125
|
onWeixinJSBridgeReady,
|
|
126
126
|
)
|
|
127
127
|
document?.removeEventListener('touchstart', onTouchstart)
|
|
128
128
|
document?.removeEventListener('scroll', onScroll)
|
|
129
129
|
ref?.current?.removeEventListener('play', onPlay)
|
|
130
130
|
}
|
|
131
131
|
disposeRef.current = dispose
|
|
132
132
|
}
|
|
133
133
|
!autoplay && (manualPauseStateRef.current = true)
|
|
134
134
|
const handleVideoPlayApiCall = () => {
|
|
135
135
|
if (!isH5 || !ref.current) return
|
|
136
136
|
playVideo()
|
|
137
137
|
manualPauseStateRef.current = false
|
|
138
138
|
}
|
|
139
139
|
const handleVideoPauseApiCall = () => {
|
|
140
140
|
if (!isH5 || !ref.current) return
|
|
141
141
|
pauseVideo()
|
|
142
142
|
manualPauseStateRef.current = true
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
if (onVideoApiCall) {
|
|
146
146
|
onVideoApiCall({
|
|
147
147
|
play: handleVideoPlayApiCall,
|
|
148
148
|
pause: handleVideoPauseApiCall,
|
|
149
149
|
})
|
|
150
150
|
}
|
|
151
151
|
return () => {
|
|
152
152
|
const dispose = disposeRef.current
|
|
153
153
|
dispose && dispose()
|
|
154
154
|
disposeRef.current = null
|
|
155
155
|
}
|
|
156
156
|
}, [])
|
|
157
157
|
|
|
158
158
|
const handleMuted = useCallback(() => {
|
|
159
159
|
if (!isH5 || !ref.current) return
|
|
160
160
|
const handleMutedState = ref.current.muted
|
|
161
161
|
if (handleMutedState === true) {
|
|
162
162
|
ref.current.muted = false
|
|
163
163
|
setVideoMutedState(false)
|
|
164
164
|
} else {
|
|
165
165
|
ref.current.muted = true
|
|
166
166
|
setVideoMutedState(true)
|
|
167
167
|
}
|
|
168
168
|
}, [videoMutedState])
|
|
169
169
|
|
|
170
170
|
const handleVideoInViewCallback = useCallback(() => {
|
|
171
171
|
if (!isH5 || !ref.current) return
|
|
172
172
|
isInViewStateRef.current = true
|
|
173
173
|
console.log(
|
|
174
174
|
'进入可视区域,initPlayStatusRef:',
|
|
175
175
|
initPlayStatusRef.current,
|
|
176
176
|
'isInViewStateRef:',
|
|
177
177
|
isInViewStateRef.current,
|
|
178
178
|
)
|
|
179
179
|
if (
|
|
180
180
|
autoplay &&
|
|
181
181
|
mockAutoplay &&
|
|
182
182
|
!initPlayStatusRef.current &&
|
|
183
183
|
ref.current.paused
|
|
184
184
|
) {
|
|
185
185
|
console.log('进入可视区域了 callInitAutoplay playVideo')
|
|
186
186
|
playVideo()
|
|
187
187
|
} else if (!manualPauseStateRef.current && ref.current.paused) {
|
|
188
188
|
playVideo()
|
|
189
189
|
}
|
|
190
190
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
191
191
|
}, [])
|
|
192
192
|
|
|
193
193
|
const handleVideoOutViewCallback = useCallback(() => {
|
|
194
194
|
if (!isH5 || !ref.current) return
|
|
195
195
|
isInViewStateRef.current = false
|
|
196
196
|
console.log(
|
|
197
197
|
'不在可视区域, 视频暂停了, isInViewStateRef:',
|
|
198
198
|
isInViewStateRef.current,
|
|
199
199
|
)
|
|
200
200
|
pauseVideo()
|
|
201
201
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
202
202
|
}, [])
|
|
203
203
|
|
|
204
204
|
const getVideoWidthAndHeightStyle = () => {
|
|
205
205
|
const style = {}
|
|
206
206
|
width && (style['width'] = width)
|
|
207
207
|
height && (style['height'] = height)
|
|
208
208
|
return style
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
const getMuteBtnBackgroundImageStyle = useCallback(() => {
|
|
212
212
|
const isMutedPicSrc = muteBtnPicSrcObj?.IS_MUTED
|
|
213
213
|
const notMutedPicSrc = muteBtnPicSrcObj?.NOT_MUTED
|
|
214
214
|
const finalIsMutedPicSrc =
|
|
215
215
|
typeof isMutedPicSrc !== 'undefined' && isMutedPicSrc !== ''
|
|
216
216
|
? isMutedPicSrc
|
|
217
217
|
: DEFAULT_MUTE_BTN_PIC.IS_MUTED
|
|
218
218
|
const finalNotMutedPicSrc =
|
|
219
219
|
typeof notMutedPicSrc !== 'undefined' && notMutedPicSrc !== ''
|
|
220
220
|
? notMutedPicSrc
|
|
221
221
|
: DEFAULT_MUTE_BTN_PIC.NOT_MUTED
|
|
222
222
|
return {
|
|
223
223
|
backgroundImage: `url(${
|
|
224
224
|
videoMutedState ? finalIsMutedPicSrc : finalNotMutedPicSrc
|
|
225
225
|
})`,
|
|
226
226
|
}
|
|
227
227
|
}, [videoMutedState])
|
|
228
228
|
console.log('autoplay:', autoplay, 'muted:', MUTED)
|
|
229
229
|
console.log('isH5:', isH5, 'isH5AndJingGouMini:', isH5AndJingGouMini)
|
|
230
230
|
return src ? (
|
|
231
231
|
<InOrOutViewObserver
|
|
232
232
|
inViewCallback={handleVideoInViewCallback}
|
|
233
233
|
outViewCallback={handleVideoOutViewCallback}
|
|
234
234
|
threshold={threshold}
|
|
235
235
|
>
|
|
236
236
|
{isH5 ? (
|
|
237
237
|
<View
|
|
238
238
|
className={customVideoStyle['d-video-wrap']}
|
|
239
239
|
style={{ ...style, ...getVideoWidthAndHeightStyle() }}
|
|
240
240
|
>
|
|
241
241
|
<video
|
|
242
242
|
style={{ ...videoStyle }}
|
|
243
243
|
className={customVideoStyle['d-video-play']}
|
|
244
244
|
src={src}
|
|
245
245
|
controls={controls}
|
|
246
246
|
poster={poster ? addHttps(poster) : ''}
|
|
247
247
|
ref={ref}
|
|
248
248
|
loop={loop}
|
|
249
249
|
autoPlay={autoplay}
|
|
250
250
|
muted={MUTED}
|
|
251
251
|
x5-playsinline="true"
|
|
252
252
|
playsInline
|
|
253
253
|
webkit-playsinline="true"
|
|
254
254
|
controlsList={
|
|
255
255
|
isH5AndJdShopView
|
|
256
256
|
? 'nodownload nofullscreen noremoteplayback'
|
|
257
257
|
: ''
|
|
258
258
|
}
|
|
259
259
|
onPlay={onPlayCallback}
|
|
260
260
|
onPause={onPauseCallback}
|
|
261
261
|
/>
|
|
262
262
|
{!controls && showMuteBtn && (
|
|
263
263
|
<View
|
|
264
264
|
className={classNames(
|
|
265
265
|
customVideoStyle['d-video-mute-btn'],
|
|
266
266
|
customVideoStyle[`d-mute-btn-${muteButtonPostion}`],
|
|
267
267
|
`${muteBtnClassName}`,
|
|
268
268
|
)}
|
|
269
269
|
style={getMuteBtnBackgroundImageStyle()}
|
|
270
270
|
onClick={handleMuted}
|
|
271
271
|
></View>
|
|
272
272
|
)}
|
|
273
273
|
</View>
|
|
274
274
|
) : (
|
|
275
275
|
<Video
|
|
276
276
|
style={{ ...videoStyle }}
|
|
277
277
|
ref={ref}
|
|
278
278
|
className={customVideoStyle['d-video-play']}
|
|
279
279
|
src={src}
|
|
280
280
|
controls={controls}
|
|
281
281
|
poster={poster ? addHttps(poster) : ''}
|
|
282
282
|
loop={loop}
|
|
283
283
|
autoplay={autoplay}
|
|
284
284
|
muted={MUTED}
|
|
285
285
|
showMuteBtn={showMuteBtn}
|
|
286
286
|
showFullscreenBtn={showFullscreenBtn}
|
|
287
287
|
objectFit={objectFit}
|
|
288
288
|
onPlay={onPlayCallback}
|
|
289
289
|
onPause={onPauseCallback}
|
|
290
290
|
/>
|
|
291
291
|
)}
|
|
292
292
|
</InOrOutViewObserver>
|
|
293
293
|
) : null
|
|
294
294
|
},
|
|
295
295
|
const buildType = process.env.BUILD_TYPE
|
|
296
296
|
const mockAutoplay = buildType === BUILD_TYPE.DECORATE ? false : true
|
|
297
297
|
return mockAutoplay
|
|
298
298
|
style: {},
|
|
299
299
|
videoStyle: {},
|
|
300
300
|
className: '',
|
|
301
301
|
src: '',
|
|
302
302
|
width: '100%',
|
|
303
303
|
height: '100%',
|
|
304
304
|
controls: false,
|
|
305
305
|
poster: '',
|
|
306
306
|
autoplay: true,
|
|
307
307
|
mockAutoplay: getDefaultMockAutoplay(),
|
|
308
308
|
loop: true,
|
|
309
309
|
showMuteBtn: true,
|
|
310
310
|
muteButtonPostion: 'topLeft',
|
|
311
311
|
muteBtnPicSrcObj: DEFAULT_MUTE_BTN_PIC,
|
|
312
312
|
muteBtnClassName: '',
|
|
313
313
|
showFullscreenBtn: false,
|
|
314
314
|
objectFit: 'cover',
|
|
315
315
|
threshold: 0.6,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { Button, View } from '@tarojs/components'
|
|
2
1
|
NetWorkErrorSubTip,
|
|
3
2
|
subMessage,
|
|
4
3
|
backgroundColorWhite,
|
|
5
4
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
6
5
|
const useErrorSubTip = subMessage? subMessage: NetWorkErrorSubTip[netWorkDataType]
|
|
7
6
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
8
7
|
const maxHeight = latestRes.displayHeight || 546
|
|
9
8
|
style={{maxHeight}}
|
|
10
9
|
{useErrorSubTip? <View className={netWorkErrorStyle['d-error-sub-tip']}>{useErrorSubTip}</View>: null}
|
|
11
10
|
<Button
|
|
12
11
|
onClick={refershInitData}
|
|
13
12
|
className={classNames(
|
|
14
13
|
netWorkErrorStyle['d-opt-btn'],
|
|
15
14
|
'd-button-no-border',
|
|
16
15
|
)}
|
|
17
16
|
plain
|
|
18
17
|
size="mini"
|
|
19
18
|
>
|
|
20
19
|
重新加载
|
|
21
20
|
</Button>
|
|
22
21
|
)}
|
|
23
22
|
subMessage: '',
|
|
23
|
+
import { Button, View } from '@tarojs/components'
|
|
24
24
|
NetWorkErrorSubTip,
|
|
25
25
|
subMessage,
|
|
26
26
|
backgroundColorWhite,
|
|
27
27
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
28
28
|
const useErrorSubTip = subMessage? subMessage: NetWorkErrorSubTip[netWorkDataType]
|
|
29
29
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
30
30
|
const maxHeight = latestRes.displayHeight || 546
|
|
31
31
|
style={{maxHeight}}
|
|
32
32
|
{useErrorSubTip? <View className={netWorkErrorStyle['d-error-sub-tip']}>{useErrorSubTip}</View>: null}
|
|
33
33
|
<Button
|
|
34
34
|
onClick={refershInitData}
|
|
35
35
|
className={classNames(
|
|
36
36
|
netWorkErrorStyle['d-opt-btn'],
|
|
37
37
|
'd-button-no-border',
|
|
38
38
|
)}
|
|
39
39
|
plain
|
|
40
40
|
size="mini"
|
|
41
41
|
>
|
|
42
42
|
重新加载
|
|
43
43
|
</Button>
|
|
44
44
|
)}
|
|
45
45
|
subMessage: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
subMessage?: string
|
|
3
2
|
customErrorIsvFloorModule?: React.ReactElement | undefined
|
|
4
3
|
containerIndex?: number
|
|
5
4
|
containerData?: any
|
|
6
5
|
shopTotalInfo?: any
|
|
7
6
|
selectContainerFn?: Function
|
|
8
7
|
selectContainerId?: string
|
|
9
8
|
placeHolderPreContainerId?: string
|
|
10
9
|
children?: any
|
|
11
10
|
style?: {
|
|
12
11
|
[key: string]: any
|
|
13
12
|
};
|
|
14
13
|
layoutLeftRightMargin?: number
|
|
15
14
|
}
|
|
15
|
+
import React from 'react'
|
|
16
16
|
subMessage?: string
|
|
17
17
|
customErrorIsvFloorModule?: React.ReactElement | undefined
|
|
18
18
|
containerIndex?: number
|
|
19
19
|
containerData?: any
|
|
20
20
|
shopTotalInfo?: any
|
|
21
21
|
selectContainerFn?: Function
|
|
22
22
|
selectContainerId?: string
|
|
23
23
|
placeHolderPreContainerId?: string
|
|
24
24
|
children?: any
|
|
25
25
|
style?: {
|
|
26
26
|
[key: string]: any
|
|
27
27
|
};
|
|
28
28
|
layoutLeftRightMargin?: number
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { isH5 } from '../utils'
|
|
1
|
+
import { isH5 } from '../utils'
|
|
2
2
|
CONFIG_TYPE_CATEGORY_PAGE= 25,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
console.log('京购商详页跳转:', this.jumpMiniPath.detail)
|
|
3
2
|
const getJsonParam = etModelInfo && logBaseInfo ? logBaseInfo : Object.assign({},{
|
|
4
3
|
shopid: global.info.queryInfo?.shopId,
|
|
5
4
|
},jsonParam)
|
|
5
|
+
import Taro from '@tarojs/taro'
|
|
6
6
|
SHOP_MENU_ID_NAME,
|
|
7
7
|
SHOP_MENU_ID_TYPE
|
|
8
8
|
|
|
9
9
|
console.log("[降级H5] jdJumpToShopCategory index.weapp")
|
|
10
10
|
this.jdJumpToAppMiniProgram(this.jumpMiniPath.shopx, {
|
|
11
11
|
shopId,
|
|
12
12
|
venderId,
|
|
13
13
|
tabActive:
|
|
14
14
|
SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY],
|
|
15
15
|
logEventInfo,
|
|
16
16
|
})
|
|
17
17
|
console.log('京购商详页跳转:', this.jumpMiniPath.detail)
|
|
18
18
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
19
19
|
this.jdJumpToShopCategory(
|
|
20
20
|
global.info.queryInfo.shopId,
|
|
21
21
|
global.info.queryInfo.venderId)
|
|
22
22
|
break
|
|
23
23
|
const getJsonParam = etModelInfo && logBaseInfo ? logBaseInfo : Object.assign({},{
|
|
24
24
|
shopid: global.info.queryInfo?.shopId,
|
|
25
25
|
},jsonParam)
|