@conecli/cone-render 0.10.1-shop3.1 → 0.10.1-shop3.100

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.
Files changed (129) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/common/accessibility.h5.ts +1 -0
  4. package/dist/common/accessibility.ts +1 -0
  5. package/dist/common/const.ts +1 -1
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.weapp.tsx +1 -0
  11. package/dist/common/jssdk.ts +1 -1
  12. package/dist/common/jssdk.weapp.ts +1 -0
  13. package/dist/common/pageType.ts +1 -1
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/wxappApi.ascf.ts +1 -0
  17. package/dist/common/wxappApi.ts +1 -1
  18. package/dist/components/ErrorBoundary.tsx +1 -1
  19. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  20. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  21. package/dist/components/base/CountDown/index.module.scss +49 -44
  22. package/dist/components/base/CountDown/index.tsx +1 -1
  23. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  24. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  25. package/dist/components/base/CustomVideo/index.tsx +1 -1
  26. package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
  27. package/dist/components/base/Dialog/index.module.scss +11 -0
  28. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  29. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  30. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  31. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  32. package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
  33. package/dist/components/base/InViewRender/index.tsx +1 -1
  34. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  35. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  36. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  37. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  38. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  39. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  40. package/dist/components/base/NetworkDataError/const.ts +1 -1
  41. package/dist/components/base/NetworkDataError/index.module.scss +118 -72
  42. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  43. package/dist/components/base/Price/Base/index.module.scss +12 -0
  44. package/dist/components/base/Price/Base/index.tsx +1 -1
  45. package/dist/components/base/Price/Double/index.module.scss +33 -1
  46. package/dist/components/base/Price/Double/index.tsx +1 -1
  47. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  48. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  49. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  50. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  51. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  52. package/dist/components/floorItem.tsx +1 -1
  53. package/dist/components/floorItem.weapp.tsx +1 -1
  54. package/dist/components/isv/Floor/index.tsx +1 -1
  55. package/dist/components/remoteFloorItem.tsx +1 -1
  56. package/dist/config/env.ts +1 -1
  57. package/dist/interface/common.ts +1 -1
  58. package/dist/interface/component.ts +1 -1
  59. package/dist/interface/jumpEventReport.ts +1 -1
  60. package/dist/interface/service.ts +1 -1
  61. package/dist/jumpEventReport/base.ts +1 -1
  62. package/dist/jumpEventReport/const.ts +1 -1
  63. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  64. package/dist/jumpEventReport/index.h5.ts +1 -1
  65. package/dist/jumpEventReport/index.jd.ts +1 -1
  66. package/dist/jumpEventReport/index.weapp.ts +1 -1
  67. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  68. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  69. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  70. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  71. package/dist/jumpEventReport/web/report.ts +1 -1
  72. package/dist/jumpEventReport/web.base.ts +1 -1
  73. package/dist/jumpEventReport/web.jd.ts +1 -1
  74. package/dist/jumpEventReport/web.jdb.ts +1 -1
  75. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  76. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  77. package/dist/jumpEventReport/web.pc.ts +1 -1
  78. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  79. package/dist/jumpEventReport/web.tjm.ts +1 -1
  80. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  81. package/dist/language/en_US.json +395 -0
  82. package/dist/language/zh_CN.json +395 -0
  83. package/dist/language/zh_HK.json +395 -0
  84. package/dist/libs/openShopBridge.js +161 -0
  85. package/dist/libs/openShopBridge.min.js +1 -0
  86. package/dist/libs/taroAppReport.js +2 -2
  87. package/dist/modules/ContainerFloorList/index.h5.module.scss +80 -53
  88. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  89. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  90. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  91. package/dist/open/api/environment.ts +1 -1
  92. package/dist/open/api/shopMember.ts +1 -1
  93. package/dist/open/api/shopMember.weapp.ts +1 -0
  94. package/dist/open/api/track.ts +1 -1
  95. package/dist/open/api/util.ts +1 -1
  96. package/dist/open/components/index.ts +1 -1
  97. package/dist/open/index.ts +1 -1
  98. package/dist/sass/app.h5.scss +278 -224
  99. package/dist/sass/base.scss +150 -145
  100. package/dist/service/fetchGateway.ts +1 -1
  101. package/dist/service/fetchGateway.weapp.ts +1 -0
  102. package/dist/service/fetchJsonp.weapp.ts +1 -0
  103. package/dist/service/http/colorSign.ts +1 -1
  104. package/dist/service/http/const.ts +1 -1
  105. package/dist/service/http/h5Http.ts +1 -1
  106. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  107. package/dist/service/requestServer.h5.ts +1 -1
  108. package/dist/service/requestServer.ts +1 -1
  109. package/dist/service/requestServer.weapp.ts +1 -0
  110. package/dist/utils/connectNativeJsBridge.ts +1 -1
  111. package/dist/utils/h5Utils.ts +1 -1
  112. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  113. package/dist/utils/harmonyCallRouter.ts +0 -0
  114. package/dist/utils/index.h5.ts +1 -1
  115. package/dist/utils/index.ts +1 -1
  116. package/dist/utils/index.weapp.ts +1 -1
  117. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  118. package/dist/utils/jumpExtMapUtil.ts +1 -0
  119. package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
  120. package/dist/utils/log.ts +1 -0
  121. package/dist/utils/sColor.ts +1 -0
  122. package/dist/utils/sColor.weapp.ts +1 -0
  123. package/dist/utils/utils.ts +1 -1
  124. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  125. package/dist/wxapp/common/user_info.js +1 -1
  126. package/package.json +162 -141
  127. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  128. package/dist/utils/memberFormatUtils.js +0 -1
  129. package/dist/utils/priceUtils.js +0 -1
@@ -0,0 +1 @@
1
+ const CustomVideo = (props) => {
2
  console.log('CustomVideo 小程序端 暂无实现',props)
1
3
  return null
@@ -119,3 +119,14 @@
119
119
  transform: scale3d(1, 1, 1);
120
120
  }
121
121
  }
122
+ :global{
123
+ .d-shop-pad{
124
+ :local{
125
+
126
+ .d-dialog-content{
127
+ max-width: 520PX;
128
+ }
129
+ }
130
+ }
131
+
132
+ }
@@ -6,8 +6,8 @@
6
6
  left: 0;
7
7
  right: 0;
8
8
  bottom: 0;
9
- opacity: 0;
10
- pointer-events: none;
9
+ opacity: 0;
10
+ pointer-events: none;
11
11
  z-index: -1;
12
12
  }
13
13
  //楼层曝光
@@ -20,3 +20,13 @@
20
20
  pointer-events: none;
21
21
  z-index: -1;
22
22
  }
23
+
24
+ :global{
25
+ .d-report-exposure-jd-point{
26
+ &:not(:empty){
27
+ opacity: 1;
28
+ z-index: 20;
29
+ }
30
+ }
31
+ }
32
+
@@ -1 +1 @@
1
- import React, { useMemo } from 'react'
2
1
  const { type, className, reportData, customReportDataKey, customReportDataFn, trackCallback, markPoint } = props
3
2
  const isCustomReport = customReportDataKey && customReportDataFn
4
3
  const isViewOnlineState =
5
4
  taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
6
5
  const showRenderState = isCustomReport ? true : reportData
7
6
  const inViewCallback = () => {
8
7
  console.log('埋点收到进入可视区域的回调啦!', reportData)
9
8
  if(!isCustomReport){
10
9
  addReportData(reportData)
11
10
  typeof trackCallback === 'function' && trackCallback(reportData)
12
11
  }else {
13
12
  typeof customReportDataFn === 'function' && customReportDataFn(customReportDataKey)
14
13
  }
15
14
  }
16
15
  let chartPointClassName = ""
17
16
 
18
17
  if(isChartH5 && markPoint && Array.isArray(reportData)){
19
18
  const [floorData, mInfo] = reportData
20
19
  if(floorData && mInfo && mInfo.hasOwnProperty('pos') ){
21
20
  chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos)
22
21
  }
23
22
  }else if(isCustomReport){
24
23
  chartPointClassName = `J_custom_${customReportDataKey}`
25
24
  }
26
25
  return isViewOnlineState && showRenderState
27
26
  ? <InViewRender className={classNames(
28
27
  {
29
28
  [exposureStyle['d-report-point']]: type === TrackType.point,
30
29
  },
31
30
  {
32
31
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
33
32
  },
34
33
  className,
35
34
  chartPointClassName
36
35
  )} height={'100%'} inViewCallback={inViewCallback}></InViewRender>
37
36
  : null
38
37
  return useMemo(() => {
39
38
  return <Exposure {...props} />
40
39
  }, [])
41
40
  reportData: null,
42
41
  trackCallback: null,
43
42
  type: TrackType.point,
44
43
  markPoint: false
44
+ import React, { useMemo } from 'react';
45
45
  const {
46
46
  type,
47
47
  className,
48
48
  reportData,
49
49
  customReportDataKey,
50
50
  customReportDataFn,
51
51
  trackCallback,
52
52
  markPoint,
53
53
  innerRef,
54
54
  } = props;
55
55
  const isCustomReport = customReportDataKey && customReportDataFn;
56
56
  const isViewOnlineState = taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE;
57
57
  const showRenderState = isCustomReport ? true : reportData;
58
58
  const inViewCallback = () => {
59
59
  const getInsertFlowMapEle =
60
60
  innerRef?.current?.querySelector('.d-report-exposure-point') || createDefaultFlowMapEle;
61
61
  if (!isCustomReport) {
62
62
  addReportData(reportData, getInsertFlowMapEle);
63
63
  typeof trackCallback === 'function' && trackCallback(reportData);
64
64
  } else {
65
65
  if (typeof customReportDataFn === 'function') {
66
66
  const getReportData = customReportDataFn(customReportDataKey);
67
67
  if(getReportData){
68
68
  const { eventId, spmAllCode, spmCodeForCD, jsonParam } = getReportData;
69
69
  (eventId || spmAllCode || spmCodeForCD) &&
70
70
  jsonParam &&
71
71
  track.reportExposureEventLog({
72
72
  ...getReportData,
73
73
  target: getInsertFlowMapEle,
74
74
  });
75
75
  }
76
76
  }
77
77
  }
78
78
  };
79
79
  let chartPointClassName = '';
80
80
 
81
81
  if (isChartH5 && markPoint && Array.isArray(reportData)) {
82
82
  const [floorData, mInfo] = reportData;
83
83
  if (floorData && mInfo && mInfo.hasOwnProperty('pos')) {
84
84
  chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos);
85
85
  }
86
86
  } else if (isCustomReport) {
87
87
  chartPointClassName = `J_custom_${customReportDataKey}`;
88
88
  }
89
89
  return isViewOnlineState && showRenderState ? (
90
90
  <InViewRender
91
91
  className={classNames(
92
92
  'd-report-exposure-point',
93
93
  {
94
94
  [exposureStyle['d-report-point']]: type === TrackType.point,
95
95
  },
96
96
  {
97
97
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
98
98
  },
99
99
  {
100
100
  'd-report-exposure-jd-point': isJdApp,
101
101
  },
102
102
  className,
103
103
  chartPointClassName,
104
104
  )}
105
105
  height={'100%'}
106
106
  inViewCallback={inViewCallback}
107
107
  ></InViewRender>
108
108
  ) : null;
109
109
  return useMemo(() => {
110
110
  return <Exposure {...props} />;
111
111
  }, []);
112
112
  reportData: null,
113
113
  trackCallback: null,
114
114
  type: TrackType.point,
115
115
  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(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
  if (!Array.isArray(data)) {
66
66
  console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data);
67
67
  return;
68
68
  }
69
69
  const [floorData, mInfo, etModelInfo] = data;
70
70
  if (floorData && mInfo && etModelInfo) {
71
71
  const isIsvReportModule = isvReportModuleTypeList.includes(floorData?.floorExtInfo?.moduleFlag);
72
72
  try {
73
73
  const reportJson = track.getExposureInfo(
74
74
  floorData,
75
75
  mInfo,
76
76
  etModelInfo,
77
77
  true,
78
78
  isIsvReportModule,
79
79
  );
80
80
  reportJson['target'] = target;
81
81
  console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`, reportJson);
82
82
  track.reportExposureEventLog(reportJson);
83
83
  } catch (e) {
84
84
  console.log('坑位曝光埋点出错啦', e);
85
85
  }
86
86
  } else {
87
87
  console.log(
88
88
  '坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:',
89
89
  data,
90
90
  );
91
91
  }
@@ -0,0 +1 @@
1
+ const InOrOutViewObserver = (props) => {
2
  console.log('InOrOutViewObserver props 暂无实现', props)
1
3
  return null
@@ -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(
7
6
  false,
8
7
  )
9
8
  const componentLazyRef = useRef<HTMLElement | null>(null)
10
9
  const componentShowStateRef = useRef(false)
11
10
  const needShowHighVersion =
12
11
  isH5AndJdShopViewH5Scroll &&
13
12
  !(
14
13
  global.info.queryInfo?.downgraded &&
15
14
  global.info.queryInfo.downgraded === 'true'
16
15
  )
17
16
  const rootDom =
18
17
  isH5AndJdShopView && needShowHighVersion
19
18
  ? null
20
19
  : document.querySelector('#J_shopHomeRoot')
21
20
  if (isH5AndJdShopView && !needShowHighVersion && !isAppStowShop) {
22
21
  useEffect(() => {
23
22
  const latestRes =
24
23
  latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
25
24
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
26
25
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, res => {
27
26
  !componentShowStateRef.current && dealPageScrollInfo(res)
28
27
  })
29
28
  }, [])
30
29
  useEffect(() => {
31
30
  if (componentShowState) {
32
31
  typeof inViewCallback === 'function' && inViewCallback()
33
32
  }
34
33
  }, [componentShowState])
35
34
 
36
35
  const dealPageScrollInfo = res => {
37
36
  const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
38
37
  if (
39
38
  typeof displayHeight === 'undefined' ||
40
39
  typeof offSetY === 'undefined'
41
40
  )
42
41
  return
43
42
  if (componentLazyRef.current) {
44
43
  const eleClientRect = componentLazyRef.current.getBoundingClientRect()
45
44
  const getContainerHeightOffSetY = displayHeight + offSetY
46
45
  const eleOffsetTop = Math.ceil(eleClientRect.top)
47
46
  if (!componentShowStateRef.current) {
48
47
  if (getContainerHeightOffSetY > eleOffsetTop) {
49
48
  componentShowStateRef.current = true
50
49
  setComponentShowState(true)
51
50
  Taro.nextTick(() => {
52
51
  setComponentRenderShowState(true)
53
52
  })
54
53
  }
55
54
  }
56
55
  }
57
56
  }
58
57
  return (
59
58
  <View
60
59
  ref={componentLazyRef}
61
60
  className={classNames(
62
61
  lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
63
62
  'd-app-floor-lazy-load',
64
63
  className,
65
64
  )}
66
65
  style={{
67
66
  minHeight: `${
68
67
  componentRenderShowState
69
68
  ? 'auto'
70
69
  : height + (typeof height === 'number' ? 'px' : '')
71
70
  }`,
72
71
  backgroundColor: componentRenderShowState ? 'transparent' : '#ffffff',
73
72
  }}
74
73
  >
75
74
  {componentShowState ? children : placeholder}
76
75
  </View>
77
76
  )
78
77
  } else {
79
78
  const { ref, inView } = useInView({
80
79
  threshold: 0.5,
81
80
  triggerOnce: true,
82
81
  root: rootDom || null,
83
82
  rootMargin: `0px 0px 0px 0px`,
84
83
  delay: 300,
85
84
  })
86
85
  useEffect(() => {
87
86
  if (inView) {
88
87
  typeof inViewCallback === 'function' && inViewCallback()
89
88
  }
90
89
  }, [inView])
91
90
  return (
92
91
  <View
93
92
  className={className}
94
93
  ref={ref}
95
94
  style={{
96
95
  minHeight: inView
97
96
  ? 'auto'
98
97
  : typeof height === 'number'
99
98
  ? `${height}px`
100
99
  : height,
101
100
  backgroundColor: 'transparent',
102
101
  }}
103
102
  >
104
103
  {inView ? children : placeholder}
105
104
  </View>
106
105
  )
107
106
  }
108
107
  children: null,
109
108
  placeholder: null,
110
109
  height: 1,
111
110
  className: '',
112
111
  lazyNodeClassName: '',
113
112
  inViewCallback: null,
113
+ import Taro from '@tarojs/taro';
114
114
  getNativePageScrollRes,
115
115
  latestFromNativeMsgStorage,
116
116
  const { children, placeholder, height, className, inViewCallback } = props;
117
117
  const [componentShowState, setComponentShowState] = useState(false);
118
118
  const [componentRenderShowState, setComponentRenderShowState] = useState(false);
119
119
  const componentLazyRef = useRef<HTMLElement | null>(null);
120
120
  const componentShowStateRef = useRef(false);
121
121
  const needShowHighVersion =
122
122
  isH5AndJdShopViewH5Scroll &&
123
123
  !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === 'true');
124
124
  const rootDom =
125
125
  isH5AndJdShopView && needShowHighVersion ? null : document.querySelector('#J_shopHomeRoot');
126
126
  if (isH5AndJdShopView && !needShowHighVersion && !isAppStowShop) {
127
127
  useEffect(() => {
128
128
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
129
129
  !componentShowStateRef.current && dealPageScrollInfo(latestRes);
130
130
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
131
131
  !componentShowStateRef.current && dealPageScrollInfo(res);
132
132
  });
133
133
  }, []);
134
134
  useEffect(() => {
135
135
  if (componentShowState) {
136
136
  typeof inViewCallback === 'function' && inViewCallback();
137
137
  }
138
138
  }, [componentShowState]);
139
139
 
140
140
  const dealPageScrollInfo = (res) => {
141
141
  const { displayHeight, offSetY } = getNativePageScrollRes(res) || {};
142
142
  if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return;
143
143
  if (componentLazyRef.current) {
144
144
  const eleClientRect = componentLazyRef.current.getBoundingClientRect();
145
145
  const getContainerHeightOffSetY = displayHeight + offSetY;
146
146
  const eleOffsetTop = Math.ceil(eleClientRect.top);
147
147
  if (!componentShowStateRef.current) {
148
148
  if (getContainerHeightOffSetY > eleOffsetTop) {
149
149
  componentShowStateRef.current = true;
150
150
  setComponentShowState(true);
151
151
  Taro.nextTick(() => {
152
152
  setComponentRenderShowState(true);
153
153
  });
154
154
  }
155
155
  }
156
156
  }
157
157
  };
158
158
  return (
159
159
  <View
160
160
  ref={componentLazyRef}
161
161
  className={classNames(
162
162
  lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
163
163
  'd-app-floor-lazy-load',
164
164
  className,
165
165
  )}
166
166
  style={{
167
167
  minHeight: `${
168
168
  componentRenderShowState ? 'auto' : height + (typeof height === 'number' ? 'px' : '')
169
169
  }`,
170
170
  backgroundColor: componentRenderShowState ? 'transparent' : '#ffffff',
171
171
  }}
172
172
  >
173
173
  {componentShowState ? children : placeholder}
174
174
  </View>
175
175
  );
176
176
  } else {
177
177
  const { ref, inView } = useInView({
178
178
  threshold: 0.5,
179
179
  triggerOnce: true,
180
180
  root: rootDom || null,
181
181
  rootMargin: `0px 0px 0px 0px`,
182
182
  delay: 300,
183
183
  });
184
184
  useEffect(() => {
185
185
  if (inView) {
186
186
  typeof inViewCallback === 'function' && inViewCallback();
187
187
  }
188
188
  }, [inView]);
189
189
  return (
190
190
  <div
191
191
  className={className}
192
192
  ref={ref}
193
193
  style={{
194
194
  minHeight: inView ? 'auto' : typeof height === 'number' ? `${height}px` : height,
195
195
  backgroundColor: 'transparent',
196
196
  }}
197
197
  >
198
198
  {inView ? children : placeholder}
199
199
  </div>
200
200
  );
201
201
  }
202
202
  children: null,
203
203
  placeholder: null,
204
204
  height: 1,
205
205
  className: '',
206
206
  lazyNodeClassName: '',
207
207
  inViewCallback: null,
@@ -1,7 +1,7 @@
1
1
 
2
- .d-item-point-layout{
2
+ .d-item-point-layout {
3
3
  position: relative;
4
- .d-item-chart-point{
4
+ .d-item-chart-point {
5
5
  opacity: 1;
6
6
  z-index: 100;
7
7
  }