@conecli/cone-render 0.10.1-shop3.12 → 0.10.1-shop3.121
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/README.md +1 -1
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +1 -0
- 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/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ascf.ts +1 -0
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CountDownForApp/index.module.scss +52 -0
- package/dist/components/base/CountDownForApp/index.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.module.scss +9 -9
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +25 -1
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/config/env.ts +1 -1
- package/dist/interface/common.ts +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.jd.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.h5.ts +1 -0
- 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.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +397 -0
- package/dist/language/zh_CN.json +397 -0
- package/dist/language/zh_HK.json +397 -0
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +19 -2
- package/dist/sass/base.scss +8 -4
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- 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/jumpExtMapUtil.ts +1 -0
- package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +166 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
1
|
const {
|
|
3
2
|
type,
|
|
4
3
|
className,
|
|
5
4
|
reportData,
|
|
6
5
|
customReportDataKey,
|
|
7
6
|
customReportDataFn,
|
|
8
7
|
trackCallback,
|
|
9
8
|
markPoint,
|
|
10
9
|
innerRef,
|
|
11
10
|
} = props;
|
|
12
11
|
const isCustomReport = customReportDataKey && customReportDataFn;
|
|
13
12
|
const isViewOnlineState = taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE;
|
|
14
13
|
const showRenderState = isCustomReport ? true : reportData;
|
|
15
14
|
const inViewCallback = () => {
|
|
16
15
|
const getInsertFlowMapEle =
|
|
17
16
|
innerRef?.current?.querySelector('.d-report-exposure-point') || createDefaultFlowMapEle;
|
|
18
17
|
if (!isCustomReport) {
|
|
19
18
|
addReportData(reportData, getInsertFlowMapEle);
|
|
20
19
|
typeof trackCallback === 'function' && trackCallback(reportData);
|
|
21
20
|
} else {
|
|
22
21
|
if (typeof customReportDataFn === 'function') {
|
|
23
22
|
const getReportData = customReportDataFn(customReportDataKey);
|
|
24
23
|
getReportData &&
|
|
25
24
|
getReportData?.eventId &&
|
|
26
25
|
getReportData?.jsonParam &&
|
|
27
26
|
track.reportExposureEventLog({
|
|
28
27
|
...getReportData,
|
|
29
28
|
target: getInsertFlowMapEle,
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
let chartPointClassName = '';
|
|
35
34
|
|
|
36
35
|
if (isChartH5 && markPoint && Array.isArray(reportData)) {
|
|
37
36
|
const [floorData, mInfo] = reportData;
|
|
38
37
|
if (floorData && mInfo && mInfo.hasOwnProperty('pos')) {
|
|
39
38
|
chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos);
|
|
40
39
|
}
|
|
41
40
|
} else if (isCustomReport) {
|
|
42
41
|
chartPointClassName = `J_custom_${customReportDataKey}`;
|
|
43
42
|
}
|
|
44
43
|
return isViewOnlineState && showRenderState ? (
|
|
45
44
|
<InViewRender
|
|
46
45
|
className={classNames(
|
|
47
46
|
'd-report-exposure-point',
|
|
48
47
|
{
|
|
49
48
|
[exposureStyle['d-report-point']]: type === TrackType.point,
|
|
50
49
|
},
|
|
51
50
|
{
|
|
52
51
|
[exposureStyle['d-report-floor']]: type === TrackType.floor,
|
|
53
52
|
},
|
|
54
53
|
{
|
|
55
54
|
'd-report-exposure-jd-point': isJdApp,
|
|
56
55
|
},
|
|
57
56
|
className,
|
|
58
57
|
chartPointClassName,
|
|
59
58
|
)}
|
|
60
59
|
height={'100%'}
|
|
61
60
|
inViewCallback={inViewCallback}
|
|
62
61
|
></InViewRender>
|
|
63
62
|
) : null;
|
|
64
63
|
return useMemo(() => {
|
|
65
64
|
return <Exposure {...props} />;
|
|
66
65
|
}, []);
|
|
67
66
|
reportData: null,
|
|
68
67
|
trackCallback: null,
|
|
69
68
|
type: TrackType.point,
|
|
70
69
|
markPoint: false,
|
|
70
|
+
import React, { useMemo } from 'react';
|
|
71
71
|
const {
|
|
72
72
|
type,
|
|
73
73
|
className,
|
|
74
74
|
reportData,
|
|
75
75
|
customReportDataKey,
|
|
76
76
|
customReportDataFn,
|
|
77
77
|
trackCallback,
|
|
78
78
|
markPoint,
|
|
79
79
|
innerRef,
|
|
80
80
|
} = props;
|
|
81
81
|
const isCustomReport = customReportDataKey && customReportDataFn;
|
|
82
82
|
const isViewOnlineState = taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE;
|
|
83
83
|
const showRenderState = isCustomReport ? true : reportData;
|
|
84
84
|
const inViewCallback = () => {
|
|
85
85
|
const getInsertFlowMapEle =
|
|
86
86
|
innerRef?.current?.querySelector('.d-report-exposure-point') || createDefaultFlowMapEle;
|
|
87
87
|
if (!isCustomReport) {
|
|
88
88
|
addReportData(reportData, getInsertFlowMapEle);
|
|
89
89
|
typeof trackCallback === 'function' && trackCallback(reportData);
|
|
90
90
|
} else {
|
|
91
91
|
if (typeof customReportDataFn === 'function') {
|
|
92
92
|
const getReportData = customReportDataFn(customReportDataKey);
|
|
93
93
|
if(getReportData){
|
|
94
94
|
const { eventId, spmAllCode, spmCodeForCD, jsonParam } = getReportData;
|
|
95
95
|
(eventId || spmAllCode || spmCodeForCD) &&
|
|
96
96
|
jsonParam &&
|
|
97
97
|
track.reportExposureEventLog({
|
|
98
98
|
...getReportData,
|
|
99
99
|
target: getInsertFlowMapEle,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
let chartPointClassName = '';
|
|
106
106
|
|
|
107
107
|
if (isChartH5 && markPoint && Array.isArray(reportData)) {
|
|
108
108
|
const [floorData, mInfo] = reportData;
|
|
109
109
|
if (floorData && mInfo && mInfo.hasOwnProperty('pos')) {
|
|
110
110
|
chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos);
|
|
111
111
|
}
|
|
112
112
|
} else if (isCustomReport) {
|
|
113
113
|
chartPointClassName = `J_custom_${customReportDataKey}`;
|
|
114
114
|
}
|
|
115
115
|
return isViewOnlineState && showRenderState ? (
|
|
116
116
|
<InViewRender
|
|
117
117
|
className={classNames(
|
|
118
118
|
'd-report-exposure-point',
|
|
119
119
|
{
|
|
120
120
|
[exposureStyle['d-report-point']]: type === TrackType.point,
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
[exposureStyle['d-report-floor']]: type === TrackType.floor,
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
'd-report-exposure-jd-point': isJdApp,
|
|
127
127
|
},
|
|
128
128
|
className,
|
|
129
129
|
chartPointClassName,
|
|
130
130
|
)}
|
|
131
131
|
height={'100%'}
|
|
132
132
|
inViewCallback={inViewCallback}
|
|
133
133
|
></InViewRender>
|
|
134
134
|
) : null;
|
|
135
135
|
return useMemo(() => {
|
|
136
136
|
return <Exposure {...props} />;
|
|
137
137
|
}, []);
|
|
138
138
|
reportData: null,
|
|
139
139
|
trackCallback: null,
|
|
140
140
|
type: TrackType.point,
|
|
141
141
|
markPoint: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
const { type, className, reportData, customReportDataKey, customReportDataFn, trackCallback } = props
|
|
3
2
|
const isViewOnlineState =
|
|
4
3
|
taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
5
4
|
const isCustomReport = customReportDataKey && customReportDataFn
|
|
6
5
|
const checkReportData = Array.isArray(reportData)
|
|
7
6
|
const [floorData, mInfo] = checkReportData ? reportData : []
|
|
8
7
|
const showRenderState = isCustomReport ? true : floorData && mInfo
|
|
9
8
|
const getFloorPointClassName = isCustomReport ? `J_custom_${customReportDataKey}` : `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
|
|
10
9
|
const getTaroSelector = isCustomReport ? `#J_miniShopRoot >>> .${getFloorPointClassName}` : `#J_floor_${floorData?.uid} >>> .${getFloorPointClassName}`
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
if (isViewOnlineState && reportData) {
|
|
13
12
|
Taro.nextTick(() => {
|
|
14
13
|
if (
|
|
15
14
|
!taroJdBaseInfo.info.pageInfo.floorExposureInfo[
|
|
16
15
|
getFloorPointClassName
|
|
17
16
|
]
|
|
18
17
|
){
|
|
19
18
|
const createIntersectionObserver = new intersectionObserver({
|
|
20
19
|
selector: getTaroSelector,
|
|
21
20
|
context: this,
|
|
22
21
|
onFinal: (res) => {
|
|
23
22
|
taroJdBaseInfo.info.pageInfo.floorExposureInfo[
|
|
24
23
|
getFloorPointClassName
|
|
25
24
|
] = true
|
|
26
25
|
console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
|
|
27
26
|
if(!isCustomReport){
|
|
28
27
|
addReportData(reportData)
|
|
29
28
|
typeof trackCallback === 'function' && trackCallback(reportData)
|
|
30
29
|
}else {
|
|
31
30
|
typeof customReportDataFn === 'function' && customReportDataFn(customReportDataKey)
|
|
32
31
|
}
|
|
33
32
|
createIntersectionObserver.disconnect()
|
|
34
33
|
},
|
|
35
34
|
})
|
|
36
35
|
createIntersectionObserver.connect()
|
|
37
36
|
}
|
|
38
37
|
})
|
|
39
38
|
}
|
|
40
39
|
}, [])
|
|
41
40
|
return (showRenderState ? (
|
|
42
41
|
<View
|
|
43
42
|
className={classNames(
|
|
44
43
|
{
|
|
45
44
|
[exposureStyle['d-report-point']]: type === TrackType.point,
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
47
|
[exposureStyle['d-report-floor']]: type === TrackType.floor,
|
|
49
48
|
},
|
|
50
49
|
getFloorPointClassName,
|
|
51
50
|
className,
|
|
52
51
|
)}
|
|
53
52
|
/>
|
|
54
53
|
) : null
|
|
55
54
|
)
|
|
56
55
|
return useMemo(() => {
|
|
57
56
|
return <ExposureFloor {...props} />
|
|
58
57
|
}, [])
|
|
59
58
|
reportData: null,
|
|
60
59
|
trackCallback: null,
|
|
61
60
|
type: TrackType.point,
|
|
61
|
+
import Taro from '@tarojs/taro'
|
|
62
62
|
const { type, className, reportData, customReportDataKey, customReportDataFn, trackCallback, innerRef } = props
|
|
63
63
|
const isViewOnlineState =
|
|
64
64
|
taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
65
65
|
const isCustomReport = customReportDataKey && customReportDataFn
|
|
66
66
|
const checkReportData = Array.isArray(reportData)
|
|
67
67
|
const [floorData, mInfo] = checkReportData ? reportData : []
|
|
68
68
|
const showRenderState = isCustomReport ? true : floorData && mInfo
|
|
69
69
|
const getFloorPointClassName = isCustomReport ? `J_custom_${customReportDataKey}` : `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
|
|
70
70
|
const getTaroSelector = isCustomReport ? `#J_miniShopRoot >>> .${getFloorPointClassName}` : `#J_floor_${floorData?.uid} >>> .${getFloorPointClassName}`
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
if (isViewOnlineState && reportData) {
|
|
73
73
|
Taro.nextTick(() => {
|
|
74
74
|
if (
|
|
75
75
|
!taroJdBaseInfo.info.pageInfo.floorExposureInfo[
|
|
76
76
|
getFloorPointClassName
|
|
77
77
|
]
|
|
78
78
|
){
|
|
79
79
|
const createIntersectionObserver = new intersectionObserver({
|
|
80
80
|
selector: getTaroSelector,
|
|
81
81
|
context: this,
|
|
82
82
|
onFinal: (res) => {
|
|
83
83
|
taroJdBaseInfo.info.pageInfo.floorExposureInfo[
|
|
84
84
|
getFloorPointClassName
|
|
85
85
|
] = true
|
|
86
86
|
console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
|
|
87
87
|
if(!isCustomReport){
|
|
88
88
|
addReportData(reportData,null)
|
|
89
89
|
typeof trackCallback === 'function' && trackCallback(reportData)
|
|
90
90
|
}else {
|
|
91
91
|
if (typeof customReportDataFn === 'function') {
|
|
92
92
|
const getReportData = customReportDataFn(customReportDataKey);
|
|
93
93
|
if(getReportData){
|
|
94
94
|
const { eventId, spmAllCode, spmCodeForCD, jsonParam } = getReportData;
|
|
95
95
|
(eventId || spmAllCode || spmCodeForCD) &&
|
|
96
96
|
jsonParam &&
|
|
97
97
|
track.reportExposureEventLog({
|
|
98
98
|
...getReportData,
|
|
99
99
|
target: null,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
createIntersectionObserver.disconnect()
|
|
105
105
|
},
|
|
106
106
|
})
|
|
107
107
|
createIntersectionObserver.connect()
|
|
108
108
|
}
|
|
109
109
|
})
|
|
110
110
|
}
|
|
111
111
|
}, [])
|
|
112
112
|
return (showRenderState ? (
|
|
113
113
|
<View
|
|
114
114
|
className={classNames(
|
|
115
115
|
{
|
|
116
116
|
[exposureStyle['d-report-point']]: type === TrackType.point,
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
[exposureStyle['d-report-floor']]: type === TrackType.floor,
|
|
120
120
|
},
|
|
121
121
|
getFloorPointClassName,
|
|
122
122
|
className,
|
|
123
123
|
)}
|
|
124
124
|
/>
|
|
125
125
|
) : null
|
|
126
126
|
)
|
|
127
127
|
return useMemo(() => {
|
|
128
128
|
return <ExposureFloor {...props} />
|
|
129
129
|
}, [])
|
|
130
130
|
reportData: null,
|
|
131
131
|
trackCallback: null,
|
|
132
132
|
type: TrackType.point,
|
|
@@ -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(
|
|
36
35
|
floorData,
|
|
37
36
|
mInfo,
|
|
38
37
|
etModelInfo,
|
|
39
38
|
true,
|
|
40
39
|
isIsvReportModule,
|
|
41
40
|
);
|
|
42
41
|
console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`, reportJson);
|
|
43
42
|
const { floorIdx } = floorData;
|
|
44
43
|
if (!task[floorIdx]) {
|
|
45
44
|
task[floorIdx] = {
|
|
46
45
|
arr: [],
|
|
47
46
|
startWaitTime: 0,
|
|
48
47
|
timer: 0,
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
50
|
const floorTask = task[floorIdx];
|
|
52
51
|
if (floorTask.arr.length === 0) {
|
|
53
52
|
floorTask.startWaitTime = Date.now();
|
|
54
53
|
}
|
|
55
54
|
if (reportJson) {
|
|
56
55
|
floorTask.arr.push(reportJson);
|
|
57
56
|
clearTimeout(floorTask.timer);
|
|
58
57
|
floorTask.timer = setTimeout(() => {
|
|
59
58
|
check(floorTask);
|
|
60
59
|
}, 1000);
|
|
61
60
|
check(floorTask);
|
|
62
61
|
}
|
|
63
62
|
} catch (e) {
|
|
64
63
|
{
|
|
65
64
|
console.log('坑位曝光埋点出错啦', e);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
} else {
|
|
69
68
|
console.log(
|
|
70
69
|
'坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:',
|
|
71
70
|
data,
|
|
72
71
|
);
|
|
73
72
|
}
|
|
73
|
+
import track from '../../../open/api/track';
|
|
74
74
|
if (!Array.isArray(data)) {
|
|
75
75
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const [floorData, mInfo, etModelInfo] = data;
|
|
79
79
|
if (floorData && mInfo && etModelInfo) {
|
|
80
80
|
const isIsvReportModule = isvReportModuleTypeList.includes(floorData?.floorExtInfo?.moduleFlag);
|
|
81
81
|
try {
|
|
82
82
|
const reportJson = track.getExposureInfo(
|
|
83
83
|
floorData,
|
|
84
84
|
mInfo,
|
|
85
85
|
etModelInfo,
|
|
86
86
|
true,
|
|
87
87
|
isIsvReportModule,
|
|
88
88
|
);
|
|
89
89
|
reportJson['target'] = target;
|
|
90
90
|
console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`, reportJson);
|
|
91
91
|
track.reportExposureEventLog(reportJson);
|
|
92
92
|
} catch (e) {
|
|
93
93
|
console.log('坑位曝光埋点出错啦', e);
|
|
94
94
|
}
|
|
95
95
|
} else {
|
|
96
96
|
console.log(
|
|
97
97
|
'坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:',
|
|
98
98
|
data,
|
|
99
99
|
);
|
|
100
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro';
|
|
2
1
|
getNativePageScrollRes,
|
|
3
2
|
latestFromNativeMsgStorage,
|
|
4
3
|
const { children, placeholder, height, className, inViewCallback } = props;
|
|
5
4
|
const [componentShowState, setComponentShowState] = useState(false);
|
|
6
5
|
const [componentRenderShowState, setComponentRenderShowState] = useState(false);
|
|
7
6
|
const componentLazyRef = useRef<HTMLElement | null>(null);
|
|
8
7
|
const componentShowStateRef = useRef(false);
|
|
9
8
|
const needShowHighVersion =
|
|
10
9
|
isH5AndJdShopViewH5Scroll &&
|
|
11
10
|
!(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === 'true');
|
|
12
11
|
const rootDom =
|
|
13
12
|
isH5AndJdShopView && needShowHighVersion ? null : document.querySelector('#J_shopHomeRoot');
|
|
14
13
|
if (isH5AndJdShopView && !needShowHighVersion && !isAppStowShop) {
|
|
15
14
|
useEffect(() => {
|
|
16
15
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
|
|
17
16
|
!componentShowStateRef.current && dealPageScrollInfo(latestRes);
|
|
18
17
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
19
18
|
!componentShowStateRef.current && dealPageScrollInfo(res);
|
|
20
19
|
});
|
|
21
20
|
}, []);
|
|
22
21
|
useEffect(() => {
|
|
23
22
|
if (componentShowState) {
|
|
24
23
|
typeof inViewCallback === 'function' && inViewCallback();
|
|
25
24
|
}
|
|
26
25
|
}, [componentShowState]);
|
|
27
26
|
|
|
28
27
|
const dealPageScrollInfo = (res) => {
|
|
29
28
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {};
|
|
30
29
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return;
|
|
31
30
|
if (componentLazyRef.current) {
|
|
32
31
|
const eleClientRect = componentLazyRef.current.getBoundingClientRect();
|
|
33
32
|
const getContainerHeightOffSetY = displayHeight + offSetY;
|
|
34
33
|
const eleOffsetTop = Math.ceil(eleClientRect.top);
|
|
35
34
|
if (!componentShowStateRef.current) {
|
|
36
35
|
if (getContainerHeightOffSetY > eleOffsetTop) {
|
|
37
36
|
componentShowStateRef.current = true;
|
|
38
37
|
setComponentShowState(true);
|
|
39
38
|
Taro.nextTick(() => {
|
|
40
39
|
setComponentRenderShowState(true);
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
45
|
return (
|
|
47
46
|
<View
|
|
48
47
|
ref={componentLazyRef}
|
|
49
48
|
className={classNames(
|
|
50
49
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
51
50
|
'd-app-floor-lazy-load',
|
|
52
51
|
className,
|
|
53
52
|
)}
|
|
54
53
|
style={{
|
|
55
54
|
minHeight: `${
|
|
56
55
|
componentRenderShowState ? 'auto' : height + (typeof height === 'number' ? 'px' : '')
|
|
57
56
|
}`,
|
|
58
57
|
backgroundColor: componentRenderShowState ? 'transparent' : '#ffffff',
|
|
59
58
|
}}
|
|
60
59
|
>
|
|
61
60
|
{componentShowState ? children : placeholder}
|
|
62
61
|
</View>
|
|
63
62
|
);
|
|
64
63
|
} else {
|
|
65
64
|
const { ref, inView } = useInView({
|
|
66
65
|
threshold: 0.5,
|
|
67
66
|
triggerOnce: true,
|
|
68
67
|
root: rootDom || null,
|
|
69
68
|
rootMargin: `0px 0px 0px 0px`,
|
|
70
69
|
delay: 300,
|
|
71
70
|
});
|
|
72
71
|
useEffect(() => {
|
|
73
72
|
if (inView) {
|
|
74
73
|
typeof inViewCallback === 'function' && inViewCallback();
|
|
75
74
|
}
|
|
76
75
|
}, [inView]);
|
|
77
76
|
return (
|
|
78
77
|
<div
|
|
79
78
|
className={className}
|
|
80
79
|
ref={ref}
|
|
81
80
|
style={{
|
|
82
81
|
minHeight: inView ? 'auto' : typeof height === 'number' ? `${height}px` : height,
|
|
83
82
|
backgroundColor: 'transparent',
|
|
84
83
|
}}
|
|
85
84
|
>
|
|
86
85
|
{inView ? children : placeholder}
|
|
87
86
|
</div>
|
|
88
87
|
);
|
|
89
88
|
}
|
|
90
89
|
children: null,
|
|
91
90
|
placeholder: null,
|
|
92
91
|
height: 1,
|
|
93
92
|
className: '',
|
|
94
93
|
lazyNodeClassName: '',
|
|
95
94
|
inViewCallback: null,
|
|
95
|
+
import Taro from '@tarojs/taro';
|
|
96
96
|
isH5AndJdShopView,
|
|
97
97
|
isH5AndJdShopViewH5Scroll,
|
|
98
98
|
isAppStowShop,
|
|
99
99
|
isAppClassifyPage,
|
|
100
100
|
getNativePageScrollRes,
|
|
101
101
|
latestFromNativeMsgStorage,
|
|
102
102
|
const { children, placeholder, height, className, inViewCallback } = props;
|
|
103
103
|
const [componentShowState, setComponentShowState] = useState(false);
|
|
104
104
|
const [componentRenderShowState, setComponentRenderShowState] = useState(false);
|
|
105
105
|
const componentLazyRef = useRef<HTMLElement | null>(null);
|
|
106
106
|
const componentShowStateRef = useRef(false);
|
|
107
107
|
const needShowHighVersion =
|
|
108
108
|
isH5AndJdShopViewH5Scroll &&
|
|
109
109
|
!(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === 'true');
|
|
110
110
|
const rootDom =
|
|
111
111
|
isH5AndJdShopView && needShowHighVersion ? null : document.querySelector('#J_shopHomeRoot');
|
|
112
112
|
if (isH5AndJdShopView && !isAppClassifyPage && !needShowHighVersion && !isAppStowShop) {
|
|
113
113
|
useEffect(() => {
|
|
114
114
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
|
|
115
115
|
!componentShowStateRef.current && dealPageScrollInfo(latestRes);
|
|
116
116
|
Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
|
|
117
117
|
!componentShowStateRef.current && dealPageScrollInfo(res);
|
|
118
118
|
});
|
|
119
119
|
}, []);
|
|
120
120
|
useEffect(() => {
|
|
121
121
|
if (componentShowState) {
|
|
122
122
|
typeof inViewCallback === 'function' && inViewCallback();
|
|
123
123
|
}
|
|
124
124
|
}, [componentShowState]);
|
|
125
125
|
|
|
126
126
|
const dealPageScrollInfo = (res) => {
|
|
127
127
|
const { displayHeight, offSetY } = getNativePageScrollRes(res) || {};
|
|
128
128
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return;
|
|
129
129
|
if (componentLazyRef.current) {
|
|
130
130
|
const eleClientRect = componentLazyRef.current.getBoundingClientRect();
|
|
131
131
|
const getContainerHeightOffSetY = displayHeight + offSetY;
|
|
132
132
|
const eleOffsetTop = Math.ceil(eleClientRect.top);
|
|
133
133
|
if (!componentShowStateRef.current) {
|
|
134
134
|
if (getContainerHeightOffSetY > eleOffsetTop) {
|
|
135
135
|
componentShowStateRef.current = true;
|
|
136
136
|
setComponentShowState(true);
|
|
137
137
|
Taro.nextTick(() => {
|
|
138
138
|
setComponentRenderShowState(true);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
return (
|
|
145
145
|
<View
|
|
146
146
|
ref={componentLazyRef}
|
|
147
147
|
className={classNames(
|
|
148
148
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
149
149
|
'd-app-floor-lazy-load',
|
|
150
150
|
className,
|
|
151
151
|
)}
|
|
152
152
|
style={{
|
|
153
153
|
minHeight: `${
|
|
154
154
|
componentRenderShowState ? 'auto' : height + (typeof height === 'number' ? 'px' : '')
|
|
155
155
|
}`,
|
|
156
156
|
backgroundColor: componentRenderShowState ? 'transparent' : '#ffffff',
|
|
157
157
|
}}
|
|
158
158
|
>
|
|
159
159
|
{componentShowState ? children : placeholder}
|
|
160
160
|
</View>
|
|
161
161
|
);
|
|
162
162
|
} else {
|
|
163
163
|
const { ref, inView } = useInView({
|
|
164
164
|
threshold: 0.5,
|
|
165
165
|
triggerOnce: true,
|
|
166
166
|
root: rootDom || null,
|
|
167
167
|
rootMargin: `0px 0px 0px 0px`,
|
|
168
168
|
delay: 300,
|
|
169
169
|
});
|
|
170
170
|
useEffect(() => {
|
|
171
171
|
if (inView) {
|
|
172
172
|
typeof inViewCallback === 'function' && inViewCallback();
|
|
173
173
|
}
|
|
174
174
|
}, [inView]);
|
|
175
175
|
return (
|
|
176
176
|
<div
|
|
177
177
|
className={className}
|
|
178
178
|
ref={ref}
|
|
179
179
|
style={{
|
|
180
180
|
minHeight: inView ? 'auto' : typeof height === 'number' ? `${height}px` : height,
|
|
181
181
|
backgroundColor: 'transparent',
|
|
182
182
|
}}
|
|
183
183
|
>
|
|
184
184
|
{inView ? children : placeholder}
|
|
185
185
|
</div>
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
children: null,
|
|
189
189
|
placeholder: null,
|
|
190
190
|
height: 1,
|
|
191
191
|
className: '',
|
|
192
192
|
lazyNodeClassName: '',
|
|
193
193
|
inViewCallback: null,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
.d-mobile-floor-lazy-layout-load,
|
|
4
4
|
.d-app-floor-lazy-layout-load {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
position: relative;
|
|
6
|
+
background: #fff
|
|
7
|
+
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAeCAMAAABT0xOcAAAAe1BMVEUAAADx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fELy0NOAAAAKHRSTlMApwmfFtYm9rWveHDm70yJHYJaD2k8IeIr6pY2X0HHfsGRZDHdu1XNmO+CqgAAAu9JREFUSMfNlNmymzAQRAchkCUhdrMZbLze/v8vjIRMKN8kRR7ykFNeVIPV9Ewj039P1TR8+eILjL7RdLFFJUO8QMS7ZmyDJvZ0nDYGY+aKKDSJpY3OwWX6uFUEY/peCNEbY4Rp6AABixFYkLQRAK3VOmAjUrawMt1GrfWtXD7rlFF3uiA6HV/p0TF1tBECEVskYe+7qqW08mqT1jruneu21/72JfHoSZ7faj2bJu6mOlgEa3qjEXKeL/ACV1s5YSbqYP6stXUeX2FZnV3wuBSZqnVWqDNCIvaFRzZIiGAIw+CS/1brQCslgOQdUBoW10C2EFJei7AkygOlAnmGeMprJq/NjhZpAIrepOpOte2Oq9EXjupIMVoiXduQ9rTo7KsODhxJYaAGuJPjgRvdkRD1KP9CawRwettyF5SbVLZ49ZbuMJxGW93XisXPKA/oXNMDEReJT6N0OfZ2V4RqX4tFQPbOQbntwrl8oXCOQmu2hVosSr6j5QcW+uvukZJP37CWzL7tQs2lH8B53Nd6eq192N/72mdfa52XhdXPx6zcXKYgikLXbaNP66M27edoAO2X+RkQ9tVRhoWC6IZkCZAbHHa1SgDHNdHDsbrLr0ojKTkfDWp6+WPh1APakMAXbVrb6B/Mn+311zlETJZOCJYChttWxedUIyvyi9bLt+J4IPcLvVYypBNaDG5TguCzmct3rUkAPSdHJRLyDEjXQ6Un3GZQBamxaU09gJg+/r+4gqV0uzixXjBfLnDzixrjhDJGNoDXXqvK76OEJaO3L1bx/FQOCSxqcfJVUWiXCydEPowHeIqaZnf3wmvNRsBiC28ttEnS+1oy+lNtOMVAzayZCwsQ5ESNREgvKKuNjjI/ewNHr9Y4N5Is98llx2U8iOQXcKczhDwAM6ObayaanfWDDwhJcMvpU8ucr6+cPji5a8+UEVMCMNo97tLm0MU2uoMmi850yrc8s8Khyzuj7+Q6U7GPMCt8mOtGljP6l/wAUcBZ6lceL/8AAAAASUVORK5CYII=')
|
|
8
|
+
center center no-repeat;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.d-mobile-prestrain-component {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
position: absolute;
|
|
13
|
+
//top: -50vh;
|
|
14
|
+
top: -35vh;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 0;
|
|
17
17
|
}
|