@conecli/cone-render 0.9.1-shop2.3 → 0.9.1-shop2.4
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/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/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/components/base/CustomScrollView/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/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +9 -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 +4 -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 +21 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.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/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.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.wxapp.ts +1 -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/track.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- 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/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/utils.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
const result = String(strPrice).match(/(-?\d+)\.?(\d+)?/);
|
|
3
2
|
if(result && Number(result[0]) > 0){
|
|
4
3
|
return {
|
|
5
4
|
integerPrice: result[1],
|
|
6
5
|
decimalPrice: (result[2] || '').replace(/0+$/, '')
|
|
7
6
|
}
|
|
8
7
|
}else{
|
|
9
8
|
return null;
|
|
10
9
|
}
|
|
11
10
|
const {
|
|
12
11
|
jdPrice,
|
|
13
12
|
finalPrice,
|
|
14
13
|
priceText = '',
|
|
15
14
|
priceType,
|
|
16
15
|
hitUserIdentity = false,
|
|
17
16
|
isAuctionWare,
|
|
18
17
|
fallbackRender = null,
|
|
19
18
|
className = null,
|
|
20
19
|
style = {},
|
|
21
20
|
childrenClassName = null,
|
|
22
21
|
bigNoPriceClassName = null,
|
|
23
22
|
bigSymbolClassName = null,
|
|
24
23
|
bigIntegerClassName = null,
|
|
25
24
|
bigDecimalClassName = null,
|
|
26
25
|
priceDescClassName = null,
|
|
27
26
|
smallPriceClassName = null,
|
|
28
27
|
lineNumber = 1,
|
|
29
28
|
size = 'M'
|
|
30
29
|
} = props
|
|
31
30
|
const especialHitStyleType = {
|
|
32
31
|
7: 'plusStyle',
|
|
33
32
|
9: 'samStyle'
|
|
34
33
|
}
|
|
35
34
|
const especialMissStyleType = {
|
|
36
35
|
7: 'plusStyle',
|
|
37
36
|
8: 'fansStyle',
|
|
38
37
|
9: 'samStyle',
|
|
39
38
|
10: 'studentStyle',
|
|
40
39
|
12: 'yhdStyle',
|
|
41
40
|
13: 'memberStyle'
|
|
42
41
|
}
|
|
43
42
|
const isNoPrice = priceType === 4
|
|
44
43
|
const isUseFinalPriceAsBigPrice = [1, 2, 6, 14, 16, 17, 18].includes(priceType)
|
|
45
44
|
const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity
|
|
46
45
|
const bigPriceObj = getDeconstructPrice(isEquivalentHit? finalPrice: jdPrice)
|
|
47
46
|
if(isAuctionWare || (!isNoPrice && bigPriceObj === null)){
|
|
48
47
|
return fallbackRender
|
|
49
48
|
}
|
|
50
49
|
const {integerPrice, decimalPrice = ''} = bigPriceObj || {}
|
|
51
50
|
const isOnlyShowBigPrice = priceType === 3
|
|
52
51
|
const isHideSmallPrice = priceType === 14
|
|
53
52
|
const smallPrice = isEquivalentHit? jdPrice: finalPrice
|
|
54
53
|
const isPriceDescInFront = isEquivalentHit
|
|
55
54
|
const hitColorStyle = isEquivalentHit? styles[especialHitStyleType[priceType]]: null
|
|
56
55
|
const missColorStyle = isEquivalentHit? null: styles[especialMissStyleType[priceType]]
|
|
57
56
|
const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice)
|
|
58
57
|
const sizeLineHeight = {
|
|
59
58
|
'XS': 28,
|
|
60
59
|
'S': 34,
|
|
61
60
|
'M': 40,
|
|
62
61
|
'L': 46,
|
|
63
62
|
'XL': 52
|
|
64
63
|
}
|
|
65
64
|
const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25)
|
|
66
65
|
const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber)
|
|
67
66
|
const computedHeightStyle = {
|
|
68
67
|
height: wrapHeight
|
|
69
68
|
}
|
|
70
69
|
const itemCommonStyle = {
|
|
71
70
|
height: lineHeight
|
|
72
71
|
}
|
|
73
72
|
const needSizeStyles = ['bigNoPrice', 'bigSymbol', 'bigInteger', 'bigDecimal', 'priceDesc', 'smallPrice']
|
|
74
73
|
const sizeStyles = needSizeStyles.reduce((acc, cur) => {
|
|
75
74
|
acc[cur] = styles[cur + size]
|
|
76
75
|
return acc
|
|
77
76
|
}, {})
|
|
78
77
|
const noPriceShowText = priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice)? jdPrice: '')
|
|
79
78
|
return (
|
|
80
79
|
<View className={classNames(styles.wrap, className)} style={{...computedHeightStyle, ...style}}>
|
|
81
80
|
{isNoPrice?
|
|
82
81
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigNoPrice, sizeStyles['bigNoPrice'], childrenClassName, bigNoPriceClassName)} style={{...itemCommonStyle}}>{noPriceShowText}</Text>
|
|
83
82
|
:
|
|
84
83
|
[
|
|
85
84
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigSymbol, sizeStyles['bigSymbol'], hitColorStyle, childrenClassName, bigSymbolClassName)} key="bigSymbol" style={{...itemCommonStyle}}>¥</Text>,
|
|
86
85
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigInteger, sizeStyles['bigInteger'], hitColorStyle, !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront ? styles.rightMargin : null, childrenClassName, bigIntegerClassName)} key="bigInteger" style={{...itemCommonStyle}}>{integerPrice}</Text>,
|
|
87
86
|
isBigPriceHasDecimal?
|
|
88
87
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigDecimal, sizeStyles['bigDecimal'], hitColorStyle, isPriceDescInFront ? null : styles.rightMargin, childrenClassName, bigDecimalClassName)} key="bigDecimal" style={{...itemCommonStyle}}>.{decimalPrice}</Text>
|
|
89
88
|
:
|
|
90
89
|
null
|
|
91
90
|
,
|
|
92
91
|
!isOnlyShowBigPrice && [
|
|
93
92
|
isPriceDescInFront && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.bigStyle, hitColorStyle, isPriceDescInFront ? styles.rightMargin : null, childrenClassName, priceDescClassName)} key="descFront" style={{...itemCommonStyle}}>{priceText}</Text>,
|
|
94
93
|
smallPrice && !isHideSmallPrice ? <Text className={classNames(styles.childStyle, styles.smallPrice, sizeStyles['smallPrice'], styles.smallStyle, missColorStyle, childrenClassName, smallPriceClassName)} key="smallPrice" style={{...itemCommonStyle}}>¥{smallPrice}</Text> : null,
|
|
95
94
|
!isPriceDescInFront && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.smallStyle, styles.missPriceDesc, missColorStyle, childrenClassName, priceDescClassName)} key="descBack" style={{...itemCommonStyle}}>{priceText}</Text>
|
|
96
95
|
]
|
|
97
96
|
]
|
|
98
97
|
}
|
|
99
98
|
</View>
|
|
100
99
|
)
|
|
100
|
+
import React from 'react';
|
|
101
101
|
const result = String(strPrice).match(/(-?\d+)\.?(\d+)?/);
|
|
102
102
|
if(result && Number(result[0]) > 0){
|
|
103
103
|
return {
|
|
104
104
|
integerPrice: result[1],
|
|
105
105
|
decimalPrice: (result[2] || '').replace(/0+$/, '')
|
|
106
106
|
}
|
|
107
107
|
}else{
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
110
|
const {
|
|
111
111
|
jdPrice,
|
|
112
112
|
finalPrice,
|
|
113
113
|
priceText = '',
|
|
114
114
|
priceType,
|
|
115
115
|
hitUserIdentity = false,
|
|
116
116
|
isAuctionWare,
|
|
117
117
|
fallbackRender = null,
|
|
118
118
|
className = null,
|
|
119
119
|
style = {},
|
|
120
120
|
childrenClassName = null,
|
|
121
121
|
bigNoPriceClassName = null,
|
|
122
122
|
bigSymbolClassName = null,
|
|
123
123
|
bigIntegerClassName = null,
|
|
124
124
|
bigDecimalClassName = null,
|
|
125
125
|
priceDescClassName = null,
|
|
126
126
|
smallPriceClassName = null,
|
|
127
127
|
lineNumber = 1,
|
|
128
128
|
size = 'M',
|
|
129
129
|
isDefaultRemoveSmallPrice = false
|
|
130
130
|
} = props
|
|
131
131
|
const especialHitStyleType = {
|
|
132
132
|
7: 'plusStyle',
|
|
133
133
|
9: 'samStyle'
|
|
134
134
|
}
|
|
135
135
|
const especialMissStyleType = {
|
|
136
136
|
7: 'plusStyle',
|
|
137
137
|
8: 'fansStyle',
|
|
138
138
|
9: 'samStyle',
|
|
139
139
|
10: 'studentStyle',
|
|
140
140
|
12: 'yhdStyle',
|
|
141
141
|
13: 'memberStyle'
|
|
142
142
|
}
|
|
143
143
|
const isNoPrice = priceType === 4
|
|
144
144
|
const isUseFinalPriceAsBigPrice = [1, 2, 6, 14, 16, 17, 18].includes(priceType)
|
|
145
145
|
const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity
|
|
146
146
|
const bigPriceObj = getDeconstructPrice(isEquivalentHit? finalPrice: jdPrice)
|
|
147
147
|
if(isAuctionWare || (!isNoPrice && bigPriceObj === null)){
|
|
148
148
|
return fallbackRender
|
|
149
149
|
}
|
|
150
150
|
const {integerPrice, decimalPrice = ''} = bigPriceObj || {}
|
|
151
151
|
const isOnlyShowBigPrice = priceType === 3
|
|
152
152
|
const isHideSmallPrice = priceType === 14 || isDefaultRemoveSmallPrice
|
|
153
153
|
const smallPrice = isEquivalentHit? jdPrice: finalPrice
|
|
154
154
|
const isPriceDescInFront = isEquivalentHit
|
|
155
155
|
const hitColorStyle = isEquivalentHit? styles[especialHitStyleType[priceType]]: null
|
|
156
156
|
const missColorStyle = isEquivalentHit? null: styles[especialMissStyleType[priceType]]
|
|
157
157
|
const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice)
|
|
158
158
|
const sizeLineHeight = {
|
|
159
159
|
'XS': 28,
|
|
160
160
|
'S': 34,
|
|
161
161
|
'M': 40,
|
|
162
162
|
'L': 46,
|
|
163
163
|
'XL': 52
|
|
164
164
|
}
|
|
165
165
|
const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25)
|
|
166
166
|
const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber)
|
|
167
167
|
const computedHeightStyle = {
|
|
168
168
|
height: wrapHeight
|
|
169
169
|
}
|
|
170
170
|
const itemCommonStyle = {
|
|
171
171
|
height: lineHeight
|
|
172
172
|
}
|
|
173
173
|
const needSizeStyles = ['bigNoPrice', 'bigSymbol', 'bigInteger', 'bigDecimal', 'priceDesc', 'smallPrice']
|
|
174
174
|
const sizeStyles = needSizeStyles.reduce((acc, cur) => {
|
|
175
175
|
acc[cur] = styles[cur + size]
|
|
176
176
|
return acc
|
|
177
177
|
}, {})
|
|
178
178
|
const noPriceShowText = priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice)? jdPrice: '')
|
|
179
179
|
return (
|
|
180
180
|
<View className={classNames(styles.wrap, className)} style={{...computedHeightStyle, ...style}}>
|
|
181
181
|
{isNoPrice?
|
|
182
182
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigNoPrice, sizeStyles['bigNoPrice'], childrenClassName, bigNoPriceClassName)} style={{...itemCommonStyle}}>{noPriceShowText}</Text>
|
|
183
183
|
:
|
|
184
184
|
[
|
|
185
185
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigSymbol, sizeStyles['bigSymbol'], hitColorStyle, childrenClassName, bigSymbolClassName)} key="bigSymbol" style={{...itemCommonStyle}}>¥</Text>,
|
|
186
186
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigInteger, sizeStyles['bigInteger'], hitColorStyle, !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront ? styles.rightMargin : null, childrenClassName, bigIntegerClassName)} key="bigInteger" style={{...itemCommonStyle}}>{integerPrice}</Text>,
|
|
187
187
|
isBigPriceHasDecimal?
|
|
188
188
|
<Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigDecimal, sizeStyles['bigDecimal'], hitColorStyle, isPriceDescInFront ? null : styles.rightMargin, childrenClassName, bigDecimalClassName)} key="bigDecimal" style={{...itemCommonStyle}}>.{decimalPrice}</Text>
|
|
189
189
|
:
|
|
190
190
|
null
|
|
191
191
|
,
|
|
192
192
|
!isOnlyShowBigPrice && [
|
|
193
193
|
isPriceDescInFront && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.bigStyle, hitColorStyle, isPriceDescInFront ? styles.rightMargin : null, childrenClassName, priceDescClassName)} key="descFront" style={{...itemCommonStyle}}>{priceText}</Text>,
|
|
194
194
|
<view style={{
|
|
195
195
|
display: 'inline-flex'
|
|
196
196
|
}}>
|
|
197
197
|
{smallPrice && !isHideSmallPrice ? <Text className={classNames(styles.childStyle, styles.smallPrice, sizeStyles['smallPrice'], styles.smallStyle, missColorStyle, childrenClassName, smallPriceClassName)} key="smallPrice" style={{...itemCommonStyle}}>¥{smallPrice}</Text> : null}
|
|
198
198
|
{!isPriceDescInFront && !isHideSmallPrice && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.smallStyle, styles.missPriceDesc, missColorStyle, childrenClassName, priceDescClassName)} key="descBack" style={{...itemCommonStyle}}>{priceText}</Text>}
|
|
199
199
|
</view>
|
|
200
200
|
]
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
</View>
|
|
204
204
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
<BasePrice {...props}/>
|
|
3
2
|
:
|
|
4
3
|
<DoublePrice {...props} />
|
|
4
|
+
import React from 'react'
|
|
5
5
|
if (props.priceType === undefined) {
|
|
6
6
|
if (props.value === undefined) {
|
|
7
7
|
if (props.jdPrice === undefined) {
|
|
8
8
|
return null
|
|
9
9
|
} else {
|
|
10
10
|
return <BasePrice {...props} value={props.jdPrice} />
|
|
11
11
|
}
|
|
12
12
|
} else {
|
|
13
13
|
return <BasePrice {...props} />
|
|
14
14
|
}
|
|
15
15
|
} else {
|
|
16
16
|
return <DoublePrice {...props} />
|
|
17
17
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
.d-container-item {
|
|
2
|
+
.d-container-item, .d-container-item-trusteeship {
|
|
3
3
|
position: relative;
|
|
4
4
|
overflow: hidden;
|
|
5
5
|
z-index: 3;
|
|
6
6
|
&:first-child {
|
|
7
7
|
z-index: 1;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
&.d-container-item-hide{
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.d-container-item{
|
|
16
|
+
&.d-container-item-active {
|
|
10
17
|
:global {
|
|
11
18
|
.d-decorate-floor-item {
|
|
12
19
|
.d-floor-selected-border {
|
|
@@ -16,3 +23,15 @@
|
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
}
|
|
26
|
+
|
|
27
|
+
.d-container-item-trusteeship{
|
|
28
|
+
&.d-container-item-active {
|
|
29
|
+
:global {
|
|
30
|
+
.d-decorate-floor-item {
|
|
31
|
+
.d-floor-selected-border {
|
|
32
|
+
border: 4px solid #4A82F2 !important;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { View } from '@tarojs/components'
|
|
2
1
|
selectContainerId,
|
|
3
2
|
placeHolderPreContainerId,
|
|
4
3
|
containerData,
|
|
5
4
|
children,
|
|
6
5
|
style,
|
|
7
6
|
shopTotalInfo,
|
|
8
7
|
} = props;
|
|
9
8
|
return children ? children : null;
|
|
10
9
|
}, [containerData, shopTotalInfo]);
|
|
11
10
|
data-container-empty={containerData?.floors?.[0]?.configEmpty || 'false'}
|
|
11
|
+
import { View } from '@tarojs/components'
|
|
12
12
|
const {
|
|
13
13
|
selectContainerId,
|
|
14
14
|
placeHolderPreContainerId,
|
|
15
15
|
containerData,
|
|
16
16
|
children,
|
|
17
17
|
style,
|
|
18
18
|
shopTotalInfo,
|
|
19
19
|
urlQueryData
|
|
20
20
|
} = props;
|
|
21
21
|
const { isTrusteeship = false } = urlQueryData || {}
|
|
22
22
|
const selectContainerState = selectContainerId == containerData?.containerId
|
|
23
23
|
const ChildrenComponent = useCallback(() => {
|
|
24
24
|
return children ? children : null;
|
|
25
25
|
}, [containerData, shopTotalInfo]);
|
|
26
26
|
const isHideFloor = isTrusteeship && containerData?.floors?.[0]?.status === -1
|
|
27
27
|
return (
|
|
28
28
|
<View
|
|
29
29
|
className={classNames(
|
|
30
30
|
decorateModuleStyle[isTrusteeship ? 'd-container-item-trusteeship' : 'd-container-item'],
|
|
31
31
|
'J_container',
|
|
32
32
|
{
|
|
33
33
|
[decorateModuleStyle['d-container-item-active']]:
|
|
34
34
|
selectContainerState,
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
J_floorItemActive: selectContainerState,
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
[decorateModuleStyle['d-container-item-hide']]:
|
|
41
41
|
isHideFloor,
|
|
42
42
|
}
|
|
43
43
|
)}
|
|
44
44
|
id={`J_container_${containerData?.containerId}`}
|
|
45
45
|
data-container-id={containerData?.containerId}
|
|
46
46
|
data-container-type={containerData?.typeCode}
|
|
47
47
|
data-container-cn={containerData?.typeCn}
|
|
48
48
|
data-container-floorFlag={containerData?.extInfo?.floorFlag || ''}
|
|
49
49
|
data-container-moduleInstanceType={containerData?.extInfo?.moduleInstanceType || ''}
|
|
50
50
|
data-container-position={containerData?.containerPosition}
|
|
51
51
|
data-container-alias={
|
|
52
52
|
containerData?.containerAlias
|
|
53
53
|
? containerData?.containerAlias
|
|
54
54
|
: ''
|
|
55
55
|
}
|
|
56
56
|
data-container-empty={containerData?.floors?.[0]?.configEmpty || 'false'}
|
|
57
57
|
style={
|
|
58
58
|
containerData?.typeCode !== ContainerShopHeaderType ? style : {}
|
|
59
59
|
}
|
|
60
60
|
>
|
|
61
61
|
<input
|
|
62
62
|
type="hidden"
|
|
63
63
|
value={`container_${containerData?.containerId}`}
|
|
64
64
|
/>
|
|
65
65
|
<ChildrenComponent />
|
|
66
66
|
<PlaceHolder
|
|
67
67
|
placeHolderPreContainerId={placeHolderPreContainerId}
|
|
68
68
|
containerId={containerData?.containerId}
|
|
69
69
|
/>
|
|
70
70
|
</View>
|
|
71
71
|
)
|
|
@@ -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) {
|
|
5
|
+
import { View, Text } from '@tarojs/components'
|
|
6
6
|
'//img11.360buyimg.com/imagetools/jfs/t1/141506/22/31698/7923/637b6db9E2af80265/10e76e2c31e0e356.png'
|
|
7
7
|
const newModuleFloorTypeList = [100, 101, 100000, 99999]
|
|
8
8
|
const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
|
|
9
9
|
if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
|
|
10
10
|
if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1) return 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 getRenderRealTimeKeyObj = {
|
|
9
9
|
key: isRealTimeRender ? Date.now() : forceRenderTime
|
|
10
10
|
}
|
|
11
11
|
console.log("远程加载楼层渲染key信息", getRenderRealTimeKeyObj)
|
|
12
12
|
{floorData?.showCommonFloorHead === false ? null : <CommonFloorHead dataDefines={dataDefines} floorData={floorData} {...getRenderRealTimeKeyObj} />}
|
|
13
13
|
...getRenderRealTimeKeyObj
|
|
14
14
|
isRealTimeRender: false,
|
|
15
15
|
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
|
const { floorData, renderSourceType, updateContainerFloorListDataFn } = props
|
|
132
132
|
const dataDefines = getFloorDataToDataDefines(floorData)
|
|
133
133
|
const [forceRenderTime,setForceRenderTime] = useState(1)
|
|
134
134
|
useEffect(() => {
|
|
135
135
|
isJdAndAndroidDevice && Taro.eventCenter.on(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT, (_result) => {
|
|
136
136
|
setForceRenderTime(Date.now())
|
|
137
137
|
})
|
|
138
138
|
return () => {
|
|
139
139
|
isJdAndAndroidDevice && Taro.eventCenter.off(TaroEventType.FORCE_UPDATE_PAGE_LAYOUT)
|
|
140
140
|
}
|
|
141
141
|
},[])
|
|
142
142
|
|
|
143
143
|
const getFloorSetHeight = (item) => {
|
|
144
144
|
const getHeight = item?.floorExtInfo?.floorHeight
|
|
145
145
|
? Number(item?.floorExtInfo?.floorHeight)
|
|
146
146
|
: 200
|
|
147
147
|
return getHeight > 0 ? getHeight : 200
|
|
148
148
|
}
|
|
149
149
|
console.log(
|
|
150
150
|
'>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>',
|
|
151
151
|
)
|
|
152
152
|
const renderResult = (() => {
|
|
153
153
|
try {
|
|
154
154
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
155
155
|
console.log(
|
|
156
156
|
'==========当前业务类型renderSourceType、楼层floorId: ',
|
|
157
157
|
renderSourceType,
|
|
158
158
|
floorData.uid,
|
|
159
159
|
)
|
|
160
160
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
161
161
|
const modularPackResultObj = formatPackResult(modularPackResult)
|
|
162
162
|
const bundleUrl = getBundleUrl(modularPackResultObj)
|
|
163
163
|
const bundleFileName = getBundleFileName(modularPackResultObj)
|
|
164
164
|
const opt = {
|
|
165
165
|
msg: `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
166
166
|
buildType,
|
|
167
167
|
uid: floorData?.uid,
|
|
168
168
|
floorIdx: floorData?.floorIdx,
|
|
169
169
|
shopId: floorData?.floorExtInfo?.shopId,
|
|
170
170
|
moduleId: floorData?.moduleId,
|
|
171
171
|
moduleName: floorData?.moduleName,
|
|
172
172
|
middleTemplateId: floorData?.middleTemplateId,
|
|
173
173
|
modularPackResult: modularPackResult,
|
|
174
174
|
}
|
|
175
175
|
if (bundleUrl && bundleFileName) {
|
|
176
176
|
let ISVModule =
|
|
177
177
|
taroJdBaseInfo?.renderedIsvComponents[
|
|
178
178
|
`${floorData.uid}_${bundleFileName}`
|
|
179
179
|
] || null
|
|
180
180
|
if (!ISVModule) {
|
|
181
181
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
182
182
|
console.log(
|
|
183
183
|
'1|加载isv模块==========走lazy import生成新的isv模块react组件',
|
|
184
184
|
bundleFileName,
|
|
185
185
|
)
|
|
186
186
|
taroJdBaseInfo.renderedIsvComponents[
|
|
187
187
|
`${floorData.uid}_${bundleFileName}`
|
|
188
188
|
] = ISVModule
|
|
189
189
|
console.log(
|
|
190
190
|
'2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ',
|
|
191
191
|
bundleFileName,
|
|
192
192
|
window['taroJshopH5WebpackJsonp'].find(
|
|
193
193
|
(item) => item[0][0] == bundleFileName,
|
|
194
194
|
),
|
|
195
195
|
)
|
|
196
196
|
} else {
|
|
197
197
|
console.log(
|
|
198
198
|
'1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ',
|
|
199
199
|
taroJdBaseInfo,
|
|
200
200
|
)
|
|
201
201
|
console.log(
|
|
202
202
|
'2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ',
|
|
203
203
|
taroJdBaseInfo.renderedIsvComponents[
|
|
204
204
|
`${floorData.uid}_${bundleFileName}`
|
|
205
205
|
],
|
|
206
206
|
)
|
|
207
207
|
}
|
|
208
208
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
209
209
|
return (
|
|
210
210
|
<ErrorBoundary {...props}>
|
|
211
211
|
<Suspense
|
|
212
212
|
fallback={
|
|
213
213
|
<View
|
|
214
214
|
style={{
|
|
215
215
|
position: 'relative',
|
|
216
216
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
217
217
|
height: `${_floorHeight}px`,
|
|
218
218
|
}}
|
|
219
219
|
></View>
|
|
220
220
|
}
|
|
221
221
|
>
|
|
222
222
|
<ISVFloor {...props} dataDefines={dataDefines} isRealTimeRender={realTimerRenderTypeList.includes(taroJdBaseInfo.info.pageInfo.dataType)}>
|
|
223
223
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
224
224
|
</ISVFloor>
|
|
225
225
|
</Suspense>
|
|
226
226
|
</ErrorBoundary>
|
|
227
227
|
)
|
|
228
228
|
} else {
|
|
229
229
|
console.log(
|
|
230
230
|
'3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ',
|
|
231
231
|
modularPackResultObj,
|
|
232
232
|
)
|
|
233
233
|
sgmCustomReport({
|
|
234
234
|
code: 'isvModuleError',
|
|
235
235
|
msg: opt,
|
|
236
236
|
})
|
|
237
237
|
return null
|
|
238
238
|
}
|
|
239
239
|
} catch (err) {
|
|
240
240
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
241
241
|
sgmCustomReport({
|
|
242
242
|
code: 'isvModuleError',
|
|
243
243
|
msg: {
|
|
244
244
|
msg: 'remoteFloorItem try catch 异常',
|
|
245
245
|
err,
|
|
246
246
|
},
|
|
247
247
|
})
|
|
248
248
|
return null
|
|
249
249
|
}
|
|
250
250
|
})()
|
|
251
251
|
if (renderResult === null) {
|
|
252
252
|
updateContainerFloorListDataFn &&
|
|
253
253
|
updateContainerFloorListDataFn({
|
|
254
254
|
type: 'filter',
|
|
255
255
|
containerId: floorData?.uid,
|
|
256
256
|
})
|
|
257
257
|
console.log('renderResult === null: 命中了!')
|
|
258
258
|
taroEventSendPageScrollInfo()
|
|
259
259
|
} else {
|
|
260
260
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
261
261
|
}
|
|
262
262
|
return renderResult
|