@conecli/cone-render 0.8.19 → 0.8.20-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/api/index.ts +1 -1
- 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/isvStorage/index.h5.ts +1 -0
- package/dist/common/isvStorage/index.ts +1 -0
- package/dist/common/token/const.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -0
- package/dist/common/token/index.ts +1 -0
- package/dist/common/token/token.jd.ts +1 -0
- package/dist/common/token/token.ts +1 -0
- package/dist/common/token/token.wxapp.ts +1 -0
- package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CustomVideo/const.ts +1 -0
- package/dist/components/base/CustomVideo/index.module.scss +40 -64
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +6 -2
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.h5.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/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +3 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
- package/dist/components/base/Price/Base/index.module.scss +136 -0
- package/dist/components/base/Price/Base/index.tsx +1 -0
- package/dist/components/base/Price/Double/index.module.scss +158 -0
- package/dist/components/base/Price/Double/index.tsx +1 -0
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -0
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.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/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.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 -0
- 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/open/api/index.ts +1 -1
- package/dist/open/api/jump/business.ts +1 -0
- package/dist/open/api/jump/index.ts +1 -0
- package/dist/open/api/jump/minPath.ts +1 -0
- package/dist/open/api/jump/side.ts +1 -0
- package/dist/open/api/jump/webUrl.ts +1 -0
- package/dist/open/api/jump copy.ts +1 -0
- package/dist/open/api/moduleUtil.ts +1 -1
- package/dist/open/api/request.ts +1 -0
- package/dist/open/api/shopMember.ts +1 -0
- package/dist/open/api/userToken.ts +1 -0
- package/dist/service/bMallConst.ts +1 -0
- package/dist/service/bMallConst.wxapp.ts +1 -0
- package/dist/service/fetchGateway.ts +1 -0
- package/dist/service/fetchJsonp.ts +1 -0
- package/dist/service/http/colorSign.ts +1 -0
- package/dist/service/http/colorSign.wxapp.ts +1 -0
- package/dist/service/http/const.ts +1 -0
- package/dist/service/http/http.ts +1 -0
- package/dist/service/http/httpInterceptors.jd.ts +1 -0
- package/dist/service/http/httpInterceptors.ts +1 -0
- package/dist/service/http/index.ts +1 -0
- package/dist/service/requestServer.ts +1 -0
- 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/jm-common.js +1 -1
- package/dist/utils/memberFormatUtils.js +1 -0
- package/dist/utils/priceUtils.js +1 -0
- package/dist/utils/ready.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +5 -4
- package/dist/components/base/Price/index.module.scss +0 -136
- package/dist/open/api/jump.ts +0 -1
|
@@ -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 isOverMax = arrTask.length >= 10
|
|
5
4
|
const hasData = arrTask.length > 0
|
|
6
5
|
if(hasData && (isTimeout || isOverMax)){
|
|
7
6
|
const reduceData = connactData(arrTask)
|
|
8
7
|
track.reportExposureEventLog(reduceData)
|
|
9
8
|
floorTask.arr = []
|
|
10
9
|
floorTask.startWaitTime = 0
|
|
11
10
|
clearTimeout(floorTask.timer)
|
|
12
11
|
}
|
|
13
12
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
14
13
|
initData.jsonParam.logBaseInfo = []
|
|
15
14
|
initData.jsonParam.etModelInfo.lstms = []
|
|
16
15
|
return arr.reduce((acc, cur) => {
|
|
17
16
|
cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo.pos
|
|
18
17
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
19
18
|
acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
|
|
20
19
|
return acc
|
|
21
20
|
}, initData)
|
|
22
21
|
if(!Array.isArray(data)){
|
|
23
22
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
24
23
|
return
|
|
25
24
|
}
|
|
26
25
|
const [floorData, mInfo, etModelInfo] = data
|
|
27
26
|
if(floorData && mInfo && etModelInfo){
|
|
28
27
|
const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
|
|
29
28
|
const { floorIdx } = floorData
|
|
30
29
|
if(!task[floorIdx]){
|
|
31
30
|
task[floorIdx] = {
|
|
32
31
|
arr: [],
|
|
33
32
|
startWaitTime: 0,
|
|
34
33
|
timer : 0
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
const floorTask = task[floorIdx]
|
|
38
37
|
if(floorTask.arr.length === 0){
|
|
39
38
|
floorTask.startWaitTime = Date.now()
|
|
40
39
|
}
|
|
41
40
|
if(reportJson){
|
|
42
41
|
floorTask.arr.push(reportJson)
|
|
43
42
|
clearTimeout(floorTask.timer)
|
|
44
43
|
floorTask.timer = setTimeout(() => {
|
|
45
44
|
check(floorTask)
|
|
46
45
|
}, 1000)
|
|
47
46
|
check(floorTask)
|
|
48
47
|
}
|
|
49
48
|
}else{
|
|
50
49
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
51
50
|
}
|
|
51
|
+
import track from '../../../open/api/track'
|
|
52
52
|
const {arr : arrTask, startWaitTime} = floorTask
|
|
53
53
|
const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
|
|
54
54
|
const isOverMax = arrTask.length >= 10
|
|
55
55
|
const hasData = arrTask.length > 0
|
|
56
56
|
if(hasData && (isTimeout || isOverMax)){
|
|
57
57
|
const reduceData = connactData(arrTask)
|
|
58
58
|
track.reportExposureEventLog(reduceData)
|
|
59
59
|
floorTask.arr = []
|
|
60
60
|
floorTask.startWaitTime = 0
|
|
61
61
|
clearTimeout(floorTask.timer)
|
|
62
62
|
}
|
|
63
63
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
64
64
|
if(initData.jsonParam.etModelInfo) {
|
|
65
65
|
initData.jsonParam.logBaseInfo = []
|
|
66
66
|
initData.jsonParam.etModelInfo.lstms = []
|
|
67
67
|
return arr.reduce((acc, cur) => {
|
|
68
68
|
cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo?.pos
|
|
69
69
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
70
70
|
acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
|
|
71
71
|
return acc
|
|
72
72
|
}, initData)
|
|
73
73
|
} else {
|
|
74
74
|
return arr.reduce((acc) => {
|
|
75
75
|
return acc
|
|
76
76
|
})
|
|
77
77
|
}
|
|
78
78
|
if(!Array.isArray(data)){
|
|
79
79
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
80
80
|
return
|
|
81
81
|
}
|
|
82
82
|
const [floorData, mInfo, etModelInfo] = data
|
|
83
83
|
if(floorData && mInfo && etModelInfo){
|
|
84
84
|
try {
|
|
85
85
|
const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
|
|
86
86
|
console.log('reportJson',reportJson)
|
|
87
87
|
const { floorIdx } = floorData
|
|
88
88
|
if(!task[floorIdx]){
|
|
89
89
|
task[floorIdx] = {
|
|
90
90
|
arr: [],
|
|
91
91
|
startWaitTime: 0,
|
|
92
92
|
timer : 0
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
const floorTask = task[floorIdx]
|
|
96
96
|
if(floorTask.arr.length === 0){
|
|
97
97
|
floorTask.startWaitTime = Date.now()
|
|
98
98
|
}
|
|
99
99
|
if(reportJson){
|
|
100
100
|
floorTask.arr.push(reportJson)
|
|
101
101
|
clearTimeout(floorTask.timer)
|
|
102
102
|
floorTask.timer = setTimeout(() => {
|
|
103
103
|
check(floorTask)
|
|
104
104
|
}, 1000)
|
|
105
105
|
check(floorTask)
|
|
106
106
|
}
|
|
107
107
|
}catch (e) {
|
|
108
108
|
{
|
|
109
109
|
console.log('坑位曝光埋点出错啦',e)
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}else{
|
|
113
113
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
114
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
TaroEventType,
|
|
3
2
|
WEBVIEW_STATE,
|
|
4
3
|
M_H5_ROOT_ELE_NODE,
|
|
5
4
|
props: ComponentInterFace.InOrOutViewObserverProps,
|
|
6
5
|
const { children, inViewCallback, outViewCallback, threshold = 0 } = props
|
|
7
6
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
8
7
|
const componentObserverRef = useRef<HTMLElement | null>(null)
|
|
9
8
|
const componentShowStateRef = useRef(false)
|
|
10
9
|
if (isH5AndJdShopView) {
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
const latestRes =
|
|
13
12
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
14
13
|
dealPageScrollInfo(latestRes)
|
|
15
14
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
16
15
|
dealPageScrollInfo(res)
|
|
17
16
|
})
|
|
18
17
|
Taro.eventCenter.on(
|
|
19
18
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
20
19
|
(state) => {
|
|
21
20
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
22
21
|
},
|
|
23
22
|
)
|
|
24
23
|
return function cleanup() {
|
|
25
24
|
Taro.eventCenter.off(TaroEventType.PAGE_SCROLL, (res) => {
|
|
26
25
|
dealPageScrollInfo(res)
|
|
27
26
|
})
|
|
28
27
|
Taro.eventCenter.off(
|
|
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
|
}
|
|
35
34
|
}, [])
|
|
36
35
|
useEffect(() => {
|
|
37
36
|
if (componentShowState) {
|
|
38
37
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
39
38
|
console.log('app=>in可视区域')
|
|
40
39
|
} else {
|
|
41
40
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
42
41
|
console.log('app=>out可视区域')
|
|
43
42
|
}
|
|
44
43
|
}, [componentShowState])
|
|
45
44
|
|
|
46
45
|
const handleInOrOutView = (type: boolean) => {
|
|
47
46
|
componentShowStateRef.current = type
|
|
48
47
|
setComponentShowState(type)
|
|
49
48
|
console.log('handleInOrOutView', type)
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
const dealPageScrollInfo = (res) => {
|
|
53
52
|
console.log('dealPageScrollInfo===', res)
|
|
54
53
|
|
|
55
54
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
|
|
56
55
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
57
56
|
console.log(
|
|
58
57
|
'处理后dealPageScrollInfo===displayHeight=offSetY',
|
|
59
58
|
displayHeight,
|
|
60
59
|
offSetY,
|
|
61
60
|
)
|
|
62
61
|
if (componentObserverRef.current) {
|
|
63
62
|
const eleClientRect =
|
|
64
63
|
componentObserverRef.current.getBoundingClientRect()
|
|
65
64
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
66
65
|
const eleHeight = Math.ceil(eleClientRect.height)
|
|
67
66
|
console.log(
|
|
68
67
|
'==========================eleOffsetTop, eleHeight',
|
|
69
68
|
eleOffsetTop,
|
|
70
69
|
eleHeight,
|
|
71
70
|
)
|
|
72
71
|
if (eleOffsetTop >= 0 && eleOffsetTop < displayHeight) {
|
|
73
72
|
const isOutView =
|
|
74
73
|
offSetY > eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)) ||
|
|
75
74
|
displayHeight - (eleOffsetTop - offSetY) <
|
|
76
75
|
Math.ceil(eleHeight * threshold)
|
|
77
76
|
|
|
78
77
|
console.log(
|
|
79
78
|
'比较isOutView',
|
|
80
79
|
isOutView,
|
|
81
80
|
offSetY,
|
|
82
81
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
83
82
|
displayHeight - (eleOffsetTop - offSetY),
|
|
84
83
|
Math.ceil(eleHeight * threshold),
|
|
85
84
|
)
|
|
86
85
|
handleInOrOutView(!isOutView)
|
|
87
86
|
} else {
|
|
88
87
|
const isInView =
|
|
89
88
|
offSetY >
|
|
90
89
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold) &&
|
|
91
90
|
offSetY < eleOffsetTop + Math.ceil(eleHeight * (1 - threshold))
|
|
92
91
|
console.log(
|
|
93
92
|
'比较isInView',
|
|
94
93
|
isInView,
|
|
95
94
|
offSetY,
|
|
96
95
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold),
|
|
97
96
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
98
97
|
)
|
|
99
98
|
handleInOrOutView(isInView)
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
return <View ref={componentObserverRef}>{children}</View>
|
|
104
103
|
} else {
|
|
105
104
|
const rootDom = document.querySelector(`${M_H5_ROOT_ELE_NODE}`)
|
|
106
105
|
const { ref, inView } = useInView({
|
|
107
106
|
threshold,
|
|
108
107
|
triggerOnce: false,
|
|
109
108
|
root: rootDom || null,
|
|
110
109
|
rootMargin: `0px 0px 0px 0px`,
|
|
111
110
|
})
|
|
112
111
|
useEffect(() => {
|
|
113
112
|
if (inView) {
|
|
114
113
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
115
114
|
console.log('其他h5=>in可视区域')
|
|
116
115
|
} else {
|
|
117
116
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
118
117
|
console.log('其他h5=>out可视区域')
|
|
119
118
|
}
|
|
120
119
|
}, [inView])
|
|
121
120
|
return <View ref={ref}>{children}</View>
|
|
122
121
|
}
|
|
123
122
|
children: null,
|
|
124
123
|
className: '',
|
|
125
124
|
inViewCallback: null,
|
|
126
125
|
outViewCallback: null,
|
|
127
126
|
threshold: 0,
|
|
127
|
+
import Taro from '@tarojs/taro'
|
|
128
128
|
TaroEventType,
|
|
129
129
|
WEBVIEW_STATE,
|
|
130
130
|
M_H5_ROOT_ELE_NODE,
|
|
131
131
|
latestFromNativeMsgStorage,
|
|
132
132
|
getNativePageScrollRes,
|
|
133
133
|
props: ComponentInterFace.InOrOutViewObserverProps,
|
|
134
134
|
const {
|
|
135
135
|
children,
|
|
136
136
|
style,
|
|
137
137
|
inViewCallback,
|
|
138
138
|
outViewCallback,
|
|
139
139
|
threshold = 0,
|
|
140
140
|
} = props
|
|
141
141
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
142
142
|
const componentObserverRef = useRef<HTMLElement | null>(null)
|
|
143
143
|
const componentShowStateRef = useRef(false)
|
|
144
144
|
if (isH5AndJdShopView) {
|
|
145
145
|
useEffect(() => {
|
|
146
146
|
const latestRes =
|
|
147
147
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
148
148
|
dealPageScrollInfo(latestRes)
|
|
149
149
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
150
150
|
dealPageScrollInfo(res)
|
|
151
151
|
})
|
|
152
152
|
Taro.eventCenter.on(
|
|
153
153
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
154
154
|
(state) => {
|
|
155
155
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
156
156
|
},
|
|
157
157
|
)
|
|
158
158
|
return function cleanup() {
|
|
159
159
|
Taro.eventCenter.off(TaroEventType.PAGE_SCROLL, (res) => {
|
|
160
160
|
dealPageScrollInfo(res)
|
|
161
161
|
})
|
|
162
162
|
Taro.eventCenter.off(
|
|
163
163
|
TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE,
|
|
164
164
|
(state) => {
|
|
165
165
|
state === WEBVIEW_STATE.NOT_VISIBLE && handleInOrOutView(false)
|
|
166
166
|
},
|
|
167
167
|
)
|
|
168
168
|
}
|
|
169
169
|
}, [])
|
|
170
170
|
useEffect(() => {
|
|
171
171
|
if (componentShowState) {
|
|
172
172
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
173
173
|
console.log('app=>in可视区域')
|
|
174
174
|
} else {
|
|
175
175
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
176
176
|
console.log('app=>out可视区域')
|
|
177
177
|
}
|
|
178
178
|
}, [componentShowState])
|
|
179
179
|
|
|
180
180
|
const handleInOrOutView = (type: boolean) => {
|
|
181
181
|
componentShowStateRef.current = type
|
|
182
182
|
setComponentShowState(type)
|
|
183
183
|
console.log('handleInOrOutView', type)
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
const dealPageScrollInfo = (res) => {
|
|
187
187
|
console.log('dealPageScrollInfo===', res)
|
|
188
188
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
|
|
189
189
|
if (
|
|
190
190
|
typeof displayHeight === 'undefined' ||
|
|
191
191
|
typeof offSetY === 'undefined'
|
|
192
192
|
)
|
|
193
193
|
return
|
|
194
194
|
console.log(
|
|
195
195
|
'处理后dealPageScrollInfo===displayHeight=offSetY',
|
|
196
196
|
displayHeight,
|
|
197
197
|
offSetY,
|
|
198
198
|
)
|
|
199
199
|
if (componentObserverRef.current) {
|
|
200
200
|
const eleClientRect =
|
|
201
201
|
componentObserverRef.current.getBoundingClientRect()
|
|
202
202
|
const eleOffsetTop = Math.ceil(eleClientRect.top)
|
|
203
203
|
const eleHeight = Math.ceil(eleClientRect.height)
|
|
204
204
|
console.log(
|
|
205
205
|
'==========================eleOffsetTop, eleHeight',
|
|
206
206
|
eleOffsetTop,
|
|
207
207
|
eleHeight,
|
|
208
208
|
)
|
|
209
209
|
if (eleOffsetTop >= 0 && eleOffsetTop < displayHeight) {
|
|
210
210
|
const isOutView =
|
|
211
211
|
offSetY > eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)) ||
|
|
212
212
|
displayHeight - (eleOffsetTop - offSetY) <
|
|
213
213
|
Math.ceil(eleHeight * threshold)
|
|
214
214
|
console.log(
|
|
215
215
|
'比较isOutView',
|
|
216
216
|
isOutView,
|
|
217
217
|
offSetY,
|
|
218
218
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
219
219
|
displayHeight - (eleOffsetTop - offSetY),
|
|
220
220
|
Math.ceil(eleHeight * threshold),
|
|
221
221
|
)
|
|
222
222
|
handleInOrOutView(!isOutView)
|
|
223
223
|
} else {
|
|
224
224
|
const isInView =
|
|
225
225
|
offSetY >
|
|
226
226
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold) &&
|
|
227
227
|
offSetY < eleOffsetTop + Math.ceil(eleHeight * (1 - threshold))
|
|
228
228
|
console.log(
|
|
229
229
|
'比较isInView',
|
|
230
230
|
isInView,
|
|
231
231
|
offSetY,
|
|
232
232
|
eleOffsetTop - displayHeight + Math.ceil(eleHeight * threshold),
|
|
233
233
|
eleOffsetTop + Math.ceil(eleHeight * (1 - threshold)),
|
|
234
234
|
)
|
|
235
235
|
handleInOrOutView(isInView)
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
return (
|
|
240
240
|
<View ref={componentObserverRef} style={style}>
|
|
241
241
|
{children}
|
|
242
242
|
</View>
|
|
243
243
|
)
|
|
244
244
|
} else {
|
|
245
245
|
const rootDom = document.querySelector(`${M_H5_ROOT_ELE_NODE}`)
|
|
246
246
|
const { ref, inView } = useInView({
|
|
247
247
|
threshold,
|
|
248
248
|
triggerOnce: false,
|
|
249
249
|
root: rootDom || null,
|
|
250
250
|
rootMargin: `0px 0px 0px 0px`,
|
|
251
251
|
})
|
|
252
252
|
useEffect(() => {
|
|
253
253
|
if (inView) {
|
|
254
254
|
typeof inViewCallback === 'function' && inViewCallback()
|
|
255
255
|
console.log('其他h5=>in可视区域')
|
|
256
256
|
} else {
|
|
257
257
|
typeof outViewCallback === 'function' && outViewCallback()
|
|
258
258
|
console.log('其他h5=>out可视区域')
|
|
259
259
|
}
|
|
260
260
|
}, [inView])
|
|
261
261
|
return (
|
|
262
262
|
<View ref={ref} style={style}>
|
|
263
263
|
{children}
|
|
264
264
|
</View>
|
|
265
265
|
)
|
|
266
266
|
}
|
|
267
267
|
children: null,
|
|
268
268
|
style: {},
|
|
269
269
|
className: '',
|
|
270
270
|
inViewCallback: null,
|
|
271
271
|
outViewCallback: null,
|
|
272
272
|
threshold: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { NETWORK_DATA_TYPE } from '../../../common/const'
|
|
1
|
+
import { NETWORK_DATA_TYPE } from '../../../common/const'
|
|
2
2
|
No_Data_Bmall:'no-data-bmall',
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
.d-no-network-err-tip {
|
|
51
51
|
background-image: url('https://img14.360buyimg.com/imagetools/jfs/t1/146556/1/17745/7493/5fd1e62dE86e86669/96f5c91befa8e991.png');
|
|
52
52
|
}
|
|
53
|
+
.d-no-data-bmall {
|
|
54
|
+
background-image: url('https://img12.360buyimg.com/imagetools/jfs/t1/217798/34/32933/150484/64ccadf3Fde1a93bf/9b1b8929a9631469.png');
|
|
55
|
+
}
|
|
53
56
|
|
|
54
57
|
.d-opt-btn {
|
|
55
58
|
display: flex;
|
|
@@ -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: isMemberPage ? '100vh' : 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: '',
|
|
File without changes
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
|
|
2
|
+
:global {
|
|
3
|
+
.d-mini-price {
|
|
4
|
+
position: relative;
|
|
5
|
+
color: #f23030;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
font-family: 'JDZhengHT-Regular';
|
|
8
|
+
|
|
9
|
+
&-sym {
|
|
10
|
+
font-size: 22px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.int-txt {
|
|
14
|
+
font-size: 36px;
|
|
15
|
+
}
|
|
16
|
+
.off-shelf {
|
|
17
|
+
color: rgb(162, 164, 172);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dec-txt {
|
|
21
|
+
font-size: 22px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sym-sup {
|
|
25
|
+
vertical-align: top;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dec-sup {
|
|
29
|
+
vertical-align: top;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.del {
|
|
33
|
+
.sym-sub,
|
|
34
|
+
.int-txt,
|
|
35
|
+
.dec-txt {
|
|
36
|
+
font-size: 22px;
|
|
37
|
+
color: #2e2e2e;
|
|
38
|
+
text-decoration: line-through;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
&.d-plus-price,
|
|
42
|
+
&.d-sams-price,
|
|
43
|
+
&.d-sfp-price,
|
|
44
|
+
&.d-member-price {
|
|
45
|
+
&:after {
|
|
46
|
+
content: '';
|
|
47
|
+
display: inline-block;
|
|
48
|
+
margin-left: 5px;
|
|
49
|
+
width: 58px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
background-repeat: no-repeat;
|
|
52
|
+
background-size: contain;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
&.d-price-label {
|
|
56
|
+
&:after {
|
|
57
|
+
// 价格后面追加显示文案例如“到手价”的默认样式
|
|
58
|
+
content: attr(data-after);
|
|
59
|
+
font-size: 20px;
|
|
60
|
+
color: #ffffff;
|
|
61
|
+
margin-left: 8px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&.d-plus-price {
|
|
65
|
+
.int-txt,
|
|
66
|
+
.sym-sub,
|
|
67
|
+
.dec-txt {
|
|
68
|
+
font-size: 24px;
|
|
69
|
+
color: #232326;
|
|
70
|
+
}
|
|
71
|
+
&:after {
|
|
72
|
+
background-image: url('../../../../assets/plus-icon.png');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
&.d-sams-price {
|
|
76
|
+
.int-txt,
|
|
77
|
+
.sym-sub,
|
|
78
|
+
.dec-txt {
|
|
79
|
+
font-size: 24px;
|
|
80
|
+
color: #1a68bc;
|
|
81
|
+
}
|
|
82
|
+
&:after {
|
|
83
|
+
background-image: url('../../../../assets/jsbundles_jdreactshopactivitytab_images_samprice.png');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
&.d-sfp-price {
|
|
87
|
+
.int-txt,
|
|
88
|
+
.sym-sub,
|
|
89
|
+
.dec-txt {
|
|
90
|
+
font-size: 24px;
|
|
91
|
+
color: #714aff;
|
|
92
|
+
}
|
|
93
|
+
&:after {
|
|
94
|
+
background-image: url('../../../../assets/fans_price@2x.png');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
&.d-member-price {
|
|
98
|
+
.int-txt,
|
|
99
|
+
.sym-sub,
|
|
100
|
+
.dec-txt {
|
|
101
|
+
font-size: 24px;
|
|
102
|
+
color: #f3c416;
|
|
103
|
+
}
|
|
104
|
+
// 默认v1会员
|
|
105
|
+
&:after {
|
|
106
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/132940/18/11320/4920/5f770610E07069747/92f14ae503ca8b7b.png');
|
|
107
|
+
}
|
|
108
|
+
// v1 会员
|
|
109
|
+
&.d-member-price-tab_214 {
|
|
110
|
+
&:after {
|
|
111
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/132940/18/11320/4920/5f770610E07069747/92f14ae503ca8b7b.png');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
&.d-member-price-tab_215 {
|
|
115
|
+
&:after {
|
|
116
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/135428/5/11263/5100/5f770623E87b73485/a3624a844f220489.png');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&.d-member-price-tab_216 {
|
|
120
|
+
&:after {
|
|
121
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/142590/8/9888/5220/5f770639E992a10a9/1decbf1689dd500c.png');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
&.d-member-price-tab_217 {
|
|
125
|
+
&:after {
|
|
126
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/128048/23/13979/5063/5f77064aE56b826d7/5e07702ee673629d.png');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
&.d-member-price-tab_218 {
|
|
130
|
+
&:after {
|
|
131
|
+
background-image: url('https://m.360buyimg.com/cc/jfs/t1/117816/19/19334/5167/5f77065eEbd592fb5/75091c85ca7d0895.png');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|