@conecli/cone-render 0.10.1-shop3.8 → 0.10.1-shop3.80
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/README.md +1 -1
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- 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.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/ItemViewExposureSmart/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/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +24 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.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/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.h5.ts +1 -0
- 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.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +274 -0
- package/dist/language/zh_CN.json +274 -0
- package/dist/language/zh_HK.json +274 -0
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- 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/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +27 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- 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/jumpExtMapUtil.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +162 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
// 默认标签高度14 部分特殊的16,因此设置最大高度16
|
|
3
|
+
|
|
4
|
+
.d-shop-tag-list {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
align-content: flex-start;
|
|
10
|
+
align-items: center;
|
|
11
|
+
align-self: flex-start;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
line-height: 10px; // 解决换行后上下无间隙导致看到线条的问题
|
|
15
|
+
max-height: 16PX;
|
|
16
|
+
|
|
17
|
+
&.d-shop-sku-tag-list{
|
|
18
|
+
margin: -2PX 8px 0 0;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
//height: 14PX;
|
|
21
|
+
//line-height: 14PX;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.d-tag-item{
|
|
26
|
+
margin-right: 8px;
|
|
27
|
+
&:last-child{
|
|
28
|
+
margin-right: 0;
|
|
29
|
+
}
|
|
30
|
+
.d-tag-item-canvas{
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
const getThisLeGaoTagKey = `${tagId}-${tagText}}`;
|
|
1
3
|
const getLeGaoTagCacheNode = shopLeGaoTagNodeMap.get(getThisLeGaoTagKey) || false;
|
|
2
4
|
return getLeGaoTagCacheNode
|
|
3
5
|
? getLeGaoTagCacheNode
|
|
4
6
|
: useMemo(() => {
|
|
5
7
|
const createCanVasTag = (
|
|
6
8
|
<canvas-tag
|
|
7
9
|
className={classNames(shopTagStyle['d-tag-item-canvas'])}
|
|
8
10
|
tagId={tagId}
|
|
9
11
|
text={tagText}
|
|
10
12
|
appVersion={getJdAppVersionStr}
|
|
11
13
|
lang={languageNowType}
|
|
12
14
|
/>
|
|
13
15
|
);
|
|
14
16
|
shopLeGaoTagNodeMap.set(getThisLeGaoTagKey, createCanVasTag);
|
|
15
17
|
return createCanVasTag;
|
|
16
18
|
}, [tagId, tagText]);
|
|
17
19
|
const {
|
|
18
20
|
tagInfoList = [],
|
|
19
21
|
className,
|
|
20
22
|
itemClassName,
|
|
21
23
|
isSkuBaseTag = false,
|
|
22
24
|
itemClickCallback,
|
|
23
25
|
} = props;
|
|
24
26
|
const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
|
|
25
27
|
const getTagInfoListNum = getTagInfoList.length;
|
|
26
28
|
const isCallBackFn = typeof itemClickCallback === 'function';
|
|
27
29
|
const needAsyncLoad = useMemo(() => {
|
|
28
30
|
if (window.CanvasTag) return false;
|
|
29
31
|
const h5TagJs = taroJdBaseInfo.loadJsSdkList.find((e) => e.fileName === 'h5TagJs');
|
|
30
32
|
return !!(h5TagJs && h5TagJs.initTriggerType === LoadJsInitTriggerType.NRXT_TICK);
|
|
31
33
|
}, []);
|
|
32
34
|
const [loadOver, setLoadOver] = useState(!needAsyncLoad);
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
async function loadTagSdk() {
|
|
35
37
|
try {
|
|
36
38
|
await taroJdBaseInfo.loadH5tagReayPromise();
|
|
37
39
|
} catch (error) {}
|
|
38
40
|
setLoadOver(true);
|
|
39
41
|
}
|
|
40
42
|
needAsyncLoad && loadTagSdk();
|
|
41
43
|
}, []);
|
|
42
44
|
if (!loadOver) return null;
|
|
43
45
|
return getTagInfoListNum > 0 ? (
|
|
44
46
|
<View
|
|
45
47
|
className={classNames(
|
|
46
48
|
shopTagStyle['d-shop-tag-list'],
|
|
47
49
|
{
|
|
48
50
|
[shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag,
|
|
49
51
|
},
|
|
50
52
|
className,
|
|
51
53
|
)}
|
|
52
54
|
>
|
|
53
55
|
{}
|
|
54
56
|
<View style={{ width: '1px', height: '100%' }} />
|
|
55
57
|
{getTagInfoList.map((item, index) => {
|
|
56
58
|
const { tagId, tabIconId, tagText, type, tabIconType, tabText } = item;
|
|
57
59
|
const getTagId = tagId || tabIconId;
|
|
58
60
|
const getTagType = type || tabIconType;
|
|
59
61
|
const getTagText = tagText || tabText;
|
|
60
62
|
return getTagId ? (
|
|
61
63
|
<View
|
|
62
64
|
key={getTagId + getTagType + index}
|
|
63
65
|
className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
|
|
64
66
|
onClick={isCallBackFn && itemClickCallback.bind(this, item, index)}
|
|
65
67
|
>
|
|
66
68
|
<LeGaoTagComponent tagId={getTagId} tagText={getTagText} />
|
|
67
69
|
</View>
|
|
68
70
|
) : null;
|
|
69
71
|
})}
|
|
70
72
|
</View>
|
|
71
73
|
) : null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
// 默认标签高度14 部分特殊的16,因此设置最大高度16
|
|
3
|
+
|
|
4
|
+
.d-shop-tag-list {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
align-content: flex-start;
|
|
10
|
+
align-items: center;
|
|
11
|
+
align-self: flex-start;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
line-height: 10px; // 解决换行后上下无间隙导致看到线条的问题
|
|
15
|
+
max-height: 32px;
|
|
16
|
+
|
|
17
|
+
&.d-shop-sku-tag-list{
|
|
18
|
+
margin: -6px 8px 0 0;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
height: 28px;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
}
|
|
24
|
+
.d-tag-item{
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
margin-right: 8px;
|
|
27
|
+
width: auto;
|
|
28
|
+
height: 28px;
|
|
29
|
+
&:last-child{
|
|
30
|
+
margin-right: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
"tab_054": "https://m.360buyimg.com/cc/jfs/t1/88382/20/39502/894/64d36235Fc720ec9d/908e4378fec75555.png",
|
|
1
3
|
"tab_054_home": "https://m.360buyimg.com/cc/jfs/t1/88382/20/39502/894/64d36235Fc720ec9d/908e4378fec75555.png",
|
|
2
4
|
"tab_665": "https://m.360buyimg.com/cc/jfs/t1/252765/17/9937/2555/677c9155F246ead31/55243d94eb9ca8db.png",
|
|
3
5
|
"tab_6209_dp": "https://m.360buyimg.com/cc/jfs/t1/252765/17/9937/2555/677c9155F246ead31/55243d94eb9ca8db.png",
|
|
4
6
|
const { tagInfoList = [], className, itemClassName, isSkuBaseTag = false } = props;
|
|
5
7
|
const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
|
|
6
8
|
const getTagInfoListNum = getTagInfoList.length;
|
|
7
9
|
return getTagInfoListNum > 0 ? (
|
|
8
10
|
<View className={classNames(shopTagStyle['d-shop-tag-list'],{
|
|
9
11
|
[shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag
|
|
10
12
|
}, className)}>
|
|
11
13
|
{}
|
|
12
14
|
<View style={{ width: '1px', height: '100%' }} />
|
|
13
15
|
{getTagInfoList.map((item, index) => {
|
|
14
16
|
const { tabIconId,tagId, tabImageUrl,type, tabIconType} = item;
|
|
15
17
|
const getTagId = tagId || tabIconId;
|
|
16
18
|
const getTagType = type || tabIconType;
|
|
17
19
|
const getUrl =
|
|
18
20
|
typeof tabImageUrl === 'string' ? tabImageUrl : shopTagIconDefaultUrl[getTagId];
|
|
19
21
|
return getUrl && getUrl !== "" ? (
|
|
20
22
|
<Image
|
|
21
23
|
key={index + getTagId + getTagType}
|
|
22
24
|
className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
|
|
23
25
|
mode="heightFix"
|
|
24
26
|
src={getUrl}
|
|
25
27
|
/>
|
|
26
28
|
) : null;
|
|
27
29
|
})}
|
|
28
30
|
</View>
|
|
29
31
|
) : null;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
left: 0;
|
|
7
7
|
right: 0;
|
|
8
8
|
bottom: 0;
|
|
9
|
-
z-index:
|
|
9
|
+
z-index: 9999;
|
|
10
10
|
|
|
11
11
|
.debug-layout {
|
|
12
12
|
position: absolute;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
.d-info {
|
|
59
59
|
position: relative;
|
|
60
60
|
cursor: pointer;
|
|
61
|
-
z-index:
|
|
61
|
+
z-index: 9999;
|
|
62
62
|
margin: 3PX 3PX;
|
|
63
63
|
width: 22PX;
|
|
64
64
|
height: 22PX;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
const {
|
|
3
2
|
floorData,
|
|
4
3
|
renderSourceType = BUSINESS_TYPE.ONLINE,
|
|
5
4
|
builtInComponents = {},
|
|
6
5
|
} = props
|
|
7
6
|
const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
|
|
8
7
|
const specificModuleFlag = ['mHeaderVideo']
|
|
9
8
|
const frontEndSpecificModuleFlag = ['header_mVideo']
|
|
10
9
|
const luxuryContainerPosition = 'luxuryFixed'
|
|
11
10
|
const floorPosition = floorData?.floorPosition
|
|
12
11
|
let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
|
|
13
12
|
specificModuleFlag.includes(floorModuleType) &&
|
|
14
13
|
floorPosition === luxuryContainerPosition &&
|
|
15
14
|
(floorModuleType = frontEndSpecificModuleFlag)
|
|
16
15
|
const FloorContentItem =
|
|
17
16
|
(floorModuleType && builtInComponents[floorModuleType]) || null
|
|
18
17
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
19
18
|
|
|
20
19
|
const renderDecorateDefaultModule = () => {
|
|
21
20
|
return (
|
|
22
21
|
<View
|
|
23
22
|
style={{
|
|
24
23
|
lineHeight: '120px',
|
|
25
24
|
textAlign: 'center',
|
|
26
25
|
}}
|
|
27
26
|
>
|
|
28
27
|
当前模块是{floorData.moduleName}
|
|
29
28
|
</View>
|
|
30
29
|
)
|
|
31
30
|
}
|
|
32
31
|
if (
|
|
33
32
|
floorModuleType &&
|
|
34
33
|
(RemoteLoadFloorList.includes(floorModuleType) ||
|
|
35
34
|
floorData?.floorExtInfo?.floorLoadWay === 2)
|
|
36
35
|
) {
|
|
37
36
|
return (
|
|
38
37
|
<RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
|
|
39
38
|
)
|
|
40
39
|
} else {
|
|
41
40
|
return FloorContentItem ? (
|
|
42
41
|
<ErrorBoundary {...props}>
|
|
43
42
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
44
43
|
</ErrorBoundary>
|
|
45
44
|
) : isDevMode ? (
|
|
46
45
|
renderDecorateDefaultModule()
|
|
47
46
|
) : null
|
|
48
47
|
}
|
|
49
48
|
switch (moduleId) {
|
|
50
49
|
case 83158:
|
|
51
50
|
return 'freeLayout'
|
|
52
51
|
case 99654:
|
|
53
52
|
return 'activeText'
|
|
54
53
|
case 100382:
|
|
55
54
|
return 'superGoods'
|
|
56
55
|
}
|
|
57
56
|
floorList.map((item) => {
|
|
58
57
|
if (!item.floorExtInfo) {
|
|
59
58
|
return null
|
|
60
59
|
}
|
|
61
60
|
const moduleFlag = item.floorExtInfo.moduleFlag
|
|
62
61
|
if (!moduleFlag) {
|
|
63
62
|
const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
|
|
64
63
|
if (newModuleFlag) {
|
|
65
64
|
item.floorExtInfo.moduleFlag = newModuleFlag
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
})
|
|
68
|
+
import React, { memo, useMemo } from 'react';
|
|
69
69
|
const {
|
|
70
70
|
floorData,
|
|
71
71
|
renderSourceType = BUSINESS_TYPE.ONLINE,
|
|
72
72
|
builtInComponents = {},
|
|
73
73
|
} = props;
|
|
74
74
|
const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE;
|
|
75
75
|
const specificModuleFlag = ['mHeaderVideo'];
|
|
76
76
|
const frontEndSpecificModuleFlag = ['header_mVideo'];
|
|
77
77
|
const luxuryContainerPosition = 'luxuryFixed';
|
|
78
78
|
const floorPosition = floorData?.floorPosition;
|
|
79
79
|
let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag;
|
|
80
80
|
specificModuleFlag.includes(floorModuleType) &&
|
|
81
81
|
floorPosition === luxuryContainerPosition &&
|
|
82
82
|
(floorModuleType = frontEndSpecificModuleFlag);
|
|
83
83
|
const FloorContentItem = (floorModuleType && builtInComponents[floorModuleType]) || null;
|
|
84
84
|
const dataDefines = useMemo(() => {
|
|
85
85
|
return getFloorDataToDataDefines(floorData);
|
|
86
86
|
}, [floorData]);
|
|
87
87
|
|
|
88
88
|
const renderDecorateDefaultModule = () => {
|
|
89
89
|
return (
|
|
90
90
|
<View
|
|
91
91
|
style={{
|
|
92
92
|
lineHeight: '120px',
|
|
93
93
|
textAlign: 'center',
|
|
94
94
|
}}
|
|
95
95
|
>
|
|
96
96
|
当前模块是{floorData.moduleName}
|
|
97
97
|
</View>
|
|
98
98
|
);
|
|
99
99
|
};
|
|
100
100
|
if (
|
|
101
101
|
floorModuleType &&
|
|
102
102
|
(RemoteLoadFloorList.includes(floorModuleType) || floorData?.floorExtInfo?.floorLoadWay === 2)
|
|
103
103
|
) {
|
|
104
104
|
return <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>;
|
|
105
105
|
} else {
|
|
106
106
|
return FloorContentItem ? (
|
|
107
107
|
<ErrorBoundary {...props}>
|
|
108
108
|
<FloorContentItem {...props} dataDefines={dataDefines} />
|
|
109
109
|
</ErrorBoundary>
|
|
110
110
|
) : isDevMode ? (
|
|
111
111
|
renderDecorateDefaultModule()
|
|
112
112
|
) : null;
|
|
113
113
|
}
|
|
114
114
|
switch (moduleId) {
|
|
115
115
|
case 83158:
|
|
116
116
|
return 'freeLayout';
|
|
117
117
|
case 99654:
|
|
118
118
|
return 'activeText';
|
|
119
119
|
case 100382:
|
|
120
120
|
return 'superGoods';
|
|
121
121
|
}
|
|
122
122
|
floorList.map((item) => {
|
|
123
123
|
if (!item.floorExtInfo) {
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
126
|
const moduleFlag = item.floorExtInfo.moduleFlag;
|
|
127
127
|
if (!moduleFlag) {
|
|
128
128
|
const newModuleFlag = moduleId2ModuleFlag(item.moduleId);
|
|
129
129
|
if (newModuleFlag) {
|
|
130
130
|
item.floorExtInfo.moduleFlag = newModuleFlag;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
if (nextProps.source !== 'appView') return false;
|
|
135
135
|
return (
|
|
136
136
|
prevProps.floorData === nextProps.floorData &&
|
|
137
137
|
prevProps.extendInfoData === nextProps.extendInfoData
|
|
138
138
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { useCallback } from 'react'
|
|
2
1
|
const {
|
|
3
2
|
style,
|
|
4
3
|
dataDefines,
|
|
5
4
|
containerBorderRadius,
|
|
6
5
|
floorData,
|
|
7
6
|
isRealTimeRender,
|
|
8
7
|
forceRenderTime,
|
|
9
8
|
} = props
|
|
10
9
|
const getRenderRealTimeKeyObj = {
|
|
11
10
|
key: isRealTimeRender ? Date.now() : forceRenderTime,
|
|
12
11
|
}
|
|
13
12
|
console.log('远程加载楼层渲染key信息', getRenderRealTimeKeyObj)
|
|
14
13
|
return (
|
|
15
14
|
<View className={floorStyle['wrap']} style={style}>
|
|
16
15
|
{floorData?.showCommonFloorHead === false ? null : (
|
|
17
16
|
<CommonFloorHead
|
|
18
17
|
dataDefines={dataDefines}
|
|
19
18
|
floorData={floorData}
|
|
20
19
|
{...getRenderRealTimeKeyObj}
|
|
21
20
|
/>
|
|
22
21
|
)}
|
|
23
22
|
<View
|
|
24
23
|
className={floorStyle['wrap']}
|
|
25
24
|
style={
|
|
26
25
|
typeof containerBorderRadius === 'number'
|
|
27
26
|
? {
|
|
28
27
|
borderRadius: containerBorderRadius + 'px',
|
|
29
28
|
}
|
|
30
29
|
: containerBorderRadius
|
|
31
30
|
}
|
|
32
31
|
>
|
|
33
32
|
{}
|
|
34
33
|
{props.children &&
|
|
35
34
|
React.cloneElement(props.children, {
|
|
36
35
|
dataDefines: dataDefines,
|
|
37
36
|
...getRenderRealTimeKeyObj,
|
|
38
37
|
})}
|
|
39
38
|
</View>
|
|
40
39
|
</View>
|
|
41
40
|
)
|
|
42
41
|
isRealTimeRender: false,
|
|
43
42
|
forceRenderTime: 1,
|
|
43
|
+
import React, { useState, useMemo, useRef, useCallback } from 'react';
|
|
44
44
|
const {
|
|
45
45
|
style,
|
|
46
46
|
dataDefines,
|
|
47
47
|
containerBorderRadius,
|
|
48
48
|
floorData,
|
|
49
49
|
isRealTimeRender,
|
|
50
50
|
forceRenderTime,
|
|
51
51
|
containerIndex = 0,
|
|
52
52
|
} = props;
|
|
53
53
|
const domRef = useRef<HTMLDivElement>(null);
|
|
54
54
|
const [wrapperHeight, setWrapperHeight] = useState<number | string>('auto');
|
|
55
55
|
const hasBeenInViewRef = useRef(false);
|
|
56
56
|
|
|
57
57
|
const globalSwitch = useMemo(() => {
|
|
58
58
|
let contentVisibilityShieldAll = true;
|
|
59
59
|
let contentVisibilityShieldModuleId: number[] = [];
|
|
60
60
|
if (window.shopGlobalSwitch) {
|
|
61
61
|
contentVisibilityShieldAll =
|
|
62
62
|
typeof window.shopGlobalSwitch.contentVisibilityShieldAll === 'boolean'
|
|
63
63
|
? window.shopGlobalSwitch.contentVisibilityShieldAll
|
|
64
64
|
: true;
|
|
65
65
|
contentVisibilityShieldModuleId = Array.isArray(
|
|
66
66
|
window.shopGlobalSwitch.contentVisibilityShieldModuleId,
|
|
67
67
|
)
|
|
68
68
|
? window.shopGlobalSwitch.contentVisibilityShieldModuleId
|
|
69
69
|
: [];
|
|
70
70
|
}
|
|
71
71
|
return { contentVisibilityShieldAll, contentVisibilityShieldModuleId };
|
|
72
72
|
}, []);
|
|
73
73
|
|
|
74
74
|
const handleInViewCallback = useCallback(() => {
|
|
75
75
|
if (globalSwitch.contentVisibilityShieldAll) return;
|
|
76
76
|
if (
|
|
77
77
|
floorData.moduleId &&
|
|
78
78
|
globalSwitch.contentVisibilityShieldModuleId.indexOf(floorData.moduleId) > -1
|
|
79
79
|
) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (!hasBeenInViewRef.current) {
|
|
83
83
|
hasBeenInViewRef.current = true;
|
|
84
84
|
setWrapperHeight('auto');
|
|
85
85
|
}
|
|
86
86
|
}, [containerIndex]);
|
|
87
87
|
|
|
88
88
|
const handleOutViewCallback = useCallback(() => {
|
|
89
89
|
if (globalSwitch.contentVisibilityShieldAll) return;
|
|
90
90
|
if (
|
|
91
91
|
floorData.moduleId &&
|
|
92
92
|
globalSwitch.contentVisibilityShieldModuleId.indexOf(floorData.moduleId) > -1
|
|
93
93
|
) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
if (hasBeenInViewRef.current && domRef.current) {
|
|
97
97
|
hasBeenInViewRef.current = false;
|
|
98
98
|
const height = domRef.current.getBoundingClientRect().height;
|
|
99
99
|
if (height > 0) {
|
|
100
100
|
setWrapperHeight(height);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}, [containerIndex]);
|
|
104
104
|
const getRenderRealTimeKeyObj = useMemo(() => {
|
|
105
105
|
return {
|
|
106
106
|
key: isRealTimeRender ? Date.now() : forceRenderTime,
|
|
107
107
|
};
|
|
108
108
|
}, [isRealTimeRender, forceRenderTime]);
|
|
109
109
|
const innerStyle = useMemo(() => {
|
|
110
110
|
const baseStyle = style || {};
|
|
111
111
|
let borderRadius = {};
|
|
112
112
|
if (typeof containerBorderRadius === 'number') {
|
|
113
113
|
borderRadius = { borderRadius: containerBorderRadius + 'px' };
|
|
114
114
|
} else if (containerBorderRadius && typeof containerBorderRadius === 'object') {
|
|
115
115
|
borderRadius = containerBorderRadius;
|
|
116
116
|
}
|
|
117
117
|
if (typeof wrapperHeight === 'number') {
|
|
118
118
|
return {
|
|
119
119
|
...baseStyle,
|
|
120
120
|
...borderRadius,
|
|
121
121
|
height: `${wrapperHeight}px`,
|
|
122
122
|
overflow: 'hidden',
|
|
123
123
|
contentVisibility: 'auto',
|
|
124
124
|
containIntrinsicSize: `${wrapperHeight}px`,
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
return { ...baseStyle, ...borderRadius };
|
|
128
128
|
}, [containerBorderRadius, wrapperHeight]);
|
|
129
129
|
return (
|
|
130
130
|
<InOrOutViewObserver
|
|
131
131
|
inViewCallback={handleInViewCallback}
|
|
132
132
|
outViewCallback={handleOutViewCallback}
|
|
133
133
|
threshold={0}
|
|
134
134
|
>
|
|
135
135
|
<View ref={domRef} style={innerStyle} className={floorStyle['wrap']}>
|
|
136
136
|
{floorData?.showCommonFloorHead === false ? null : (
|
|
137
137
|
<CommonFloorHead
|
|
138
138
|
dataDefines={dataDefines}
|
|
139
139
|
floorData={floorData}
|
|
140
140
|
{...getRenderRealTimeKeyObj}
|
|
141
141
|
/>
|
|
142
142
|
)}
|
|
143
143
|
{props.children &&
|
|
144
144
|
React.cloneElement(props.children, {
|
|
145
145
|
dataDefines: dataDefines,
|
|
146
146
|
...getRenderRealTimeKeyObj,
|
|
147
147
|
})}
|
|
148
148
|
</View>
|
|
149
149
|
</InOrOutViewObserver>
|
|
150
150
|
);
|
|
151
151
|
isRealTimeRender: false,
|
|
152
152
|
forceRenderTime: 1,
|