@conecli/cone-render 0.8.38-beta.0 → 0.8.39
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/common/jssdk.ts +1 -1
- package/dist/common/pageType.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/jumpEventReport/const.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.wxapp.ts +1 -1
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
console.log('load token.jd')
|
|
2
1
|
return new Promise((resolve) => {
|
|
3
2
|
if (jmfe) {
|
|
4
3
|
jmfe.isJDAppLogin().then(({ data }) => {
|
|
5
4
|
if (data === '1') {
|
|
6
5
|
resolve(true)
|
|
7
6
|
} else if (data === '0') {
|
|
8
7
|
resolve(false)
|
|
9
8
|
}
|
|
10
9
|
})
|
|
11
10
|
} else {
|
|
12
11
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
13
12
|
resolve(false)
|
|
14
13
|
}
|
|
15
14
|
})
|
|
16
15
|
return requestIsvToken(window.location.href)
|
|
17
16
|
if (jmfe) {
|
|
18
17
|
jmfe.toLogin(options)
|
|
19
18
|
} else {
|
|
20
19
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
21
20
|
}
|
|
22
21
|
if (jmfe) {
|
|
23
22
|
console.log('registerCode:', code)
|
|
24
23
|
jmfe.registerCode(code)
|
|
25
24
|
} else {
|
|
26
25
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
27
26
|
}
|
|
28
27
|
return new Promise((resolve) => {
|
|
29
28
|
console.log('requestIsvToken:', url)
|
|
30
29
|
if (jmfe) {
|
|
31
30
|
jmfe
|
|
32
31
|
.requestIsvToken(url)
|
|
33
32
|
.then((result: any) => {
|
|
34
33
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
35
34
|
const { status, data, msg } = result
|
|
36
35
|
if (status === '0') {
|
|
37
36
|
resolve(data || '')
|
|
38
37
|
} else {
|
|
39
38
|
resolve('')
|
|
40
39
|
}
|
|
41
40
|
})
|
|
42
41
|
.catch((e: any) => {
|
|
43
42
|
console.log('requestIsvToken error:' + JSON.stringify(e))
|
|
44
43
|
resolve('')
|
|
45
44
|
})
|
|
46
45
|
} else {
|
|
47
46
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
48
47
|
resolve('')
|
|
49
48
|
}
|
|
50
49
|
})
|
|
50
|
+
console.log('load token.jd')
|
|
51
51
|
return new Promise((resolve) => {
|
|
52
52
|
if (window['jmfe']) {
|
|
53
53
|
window['jmfe'].isJDAppLogin().then(({ data }) => {
|
|
54
54
|
if (data === '1') {
|
|
55
55
|
resolve(true)
|
|
56
56
|
} else if (data === '0') {
|
|
57
57
|
resolve(false)
|
|
58
58
|
}
|
|
59
59
|
})
|
|
60
60
|
} else {
|
|
61
61
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
62
62
|
resolve(false)
|
|
63
63
|
}
|
|
64
64
|
})
|
|
65
65
|
return requestIsvToken(window.location.href)
|
|
66
66
|
if (window['jmfe']) {
|
|
67
67
|
window['jmfe'].toLogin(options)
|
|
68
68
|
} else {
|
|
69
69
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
70
70
|
}
|
|
71
71
|
if (window['jmfe']) {
|
|
72
72
|
console.log('registerCode:', code)
|
|
73
73
|
window['jmfe'].registerCode(code)
|
|
74
74
|
} else {
|
|
75
75
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
76
76
|
}
|
|
77
77
|
return new Promise((resolve) => {
|
|
78
78
|
console.log('requestIsvToken:', url)
|
|
79
79
|
if (window['jmfe']) {
|
|
80
80
|
window['jmfe']
|
|
81
81
|
.requestIsvToken(url)
|
|
82
82
|
.then((result: any) => {
|
|
83
83
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
84
84
|
const { status, data, msg } = result
|
|
85
85
|
if (status === '0') {
|
|
86
86
|
resolve(data || '')
|
|
87
87
|
} else {
|
|
88
88
|
resolve('')
|
|
89
89
|
}
|
|
90
90
|
})
|
|
91
91
|
.catch((e: any) => {
|
|
92
92
|
console.log('requestIsvToken error:' + JSON.stringify(e))
|
|
93
93
|
resolve('')
|
|
94
94
|
})
|
|
95
95
|
} else {
|
|
96
96
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
97
97
|
resolve('')
|
|
98
98
|
}
|
|
99
99
|
})
|
|
@@ -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
|
const GetSlideAngle = (dx,dy) => {
|
|
12
11
|
return Math.atan2(dy,dx) * 180 / Math.PI;
|
|
13
12
|
}
|
|
14
13
|
const GetSlideDirection = (startX,startY,endX,endY) => {
|
|
15
14
|
const dy = startY - endY;
|
|
16
15
|
const dx = endX - startX;
|
|
17
16
|
let result = 0;
|
|
18
17
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
19
18
|
return result;
|
|
20
19
|
}
|
|
21
20
|
const angle = GetSlideAngle(dx, dy);
|
|
22
21
|
if (angle >= -45 && angle < 45) {
|
|
23
22
|
result = 4;
|
|
24
23
|
}else if (angle >= 45 && angle < 135) {
|
|
25
24
|
result = 1;
|
|
26
25
|
}else if (angle >= -135 && angle < -45) {
|
|
27
26
|
result = 2;
|
|
28
27
|
}else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
29
28
|
result = 3;
|
|
30
29
|
}
|
|
31
30
|
return result;
|
|
32
31
|
}
|
|
33
32
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
34
33
|
const touchEvent =
|
|
35
34
|
e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
|
|
36
35
|
const xDiff = Math.abs(
|
|
37
36
|
touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
|
|
38
37
|
).toFixed(2)
|
|
39
38
|
const yDiff = Math.abs(
|
|
40
39
|
touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
|
|
41
40
|
).toFixed(2)
|
|
42
41
|
if(isAndroidDevice) {
|
|
43
42
|
if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
|
|
44
43
|
console.log(
|
|
45
44
|
'横向滚动触发',
|
|
46
45
|
xDiff,
|
|
47
46
|
touchEvent,
|
|
48
47
|
window.JDJshopViewInfo.androidTouchSlop,
|
|
49
48
|
)
|
|
50
49
|
} else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
|
|
51
50
|
console.log(
|
|
52
51
|
'纵向滚动触发',
|
|
53
52
|
yDiff,
|
|
54
53
|
touchEvent,
|
|
55
54
|
window.JDJshopViewInfo.androidTouchSlop,
|
|
56
55
|
)
|
|
57
56
|
androidDeviceStopNativeScrollEvent(false)
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
if(needShowHighVersion) {
|
|
61
60
|
const direction = GetSlideDirection(mLastClientPosRef.current.mLastClientX, mLastClientPosRef.current.mLastClientY, touchEvent.clientX, touchEvent.clientY);
|
|
62
61
|
if(direction === 1 || direction === 2) {
|
|
63
62
|
rootEleNode && rootEleNode.classList.remove('over-hidden')
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
<ScrollView
|
|
67
66
|
scrollX
|
|
68
67
|
onTouchStart={changeTouchStart}
|
|
69
68
|
onTouchEnd={changeTouchEnd}
|
|
70
69
|
onTouchCancel={changeTouchEnd}
|
|
71
70
|
onTouchMove={changeTouchMove}
|
|
72
71
|
enhanced
|
|
73
72
|
showScrollbar={false}
|
|
74
73
|
style={style}
|
|
75
74
|
className={classNames(className, {
|
|
76
75
|
[customScrollViewStyle[
|
|
77
76
|
'd-custom-ios-h5-extend-border-radius'
|
|
78
77
|
]]: isIosDevice,
|
|
79
78
|
},'J_customScroll')}
|
|
80
79
|
{...otherProps}
|
|
81
80
|
>
|
|
82
81
|
{children}
|
|
83
82
|
</ScrollView>
|
|
83
|
+
import React, {useRef, useEffect} from 'react'
|
|
84
84
|
isH5AndJdShopView,
|
|
85
85
|
isAndroidDevice,
|
|
86
86
|
isIosDevice,
|
|
87
87
|
isJdApp,
|
|
88
88
|
isWxMin,
|
|
89
89
|
isH5AndJdShopViewH5Scroll,
|
|
90
90
|
isH5,
|
|
91
91
|
START: 'start',
|
|
92
92
|
END: 'end'
|
|
93
93
|
const rootEleNode = isH5 && document ? document.querySelector('body') : null
|
|
94
94
|
const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
|
|
95
95
|
const iosDeviceStopNativeScrollEvent = (e, touchType) => {
|
|
96
96
|
e && e.stopPropagation()
|
|
97
97
|
iosDeviceSendRouter(touchType)
|
|
98
98
|
}
|
|
99
99
|
const iosDeviceSendRouter = (state) => {
|
|
100
100
|
window.webkit.messageHandlers.MobileNavi.postMessage?.({
|
|
101
101
|
method: 'callRouterModuleWithParams',
|
|
102
102
|
params: {
|
|
103
103
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
104
104
|
routerParam: { slideDirection: 'horizontal', state },
|
|
105
105
|
callBackId: new Date().getTime(),
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
isAndroidDevice && androidDeviceStopNativeScrollEvent(touchType)
|
|
110
110
|
const GetSlideAngle = (dx,dy) => {
|
|
111
111
|
return Math.atan2(dy,dx) * 180 / Math.PI;
|
|
112
112
|
}
|
|
113
113
|
const GetSlideDirection = (startX,startY,endX,endY) => {
|
|
114
114
|
const dy = startY - endY;
|
|
115
115
|
const dx = endX - startX;
|
|
116
116
|
let result = 0;
|
|
117
117
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
118
118
|
return result;
|
|
119
119
|
}
|
|
120
120
|
const angle = GetSlideAngle(dx, dy);
|
|
121
121
|
if (angle >= -45 && angle < 45) {
|
|
122
122
|
result = 4;
|
|
123
123
|
}else if (angle >= 45 && angle < 135) {
|
|
124
124
|
result = 1;
|
|
125
125
|
}else if (angle >= -135 && angle < -45) {
|
|
126
126
|
result = 2;
|
|
127
127
|
}else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
128
128
|
result = 3;
|
|
129
129
|
}
|
|
130
130
|
return result;
|
|
131
131
|
}
|
|
132
132
|
needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
|
|
133
133
|
stopNativeScrollEvent(e,TouchType.END)
|
|
134
134
|
const touchEvent =
|
|
135
135
|
e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
|
|
136
136
|
const xDiff = Math.abs(
|
|
137
137
|
touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
|
|
138
138
|
).toFixed(2)
|
|
139
139
|
const yDiff = Math.abs(
|
|
140
140
|
touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
|
|
141
141
|
).toFixed(2)
|
|
142
142
|
if(isAndroidDevice) {
|
|
143
143
|
if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
|
|
144
144
|
console.log(
|
|
145
145
|
'横向滚动触发',
|
|
146
146
|
xDiff,
|
|
147
147
|
touchEvent,
|
|
148
148
|
window.JDJshopViewInfo.androidTouchSlop,
|
|
149
149
|
)
|
|
150
150
|
} else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
|
|
151
151
|
console.log(
|
|
152
152
|
'纵向滚动触发',
|
|
153
153
|
yDiff,
|
|
154
154
|
touchEvent,
|
|
155
155
|
window.JDJshopViewInfo.androidTouchSlop,
|
|
156
156
|
)
|
|
157
157
|
stopNativeScrollEvent(e,TouchType.END)
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
if(needShowHighVersion) {
|
|
161
161
|
const direction = GetSlideDirection(mLastClientPosRef.current.mLastClientX, mLastClientPosRef.current.mLastClientY, touchEvent.clientX, touchEvent.clientY);
|
|
162
162
|
if(direction === 1 || direction === 2) {
|
|
163
163
|
rootEleNode && rootEleNode.classList.remove('over-hidden')
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
<ScrollView
|
|
167
167
|
scrollX
|
|
168
168
|
onTouchStart={changeTouchStart}
|
|
169
169
|
onTouchEnd={changeTouchEnd}
|
|
170
170
|
onTouchCancel={changeTouchEnd}
|
|
171
171
|
onTouchMove={changeTouchMove}
|
|
172
172
|
enhanced
|
|
173
173
|
showScrollbar={false}
|
|
174
174
|
style={style}
|
|
175
175
|
className={classNames(className, {
|
|
176
176
|
[customScrollViewStyle[
|
|
177
177
|
'd-custom-ios-h5-extend-border-radius'
|
|
178
178
|
]]: isIosDevice,
|
|
179
179
|
},'J_customScroll')}
|
|
180
180
|
{...otherProps}
|
|
181
181
|
>
|
|
182
182
|
{children}
|
|
183
183
|
</ScrollView>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import track from '../../../open/api/track'
|
|
2
1
|
const {arr : arrTask, startWaitTime} = floorTask
|
|
3
2
|
const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
|
|
4
3
|
const arrTaskNum = arrTask.length;
|
|
5
4
|
const isOverMax = arrTaskNum >= 10
|
|
6
5
|
const hasData = arrTaskNum > 0
|
|
7
6
|
if(hasData && (isTimeout || isOverMax)){
|
|
8
7
|
const reduceData = connactData(arrTask)
|
|
9
8
|
track.reportExposureEventLog(reduceData)
|
|
10
9
|
floorTask.arr = []
|
|
11
10
|
floorTask.startWaitTime = 0
|
|
12
11
|
clearTimeout(floorTask.timer)
|
|
13
12
|
}
|
|
14
13
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
15
14
|
if(initData.jsonParam.etModelInfo) {
|
|
16
15
|
initData.jsonParam.logBaseInfo = []
|
|
17
16
|
initData.jsonParam.etModelInfo.lstms = []
|
|
18
17
|
return arr.reduce((acc, cur) => {
|
|
19
18
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
20
19
|
return acc
|
|
21
20
|
}, initData)
|
|
22
21
|
} else {
|
|
23
22
|
return arr.reduce((acc) => {
|
|
24
23
|
return acc
|
|
25
24
|
})
|
|
26
25
|
}
|
|
27
26
|
if(!Array.isArray(data)){
|
|
28
27
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
29
28
|
return
|
|
30
29
|
}
|
|
31
30
|
const [floorData, mInfo, etModelInfo] = data
|
|
32
31
|
if(floorData && mInfo && etModelInfo){
|
|
33
32
|
const isIsvReportModule = isvReportModuleTypeList.includes(floorData?.floorExtInfo?.moduleFlag)
|
|
34
33
|
try {
|
|
35
34
|
const reportJson = track.getExposureInfo(floorData, mInfo, etModelInfo,true, isIsvReportModule)
|
|
36
35
|
console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`,reportJson)
|
|
37
36
|
const { floorIdx } = floorData
|
|
38
37
|
if(!task[floorIdx]){
|
|
39
38
|
task[floorIdx] = {
|
|
40
39
|
arr: [],
|
|
41
40
|
startWaitTime: 0,
|
|
42
41
|
timer : 0
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
const floorTask = task[floorIdx]
|
|
46
45
|
if(floorTask.arr.length === 0){
|
|
47
46
|
floorTask.startWaitTime = Date.now()
|
|
48
47
|
}
|
|
49
48
|
if(reportJson){
|
|
50
49
|
floorTask.arr.push(reportJson)
|
|
51
50
|
clearTimeout(floorTask.timer)
|
|
52
51
|
floorTask.timer = setTimeout(() => {
|
|
53
52
|
check(floorTask)
|
|
54
53
|
}, 1000)
|
|
55
54
|
check(floorTask)
|
|
56
55
|
}
|
|
57
56
|
}catch (e) {
|
|
58
57
|
{
|
|
59
58
|
console.log('坑位曝光埋点出错啦',e)
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}else{
|
|
63
62
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
64
63
|
}
|
|
64
|
+
import track from '../../../open/api/track'
|
|
65
65
|
const {arr : arrTask, startWaitTime} = floorTask
|
|
66
66
|
const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
|
|
67
67
|
const arrTaskNum = arrTask.length;
|
|
68
68
|
const isOverMax = arrTaskNum >= 10
|
|
69
69
|
const hasData = arrTaskNum > 0
|
|
70
70
|
if(hasData && (isTimeout || isOverMax)){
|
|
71
71
|
const reduceData = connactData(arrTask)
|
|
72
72
|
track.reportExposureEventLog(reduceData)
|
|
73
73
|
floorTask.arr = []
|
|
74
74
|
floorTask.startWaitTime = 0
|
|
75
75
|
clearTimeout(floorTask.timer)
|
|
76
76
|
}
|
|
77
77
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
78
78
|
if(initData.jsonParam.etModelInfo) {
|
|
79
79
|
initData.jsonParam.logBaseInfo = []
|
|
80
80
|
initData.jsonParam.etModelInfo.lstms = []
|
|
81
81
|
return arr.reduce((acc, cur) => {
|
|
82
82
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
83
83
|
return acc
|
|
84
84
|
}, initData)
|
|
85
85
|
} else {
|
|
86
86
|
return arr.reduce((acc) => {
|
|
87
87
|
return acc
|
|
88
88
|
})
|
|
89
89
|
}
|
|
90
90
|
if(!Array.isArray(data)){
|
|
91
91
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
92
92
|
return
|
|
93
93
|
}
|
|
94
94
|
const [floorData, mInfo, etModelInfo] = data
|
|
95
95
|
if(floorData && mInfo && etModelInfo){
|
|
96
96
|
const isIsvReportModule = isvReportModuleTypeList.includes(floorData?.floorExtInfo?.moduleFlag)
|
|
97
97
|
try {
|
|
98
98
|
const reportJson = track.getExposureInfo(floorData, mInfo, etModelInfo,true, isIsvReportModule)
|
|
99
99
|
console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`,reportJson)
|
|
100
100
|
const { floorIdx } = floorData
|
|
101
101
|
if(!task[floorIdx]){
|
|
102
102
|
task[floorIdx] = {
|
|
103
103
|
arr: [],
|
|
104
104
|
startWaitTime: 0,
|
|
105
105
|
timer : 0
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
const floorTask = task[floorIdx]
|
|
109
109
|
if(floorTask.arr.length === 0){
|
|
110
110
|
floorTask.startWaitTime = Date.now()
|
|
111
111
|
}
|
|
112
112
|
if(reportJson){
|
|
113
113
|
floorTask.arr.push(reportJson)
|
|
114
114
|
clearTimeout(floorTask.timer)
|
|
115
115
|
floorTask.timer = setTimeout(() => {
|
|
116
116
|
check(floorTask)
|
|
117
117
|
}, 1000)
|
|
118
118
|
check(floorTask)
|
|
119
119
|
}
|
|
120
120
|
}catch (e) {
|
|
121
121
|
{
|
|
122
122
|
console.log('坑位曝光埋点出错啦',e)
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}else{
|
|
126
126
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
127
127
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React, { useEffect, useContext, useState } from 'react'
|
|
2
|
const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
|
|
1
3
|
useEffect(() => {
|
|
2
4
|
hasCommonHeader && initCommonHeader()
|
|
3
5
|
hasDownloadTips && initDownloadAppLayerConfigData()
|
|
4
6
|
}, [])
|
|
5
7
|
const initCommonHeader = () => {
|
|
6
8
|
if (window?.MCommonHeaderBottom) {
|
|
7
9
|
const mchb = new MCommonHeaderBottom()
|
|
8
10
|
const headerArg = {
|
|
9
11
|
moduleName: 'shop',
|
|
10
12
|
hrederId: 'm_common_header',
|
|
11
13
|
title,
|
|
12
14
|
stype: 1,
|
|
13
15
|
onClickJdkey: function () {
|
|
14
16
|
console.log('==>m_common_header jdkey click.')
|
|
15
17
|
},
|
|
16
18
|
...headerParams
|
|
17
19
|
}
|
|
18
20
|
mchb.header(headerArg)
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
const initDownloadAppLayerConfigData = () => {
|
|
22
24
|
const getEle = document.getElementById('m_common_tip')
|
|
23
25
|
getEle &&
|
|
24
26
|
window.$ &&
|
|
25
27
|
window.$.downloadAppLayerConfigData &&
|
|
26
28
|
window.$.downloadAppLayerConfigData({
|
|
27
29
|
tipId: 'm_common_tip',
|
|
28
30
|
M_sourceFrom: 'jshop',
|
|
29
31
|
bottom: 74,
|
|
30
32
|
onClickTipX: () => {
|
|
31
33
|
Taro.eventCenter.trigger(
|
|
32
34
|
TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
|
|
33
35
|
true,
|
|
34
36
|
)
|
|
35
37
|
},
|
|
36
38
|
downloadAppPlugIn: {
|
|
37
39
|
M_sourceFrom: 'jshop',
|
|
38
40
|
openAppBtnId: 'download_openapp',
|
|
39
41
|
downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
|
|
40
42
|
inteneUrl: 'openapp.jdmobile://virtual?',
|
|
41
43
|
inteneUrlParams: {
|
|
42
44
|
category: 'jump',
|
|
43
45
|
des: 'jshopMain',
|
|
44
46
|
shopId: `${global.info.queryInfo.shopId || ''}`,
|
|
45
47
|
venderId: `${global.info.queryInfo.venderId || ''}`,
|
|
46
48
|
sourceType: global.info.queryInfo?.sourceType || 'M-H5',
|
|
47
49
|
sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
|
|
48
50
|
...openAppParams,
|
|
49
51
|
},
|
|
50
52
|
},
|
|
51
53
|
})
|
|
52
54
|
}
|
|
53
55
|
return !isWxMiniH5View && !isJdApp ? (
|
|
54
56
|
<View
|
|
55
57
|
className={mobileCommonHeaderStyle['d-mobile-header-layout']}
|
|
56
58
|
style={style}
|
|
57
59
|
>
|
|
58
60
|
<View
|
|
59
61
|
id="m_common_tip"
|
|
60
62
|
className={mobileCommonHeaderStyle['d-mobile-common-tip']}
|
|
61
63
|
/>
|
|
62
64
|
{hasCommonHeader && (
|
|
63
65
|
<View
|
|
64
66
|
id="m_common_header"
|
|
65
67
|
className={mobileCommonHeaderStyle['d-mobile-common-header']}
|
|
66
68
|
/>
|
|
67
69
|
)}
|
|
68
70
|
</View>
|
|
69
71
|
) : null
|
|
70
72
|
title: '店铺',
|
|
71
73
|
openAppParams: {},
|
|
@@ -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: isMemberPage ? '100vh' : 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
|
NetWorkErrorList,
|
|
25
25
|
NetWorkErrorTip,
|
|
26
26
|
NetWorkErrorSubTip,
|
|
27
27
|
NetWorkShowType,
|
|
28
28
|
NetWork_Image_Type,
|
|
29
29
|
const {
|
|
30
30
|
className,
|
|
31
31
|
message,
|
|
32
32
|
subMessage,
|
|
33
33
|
btnLabel,
|
|
34
34
|
backgroundColorWhite,
|
|
35
35
|
netWorkDataType,
|
|
36
36
|
netWorkShowType,
|
|
37
37
|
netWorkImageType,
|
|
38
38
|
refreshCallBackFn,
|
|
39
39
|
} = props
|
|
40
40
|
const refershInitData = useCallback(() => {
|
|
41
41
|
refreshCallBackFn && refreshCallBackFn(true)
|
|
42
42
|
}, [])
|
|
43
43
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
44
44
|
const useErrorSubTip = subMessage
|
|
45
45
|
? subMessage
|
|
46
46
|
: NetWorkErrorSubTip[netWorkDataType]
|
|
47
47
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
48
48
|
const maxHeight = latestRes.displayHeight || 546
|
|
49
49
|
return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
|
|
50
50
|
<View
|
|
51
51
|
style={{ maxHeight: isMemberPage ? '100vh' : maxHeight }}
|
|
52
52
|
className={classNames(
|
|
53
53
|
netWorkErrorStyle['d-shop-network'],
|
|
54
54
|
{
|
|
55
55
|
[netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
[netWorkErrorStyle['d-shop-network-part']]:
|
|
59
59
|
netWorkShowType === NetWorkShowType.PART,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
[netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
|
|
63
63
|
},
|
|
64
64
|
'flexible-center-box',
|
|
65
65
|
className,
|
|
66
66
|
)}
|
|
67
67
|
>
|
|
68
68
|
<View className={netWorkErrorStyle['d-error-content']}>
|
|
69
69
|
<View
|
|
70
70
|
className={classNames(
|
|
71
71
|
netWorkErrorStyle['d-error-type'],
|
|
72
72
|
netWorkErrorStyle[`d-${netWorkDataType}`],
|
|
73
73
|
netWorkErrorStyle[`d-${netWorkImageType}`],
|
|
74
74
|
)}
|
|
75
75
|
/>
|
|
76
76
|
<View className={netWorkErrorStyle['d-error-tip']}>{useErrorTip}</View>
|
|
77
77
|
{useErrorSubTip ? (
|
|
78
78
|
<View className={netWorkErrorStyle['d-error-sub-tip']}>
|
|
79
79
|
{useErrorSubTip}
|
|
80
80
|
</View>
|
|
81
81
|
) : null}
|
|
82
82
|
<View className={'flexible-horizontal-center-box'}>
|
|
83
83
|
{refreshCallBackFn && (
|
|
84
84
|
<Button
|
|
85
85
|
onClick={refershInitData}
|
|
86
86
|
className={classNames(
|
|
87
87
|
netWorkErrorStyle['d-opt-btn'],
|
|
88
88
|
'd-button-no-border',
|
|
89
89
|
)}
|
|
90
90
|
plain
|
|
91
91
|
size="mini"
|
|
92
92
|
>
|
|
93
93
|
{btnLabel}
|
|
94
94
|
</Button>
|
|
95
95
|
)}
|
|
96
96
|
</View>
|
|
97
97
|
</View>
|
|
98
98
|
</View>
|
|
99
99
|
) : null
|
|
100
100
|
className: '',
|
|
101
101
|
message: '',
|
|
102
102
|
subMessage: '',
|
|
103
103
|
btnLabel: '重新加载',
|
|
104
104
|
backgroundColorWhite: false,
|
|
105
105
|
netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
|
|
106
106
|
netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
|
|
107
107
|
netWorkShowType: NetWorkShowType.FULL,
|
|
108
108
|
refreshCallBackFn: null,
|