@conecli/cone-render 0.10.1-shop-beta.4 → 0.10.1-shop-beta.5

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 (63) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -1
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/sgmCustomCode.ts +1 -1
  9. package/dist/components/ErrorBoundary.tsx +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/CustomVideo/index.tsx +1 -1
  12. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  13. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  14. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  15. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  16. package/dist/components/base/LazyLoadImage/index.h5.module.scss +4 -0
  17. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  18. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  19. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  20. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  21. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  22. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  23. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  24. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  25. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  26. package/dist/components/floorItem.jd.tsx +1 -1
  27. package/dist/components/floorItem.tsx +1 -1
  28. package/dist/components/floorItem.weapp.tsx +1 -1
  29. package/dist/components/remoteFloorItem.tsx +1 -1
  30. package/dist/interface/common.ts +1 -1
  31. package/dist/interface/component.ts +1 -1
  32. package/dist/interface/jumpEventReport.ts +1 -1
  33. package/dist/interface/service.ts +1 -1
  34. package/dist/jumpEventReport/base.ts +1 -1
  35. package/dist/jumpEventReport/const.ts +1 -1
  36. package/dist/jumpEventReport/index.jd.ts +1 -1
  37. package/dist/jumpEventReport/index.weapp.ts +1 -1
  38. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  39. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  40. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  41. package/dist/jumpEventReport/web.base.ts +1 -1
  42. package/dist/jumpEventReport/web.jd.ts +1 -1
  43. package/dist/jumpEventReport/web.tjm.ts +1 -1
  44. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
  45. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  46. package/dist/open/api/device.ts +1 -1
  47. package/dist/open/api/request.ts +1 -1
  48. package/dist/open/api/shopMember.ts +1 -1
  49. package/dist/open/api/util.ts +1 -1
  50. package/dist/open/components/index.ts +1 -1
  51. package/dist/sass/app.h5.scss +5 -0
  52. package/dist/sass/base.scss +45 -0
  53. package/dist/service/requestServer.ts +1 -1
  54. package/dist/utils/connectNativeJsBridge.ts +1 -1
  55. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  56. package/dist/utils/h5Utils.ts +1 -1
  57. package/dist/utils/index.h5.ts +1 -1
  58. package/dist/utils/index.ts +1 -1
  59. package/dist/utils/index.weapp.ts +1 -1
  60. package/dist/utils/sgmCodeUtils.ts +1 -1
  61. package/dist/utils/taroRenderUtil.ts +1 -1
  62. package/dist/utils/utils.ts +1 -1
  63. package/package.json +24 -23
@@ -1 +1 @@
1
- import { View, Text } from '@tarojs/components'
2
1
  '//img11.360buyimg.com/imagetools/jfs/t1/141506/22/31698/7923/637b6db9E2af80265/10e76e2c31e0e356.png'
3
2
  const {
4
3
  moduleType,
5
4
  configEmpty,
6
5
  previewUri = null,
7
6
  uid,
8
7
  moduleFlag,
9
8
  moduleName,
10
9
  } = props.floorData
11
10
  let previewUrl = previewUri
12
11
  const newModuleFloorTypeList = [100, 101, 100000, 99999]
13
12
  const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
14
13
  if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
15
14
  previewUrl = decorateModulePrevDefaultUrl
16
15
  }
17
16
  const loadImageErr = e => {
18
17
  e.target.src = decorateModulePrevDefaultUrl
19
18
  }
20
19
  if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1)
21
20
  return null
22
21
  return isNewFloorState && configEmpty && previewUrl ? (
23
22
  <View
24
23
  className={emptyModuleStyle['d-empty-module']}
25
24
  data-floor-uid={uid}
26
25
  data-floor-type={moduleFlag}
27
26
  data-floor-modulename={moduleName}
28
27
  >
29
28
  {}
30
29
  {}
31
30
  {}
32
31
  {}
33
32
  {}
34
33
  {}
35
34
  {}
36
35
  <View className={classNames(emptyModuleStyle['d-empty-img'])}>
37
36
  <img
38
37
  width={355}
39
38
  className={classNames('J_floorEmptyDataImg')}
40
39
  src={previewUrl}
41
40
  onError={loadImageErr.bind(this)}
42
41
  />
43
42
  </View>
44
43
  </View>
45
44
  ) : (
46
45
  <View
47
46
  className={classNames(
48
47
  emptyModuleStyle['d-empty-module'],
49
48
  emptyModuleStyle['d-empty-text-warp'],
50
49
  )}
51
50
  data-floor-uid={uid}
52
51
  data-floor-type={moduleFlag}
53
52
  data-floor-modulename={moduleName}
54
53
  >
55
54
  <Text className={emptyModuleStyle['d-empty-text']}>
56
55
  该楼层还未配置数据
57
56
  </Text>
58
57
  </View>
59
58
  )
59
+ import { View, Text } from '@tarojs/components'
60
60
  '//img11.360buyimg.com/imagetools/jfs/t1/141506/22/31698/7923/637b6db9E2af80265/10e76e2c31e0e356.png'
61
61
  '//img14.360buyimg.com/imagetools/jfs/t1/247708/11/19310/58975/66ecefa4Fe36ade02/370c18c961aceef1.png'
62
62
  const {
63
63
  moduleType,
64
64
  configEmpty,
65
65
  previewUri = null,
66
66
  uid,
67
67
  moduleFlag,
68
68
  moduleName,
69
69
  } = props.floorData
70
70
  const { luxuryFixed = false } = props
71
71
  let previewUrl = previewUri
72
72
  const newModuleFloorTypeList = [100, 101, 100000, 99999]
73
73
  const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
74
74
  if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
75
75
  previewUrl = luxuryFixed ? luxuryDecorateModulePrevDefaultUrl : decorateModulePrevDefaultUrl
76
76
  }
77
77
  const loadImageErr = e => {
78
78
  e.target.src = decorateModulePrevDefaultUrl
79
79
  }
80
80
  if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1)
81
81
  return null
82
82
  return isNewFloorState && configEmpty && previewUrl ? (
83
83
  <View
84
84
  className={emptyModuleStyle['d-empty-module']}
85
85
  data-floor-uid={uid}
86
86
  data-floor-type={moduleFlag}
87
87
  data-floor-modulename={moduleName}
88
88
  >
89
89
  {}
90
90
  {}
91
91
  {}
92
92
  {}
93
93
  {}
94
94
  {}
95
95
  {}
96
96
  <View className={classNames(emptyModuleStyle['d-empty-img'])}>
97
97
  <img
98
98
  width={luxuryFixed ? 375 : 355}
99
99
  className={classNames('J_floorEmptyDataImg')}
100
100
  src={previewUrl}
101
101
  onError={loadImageErr.bind(this)}
102
102
  />
103
103
  </View>
104
104
  </View>
105
105
  ) : (
106
106
  <View
107
107
  className={classNames(
108
108
  emptyModuleStyle['d-empty-module'],
109
109
  emptyModuleStyle['d-empty-text-warp'],
110
110
  )}
111
111
  data-floor-uid={uid}
112
112
  data-floor-type={moduleFlag}
113
113
  data-floor-modulename={moduleName}
114
114
  >
115
115
  <Text className={emptyModuleStyle['d-empty-text']}>
116
116
  该楼层还未配置数据
117
117
  </Text>
118
118
  </View>
119
119
  )
@@ -1 +1 @@
1
- import { View, Text } from '@tarojs/components'
1
+ import { View, Text } from '@tarojs/components'
@@ -1 +1 @@
1
- import React from 'react'
2
1
  return FloorContentItem ? (
3
2
  <FloorContentItem {...props} dataDefines={dataDefines} />
4
3
  ) : isDevMode ? (
5
4
  renderDecorateDefaultModule()
6
5
  ) : null
6
+ import React from 'react'
7
7
  const {
8
8
  floorData,
9
9
  renderSourceType = BUSINESS_TYPE.ONLINE,
10
10
  builtInComponents = {},
11
11
  updateContainerFloorListDataFn,
12
12
  } = props
13
13
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
14
14
  const floorModuleType = floorData?.floorExtInfo?.moduleFlag
15
15
  const FloorContentItem =
16
16
  (floorModuleType && builtInComponents[floorModuleType]) || null
17
17
  const dataDefines = getFloorDataToDataDefines(floorData)
18
18
 
19
19
  const renderDecorateDefaultModule = () => {
20
20
  return (
21
21
  <View
22
22
  style={{
23
23
  lineHeight: '120px',
24
24
  textAlign: 'center',
25
25
  }}
26
26
  >
27
27
  当前模块是{floorData.moduleName}
28
28
  </View>
29
29
  )
30
30
  }
31
31
  return FloorContentItem ? (
32
32
  <FloorContentItem {...props} dataDefines={dataDefines} />
33
33
  ) : isDevMode ? (
34
34
  renderDecorateDefaultModule()
35
35
  ) : null
36
36
  switch (moduleId) {
37
37
  case 83158:
38
38
  return 'freeLayout'
39
39
  case 99654:
40
40
  return 'activeText'
41
41
  case 100382:
42
42
  return 'superGoods'
43
43
  }
44
44
  floorList.map((item) => {
45
45
  if (!item.floorExtInfo) {
46
46
  return null
47
47
  }
48
48
  const moduleFlag = item.floorExtInfo.moduleFlag
49
49
  if (!moduleFlag) {
50
50
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
51
51
  if (newModuleFlag) {
52
52
  item.floorExtInfo.moduleFlag = newModuleFlag
53
53
  }
54
54
  }
55
55
  })
@@ -1 +1 @@
1
- import React from 'react'
2
1
  const { floorData, renderSourceType, builtInComponents = {} } = props
3
2
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
4
3
  const floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
5
4
  const FloorContentItem =
6
5
  (floorModuleType && builtInComponents[floorModuleType]) || null
7
6
  const dataDefines = getFloorDataToDataDefines(floorData)
8
7
 
9
8
  const renderDecorateDefaultModule = () => {
10
9
  return (
11
10
  <View
12
11
  style={{
13
12
  lineHeight: '120px',
14
13
  textAlign: 'center',
15
14
  }}
16
15
  >
17
16
  当前模块是{floorData.moduleName}
18
17
  </View>
19
18
  )
20
19
  }
21
20
  if (floorModuleType && (RemoteLoadFloorList.includes(floorModuleType) || floorData?.floorExtInfo?.floorLoadWay === 2)) {
22
21
  return (
23
22
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
24
23
  )
25
24
  } else {
26
25
  return FloorContentItem ? (
27
26
  <ErrorBoundary {...props}>
28
27
  <FloorContentItem {...props} dataDefines={dataDefines} />
29
28
  </ErrorBoundary>
30
29
  ) : isDevMode ? (
31
30
  renderDecorateDefaultModule()
32
31
  ) : null
33
32
  }
34
33
  renderSourceType: BUSINESS_TYPE.ONLINE,
35
34
  switch (moduleId) {
36
35
  case 83158:
37
36
  return 'freeLayout'
38
37
  case 99654:
39
38
  return 'activeText'
40
39
  case 100382:
41
40
  return 'superGoods'
42
41
  }
43
42
  floorList.map((item) => {
44
43
  if (!item.floorExtInfo) {
45
44
  return null
46
45
  }
47
46
  const moduleFlag = item.floorExtInfo.moduleFlag
48
47
  if (!moduleFlag) {
49
48
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
50
49
  if (newModuleFlag) {
51
50
  item.floorExtInfo.moduleFlag = newModuleFlag
52
51
  }
53
52
  }
54
53
  })
54
+ import React from 'react'
55
55
  const {
56
56
  floorData,
57
57
  renderSourceType = BUSINESS_TYPE.ONLINE,
58
58
  builtInComponents = {},
59
59
  } = props
60
60
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
61
61
  const specificModuleFlag = ['mHeaderVideo']
62
62
  const frontEndSpecificModuleFlag = ['header_mVideo']
63
63
  const luxuryContainerPosition = 'luxuryFixed'
64
64
  const floorPosition = floorData?.floorPosition
65
65
  let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
66
66
  specificModuleFlag.includes(floorModuleType) && floorPosition === luxuryContainerPosition && (floorModuleType = frontEndSpecificModuleFlag)
67
67
  const FloorContentItem =
68
68
  (floorModuleType && builtInComponents[floorModuleType]) || null
69
69
  const dataDefines = getFloorDataToDataDefines(floorData)
70
70
 
71
71
  const renderDecorateDefaultModule = () => {
72
72
  return (
73
73
  <View
74
74
  style={{
75
75
  lineHeight: '120px',
76
76
  textAlign: 'center',
77
77
  }}
78
78
  >
79
79
  当前模块是{floorData.moduleName}
80
80
  </View>
81
81
  )
82
82
  }
83
83
  if (
84
84
  floorModuleType &&
85
85
  (RemoteLoadFloorList.includes(floorModuleType) ||
86
86
  floorData?.floorExtInfo?.floorLoadWay === 2)
87
87
  ) {
88
88
  return (
89
89
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
90
90
  )
91
91
  } else {
92
92
  return FloorContentItem ? (
93
93
  <ErrorBoundary {...props}>
94
94
  <FloorContentItem {...props} dataDefines={dataDefines} />
95
95
  </ErrorBoundary>
96
96
  ) : isDevMode ? (
97
97
  renderDecorateDefaultModule()
98
98
  ) : null
99
99
  }
100
100
  switch (moduleId) {
101
101
  case 83158:
102
102
  return 'freeLayout'
103
103
  case 99654:
104
104
  return 'activeText'
105
105
  case 100382:
106
106
  return 'superGoods'
107
107
  }
108
108
  floorList.map((item) => {
109
109
  if (!item.floorExtInfo) {
110
110
  return null
111
111
  }
112
112
  const moduleFlag = item.floorExtInfo.moduleFlag
113
113
  if (!moduleFlag) {
114
114
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
115
115
  if (newModuleFlag) {
116
116
  item.floorExtInfo.moduleFlag = newModuleFlag
117
117
  }
118
118
  }
119
119
  })
@@ -1 +1 @@
1
- import React from 'react'
2
1
  return FloorContentItem ? (
3
2
  <ErrorBoundary {...props}>
4
3
  <FloorContentItem {...props} dataDefines={dataDefines} />
5
4
  </ErrorBoundary>
6
5
  ) : isDevMode ? (
7
6
  renderDecorateDefaultModule()
8
7
  ) : null
8
+ import React from 'react'
9
9
  const {
10
10
  floorData,
11
11
  renderSourceType = BUSINESS_TYPE.ONLINE,
12
12
  builtInComponents = {},
13
13
  updateContainerFloorListDataFn,
14
14
  } = props
15
15
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
16
16
  const floorModuleType = floorData?.floorExtInfo?.moduleFlag
17
17
  const FloorContentItem =
18
18
  (floorModuleType && builtInComponents[floorModuleType]) || null
19
19
  const dataDefines = getFloorDataToDataDefines(floorData)
20
20
 
21
21
  const renderDecorateDefaultModule = () => {
22
22
  return (
23
23
  <View
24
24
  style={{
25
25
  lineHeight: '120px',
26
26
  textAlign: 'center',
27
27
  }}
28
28
  >
29
29
  当前模块是{floorData.moduleName}
30
30
  </View>
31
31
  )
32
32
  }
33
33
  return FloorContentItem ? (
34
34
  <ErrorBoundary {...props}>
35
35
  <FloorContentItem {...props} dataDefines={dataDefines} />
36
36
  </ErrorBoundary>
37
37
  ) : isDevMode ? (
38
38
  renderDecorateDefaultModule()
39
39
  ) : null
40
40
  switch (moduleId) {
41
41
  case 83158:
42
42
  return 'freeLayout'
43
43
  case 99654:
44
44
  return 'activeText'
45
45
  case 100382:
46
46
  return 'superGoods'
47
47
  }
48
48
  floorList.map((item) => {
49
49
  if (!item.floorExtInfo) {
50
50
  return null
51
51
  }
52
52
  const moduleFlag = item.floorExtInfo.moduleFlag
53
53
  if (!moduleFlag) {
54
54
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
55
55
  if (newModuleFlag) {
56
56
  item.floorExtInfo.moduleFlag = newModuleFlag
57
57
  }
58
58
  }
59
59
  })
@@ -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
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  isJingxiMiniViewState?: boolean
3
2
  floorVideInfo: object
4
3
  originQueryInfo: {
5
4
  openAppData?: {
6
5
  [key: string]: any
7
6
  }
7
+ import Taro from '@tarojs/taro'
8
8
  isJingxiMiniViewState?: boolean
9
9
  floorVideInfo: object
10
10
  isFloorInfoDataByPage?: boolean
11
11
  originQueryInfo: {
12
12
  openAppData?: {
13
13
  [key: string]: any
14
14
  }