@conecli/cone-render 0.9.1-shop2.13 → 0.9.1-shop2.14

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 (35) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/index.weapp.ts +1 -1
  4. package/dist/common/sgmCustomCode.ts +1 -1
  5. package/dist/components/ErrorBoundary.tsx +1 -1
  6. package/dist/components/base/CustomVideo/index.tsx +1 -1
  7. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  8. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  9. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  10. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  11. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  12. package/dist/components/remoteFloorItem.tsx +1 -1
  13. package/dist/interface/component.ts +1 -1
  14. package/dist/jumpEventReport/base.ts +1 -1
  15. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  16. package/dist/jumpEventReport/web.base.ts +1 -1
  17. package/dist/jumpEventReport/web.jd.ts +1 -1
  18. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
  19. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  20. package/dist/open/api/device.ts +1 -1
  21. package/dist/open/api/request.ts +1 -1
  22. package/dist/open/api/shopMember.ts +1 -1
  23. package/dist/open/api/util.ts +1 -1
  24. package/dist/open/components/index.ts +1 -1
  25. package/dist/sass/app.h5.scss +5 -0
  26. package/dist/service/requestServer.ts +1 -1
  27. package/dist/utils/connectNativeJsBridge.ts +1 -1
  28. package/dist/utils/h5Utils.ts +1 -1
  29. package/dist/utils/index.h5.ts +1 -1
  30. package/dist/utils/index.ts +1 -1
  31. package/dist/utils/index.weapp.ts +1 -1
  32. package/dist/utils/sgmCodeUtils.ts +1 -1
  33. package/dist/utils/taroRenderUtil.ts +1 -1
  34. package/dist/utils/utils.ts +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- import React, {useEffect, useRef} from 'react'
2
1
  const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
3
2
  const headerRef:any = useRef(null)
4
3
  useEffect(() => {
5
4
  hasCommonHeader && initCommonHeader()
6
5
  hasDownloadTips && initDownloadAppLayerConfigData()
7
6
  }, [])
8
7
  const scrollEventFunc = () => {
9
8
  const stickyTop = headerRef.current?.getBoundingClientRect()?.top || 0;
10
9
  const rootScrollEleNode = document.querySelector('#J_shopHomeRoot')
11
10
  if (rootScrollEleNode && rootScrollEleNode.scrollTop > stickyTop) {
12
11
  headerRef.current.classList.add('d-mobile-header-sticky');
13
12
  } else {
14
13
  headerRef.current.classList.remove('d-mobile-header-sticky');
15
14
  }
16
15
  }
17
16
  useEffect(() => {
18
17
  if(!headerRef.current) return
19
18
  const rootScrollEleNode = document.querySelector('#J_shopHomeRoot')
20
19
  rootScrollEleNode && rootScrollEleNode.addEventListener('scroll', scrollEventFunc);
21
20
  return () => {
22
21
  rootScrollEleNode && rootScrollEleNode.removeEventListener('scroll', scrollEventFunc)
23
22
  }
24
23
  },[])
25
24
  const initCommonHeader = () => {
26
25
  if (window?.MCommonHeaderBottom) {
27
26
  const mchb = new MCommonHeaderBottom()
28
27
  const headerArg = {
29
28
  moduleName: 'shop',
30
29
  hrederId: 'm_common_header',
31
30
  title,
32
31
  stype: 1,
33
32
  onClickJdkey: function () {
34
33
  console.log('==>m_common_header jdkey click.')
35
34
  },
36
35
  ...headerParams
37
36
  }
38
37
  mchb.header(headerArg)
39
38
  }
40
39
  }
41
40
  const initDownloadAppLayerConfigData = () => {
42
41
  const getEle = document.getElementById('m_common_tip')
43
42
  getEle &&
44
43
  window.$ &&
45
44
  window.$.downloadAppLayerConfigData &&
46
45
  window.$.downloadAppLayerConfigData({
47
46
  tipId: 'm_common_tip',
48
47
  M_sourceFrom: 'jshop',
49
48
  bottom: 74,
50
49
  onClickTipX: () => {
51
50
  Taro.eventCenter.trigger(
52
51
  TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
53
52
  true,
54
53
  )
55
54
  },
56
55
  downloadAppPlugIn: {
57
56
  M_sourceFrom: 'jshop',
58
57
  openAppBtnId: 'download_openapp',
59
58
  downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
60
59
  inteneUrl: 'openapp.jdmobile://virtual?',
61
60
  inteneUrlParams: {
62
61
  category: 'jump',
63
62
  des: 'jshopMain',
64
63
  shopId: `${global.info.queryInfo.shopId || ''}`,
65
64
  venderId: `${global.info.queryInfo.venderId || ''}`,
66
65
  sourceType: global.info.queryInfo?.sourceType || 'M-H5',
67
66
  sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
68
67
  ...openAppParams,
69
68
  },
70
69
  },
71
70
  })
72
71
  }
73
72
  return !isWxMiniH5View && !isJdApp ? (
74
73
  <View
75
74
  className={mobileCommonHeaderStyle['d-mobile-header-layout']}
76
75
  style={style}
77
76
  ref={headerRef}
78
77
  >
79
78
  <View
80
79
  id="m_common_tip"
81
80
  className={mobileCommonHeaderStyle['d-mobile-common-tip']}
82
81
  />
83
82
  {hasCommonHeader && (
84
83
  <View
85
84
  id="m_common_header"
86
85
  className={mobileCommonHeaderStyle['d-mobile-common-header']}
87
86
  />
88
87
  )}
89
88
  </View>
90
89
  ) : null
91
90
  title: '店铺',
92
91
  openAppParams: {},
92
+ import React, {useEffect, useRef} from 'react'
93
93
  const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
94
94
  const headerRef:any = useRef(null)
95
95
  useEffect(() => {
96
96
  hasCommonHeader && initCommonHeader()
97
97
  hasDownloadTips && initDownloadAppLayerConfigData()
98
98
  }, [])
99
99
  const isScrolledToTop = () => {
100
100
  return window.scrollY !== undefined ? window.scrollY === 0 :
101
101
  document.documentElement.scrollTop === 0 || document.body.scrollTop === 0;
102
102
  }
103
103
  const scrollEventFunc = () => {
104
104
  if(!headerRef.current) return
105
105
  const stickyTop = headerRef.current?.getBoundingClientRect()?.top || 0;
106
106
  if(Math.trunc(stickyTop) <= 0 && !isScrolledToTop()) {
107
107
  console.log('scroll 添加class',Math.trunc(stickyTop), isScrolledToTop())
108
108
  headerRef.current.classList.add('d-mobile-header-sticky');
109
109
  }else {
110
110
  console.log('scroll 移除class',Math.trunc(stickyTop), isScrolledToTop())
111
111
  headerRef.current.classList.remove('d-mobile-header-sticky');
112
112
  }
113
113
  }
114
114
  useEffect(() => {
115
115
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL,() => {
116
116
  scrollEventFunc()
117
117
  })
118
118
  },[])
119
119
  const initCommonHeader = () => {
120
120
  if (window?.MCommonHeaderBottom) {
121
121
  const mchb = new MCommonHeaderBottom()
122
122
  const headerArg = {
123
123
  moduleName: 'shop',
124
124
  hrederId: 'm_common_header',
125
125
  title,
126
126
  stype: 1,
127
127
  onClickJdkey: function () {
128
128
  console.log('==>m_common_header jdkey click.')
129
129
  },
130
130
  ...headerParams
131
131
  }
132
132
  mchb.header(headerArg)
133
133
  }
134
134
  }
135
135
  const initDownloadAppLayerConfigData = () => {
136
136
  const getEle = document.getElementById('m_common_tip')
137
137
  getEle &&
138
138
  window.$ &&
139
139
  window.$.downloadAppLayerConfigData &&
140
140
  window.$.downloadAppLayerConfigData({
141
141
  tipId: 'm_common_tip',
142
142
  M_sourceFrom: 'jshop',
143
143
  bottom: 74,
144
144
  onClickTipX: () => {
145
145
  Taro.eventCenter.trigger(
146
146
  TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
147
147
  true,
148
148
  )
149
149
  },
150
150
  downloadAppPlugIn: {
151
151
  M_sourceFrom: 'jshop',
152
152
  openAppBtnId: 'download_openapp',
153
153
  downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
154
154
  inteneUrl: 'openapp.jdmobile://virtual?',
155
155
  inteneUrlParams: {
156
156
  category: 'jump',
157
157
  des: 'jshopMain',
158
158
  shopId: `${global.info.queryInfo.shopId || ''}`,
159
159
  venderId: `${global.info.queryInfo.venderId || ''}`,
160
160
  sourceType: global.info.queryInfo?.sourceType || 'M-H5',
161
161
  sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
162
162
  ...openAppParams,
163
163
  },
164
164
  },
165
165
  })
166
166
  }
167
167
  return !isWxMiniH5View && !isJdApp ? (
168
168
  <View
169
169
  className={mobileCommonHeaderStyle['d-mobile-header-layout']}
170
170
  style={style}
171
171
  ref={headerRef}
172
172
  >
173
173
  <View
174
174
  id="m_common_tip"
175
175
  className={mobileCommonHeaderStyle['d-mobile-common-tip']}
176
176
  />
177
177
  {hasCommonHeader && (
178
178
  <View
179
179
  id="m_common_header"
180
180
  className={mobileCommonHeaderStyle['d-mobile-common-header']}
181
181
  />
182
182
  )}
183
183
  </View>
184
184
  ) : null
185
185
  title: '店铺',
186
186
  openAppParams: {},
@@ -89,3 +89,6 @@
89
89
  min-height: 500px;
90
90
  background: #f2f2f2;
91
91
  }
92
+ .d-shop-network-no-position {
93
+ position: static;
94
+ }
@@ -1 +1 @@
1
- import { Button, View } from '@tarojs/components'
2
1
  NetWorkErrorList,
3
2
  NetWorkErrorTip,
4
3
  NetWorkErrorSubTip,
5
4
  NetWorkShowType,
6
5
  NetWork_Image_Type,
7
6
  const {
8
7
  className,
9
8
  message,
10
9
  subMessage,
11
10
  btnLabel,
12
11
  backgroundColorWhite,
13
12
  netWorkDataType,
14
13
  netWorkShowType,
15
14
  netWorkImageType,
16
15
  refreshCallBackFn,
17
16
  viewMaxHeight
18
17
  } = props
19
18
  const refershInitData = useCallback(() => {
20
19
  refreshCallBackFn && refreshCallBackFn(true)
21
20
  }, [])
22
21
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
23
22
  const useErrorSubTip = subMessage
24
23
  ? subMessage
25
24
  : NetWorkErrorSubTip[netWorkDataType]
26
25
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
27
26
  const maxHeight = latestRes.displayHeight || 546
28
27
  return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
29
28
  <View
30
29
  style={{ maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight }}
31
30
  className={classNames(
32
31
  netWorkErrorStyle['d-shop-network'],
33
32
  {
34
33
  [netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
35
34
  },
36
35
  {
37
36
  [netWorkErrorStyle['d-shop-network-part']]:
38
37
  netWorkShowType === NetWorkShowType.PART,
39
38
  },
40
39
  {
41
40
  [netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
42
41
  },
43
42
  'flexible-center-box',
44
43
  className,
45
44
  )}
46
45
  >
47
46
  <View className={classNames(netWorkErrorStyle['d-error-content'],'d-error-content')}>
48
47
  <View
49
48
  className={classNames(
50
49
  netWorkErrorStyle['d-error-type'],
51
50
  netWorkErrorStyle[`d-${netWorkDataType}`],
52
51
  netWorkErrorStyle[`d-${netWorkImageType}`],
53
52
  'd-error-type'
54
53
  )}
55
54
  />
56
55
  <View className={classNames(netWorkErrorStyle['d-error-tip'],'d-error-tip')}>
57
56
  {useErrorTip}
58
57
  </View>
59
58
  {useErrorSubTip ? <View className={classNames(netWorkErrorStyle['d-error-sub-tip'],'d-error-sub-tip')}>{useErrorSubTip}</View> : null}
60
59
  <View className={'flexible-horizontal-center-box'}>
61
60
  {refreshCallBackFn && (
62
61
  <Button
63
62
  onClick={refershInitData}
64
63
  className={classNames(
65
64
  netWorkErrorStyle['d-opt-btn'],
66
65
  'd-button-no-border',
67
66
  'd-opt-btn'
68
67
  )}
69
68
  plain
70
69
  size="mini"
71
70
  >
72
71
  {btnLabel}
73
72
  </Button>
74
73
  )}
75
74
  </View>
76
75
  </View>
77
76
  </View>
78
77
  ) : null
79
78
  className: '',
80
79
  message: '',
81
80
  subMessage: '',
82
81
  btnLabel: '重新加载',
83
82
  backgroundColorWhite: false,
84
83
  netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
85
84
  netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
86
85
  netWorkShowType: NetWorkShowType.FULL,
87
86
  refreshCallBackFn: null,
88
87
  viewMaxHeight: ''
88
+ import { Button, View } from '@tarojs/components'
89
89
  NetWorkErrorList,
90
90
  NetWorkErrorTip,
91
91
  NetWorkErrorSubTip,
92
92
  NetWorkShowType,
93
93
  NetWork_Image_Type,
94
94
  const {
95
95
  className,
96
96
  message,
97
97
  subMessage,
98
98
  btnLabel,
99
99
  backgroundColorWhite,
100
100
  netWorkDataType,
101
101
  netWorkShowType,
102
102
  netWorkImageType,
103
103
  refreshCallBackFn,
104
104
  viewMaxHeight,
105
105
  noPosition = false,
106
106
  } = props
107
107
  const refershInitData = useCallback(() => {
108
108
  refreshCallBackFn && refreshCallBackFn(true)
109
109
  }, [])
110
110
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
111
111
  const useErrorSubTip = subMessage
112
112
  ? subMessage
113
113
  : NetWorkErrorSubTip[netWorkDataType]
114
114
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
115
115
  const maxHeight = latestRes.displayHeight || 546
116
116
  return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
117
117
  <View
118
118
  style={{ maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight }}
119
119
  className={classNames(
120
120
  netWorkErrorStyle['d-shop-network'],
121
121
  {
122
122
  [netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
123
123
  },
124
124
  {
125
125
  [netWorkErrorStyle['d-shop-network-part']]:
126
126
  netWorkShowType === NetWorkShowType.PART,
127
127
  },
128
128
  {
129
129
  [netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
130
130
  },
131
131
  {
132
132
  [netWorkErrorStyle['d-shop-network-no-position']]: noPosition
133
133
  },
134
134
  'flexible-center-box',
135
135
  className,
136
136
  )}
137
137
  >
138
138
  <View className={classNames(netWorkErrorStyle['d-error-content'],'d-error-content')}>
139
139
  <View
140
140
  className={classNames(
141
141
  netWorkErrorStyle['d-error-type'],
142
142
  netWorkErrorStyle[`d-${netWorkDataType}`],
143
143
  netWorkErrorStyle[`d-${netWorkImageType}`],
144
144
  'd-error-type'
145
145
  )}
146
146
  />
147
147
  <View className={classNames(netWorkErrorStyle['d-error-tip'],'d-error-tip')}>
148
148
  {useErrorTip}
149
149
  </View>
150
150
  {useErrorSubTip ? <View className={classNames(netWorkErrorStyle['d-error-sub-tip'],'d-error-sub-tip')}>{useErrorSubTip}</View> : null}
151
151
  <View className={'flexible-horizontal-center-box'}>
152
152
  {refreshCallBackFn && (
153
153
  <Button
154
154
  onClick={refershInitData}
155
155
  className={classNames(
156
156
  netWorkErrorStyle['d-opt-btn'],
157
157
  'd-button-no-border',
158
158
  'd-opt-btn'
159
159
  )}
160
160
  plain
161
161
  size="mini"
162
162
  >
163
163
  {btnLabel}
164
164
  </Button>
165
165
  )}
166
166
  </View>
167
167
  </View>
168
168
  </View>
169
169
  ) : null
170
170
  className: '',
171
171
  message: '',
172
172
  subMessage: '',
173
173
  btnLabel: '重新加载',
174
174
  backgroundColorWhite: false,
175
175
  netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
176
176
  netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
177
177
  netWorkShowType: NetWorkShowType.FULL,
178
178
  refreshCallBackFn: null,
179
179
  viewMaxHeight: ''
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  getBundleUrl,
3
2
  getBundleFileName,
4
3
  formatPackResult,
5
4
  const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
6
5
  const dataDefines = getFloorDataToDataDefines(floorData)
7
6
  const [forceRenderTime,setForceRenderTime] = useState(1)
8
7
  useEffect(() => {
9
8
  isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
10
9
  setForceRenderTime(Date.now())
11
10
  })
12
11
  return () => {
13
12
  isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
14
13
  }
15
14
  },[])
16
15
 
17
16
  const getFloorSetHeight = (item) => {
18
17
  const getHeight = item?.floorExtInfo?.floorHeight
19
18
  ? Number(item?.floorExtInfo?.floorHeight)
20
19
  : 200
21
20
  return getHeight > 0 ? getHeight : 200
22
21
  }
23
22
  console.log(
24
23
  '>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
25
24
  )
26
25
  const renderResult = (() => {
27
26
  try {
28
27
  console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
29
28
  console.log(
30
29
  '==========当前业务类型renderSourceType、楼层floorId: ',
31
30
  renderSourceType,
32
31
  floorData.uid,
33
32
  )
34
33
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
35
34
  const modularPackResultObj = formatPackResult(modularPackResult)
36
35
  const bundleUrl = getBundleUrl(modularPackResultObj)
37
36
  const bundleFileName = getBundleFileName(modularPackResultObj)
38
37
  const opt = {
39
38
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
40
39
  floorIdx: floorData?.floorIdx,
41
40
  uid: floorData?.uid,
42
41
  shopId: floorData?.floorExtInfo?.shopId,
43
42
  moduleId: floorData?.moduleId,
44
43
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
45
44
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
46
45
  floorKind: floorData?.floorExtInfo?.floorKind,
47
46
  middleTemplateId: floorData?.middleTemplateId,
48
47
  modularPackResult: modularPackResult,
49
48
  }
50
49
  if (bundleUrl && bundleFileName) {
51
50
  let ISVModule =
52
51
  taroJdBaseInfo?.renderedIsvComponents[
53
52
  `${floorData.uid}_${bundleFileName}`
54
53
  ] || null
55
54
  if (!ISVModule) {
56
55
  ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
57
56
  console.log(
58
57
  '1|加载isv模块==========走lazy import生成新的isv模块react组件',
59
58
  bundleFileName,
60
59
  )
61
60
  taroJdBaseInfo.renderedIsvComponents[
62
61
  `${floorData.uid}_${bundleFileName}`
63
62
  ] = ISVModule
64
63
  console.log(
65
64
  '2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
66
65
  bundleFileName,
67
66
  window['taroJshopH5WebpackJsonp'].find(
68
67
  (item) => item[0][0] == bundleFileName,
69
68
  ),
70
69
  )
71
70
  } else {
72
71
  console.log(
73
72
  '1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
74
73
  taroJdBaseInfo,
75
74
  )
76
75
  console.log(
77
76
  '2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
78
77
  taroJdBaseInfo.renderedIsvComponents[
79
78
  `${floorData.uid}_${bundleFileName}`
80
79
  ],
81
80
  )
82
81
  }
83
82
  const _floorHeight = getFloorSetHeight(floorData)
84
83
  return (
85
84
  <ErrorBoundary {...props}>
86
85
  <Suspense
87
86
  fallback={
88
87
  <View
89
88
  style={{
90
89
  position: 'relative',
91
90
  background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
92
91
  height: `${_floorHeight}px`,
93
92
  }}
94
93
  ></View>
95
94
  }
96
95
  >
97
96
  <ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
98
97
  <ISVModule {...props} dataDefines={dataDefines}></ISVModule>
99
98
  </ISVFloor>
100
99
  </Suspense>
101
100
  </ErrorBoundary>
102
101
  )
103
102
  } else {
104
103
  console.log(
105
104
  '3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
106
105
  modularPackResultObj,
107
106
  )
108
107
  sgmCustomReport({
109
108
  code: getSgmCustomCode(SgmCustomCode.REMOTEMODULE_DATA),
110
109
  msg: opt,
111
110
  })
112
111
  return null
113
112
  }
114
113
  } catch (err) {
115
114
  console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
116
115
  return null
117
116
  }
118
117
  })()
119
118
  if (renderResult === null) {
120
119
  updateContainerFloorListDataFn &&
121
120
  updateContainerFloorListDataFn({
122
121
  type: 'filter',
123
122
  containerId: floorData?.uid,
124
123
  })
125
124
  console.log('renderResult === null: 命中了!')
126
125
  taroEventSendPageScrollInfo()
127
126
  } else {
128
127
  console.log('renderResult !== null: 没命中', renderResult)
129
128
  }
130
129
  return renderResult
130
+ import Taro from '@tarojs/taro'
131
131
  getBundleUrl,
132
132
  getBundleFileName,
133
133
  formatPackResult,
134
134
  getTaroVersion
135
135
  const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
136
136
  const dataDefines = getFloorDataToDataDefines(floorData)
137
137
  const [forceRenderTime,setForceRenderTime] = useState(1)
138
138
  useEffect(() => {
139
139
  isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
140
140
  setForceRenderTime(Date.now())
141
141
  })
142
142
  return () => {
143
143
  isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
144
144
  }
145
145
  },[])
146
146
 
147
147
  const getFloorSetHeight = (item) => {
148
148
  const getHeight = item?.floorExtInfo?.floorHeight
149
149
  ? Number(item?.floorExtInfo?.floorHeight)
150
150
  : 200
151
151
  return getHeight > 0 ? getHeight : 200
152
152
  }
153
153
  console.log(
154
154
  '>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
155
155
  )
156
156
  const renderResult = (() => {
157
157
  try {
158
158
  console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
159
159
  console.log(
160
160
  '==========当前业务类型renderSourceType、楼层floorId: ',
161
161
  renderSourceType,
162
162
  floorData.uid,
163
163
  )
164
164
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
165
165
  const modularPackResultObj = formatPackResult(modularPackResult)
166
166
  const bundleUrl = getBundleUrl(modularPackResultObj)
167
167
  const bundleFileName = getBundleFileName(modularPackResultObj)
168
168
  const taroVersion = getTaroVersion(modularPackResultObj)
169
169
  const opt = {
170
170
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
171
171
  floorIdx: floorData?.floorIdx,
172
172
  uid: floorData?.uid,
173
173
  shopId: floorData?.floorExtInfo?.shopId,
174
174
  moduleId: floorData?.moduleId,
175
175
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
176
176
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
177
177
  floorKind: floorData?.floorExtInfo?.floorKind,
178
178
  middleTemplateId: floorData?.middleTemplateId,
179
179
  modularPackResult: {
180
180
  bundleUrl,
181
181
  taroVersion
182
182
  }
183
183
  }
184
184
  if (bundleUrl && bundleFileName) {
185
185
  let ISVModule =
186
186
  taroJdBaseInfo?.renderedIsvComponents[
187
187
  `${floorData.uid}_${bundleFileName}`
188
188
  ] || null
189
189
  if (!ISVModule) {
190
190
  ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
191
191
  console.log(
192
192
  '1|加载isv模块==========走lazy import生成新的isv模块react组件',
193
193
  bundleFileName,
194
194
  )
195
195
  taroJdBaseInfo.renderedIsvComponents[
196
196
  `${floorData.uid}_${bundleFileName}`
197
197
  ] = ISVModule
198
198
  console.log(
199
199
  '2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
200
200
  bundleFileName,
201
201
  window['taroJshopH5WebpackJsonp'].find(
202
202
  (item) => item[0][0] == bundleFileName,
203
203
  ),
204
204
  )
205
205
  } else {
206
206
  console.log(
207
207
  '1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
208
208
  taroJdBaseInfo,
209
209
  )
210
210
  console.log(
211
211
  '2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
212
212
  taroJdBaseInfo.renderedIsvComponents[
213
213
  `${floorData.uid}_${bundleFileName}`
214
214
  ],
215
215
  )
216
216
  }
217
217
  const _floorHeight = getFloorSetHeight(floorData)
218
218
  return (
219
219
  <ErrorBoundary {...props}>
220
220
  <Suspense
221
221
  fallback={
222
222
  <View
223
223
  style={{
224
224
  position: 'relative',
225
225
  background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
226
226
  height: `${_floorHeight}px`,
227
227
  }}
228
228
  ></View>
229
229
  }
230
230
  >
231
231
  <ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
232
232
  <ISVModule {...props} dataDefines={dataDefines}></ISVModule>
233
233
  </ISVFloor>
234
234
  </Suspense>
235
235
  </ErrorBoundary>
236
236
  )
237
237
  } else {
238
238
  console.log(
239
239
  '3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
240
240
  modularPackResultObj,
241
241
  )
242
242
  sgmCustomReport({
243
243
  code: getSgmCustomCode(handleSgmCodeTaroVersion(floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE ? SgmCustomCode.SYSTEMPDCMODULE_DATA : SgmCustomCode.REMOTEMODULE_DATA)),
244
244
  msg: opt,
245
245
  })
246
246
  return null
247
247
  }
248
248
  } catch (err) {
249
249
  console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
250
250
  return null
251
251
  }
252
252
  })()
253
253
  if (renderResult === null) {
254
254
  updateContainerFloorListDataFn &&
255
255
  updateContainerFloorListDataFn({
256
256
  type: 'filter',
257
257
  containerId: floorData?.uid,
258
258
  })
259
259
  console.log('renderResult === null: 命中了!')
260
260
  taroEventSendPageScrollInfo()
261
261
  } else {
262
262
  console.log('renderResult !== null: 没命中', renderResult)
263
263
  }
264
264
  return renderResult