@conecli/cone-render 0.9.1-shop2.2 → 0.9.1-shop2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.ts +1 -1
- package/dist/common/const.ts +1 -1
- package/dist/common/environmentType.ts +1 -0
- 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.ts +1 -0
- package/dist/common/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/token/token.ts +1 -1
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.module.scss +7 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +5 -0
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/Exposure/index.h5.tsx +1 -1
- 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.tsx +1 -1
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +7 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +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/interface/utils.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.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -1
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.tjapp.ts +1 -0
- package/dist/jumpEventReport/web.tjm.ts +1 -0
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.module.scss +18 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/jump copy.ts +1 -1
- package/dist/open/api/request.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- 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/sass/app.h5.scss +49 -3
- package/dist/sass/base.scss +57 -0
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/draExceptionAndProfile.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jm-common.js +1 -1
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/taroRenderUtil.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
|
@@ -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 { floorData, renderSourceType, builtInComponents = {} } = props
|
|
56
56
|
const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
|
|
57
57
|
const specificModuleFlag = ['mHeaderVideo']
|
|
58
58
|
const frontEndSpecificModuleFlag = ['header_mVideo']
|
|
59
59
|
const luxuryContainerPosition = 'luxuryFixed'
|
|
60
60
|
const floorPosition = floorData?.floorPosition
|
|
61
61
|
let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
|
|
62
62
|
specificModuleFlag.includes(floorModuleType) && floorPosition === luxuryContainerPosition && (floorModuleType = frontEndSpecificModuleFlag)
|
|
63
63
|
const FloorContentItem =
|
|
64
64
|
(floorModuleType && builtInComponents[floorModuleType]) || null
|
|
65
65
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
66
66
|
|
|
67
67
|
const renderDecorateDefaultModule = () => {
|
|
68
68
|
return (
|
|
69
69
|
<View
|
|
70
70
|
style={{
|
|
71
71
|
lineHeight: '120px',
|
|
72
72
|
textAlign: 'center',
|
|
73
73
|
}}
|
|
74
74
|
>
|
|
75
75
|
当前模块是{floorData.moduleName}
|
|
76
76
|
</View>
|
|
77
77
|
)
|
|
78
78
|
}
|
|
79
79
|
if (floorModuleType && (RemoteLoadFloorList.includes(floorModuleType) || floorData?.floorExtInfo?.floorLoadWay === 2)) {
|
|
80
80
|
return (
|
|
81
81
|
<RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
|
|
82
82
|
)
|
|
83
83
|
} else {
|
|
84
84
|
return FloorContentItem ? (
|
|
85
85
|
<ErrorBoundary {...props}>
|
|
86
86
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
87
87
|
</ErrorBoundary>
|
|
88
88
|
) : isDevMode ? (
|
|
89
89
|
renderDecorateDefaultModule()
|
|
90
90
|
) : null
|
|
91
91
|
}
|
|
92
92
|
renderSourceType: BUSINESS_TYPE.ONLINE,
|
|
93
93
|
switch (moduleId) {
|
|
94
94
|
case 83158:
|
|
95
95
|
return 'freeLayout'
|
|
96
96
|
case 99654:
|
|
97
97
|
return 'activeText'
|
|
98
98
|
case 100382:
|
|
99
99
|
return 'superGoods'
|
|
100
100
|
}
|
|
101
101
|
floorList.map((item) => {
|
|
102
102
|
if (!item.floorExtInfo) {
|
|
103
103
|
return null
|
|
104
104
|
}
|
|
105
105
|
const moduleFlag = item.floorExtInfo.moduleFlag
|
|
106
106
|
if (!moduleFlag) {
|
|
107
107
|
const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
|
|
108
108
|
if (newModuleFlag) {
|
|
109
109
|
item.floorExtInfo.moduleFlag = newModuleFlag
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
})
|
|
@@ -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
|
return FloorContentItem ? (
|
|
8
8
|
<ErrorBoundary {...props}>
|
|
9
9
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
10
10
|
</ErrorBoundary>
|
|
11
11
|
) : isDevMode ? (
|
|
12
12
|
renderDecorateDefaultModule()
|
|
13
13
|
) : null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { useCallback } from 'react'
|
|
2
1
|
const getRenderRealTimeKeyObj = isRealTimeRender ? {
|
|
3
2
|
key: Date.now()
|
|
4
3
|
} : {}
|
|
5
4
|
{floorData?.showCommonFloorHead === false ? null : <CommonFloorHead dataDefines={dataDefines} floorData={floorData} {...getRenderRealTimeKeyObj} />}
|
|
6
5
|
...getRenderRealTimeKeyObj
|
|
7
6
|
isRealTimeRender: false,
|
|
7
|
+
import React, { useCallback } from 'react'
|
|
8
8
|
const {
|
|
9
9
|
style,
|
|
10
10
|
dataDefines,
|
|
11
11
|
containerBorderRadius,
|
|
12
12
|
floorData,
|
|
13
13
|
isRealTimeRender,
|
|
14
14
|
forceRenderTime,
|
|
15
15
|
} = props
|
|
16
16
|
const getRenderRealTimeKeyObj = {
|
|
17
17
|
key: isRealTimeRender ? Date.now() : forceRenderTime,
|
|
18
18
|
}
|
|
19
19
|
console.log('远程加载楼层渲染key信息', getRenderRealTimeKeyObj)
|
|
20
20
|
return (
|
|
21
21
|
<View className={floorStyle['wrap']} style={style}>
|
|
22
22
|
{floorData?.showCommonFloorHead === false ? null : (
|
|
23
23
|
<CommonFloorHead
|
|
24
24
|
dataDefines={dataDefines}
|
|
25
25
|
floorData={floorData}
|
|
26
26
|
{...getRenderRealTimeKeyObj}
|
|
27
27
|
/>
|
|
28
28
|
)}
|
|
29
29
|
<View
|
|
30
30
|
className={floorStyle['wrap']}
|
|
31
31
|
style={
|
|
32
32
|
containerBorderRadius
|
|
33
33
|
? {
|
|
34
34
|
borderRadius: containerBorderRadius + 'px',
|
|
35
35
|
}
|
|
36
36
|
: {}
|
|
37
37
|
}
|
|
38
38
|
>
|
|
39
39
|
{}
|
|
40
40
|
{props.children &&
|
|
41
41
|
React.cloneElement(props.children, {
|
|
42
42
|
dataDefines: dataDefines,
|
|
43
43
|
...getRenderRealTimeKeyObj,
|
|
44
44
|
})}
|
|
45
45
|
</View>
|
|
46
46
|
</View>
|
|
47
47
|
)
|
|
48
48
|
isRealTimeRender: false,
|
|
49
49
|
forceRenderTime: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { Suspense, lazy } from 'react'
|
|
2
1
|
getBundleUrl,
|
|
3
2
|
getBundleFileName,
|
|
4
3
|
formatPackResult,
|
|
5
4
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
6
5
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
7
6
|
|
|
8
7
|
const getFloorSetHeight = (item) => {
|
|
9
8
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
10
9
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
11
10
|
: 200
|
|
12
11
|
return getHeight > 0 ? getHeight : 200
|
|
13
12
|
}
|
|
14
13
|
console.log(
|
|
15
14
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
16
15
|
)
|
|
17
16
|
const renderResult = (() => {
|
|
18
17
|
try {
|
|
19
18
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
20
19
|
console.log(
|
|
21
20
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
22
21
|
renderSourceType,
|
|
23
22
|
floorData.uid,
|
|
24
23
|
)
|
|
25
24
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
26
25
|
const modularPackResultObj = formatPackResult(modularPackResult)
|
|
27
26
|
const bundleUrl = getBundleUrl(modularPackResultObj)
|
|
28
27
|
const bundleFileName = getBundleFileName(modularPackResultObj)
|
|
29
28
|
const opt = {
|
|
30
29
|
msg: `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
31
30
|
buildType,
|
|
32
31
|
uid: floorData?.uid,
|
|
33
32
|
floorIdx: floorData?.floorIdx,
|
|
34
33
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
35
34
|
moduleId: floorData?.moduleId,
|
|
36
35
|
moduleName: floorData?.moduleName,
|
|
37
36
|
middleTemplateId: floorData?.middleTemplateId,
|
|
38
37
|
modularPackResult: modularPackResult,
|
|
39
38
|
}
|
|
40
39
|
if (bundleUrl && bundleFileName) {
|
|
41
40
|
let ISVModule =
|
|
42
41
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
43
42
|
`${floorData.uid}_${bundleFileName}`
|
|
44
43
|
] || null
|
|
45
44
|
if (!ISVModule) {
|
|
46
45
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
47
46
|
console.log(
|
|
48
47
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
49
48
|
bundleFileName,
|
|
50
49
|
)
|
|
51
50
|
taroJdBaseInfo.renderedIsvComponents[
|
|
52
51
|
`${floorData.uid}_${bundleFileName}`
|
|
53
52
|
] = ISVModule
|
|
54
53
|
console.log(
|
|
55
54
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
56
55
|
bundleFileName,
|
|
57
56
|
window['taroJshopH5WebpackJsonp'].find(
|
|
58
57
|
(item) => item[0][0] == bundleFileName,
|
|
59
58
|
),
|
|
60
59
|
)
|
|
61
60
|
} else {
|
|
62
61
|
console.log(
|
|
63
62
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
64
63
|
taroJdBaseInfo,
|
|
65
64
|
)
|
|
66
65
|
console.log(
|
|
67
66
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
68
67
|
taroJdBaseInfo.renderedIsvComponents[
|
|
69
68
|
`${floorData.uid}_${bundleFileName}`
|
|
70
69
|
],
|
|
71
70
|
)
|
|
72
71
|
}
|
|
73
72
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
74
73
|
return (
|
|
75
74
|
<ErrorBoundary {...props}>
|
|
76
75
|
<Suspense
|
|
77
76
|
fallback={
|
|
78
77
|
<View
|
|
79
78
|
style={{
|
|
80
79
|
position: 'relative',
|
|
81
80
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
82
81
|
height: `${_floorHeight}px`,
|
|
83
82
|
}}
|
|
84
83
|
></View>
|
|
85
84
|
}
|
|
86
85
|
>
|
|
87
86
|
<ISVFloor {...props} dataDefines={dataDefines} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
88
87
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
89
88
|
</ISVFloor>
|
|
90
89
|
</Suspense>
|
|
91
90
|
</ErrorBoundary>
|
|
92
91
|
)
|
|
93
92
|
} else {
|
|
94
93
|
console.log(
|
|
95
94
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
96
95
|
modularPackResultObj,
|
|
97
96
|
)
|
|
98
97
|
sgmCustomReport({
|
|
99
98
|
code: 'isvModuleError',
|
|
100
99
|
msg: opt,
|
|
101
100
|
})
|
|
102
101
|
return null
|
|
103
102
|
}
|
|
104
103
|
} catch (err) {
|
|
105
104
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
106
105
|
sgmCustomReport({
|
|
107
106
|
code: 'isvModuleError',
|
|
108
107
|
msg: {
|
|
109
108
|
msg: 'remoteFloorItem try catch 异常',
|
|
110
109
|
err,
|
|
111
110
|
},
|
|
112
111
|
})
|
|
113
112
|
return null
|
|
114
113
|
}
|
|
115
114
|
})()
|
|
116
115
|
if (renderResult === null) {
|
|
117
116
|
updateContainerFloorListDataFn &&
|
|
118
117
|
updateContainerFloorListDataFn({
|
|
119
118
|
type: 'filter',
|
|
120
119
|
containerId: floorData?.uid,
|
|
121
120
|
})
|
|
122
121
|
console.log('renderResult === null: 命中了!')
|
|
123
122
|
taroEventSendPageScrollInfo()
|
|
124
123
|
} else {
|
|
125
124
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
126
125
|
}
|
|
127
126
|
return renderResult
|
|
127
|
+
import Taro from '@tarojs/taro'
|
|
128
128
|
getBundleUrl,
|
|
129
129
|
getBundleFileName,
|
|
130
130
|
formatPackResult,
|
|
131
131
|
getTaroVersion
|
|
132
132
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
133
133
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
134
134
|
const [forceRenderTime,setForceRenderTime] = useState(1)
|
|
135
135
|
useEffect(() => {
|
|
136
136
|
isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
|
|
137
137
|
setForceRenderTime(Date.now())
|
|
138
138
|
})
|
|
139
139
|
return () => {
|
|
140
140
|
isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
|
|
141
141
|
}
|
|
142
142
|
},[])
|
|
143
143
|
|
|
144
144
|
const getFloorSetHeight = (item) => {
|
|
145
145
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
146
146
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
147
147
|
: 200
|
|
148
148
|
return getHeight > 0 ? getHeight : 200
|
|
149
149
|
}
|
|
150
150
|
console.log(
|
|
151
151
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
152
152
|
)
|
|
153
153
|
const renderResult = (() => {
|
|
154
154
|
try {
|
|
155
155
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
156
156
|
console.log(
|
|
157
157
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
158
158
|
renderSourceType,
|
|
159
159
|
floorData.uid,
|
|
160
160
|
)
|
|
161
161
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
162
162
|
const modularPackResultObj = formatPackResult(modularPackResult)
|
|
163
163
|
const bundleUrl = getBundleUrl(modularPackResultObj)
|
|
164
164
|
const bundleFileName = getBundleFileName(modularPackResultObj)
|
|
165
165
|
const taroVersion = getTaroVersion(modularPackResultObj)
|
|
166
166
|
const opt = {
|
|
167
167
|
msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
|
|
168
168
|
floorIdx: floorData?.floorIdx,
|
|
169
169
|
uid: floorData?.uid,
|
|
170
170
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
171
171
|
moduleId: floorData?.moduleId,
|
|
172
172
|
moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
|
|
173
173
|
floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
|
|
174
174
|
floorKind: floorData?.floorExtInfo?.floorKind,
|
|
175
175
|
middleTemplateId: floorData?.middleTemplateId,
|
|
176
176
|
modularPackResult: {
|
|
177
177
|
bundleUrl,
|
|
178
178
|
taroVersion
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
if (bundleUrl && bundleFileName) {
|
|
182
182
|
let ISVModule =
|
|
183
183
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
184
184
|
`${floorData.uid}_${bundleFileName}`
|
|
185
185
|
] || null
|
|
186
186
|
if (!ISVModule) {
|
|
187
187
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
188
188
|
console.log(
|
|
189
189
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
190
190
|
bundleFileName,
|
|
191
191
|
)
|
|
192
192
|
taroJdBaseInfo.renderedIsvComponents[
|
|
193
193
|
`${floorData.uid}_${bundleFileName}`
|
|
194
194
|
] = ISVModule
|
|
195
195
|
console.log(
|
|
196
196
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
197
197
|
bundleFileName,
|
|
198
198
|
window['taroJshopH5WebpackJsonp'].find(
|
|
199
199
|
(item) => item[0][0] == bundleFileName,
|
|
200
200
|
),
|
|
201
201
|
)
|
|
202
202
|
} else {
|
|
203
203
|
console.log(
|
|
204
204
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
205
205
|
taroJdBaseInfo,
|
|
206
206
|
)
|
|
207
207
|
console.log(
|
|
208
208
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
209
209
|
taroJdBaseInfo.renderedIsvComponents[
|
|
210
210
|
`${floorData.uid}_${bundleFileName}`
|
|
211
211
|
],
|
|
212
212
|
)
|
|
213
213
|
}
|
|
214
214
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
215
215
|
return (
|
|
216
216
|
<ErrorBoundary {...props}>
|
|
217
217
|
<Suspense
|
|
218
218
|
fallback={
|
|
219
219
|
<View
|
|
220
220
|
style={{
|
|
221
221
|
position: 'relative',
|
|
222
222
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
223
223
|
height: `${_floorHeight}px`,
|
|
224
224
|
}}
|
|
225
225
|
></View>
|
|
226
226
|
}
|
|
227
227
|
>
|
|
228
228
|
<ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
229
229
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
230
230
|
</ISVFloor>
|
|
231
231
|
</Suspense>
|
|
232
232
|
</ErrorBoundary>
|
|
233
233
|
)
|
|
234
234
|
} else {
|
|
235
235
|
console.log(
|
|
236
236
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
237
237
|
modularPackResultObj,
|
|
238
238
|
)
|
|
239
239
|
sgmCustomReport({
|
|
240
240
|
code: getSgmCustomCode(handleSgmCodeTaroVersion(floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE ? SgmCustomCode.SYSTEMPDCMODULE_DATA : SgmCustomCode.REMOTEMODULE_DATA)),
|
|
241
241
|
msg: opt,
|
|
242
242
|
})
|
|
243
243
|
return null
|
|
244
244
|
}
|
|
245
245
|
} catch (err) {
|
|
246
246
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
247
247
|
return null
|
|
248
248
|
}
|
|
249
249
|
})()
|
|
250
250
|
if (renderResult === null) {
|
|
251
251
|
updateContainerFloorListDataFn &&
|
|
252
252
|
updateContainerFloorListDataFn({
|
|
253
253
|
type: 'filter',
|
|
254
254
|
containerId: floorData?.uid,
|
|
255
255
|
})
|
|
256
256
|
console.log('renderResult === null: 命中了!')
|
|
257
257
|
taroEventSendPageScrollInfo()
|
|
258
258
|
} else {
|
|
259
259
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
260
260
|
}
|
|
261
261
|
return renderResult
|
package/dist/interface/common.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
subMessage?: string
|
|
3
2
|
floorLoadWay?: number
|
|
4
3
|
showCommonFloorHead?: boolean
|
|
5
4
|
isRealTimeRender: boolean
|
|
6
5
|
customErrorIsvFloorModule?: React.ReactElement | undefined
|
|
7
6
|
containerIndex?: number
|
|
8
7
|
containerData?: any
|
|
9
8
|
shopTotalInfo?: any
|
|
10
9
|
selectContainerFn?: Function
|
|
11
10
|
selectContainerId?: string
|
|
12
11
|
placeHolderPreContainerId?: string
|
|
13
12
|
children?: any
|
|
14
13
|
style?: {
|
|
15
14
|
[key: string]: any
|
|
16
15
|
};
|
|
17
16
|
layoutLeftRightMargin?: number
|
|
18
17
|
}
|
|
19
18
|
onFormSubmit?: Function
|
|
20
19
|
onFormReset?: Function
|
|
21
20
|
isFormDialog?: boolean
|
|
22
21
|
forbiddenBgScrollState?: boolean
|
|
22
|
+
import React from 'react'
|
|
23
23
|
subMessage?: string
|
|
24
24
|
viewMaxHeight?: string
|
|
25
25
|
noPosition?: boolean
|
|
26
26
|
floorLoadWay?: number
|
|
27
27
|
floorKind?: number
|
|
28
28
|
shopId?: string
|
|
29
29
|
moduleDesignerType?: string
|
|
30
30
|
showCommonFloorHead?: boolean
|
|
31
31
|
borderRadius: number
|
|
32
32
|
borderTopLeftRadius?: number
|
|
33
33
|
borderTopRightRadius?: number
|
|
34
34
|
borderBottomLeftRadius?: number
|
|
35
35
|
borderBottomRightRadius?: number
|
|
36
36
|
marginTop?: number
|
|
37
37
|
marginBottom?: number
|
|
38
38
|
marginLeft?: number
|
|
39
39
|
marginRight?: number
|
|
40
40
|
paddingTop?: number
|
|
41
41
|
paddingBottom?: number
|
|
42
42
|
paddingLeft?: number
|
|
43
43
|
paddingRight?: number
|
|
44
44
|
containerId: string
|
|
45
45
|
background?: string
|
|
46
46
|
containerPosition?: string
|
|
47
47
|
key?: string
|
|
48
48
|
floors: floorItemData[]
|
|
49
49
|
includeUids: string[]
|
|
50
50
|
typeCn: string
|
|
51
51
|
typeCode?: string
|
|
52
52
|
addLuxuryStyle?: boolean
|
|
53
53
|
addLuxuryBackupStyle?: boolean
|
|
54
54
|
renderExtendComponent?: Function
|
|
55
55
|
insertContainerStartComponent?: Function
|
|
56
56
|
floorExtendData?: any
|
|
57
57
|
}
|
|
58
58
|
isRealTimeRender: boolean
|
|
59
59
|
forceRenderTime: number
|
|
60
60
|
luxuryFixed?: boolean
|
|
61
61
|
customErrorIsvFloorModule?: React.ReactElement | undefined
|
|
62
62
|
containerIndex?: number
|
|
63
63
|
containerData?: any
|
|
64
64
|
shopTotalInfo?: any
|
|
65
65
|
selectContainerFn?: Function
|
|
66
66
|
selectContainerId?: string
|
|
67
67
|
placeHolderPreContainerId?: string
|
|
68
68
|
children?: any
|
|
69
69
|
luxuryFixed?: boolean
|
|
70
70
|
style?: {
|
|
71
71
|
[key: string]: any
|
|
72
72
|
};
|
|
73
73
|
layoutLeftRightMargin?: number
|
|
74
74
|
}
|
|
75
75
|
isShowPlaceHolder?: boolean
|
|
76
76
|
showDayToSecondState?: boolean
|
|
77
77
|
onFormSubmit?: Function
|
|
78
78
|
onFormReset?: Function
|
|
79
79
|
isFormDialog?: boolean
|
|
80
80
|
forbiddenBgScrollState?: boolean
|
|
81
81
|
evenList: any[]
|
|
82
82
|
oddList: any[]
|