@conecli/cone-render 0.8.39 → 0.8.41
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 +7 -1
- 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/sgmCustomCode.ts +1 -0
- 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/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/LazyLayoutLoad/index.weapp.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +20 -20
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +4 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Skeleton/index.tsx +1 -1
- 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/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 +17 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +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/shopMember.ts +1 -1
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/sass/app.h5.scss +39 -3
- package/dist/sass/base.scss +12 -0
- 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 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +2 -1
- package/dist/components/base/Skeleton/old.tsx +0 -1
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import { Button, View } from '@tarojs/components'
|
|
2
1
|
NetWorkErrorList,
|
|
3
2
|
NetWorkErrorTip,
|
|
4
3
|
NetWorkErrorSubTip,
|
|
5
4
|
NetWorkShowType,
|
|
6
5
|
NetWork_Image_Type,
|
|
7
6
|
const {
|
|
8
7
|
className,
|
|
9
8
|
message,
|
|
10
9
|
subMessage,
|
|
11
10
|
btnLabel,
|
|
12
11
|
backgroundColorWhite,
|
|
13
12
|
netWorkDataType,
|
|
14
13
|
netWorkShowType,
|
|
15
14
|
netWorkImageType,
|
|
16
15
|
refreshCallBackFn,
|
|
17
16
|
} = props
|
|
18
17
|
const refershInitData = useCallback(() => {
|
|
19
18
|
refreshCallBackFn && refreshCallBackFn(true)
|
|
20
19
|
}, [])
|
|
21
20
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
22
21
|
const useErrorSubTip = subMessage
|
|
23
22
|
? subMessage
|
|
24
23
|
: NetWorkErrorSubTip[netWorkDataType]
|
|
25
24
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
26
25
|
const maxHeight = latestRes.displayHeight || 546
|
|
27
26
|
return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
|
|
28
27
|
<View
|
|
29
28
|
style={{ maxHeight: isMemberPage ? '100vh' : maxHeight }}
|
|
30
29
|
className={classNames(
|
|
31
30
|
netWorkErrorStyle['d-shop-network'],
|
|
32
31
|
{
|
|
33
32
|
[netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
35
|
[netWorkErrorStyle['d-shop-network-part']]:
|
|
37
36
|
netWorkShowType === NetWorkShowType.PART,
|
|
38
37
|
},
|
|
39
38
|
{
|
|
40
39
|
[netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
|
|
41
40
|
},
|
|
42
41
|
'flexible-center-box',
|
|
43
42
|
className,
|
|
44
43
|
)}
|
|
45
44
|
>
|
|
46
45
|
<View className={netWorkErrorStyle['d-error-content']}>
|
|
47
46
|
<View
|
|
48
47
|
className={classNames(
|
|
49
48
|
netWorkErrorStyle['d-error-type'],
|
|
50
49
|
netWorkErrorStyle[`d-${netWorkDataType}`],
|
|
51
50
|
netWorkErrorStyle[`d-${netWorkImageType}`],
|
|
52
51
|
)}
|
|
53
52
|
/>
|
|
54
53
|
<View className={netWorkErrorStyle['d-error-tip']}>{useErrorTip}</View>
|
|
55
54
|
{useErrorSubTip ? (
|
|
56
55
|
<View className={netWorkErrorStyle['d-error-sub-tip']}>
|
|
57
56
|
{useErrorSubTip}
|
|
58
57
|
</View>
|
|
59
58
|
) : null}
|
|
60
59
|
<View className={'flexible-horizontal-center-box'}>
|
|
61
60
|
{refreshCallBackFn && (
|
|
62
61
|
<Button
|
|
63
62
|
onClick={refershInitData}
|
|
64
63
|
className={classNames(
|
|
65
64
|
netWorkErrorStyle['d-opt-btn'],
|
|
66
65
|
'd-button-no-border',
|
|
67
66
|
)}
|
|
68
67
|
plain
|
|
69
68
|
size="mini"
|
|
70
69
|
>
|
|
71
70
|
{btnLabel}
|
|
72
71
|
</Button>
|
|
73
72
|
)}
|
|
74
73
|
</View>
|
|
75
74
|
</View>
|
|
76
75
|
</View>
|
|
77
76
|
) : null
|
|
78
77
|
className: '',
|
|
79
78
|
message: '',
|
|
80
79
|
subMessage: '',
|
|
81
80
|
btnLabel: '重新加载',
|
|
82
81
|
backgroundColorWhite: false,
|
|
83
82
|
netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
|
|
84
83
|
netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
|
|
85
84
|
netWorkShowType: NetWorkShowType.FULL,
|
|
86
85
|
refreshCallBackFn: null,
|
|
86
|
+
import { Button, View } from '@tarojs/components'
|
|
87
87
|
NetWorkErrorList,
|
|
88
88
|
NetWorkErrorTip,
|
|
89
89
|
NetWorkErrorSubTip,
|
|
90
90
|
NetWorkShowType,
|
|
91
91
|
NetWork_Image_Type,
|
|
92
92
|
const {
|
|
93
93
|
className,
|
|
94
94
|
message,
|
|
95
95
|
subMessage,
|
|
96
96
|
btnLabel,
|
|
97
97
|
backgroundColorWhite,
|
|
98
98
|
netWorkDataType,
|
|
99
99
|
netWorkShowType,
|
|
100
100
|
netWorkImageType,
|
|
101
101
|
refreshCallBackFn,
|
|
102
102
|
viewMaxHeight
|
|
103
103
|
} = props
|
|
104
104
|
const refershInitData = useCallback(() => {
|
|
105
105
|
refreshCallBackFn && refreshCallBackFn(true)
|
|
106
106
|
}, [])
|
|
107
107
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
108
108
|
const useErrorSubTip = subMessage
|
|
109
109
|
? subMessage
|
|
110
110
|
: NetWorkErrorSubTip[netWorkDataType]
|
|
111
111
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
112
112
|
const maxHeight = latestRes.displayHeight || 546
|
|
113
113
|
return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
|
|
114
114
|
<View
|
|
115
115
|
style={{ maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight }}
|
|
116
116
|
className={classNames(
|
|
117
117
|
netWorkErrorStyle['d-shop-network'],
|
|
118
118
|
{
|
|
119
119
|
[netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
[netWorkErrorStyle['d-shop-network-part']]:
|
|
123
123
|
netWorkShowType === NetWorkShowType.PART,
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
[netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
|
|
127
127
|
},
|
|
128
128
|
'flexible-center-box',
|
|
129
129
|
className,
|
|
130
130
|
)}
|
|
131
131
|
>
|
|
132
132
|
<View className={classNames(netWorkErrorStyle['d-error-content'],'d-error-content')}>
|
|
133
133
|
<View
|
|
134
134
|
className={classNames(
|
|
135
135
|
netWorkErrorStyle['d-error-type'],
|
|
136
136
|
netWorkErrorStyle[`d-${netWorkDataType}`],
|
|
137
137
|
netWorkErrorStyle[`d-${netWorkImageType}`],
|
|
138
138
|
'd-error-type'
|
|
139
139
|
)}
|
|
140
140
|
/>
|
|
141
141
|
<View className={classNames(netWorkErrorStyle['d-error-tip'],'d-error-tip')}>
|
|
142
142
|
{useErrorTip}
|
|
143
143
|
</View>
|
|
144
144
|
{useErrorSubTip ? <View className={classNames(netWorkErrorStyle['d-error-sub-tip'],'d-error-sub-tip')}>{useErrorSubTip}</View> : null}
|
|
145
145
|
<View className={'flexible-horizontal-center-box'}>
|
|
146
146
|
{refreshCallBackFn && (
|
|
147
147
|
<Button
|
|
148
148
|
onClick={refershInitData}
|
|
149
149
|
className={classNames(
|
|
150
150
|
netWorkErrorStyle['d-opt-btn'],
|
|
151
151
|
'd-button-no-border',
|
|
152
152
|
'd-opt-btn'
|
|
153
153
|
)}
|
|
154
154
|
plain
|
|
155
155
|
size="mini"
|
|
156
156
|
>
|
|
157
157
|
{btnLabel}
|
|
158
158
|
</Button>
|
|
159
159
|
)}
|
|
160
160
|
</View>
|
|
161
161
|
</View>
|
|
162
162
|
</View>
|
|
163
163
|
) : null
|
|
164
164
|
className: '',
|
|
165
165
|
message: '',
|
|
166
166
|
subMessage: '',
|
|
167
167
|
btnLabel: '重新加载',
|
|
168
168
|
backgroundColorWhite: false,
|
|
169
169
|
netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
|
|
170
170
|
netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
|
|
171
171
|
netWorkShowType: NetWorkShowType.FULL,
|
|
172
172
|
refreshCallBackFn: null,
|
|
173
173
|
viewMaxHeight: ''
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
<View className={blockStyle['skeleton-header']}>
|
|
3
2
|
<Image
|
|
4
3
|
className={blockStyle['skeleton-header-img']}
|
|
5
4
|
src={ShopHeaderSvgUrl}
|
|
6
5
|
mode='widthFix'
|
|
7
6
|
/>
|
|
8
7
|
</View>
|
|
9
8
|
<View className={blockStyle['skeleton-new-product']}>
|
|
10
9
|
<ContentLoader viewBox='0 0 375 280' {...props}>
|
|
11
10
|
<rect x='10' y='38' rx='5' ry='5' width='355' height='55' />
|
|
12
11
|
<rect x='12' y='112' rx='3' ry='3' width='111' height='95' />
|
|
13
12
|
<rect x='12' y='11' rx='3' ry='3' width='100' height='10' />
|
|
14
13
|
<rect x='254' y='112' rx='3' ry='3' width='111' height='95' />
|
|
15
14
|
<rect x='14' y='218' rx='0' ry='0' width='111' height='27' />
|
|
16
15
|
<rect x='261' y='217' rx='0' ry='0' width='111' height='27' />
|
|
17
16
|
<rect x='134' y='112' rx='3' ry='3' width='111' height='95' />
|
|
18
17
|
<rect x='133' y='218' rx='0' ry='0' width='111' height='27' />
|
|
19
18
|
<rect x='20' y='255' rx='0' ry='0' width='100' height='9' />
|
|
20
19
|
<rect x='140' y='255' rx='0' ry='0' width='100' height='9' />
|
|
21
20
|
<rect x='263' y='255' rx='0' ry='0' width='100' height='9' />
|
|
22
21
|
</ContentLoader>
|
|
23
22
|
</View>
|
|
23
|
+
import React from 'react'
|
|
24
24
|
<View className={blockStyle['skeleton-header']}>
|
|
25
25
|
<Image
|
|
26
26
|
className={blockStyle['skeleton-header-img']}
|
|
27
27
|
src={ShopHeaderSvgUrl}
|
|
28
28
|
mode="widthFix"
|
|
29
29
|
/>
|
|
30
30
|
</View>
|
|
@@ -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 = 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
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
3
2
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
4
3
|
|
|
5
4
|
const getFloorSetHeight = (item) => {
|
|
6
5
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
7
6
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
8
7
|
: 200
|
|
9
8
|
return getHeight > 0 ? getHeight : 200
|
|
10
9
|
}
|
|
11
10
|
console.log(
|
|
12
11
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
13
12
|
)
|
|
14
13
|
const renderResult = (() => {
|
|
15
14
|
try {
|
|
16
15
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
17
16
|
console.log(
|
|
18
17
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
19
18
|
renderSourceType,
|
|
20
19
|
floorData.uid,
|
|
21
20
|
)
|
|
22
21
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
23
22
|
const modularPackResultObj =
|
|
24
23
|
typeof modularPackResult === 'string'
|
|
25
24
|
? JSON.parse(modularPackResult)
|
|
26
25
|
: modularPackResult
|
|
27
26
|
const opt = {
|
|
28
27
|
msg: `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
29
28
|
buildType,
|
|
30
29
|
uid: floorData?.uid,
|
|
31
30
|
floorIdx: floorData?.floorIdx,
|
|
32
31
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
33
32
|
moduleId: floorData?.moduleId,
|
|
34
33
|
moduleName: floorData?.moduleName,
|
|
35
34
|
middleTemplateId: floorData?.middleTemplateId,
|
|
36
35
|
modularPackResult: modularPackResult,
|
|
37
36
|
}
|
|
38
37
|
if (modularPackResultObj) {
|
|
39
38
|
const { bundleUrl, bundleFileName } = modularPackResultObj
|
|
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(
|
|
47
46
|
() => import(bundleFileName + '@@@@@@' + bundleUrl),
|
|
48
47
|
)
|
|
49
48
|
console.log(
|
|
50
49
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
51
50
|
bundleFileName,
|
|
52
51
|
)
|
|
53
52
|
taroJdBaseInfo.renderedIsvComponents[
|
|
54
53
|
`${floorData.uid}_${bundleFileName}`
|
|
55
54
|
] = ISVModule
|
|
56
55
|
console.log(
|
|
57
56
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
58
57
|
bundleFileName,
|
|
59
58
|
window['taroJshopH5WebpackJsonp'].find(
|
|
60
59
|
(item) => item[0][0] == bundleFileName,
|
|
61
60
|
),
|
|
62
61
|
)
|
|
63
62
|
} else {
|
|
64
63
|
console.log(
|
|
65
64
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
66
65
|
taroJdBaseInfo,
|
|
67
66
|
)
|
|
68
67
|
console.log(
|
|
69
68
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
70
69
|
taroJdBaseInfo.renderedIsvComponents[
|
|
71
70
|
`${floorData.uid}_${bundleFileName}`
|
|
72
71
|
],
|
|
73
72
|
)
|
|
74
73
|
}
|
|
75
74
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
76
75
|
return (
|
|
77
76
|
<ErrorBoundary {...props}>
|
|
78
77
|
<Suspense
|
|
79
78
|
fallback={
|
|
80
79
|
<View
|
|
81
80
|
style={{
|
|
82
81
|
position: 'relative',
|
|
83
82
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
84
83
|
height: `${_floorHeight}px`,
|
|
85
84
|
}}
|
|
86
85
|
></View>
|
|
87
86
|
}
|
|
88
87
|
>
|
|
89
88
|
<ISVFloor {...props} dataDefines={dataDefines} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
90
89
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
91
90
|
</ISVFloor>
|
|
92
91
|
</Suspense>
|
|
93
92
|
</ErrorBoundary>
|
|
94
93
|
)
|
|
95
94
|
} else {
|
|
96
95
|
console.log(
|
|
97
96
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
98
97
|
modularPackResultObj,
|
|
99
98
|
)
|
|
100
99
|
sgmCustomReport({
|
|
101
100
|
code: 'isvModuleError',
|
|
102
101
|
msg: opt,
|
|
103
102
|
})
|
|
104
103
|
return null
|
|
105
104
|
}
|
|
106
105
|
} else {
|
|
107
106
|
console.log(
|
|
108
107
|
'3|isv模块渲染异常,缺少modularPackResult==========modularPackResult: ',
|
|
109
108
|
modularPackResultObj,
|
|
110
109
|
)
|
|
111
110
|
sgmCustomReport({
|
|
112
111
|
code: 'isvModuleError',
|
|
113
112
|
msg: opt,
|
|
114
113
|
})
|
|
115
114
|
return null
|
|
116
115
|
}
|
|
117
116
|
} catch (err) {
|
|
118
117
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
119
118
|
sgmCustomReport({
|
|
120
119
|
code: 'isvModuleError',
|
|
121
120
|
msg: {
|
|
122
121
|
msg: 'remoteFloorItem try catch 异常',
|
|
123
122
|
err
|
|
124
123
|
},
|
|
125
124
|
})
|
|
126
125
|
return null
|
|
127
126
|
}
|
|
128
127
|
})()
|
|
129
128
|
if (renderResult === null) {
|
|
130
129
|
updateContainerFloorListDataFn &&
|
|
131
130
|
updateContainerFloorListDataFn({
|
|
132
131
|
type: 'filter',
|
|
133
132
|
containerId: floorData?.uid,
|
|
134
133
|
})
|
|
135
134
|
console.log('renderResult === null: 命中了!')
|
|
136
135
|
taroEventSendPageScrollInfo()
|
|
137
136
|
} else {
|
|
138
137
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
139
138
|
}
|
|
140
139
|
return renderResult
|
|
140
|
+
import Taro from '@tarojs/taro'
|
|
141
141
|
getBundleUrl,
|
|
142
142
|
getBundleFileName,
|
|
143
143
|
formatPackResult,
|
|
144
144
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
145
145
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
146
146
|
const [forceRenderTime,setForceRenderTime] = useState(1)
|
|
147
147
|
useEffect(() => {
|
|
148
148
|
isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
|
|
149
149
|
setForceRenderTime(Date.now())
|
|
150
150
|
})
|
|
151
151
|
return () => {
|
|
152
152
|
isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
|
|
153
153
|
}
|
|
154
154
|
},[])
|
|
155
155
|
|
|
156
156
|
const getFloorSetHeight = (item) => {
|
|
157
157
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
158
158
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
159
159
|
: 200
|
|
160
160
|
return getHeight > 0 ? getHeight : 200
|
|
161
161
|
}
|
|
162
162
|
console.log(
|
|
163
163
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
164
164
|
)
|
|
165
165
|
const renderResult = (() => {
|
|
166
166
|
try {
|
|
167
167
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
168
168
|
console.log(
|
|
169
169
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
170
170
|
renderSourceType,
|
|
171
171
|
floorData.uid,
|
|
172
172
|
)
|
|
173
173
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
174
174
|
const modularPackResultObj = formatPackResult(modularPackResult)
|
|
175
175
|
const bundleUrl = getBundleUrl(modularPackResultObj)
|
|
176
176
|
const bundleFileName = getBundleFileName(modularPackResultObj)
|
|
177
177
|
const opt = {
|
|
178
178
|
msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
|
|
179
179
|
floorIdx: floorData?.floorIdx,
|
|
180
180
|
uid: floorData?.uid,
|
|
181
181
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
182
182
|
moduleId: floorData?.moduleId,
|
|
183
183
|
moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
|
|
184
184
|
floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
|
|
185
185
|
floorKind: floorData?.floorExtInfo?.floorKind,
|
|
186
186
|
middleTemplateId: floorData?.middleTemplateId,
|
|
187
187
|
modularPackResult: modularPackResult,
|
|
188
188
|
}
|
|
189
189
|
if (bundleUrl && bundleFileName) {
|
|
190
190
|
let ISVModule =
|
|
191
191
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
192
192
|
`${floorData.uid}_${bundleFileName}`
|
|
193
193
|
] || null
|
|
194
194
|
if (!ISVModule) {
|
|
195
195
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
196
196
|
console.log(
|
|
197
197
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
198
198
|
bundleFileName,
|
|
199
199
|
)
|
|
200
200
|
taroJdBaseInfo.renderedIsvComponents[
|
|
201
201
|
`${floorData.uid}_${bundleFileName}`
|
|
202
202
|
] = ISVModule
|
|
203
203
|
console.log(
|
|
204
204
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
205
205
|
bundleFileName,
|
|
206
206
|
window['taroJshopH5WebpackJsonp'].find(
|
|
207
207
|
(item) => item[0][0] == bundleFileName,
|
|
208
208
|
),
|
|
209
209
|
)
|
|
210
210
|
} else {
|
|
211
211
|
console.log(
|
|
212
212
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
213
213
|
taroJdBaseInfo,
|
|
214
214
|
)
|
|
215
215
|
console.log(
|
|
216
216
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
217
217
|
taroJdBaseInfo.renderedIsvComponents[
|
|
218
218
|
`${floorData.uid}_${bundleFileName}`
|
|
219
219
|
],
|
|
220
220
|
)
|
|
221
221
|
}
|
|
222
222
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
223
223
|
return (
|
|
224
224
|
<ErrorBoundary {...props}>
|
|
225
225
|
<Suspense
|
|
226
226
|
fallback={
|
|
227
227
|
<View
|
|
228
228
|
style={{
|
|
229
229
|
position: 'relative',
|
|
230
230
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
231
231
|
height: `${_floorHeight}px`,
|
|
232
232
|
}}
|
|
233
233
|
></View>
|
|
234
234
|
}
|
|
235
235
|
>
|
|
236
236
|
<ISVFloor {...props} dataDefines={dataDefines} forceRenderTime={forceRenderTime} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
237
237
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
238
238
|
</ISVFloor>
|
|
239
239
|
</Suspense>
|
|
240
240
|
</ErrorBoundary>
|
|
241
241
|
)
|
|
242
242
|
} else {
|
|
243
243
|
console.log(
|
|
244
244
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
245
245
|
modularPackResultObj,
|
|
246
246
|
)
|
|
247
247
|
sgmCustomReport({
|
|
248
248
|
code: getSgmCustomCode(SgmCustomCode.REMOTEMODULE_DATA),
|
|
249
249
|
msg: opt,
|
|
250
250
|
})
|
|
251
251
|
return null
|
|
252
252
|
}
|
|
253
253
|
} catch (err) {
|
|
254
254
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
255
255
|
return null
|
|
256
256
|
}
|
|
257
257
|
})()
|
|
258
258
|
if (renderResult === null) {
|
|
259
259
|
updateContainerFloorListDataFn &&
|
|
260
260
|
updateContainerFloorListDataFn({
|
|
261
261
|
type: 'filter',
|
|
262
262
|
containerId: floorData?.uid,
|
|
263
263
|
})
|
|
264
264
|
console.log('renderResult === null: 命中了!')
|
|
265
265
|
taroEventSendPageScrollInfo()
|
|
266
266
|
} else {
|
|
267
267
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
268
268
|
}
|
|
269
269
|
return renderResult
|