@conecli/cone-render 0.9.1-shop2.8 → 0.10.1-beta.0
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/assets/icon_blue_info.svg +1 -0
- 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/sgmCustomCode.ts +1 -0
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/components/ErrorBoundary.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/CustomVideo/index.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +67 -0
- package/dist/components/debug/DebugLayout/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/utils.ts +1 -0
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/floorItem.jd.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/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.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/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/track.ts +1 -1
- package/dist/sass/app.h5.scss +5 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.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/utils.ts +1 -1
- package/package.json +42 -39
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
.debug-layout-warp {
|
|
3
|
+
position: absolute;
|
|
4
|
+
border-radius: 12PX;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
z-index: 50;
|
|
10
|
+
|
|
11
|
+
.debug-layout {
|
|
12
|
+
position: absolute;
|
|
13
|
+
border-radius: 12PX;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
|
|
19
|
+
border: 1PX solid #f50707;
|
|
20
|
+
background-color: rgba(219, 38, 38, 0.2);
|
|
21
|
+
|
|
22
|
+
&[data-module-type='JOINT'] {
|
|
23
|
+
border: 1PX solid #f507c9;
|
|
24
|
+
background-color: rgba(219, 38, 150, 0.2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.green {
|
|
28
|
+
border: 1PX solid #04a607;
|
|
29
|
+
background-color: rgba(38, 219, 71, 0.2);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cd-version-list {
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
position: absolute;
|
|
35
|
+
font-size: 0;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
text-align: center;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.cd-version-item {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
background-color: #00c853;
|
|
47
|
+
font-size: 30px;
|
|
48
|
+
color: white;
|
|
49
|
+
padding: 1PX 3PX;
|
|
50
|
+
border-radius: 4PX;
|
|
51
|
+
margin: 0 5PX;
|
|
52
|
+
&[data-version='3.5.4'] {
|
|
53
|
+
background-color: #999;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.d-info {
|
|
59
|
+
position: relative;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
z-index: 3;
|
|
62
|
+
margin: 3PX 3PX;
|
|
63
|
+
width: 22PX;
|
|
64
|
+
height: 22PX;
|
|
65
|
+
background: url('../../../assets/icon_blue_info.svg') center center / 22PX 22PX no-repeat;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
const { debug } = global.info.queryInfo
|
|
1
3
|
const { floorData, index } = props
|
|
2
4
|
if (debug != '1' || !floorData) {
|
|
3
5
|
return null
|
|
4
6
|
}
|
|
5
7
|
const renderRemoteLayout = () => {
|
|
6
8
|
const isRemote = isRemoteFloor(floorData)
|
|
7
9
|
if (isRemote) {
|
|
8
10
|
const moduleType = getModuleType(floorData)
|
|
9
11
|
const packResult = floorData?.floorExtInfo?.modularPackResult
|
|
10
12
|
const packResultObj = JSONParse(packResult)
|
|
11
13
|
const taroVersionList = getTaroVersionList(packResultObj)
|
|
12
14
|
const layoutClass = classNames(style['debug-layout'], {
|
|
13
15
|
[style['green']]: taroVersionList.length >= 2,
|
|
14
16
|
})
|
|
15
17
|
return (
|
|
16
18
|
<View data-module-type={moduleType} className={layoutClass}>
|
|
17
19
|
<View className={style['cd-version-list']}>
|
|
18
20
|
{taroVersionList.map(item => {
|
|
19
21
|
return (
|
|
20
22
|
<Text className={style['cd-version-item']} data-version={item}>
|
|
21
23
|
v{item}
|
|
22
24
|
</Text>
|
|
23
25
|
)
|
|
24
26
|
})}
|
|
25
27
|
</View>
|
|
26
28
|
</View>
|
|
27
29
|
)
|
|
28
30
|
} else {
|
|
29
31
|
return null
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
return (
|
|
33
35
|
<View className={style['debug-layout-warp']}>
|
|
34
36
|
<View
|
|
35
37
|
className={style['d-info']}
|
|
36
38
|
onClick={() => {
|
|
37
39
|
Messager && Messager.trigger('openDebugLayout', { floorData, index })
|
|
38
40
|
}}
|
|
39
41
|
/>
|
|
40
42
|
{renderRemoteLayout()}
|
|
41
43
|
</View>
|
|
42
44
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { RemoteLoadFloorList, FloorModuleType } from '../../../common/const'
|
|
2
|
if (!packResultObj) {
|
|
1
3
|
return []
|
|
2
4
|
}
|
|
3
5
|
const result: string[] = []
|
|
4
6
|
if (packResultObj.bundleUrl) {
|
|
5
7
|
result.push(packResultObj.taroVersion || '3.5.4')
|
|
6
8
|
}
|
|
7
9
|
if (packResultObj.bundleUrlV2) {
|
|
8
10
|
result.push(packResultObj.taroVersionV2)
|
|
9
11
|
}
|
|
10
12
|
return result
|
|
11
13
|
if (!floorData) {
|
|
12
14
|
return false
|
|
13
15
|
}
|
|
14
16
|
const moduleFlag = floorData.floorExtInfo?.moduleFlag
|
|
15
17
|
const floorLoadWay = floorData.floorExtInfo?.floorLoadWay
|
|
16
18
|
return RemoteLoadFloorList.includes(moduleFlag) || floorLoadWay === 2
|
|
17
19
|
if (!floorData) {
|
|
18
20
|
return ''
|
|
19
21
|
}
|
|
20
22
|
const moduleFlag = floorData.floorExtInfo?.moduleFlag
|
|
21
23
|
const floorLoadWay = floorData.floorExtInfo?.floorLoadWay
|
|
22
24
|
if (moduleFlag === FloorModuleType.ISVDESIGNERH5MODULE) {
|
|
23
25
|
return 'ISV'
|
|
24
26
|
} else if (
|
|
25
27
|
moduleFlag === FloorModuleType.JOINT_MODULE ||
|
|
26
28
|
floorLoadWay === 2
|
|
27
29
|
) {
|
|
28
30
|
return 'JOINT'
|
|
29
31
|
} else {
|
|
30
32
|
return 'SYSTEM'
|
|
31
33
|
}
|
|
@@ -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 newModuleFloorTypeList = [100, 101, 100000, 99999]
|
|
4
3
|
const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
|
|
5
4
|
if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
|
|
6
5
|
if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1) return null
|
|
6
|
+
import { View, Text } from '@tarojs/components'
|
|
7
7
|
'//img11.360buyimg.com/imagetools/jfs/t1/141506/22/31698/7923/637b6db9E2af80265/10e76e2c31e0e356.png'
|
|
8
8
|
const {
|
|
9
9
|
moduleType,
|
|
10
10
|
configEmpty,
|
|
11
11
|
previewUri = null,
|
|
12
12
|
uid,
|
|
13
13
|
moduleFlag,
|
|
14
14
|
moduleName,
|
|
15
15
|
} = props.floorData
|
|
16
16
|
let previewUrl = previewUri
|
|
17
17
|
const newModuleFloorTypeList = [100, 101, 100000, 99999]
|
|
18
18
|
const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
|
|
19
19
|
if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
|
|
20
20
|
previewUrl = decorateModulePrevDefaultUrl
|
|
21
21
|
}
|
|
22
22
|
const loadImageErr = e => {
|
|
23
23
|
e.target.src = decorateModulePrevDefaultUrl
|
|
24
24
|
}
|
|
25
25
|
if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1)
|
|
26
26
|
return null
|
|
27
27
|
return isNewFloorState && configEmpty && previewUrl ? (
|
|
28
28
|
<View
|
|
29
29
|
className={emptyModuleStyle['d-empty-module']}
|
|
30
30
|
data-floor-uid={uid}
|
|
31
31
|
data-floor-type={moduleFlag}
|
|
32
32
|
data-floor-modulename={moduleName}
|
|
33
33
|
>
|
|
34
34
|
{}
|
|
35
35
|
{}
|
|
36
36
|
{}
|
|
37
37
|
{}
|
|
38
38
|
{}
|
|
39
39
|
{}
|
|
40
40
|
{}
|
|
41
41
|
<View className={classNames(emptyModuleStyle['d-empty-img'])}>
|
|
42
42
|
<img
|
|
43
43
|
width={355}
|
|
44
44
|
className={classNames('J_floorEmptyDataImg')}
|
|
45
45
|
src={previewUrl}
|
|
46
46
|
onError={loadImageErr.bind(this)}
|
|
47
47
|
/>
|
|
48
48
|
</View>
|
|
49
49
|
</View>
|
|
50
50
|
) : (
|
|
51
51
|
<View
|
|
52
52
|
className={classNames(
|
|
53
53
|
emptyModuleStyle['d-empty-module'],
|
|
54
54
|
emptyModuleStyle['d-empty-text-warp'],
|
|
55
55
|
)}
|
|
56
56
|
data-floor-uid={uid}
|
|
57
57
|
data-floor-type={moduleFlag}
|
|
58
58
|
data-floor-modulename={moduleName}
|
|
59
59
|
>
|
|
60
60
|
<Text className={emptyModuleStyle['d-empty-text']}>
|
|
61
61
|
该楼层还未配置数据
|
|
62
62
|
</Text>
|
|
63
63
|
</View>
|
|
64
64
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { ComponentInterFace } from '../interface/component'
|
|
2
1
|
const { floorData, builtInComponents = {} } = props
|
|
3
2
|
const floorModuleType = floorData?.floorExtInfo?.moduleFlag
|
|
4
3
|
const FloorContentItem =
|
|
5
4
|
(floorModuleType && builtInComponents[floorModuleType]) || null
|
|
6
5
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
7
6
|
return FloorContentItem ? (
|
|
8
7
|
<ErrorBoundary {...props}>
|
|
9
8
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
10
9
|
</ErrorBoundary>
|
|
11
10
|
) : null
|
|
12
11
|
renderSourceType: BUSINESS_TYPE.ONLINE,
|
|
13
12
|
switch (moduleId) {
|
|
14
13
|
case 83158:
|
|
15
14
|
return 'freeLayout'
|
|
16
15
|
case 99654:
|
|
17
16
|
return 'activeText'
|
|
18
17
|
case 100382:
|
|
19
18
|
return 'superGoods'
|
|
20
19
|
}
|
|
21
20
|
floorList.map((item) => {
|
|
22
21
|
if (!item.floorExtInfo) {
|
|
23
22
|
return null
|
|
24
23
|
}
|
|
25
24
|
const moduleFlag = item.floorExtInfo.moduleFlag
|
|
26
25
|
if (!moduleFlag) {
|
|
27
26
|
const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
|
|
28
27
|
if (newModuleFlag) {
|
|
29
28
|
item.floorExtInfo.moduleFlag = newModuleFlag
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
})
|
|
32
|
+
import React from 'react'
|
|
33
33
|
return FloorContentItem ? (
|
|
34
34
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
35
35
|
) : isDevMode ? (
|
|
36
36
|
renderDecorateDefaultModule()
|
|
37
37
|
) : null
|
|
@@ -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 = {
|
|
3
2
|
key: isRealTimeRender ? Date.now() : forceRenderTime
|
|
4
3
|
}
|
|
5
4
|
console.log("远程加载楼层渲染key信息", getRenderRealTimeKeyObj)
|
|
6
5
|
{floorData?.showCommonFloorHead === false ? null : <CommonFloorHead dataDefines={dataDefines} floorData={floorData} {...getRenderRealTimeKeyObj} />}
|
|
7
6
|
...getRenderRealTimeKeyObj
|
|
8
7
|
isRealTimeRender: false,
|
|
9
8
|
forceRenderTime: 1,
|
|
9
|
+
import React, { useCallback } from 'react'
|
|
10
10
|
const {
|
|
11
11
|
style,
|
|
12
12
|
dataDefines,
|
|
13
13
|
containerBorderRadius,
|
|
14
14
|
floorData,
|
|
15
15
|
isRealTimeRender,
|
|
16
16
|
forceRenderTime,
|
|
17
17
|
} = props
|
|
18
18
|
const getRenderRealTimeKeyObj = {
|
|
19
19
|
key: isRealTimeRender ? Date.now() : forceRenderTime,
|
|
20
20
|
}
|
|
21
21
|
console.log('远程加载楼层渲染key信息', getRenderRealTimeKeyObj)
|
|
22
22
|
return (
|
|
23
23
|
<View className={floorStyle['wrap']} style={style}>
|
|
24
24
|
{floorData?.showCommonFloorHead === false ? null : (
|
|
25
25
|
<CommonFloorHead
|
|
26
26
|
dataDefines={dataDefines}
|
|
27
27
|
floorData={floorData}
|
|
28
28
|
{...getRenderRealTimeKeyObj}
|
|
29
29
|
/>
|
|
30
30
|
)}
|
|
31
31
|
<View
|
|
32
32
|
className={floorStyle['wrap']}
|
|
33
33
|
style={
|
|
34
34
|
containerBorderRadius
|
|
35
35
|
? {
|
|
36
36
|
borderRadius: containerBorderRadius + 'px',
|
|
37
37
|
}
|
|
38
38
|
: {}
|
|
39
39
|
}
|
|
40
40
|
>
|
|
41
41
|
{}
|
|
42
42
|
{props.children &&
|
|
43
43
|
React.cloneElement(props.children, {
|
|
44
44
|
dataDefines: dataDefines,
|
|
45
45
|
...getRenderRealTimeKeyObj,
|
|
46
46
|
})}
|
|
47
47
|
</View>
|
|
48
48
|
</View>
|
|
49
49
|
)
|
|
50
50
|
isRealTimeRender: false,
|
|
51
51
|
forceRenderTime: 1,
|
|
@@ -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: `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
40
39
|
buildType,
|
|
41
40
|
uid: floorData?.uid,
|
|
42
41
|
floorIdx: floorData?.floorIdx,
|
|
43
42
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
44
43
|
moduleId: floorData?.moduleId,
|
|
45
44
|
moduleName: floorData?.moduleName,
|
|
46
45
|
middleTemplateId: floorData?.middleTemplateId,
|
|
47
46
|
modularPackResult: modularPackResult,
|
|
48
47
|
}
|
|
49
48
|
if (bundleUrl && bundleFileName) {
|
|
50
49
|
let ISVModule =
|
|
51
50
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
52
51
|
`${floorData.uid}_${bundleFileName}`
|
|
53
52
|
] || null
|
|
54
53
|
if (!ISVModule) {
|
|
55
54
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
56
55
|
console.log(
|
|
57
56
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
58
57
|
bundleFileName,
|
|
59
58
|
)
|
|
60
59
|
taroJdBaseInfo.renderedIsvComponents[
|
|
61
60
|
`${floorData.uid}_${bundleFileName}`
|
|
62
61
|
] = ISVModule
|
|
63
62
|
console.log(
|
|
64
63
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
65
64
|
bundleFileName,
|
|
66
65
|
window['taroJshopH5WebpackJsonp'].find(
|
|
67
66
|
(item) => item[0][0] == bundleFileName,
|
|
68
67
|
),
|
|
69
68
|
)
|
|
70
69
|
} else {
|
|
71
70
|
console.log(
|
|
72
71
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
73
72
|
taroJdBaseInfo,
|
|
74
73
|
)
|
|
75
74
|
console.log(
|
|
76
75
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
77
76
|
taroJdBaseInfo.renderedIsvComponents[
|
|
78
77
|
`${floorData.uid}_${bundleFileName}`
|
|
79
78
|
],
|
|
80
79
|
)
|
|
81
80
|
}
|
|
82
81
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
83
82
|
return (
|
|
84
83
|
<ErrorBoundary {...props}>
|
|
85
84
|
<Suspense
|
|
86
85
|
fallback={
|
|
87
86
|
<View
|
|
88
87
|
style={{
|
|
89
88
|
position: 'relative',
|
|
90
89
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
91
90
|
height: `${_floorHeight}px`,
|
|
92
91
|
}}
|
|
93
92
|
></View>
|
|
94
93
|
}
|
|
95
94
|
>
|
|
96
95
|
<ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
97
96
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
98
97
|
</ISVFloor>
|
|
99
98
|
</Suspense>
|
|
100
99
|
</ErrorBoundary>
|
|
101
100
|
)
|
|
102
101
|
} else {
|
|
103
102
|
console.log(
|
|
104
103
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
105
104
|
modularPackResultObj,
|
|
106
105
|
)
|
|
107
106
|
sgmCustomReport({
|
|
108
107
|
code: 'isvModuleError',
|
|
109
108
|
msg: opt,
|
|
110
109
|
})
|
|
111
110
|
return null
|
|
112
111
|
}
|
|
113
112
|
} catch (err) {
|
|
114
113
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
115
114
|
sgmCustomReport({
|
|
116
115
|
code: 'isvModuleError',
|
|
117
116
|
msg: {
|
|
118
117
|
msg: 'remoteFloorItem try catch 异常',
|
|
119
118
|
err,
|
|
120
119
|
},
|
|
121
120
|
})
|
|
122
121
|
return null
|
|
123
122
|
}
|
|
124
123
|
})()
|
|
125
124
|
if (renderResult === null) {
|
|
126
125
|
updateContainerFloorListDataFn &&
|
|
127
126
|
updateContainerFloorListDataFn({
|
|
128
127
|
type: 'filter',
|
|
129
128
|
containerId: floorData?.uid,
|
|
130
129
|
})
|
|
131
130
|
console.log('renderResult === null: 命中了!')
|
|
132
131
|
taroEventSendPageScrollInfo()
|
|
133
132
|
} else {
|
|
134
133
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
135
134
|
}
|
|
136
135
|
return renderResult
|
|
136
|
+
import Taro from '@tarojs/taro'
|
|
137
137
|
getBundleUrl,
|
|
138
138
|
getBundleFileName,
|
|
139
139
|
formatPackResult,
|
|
140
140
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
141
141
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
142
142
|
const [forceRenderTime,setForceRenderTime] = useState(1)
|
|
143
143
|
useEffect(() => {
|
|
144
144
|
isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
|
|
145
145
|
setForceRenderTime(Date.now())
|
|
146
146
|
})
|
|
147
147
|
return () => {
|
|
148
148
|
isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
|
|
149
149
|
}
|
|
150
150
|
},[])
|
|
151
151
|
|
|
152
152
|
const getFloorSetHeight = (item) => {
|
|
153
153
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
154
154
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
155
155
|
: 200
|
|
156
156
|
return getHeight > 0 ? getHeight : 200
|
|
157
157
|
}
|
|
158
158
|
console.log(
|
|
159
159
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
160
160
|
)
|
|
161
161
|
const renderResult = (() => {
|
|
162
162
|
try {
|
|
163
163
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
164
164
|
console.log(
|
|
165
165
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
166
166
|
renderSourceType,
|
|
167
167
|
floorData.uid,
|
|
168
168
|
)
|
|
169
169
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
170
170
|
const modularPackResultObj = formatPackResult(modularPackResult)
|
|
171
171
|
const bundleUrl = getBundleUrl(modularPackResultObj)
|
|
172
172
|
const bundleFileName = getBundleFileName(modularPackResultObj)
|
|
173
173
|
const opt = {
|
|
174
174
|
msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
|
|
175
175
|
floorIdx: floorData?.floorIdx,
|
|
176
176
|
uid: floorData?.uid,
|
|
177
177
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
178
178
|
moduleId: floorData?.moduleId,
|
|
179
179
|
moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
|
|
180
180
|
floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
|
|
181
181
|
floorKind: floorData?.floorExtInfo?.floorKind,
|
|
182
182
|
middleTemplateId: floorData?.middleTemplateId,
|
|
183
183
|
modularPackResult: modularPackResult,
|
|
184
184
|
}
|
|
185
185
|
if (bundleUrl && bundleFileName) {
|
|
186
186
|
let ISVModule =
|
|
187
187
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
188
188
|
`${floorData.uid}_${bundleFileName}`
|
|
189
189
|
] || null
|
|
190
190
|
if (!ISVModule) {
|
|
191
191
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
192
192
|
console.log(
|
|
193
193
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
194
194
|
bundleFileName,
|
|
195
195
|
)
|
|
196
196
|
taroJdBaseInfo.renderedIsvComponents[
|
|
197
197
|
`${floorData.uid}_${bundleFileName}`
|
|
198
198
|
] = ISVModule
|
|
199
199
|
console.log(
|
|
200
200
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
201
201
|
bundleFileName,
|
|
202
202
|
window['taroJshopH5WebpackJsonp'].find(
|
|
203
203
|
(item) => item[0][0] == bundleFileName,
|
|
204
204
|
),
|
|
205
205
|
)
|
|
206
206
|
} else {
|
|
207
207
|
console.log(
|
|
208
208
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
209
209
|
taroJdBaseInfo,
|
|
210
210
|
)
|
|
211
211
|
console.log(
|
|
212
212
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
213
213
|
taroJdBaseInfo.renderedIsvComponents[
|
|
214
214
|
`${floorData.uid}_${bundleFileName}`
|
|
215
215
|
],
|
|
216
216
|
)
|
|
217
217
|
}
|
|
218
218
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
219
219
|
return (
|
|
220
220
|
<ErrorBoundary {...props}>
|
|
221
221
|
<Suspense
|
|
222
222
|
fallback={
|
|
223
223
|
<View
|
|
224
224
|
style={{
|
|
225
225
|
position: 'relative',
|
|
226
226
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
227
227
|
height: `${_floorHeight}px`,
|
|
228
228
|
}}
|
|
229
229
|
></View>
|
|
230
230
|
}
|
|
231
231
|
>
|
|
232
232
|
<ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
233
233
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
234
234
|
</ISVFloor>
|
|
235
235
|
</Suspense>
|
|
236
236
|
</ErrorBoundary>
|
|
237
237
|
)
|
|
238
238
|
} else {
|
|
239
239
|
console.log(
|
|
240
240
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
241
241
|
modularPackResultObj,
|
|
242
242
|
)
|
|
243
243
|
sgmCustomReport({
|
|
244
244
|
code: getSgmCustomCode(SgmCustomCode.REMOTEMODULE_DATA),
|
|
245
245
|
msg: opt,
|
|
246
246
|
})
|
|
247
247
|
return null
|
|
248
248
|
}
|
|
249
249
|
} catch (err) {
|
|
250
250
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
251
251
|
return null
|
|
252
252
|
}
|
|
253
253
|
})()
|
|
254
254
|
if (renderResult === null) {
|
|
255
255
|
updateContainerFloorListDataFn &&
|
|
256
256
|
updateContainerFloorListDataFn({
|
|
257
257
|
type: 'filter',
|
|
258
258
|
containerId: floorData?.uid,
|
|
259
259
|
})
|
|
260
260
|
console.log('renderResult === null: 命中了!')
|
|
261
261
|
taroEventSendPageScrollInfo()
|
|
262
262
|
} else {
|
|
263
263
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
264
264
|
}
|
|
265
265
|
return renderResult
|
package/dist/interface/common.ts
CHANGED