@conecli/cone-render 0.10.1-shop-beta.4 → 0.10.1-shop3.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.
Files changed (73) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -1
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/pageType.ts +1 -1
  9. package/dist/common/sgmCustomCode.ts +1 -1
  10. package/dist/components/ErrorBoundary.tsx +1 -1
  11. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  12. package/dist/components/base/CustomVideo/common.ts +1 -0
  13. package/dist/components/base/CustomVideo/index.tsx +1 -1
  14. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  15. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  16. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  17. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  18. package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -3
  19. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  20. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  21. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  22. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  23. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  24. package/dist/components/base/Price/Base/index.tsx +1 -1
  25. package/dist/components/base/Price/Double/index.tsx +1 -1
  26. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  27. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  28. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  29. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  30. package/dist/components/floorItem.jd.tsx +1 -1
  31. package/dist/components/floorItem.tsx +1 -1
  32. package/dist/components/floorItem.weapp.tsx +1 -1
  33. package/dist/components/isv/Floor/index.tsx +1 -1
  34. package/dist/components/remoteFloorItem.tsx +1 -1
  35. package/dist/interface/common.ts +1 -1
  36. package/dist/interface/component.ts +1 -1
  37. package/dist/interface/jumpEventReport.ts +1 -1
  38. package/dist/interface/service.ts +1 -1
  39. package/dist/jumpEventReport/base.ts +1 -1
  40. package/dist/jumpEventReport/const.ts +1 -1
  41. package/dist/jumpEventReport/index.jd.ts +1 -1
  42. package/dist/jumpEventReport/index.weapp.ts +1 -1
  43. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  44. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  45. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  46. package/dist/jumpEventReport/web.base.ts +1 -1
  47. package/dist/jumpEventReport/web.jd.ts +1 -1
  48. package/dist/jumpEventReport/web.tjm.ts +1 -1
  49. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
  50. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  51. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  52. package/dist/open/api/device.ts +1 -1
  53. package/dist/open/api/request.ts +1 -1
  54. package/dist/open/api/shopMember.ts +1 -1
  55. package/dist/open/api/util.ts +1 -1
  56. package/dist/open/components/index.ts +1 -1
  57. package/dist/sass/app.h5.scss +5 -0
  58. package/dist/sass/base.scss +45 -0
  59. package/dist/service/http/colorSign.ts +1 -1
  60. package/dist/service/http/h5Http.ts +1 -0
  61. package/dist/service/http/index.h5.ts +1 -0
  62. package/dist/service/requestServer.h5.ts +1 -0
  63. package/dist/service/requestServer.ts +1 -1
  64. package/dist/utils/connectNativeJsBridge.ts +1 -1
  65. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  66. package/dist/utils/h5Utils.ts +1 -1
  67. package/dist/utils/index.h5.ts +1 -1
  68. package/dist/utils/index.ts +1 -1
  69. package/dist/utils/index.weapp.ts +1 -1
  70. package/dist/utils/sgmCodeUtils.ts +1 -1
  71. package/dist/utils/taroRenderUtil.ts +1 -1
  72. package/dist/utils/utils.ts +1 -1
  73. package/package.json +24 -23
@@ -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
  isDefaultRemoveSmallPrice = false
31
30
  } = props
32
31
  const especialHitStyleType = {
33
32
  7: 'plusStyle',
34
33
  9: 'samStyle'
35
34
  }
36
35
  const especialMissStyleType = {
37
36
  7: 'plusStyle',
38
37
  8: 'fansStyle',
39
38
  9: 'samStyle',
40
39
  10: 'studentStyle',
41
40
  12: 'yhdStyle',
42
41
  13: 'memberStyle'
43
42
  }
44
43
  const isNoPrice = priceType === 4
45
44
  const isUseFinalPriceAsBigPrice = [1, 2, 6, 14, 16, 17, 18].includes(priceType)
46
45
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity
47
46
  const bigPriceObj = getDeconstructPrice(isEquivalentHit? finalPrice: jdPrice)
48
47
  if(isAuctionWare || (!isNoPrice && bigPriceObj === null)){
49
48
  return fallbackRender
50
49
  }
51
50
  const {integerPrice, decimalPrice = ''} = bigPriceObj || {}
52
51
  const isOnlyShowBigPrice = priceType === 3
53
52
  const isHideSmallPrice = priceType === 14 || isDefaultRemoveSmallPrice
54
53
  const smallPrice = isEquivalentHit? jdPrice: finalPrice
55
54
  const isPriceDescInFront = isEquivalentHit
56
55
  const hitColorStyle = isEquivalentHit? styles[especialHitStyleType[priceType]]: null
57
56
  const missColorStyle = isEquivalentHit? null: styles[especialMissStyleType[priceType]]
58
57
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice)
59
58
  const sizeLineHeight = {
60
59
  'XS': 28,
61
60
  'S': 34,
62
61
  'M': 40,
63
62
  'L': 46,
64
63
  'XL': 52
65
64
  }
66
65
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25)
67
66
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber)
68
67
  const computedHeightStyle = {
69
68
  height: wrapHeight
70
69
  }
71
70
  const itemCommonStyle = {
72
71
  height: lineHeight
73
72
  }
74
73
  const needSizeStyles = ['bigNoPrice', 'bigSymbol', 'bigInteger', 'bigDecimal', 'priceDesc', 'smallPrice']
75
74
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
76
75
  acc[cur] = styles[cur + size]
77
76
  return acc
78
77
  }, {})
79
78
  const noPriceShowText = priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice)? jdPrice: '')
80
79
  return (
81
80
  <View className={classNames(styles.wrap, className)} style={{...computedHeightStyle, ...style}}>
82
81
  {isNoPrice?
83
82
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigNoPrice, sizeStyles['bigNoPrice'], childrenClassName, bigNoPriceClassName)} style={{...itemCommonStyle}}>{noPriceShowText}</Text>
84
83
  :
85
84
  [
86
85
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigSymbol, sizeStyles['bigSymbol'], hitColorStyle, childrenClassName, bigSymbolClassName)} key="bigSymbol" style={{...itemCommonStyle}}>¥</Text>,
87
86
  <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>,
88
87
  isBigPriceHasDecimal?
89
88
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigDecimal, sizeStyles['bigDecimal'], hitColorStyle, isPriceDescInFront ? null : styles.rightMargin, childrenClassName, bigDecimalClassName)} key="bigDecimal" style={{...itemCommonStyle}}>.{decimalPrice}</Text>
90
89
  :
91
90
  null
92
91
  ,
93
92
  !isOnlyShowBigPrice && [
94
93
  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>,
95
94
  <view style={{
96
95
  display: 'inline-flex'
97
96
  }}>
98
97
  {smallPrice && !isHideSmallPrice ? <Text className={classNames(styles.childStyle, styles.smallPrice, sizeStyles['smallPrice'], styles.smallStyle, missColorStyle, childrenClassName, smallPriceClassName)} key="smallPrice" style={{...itemCommonStyle}}>¥{smallPrice}</Text> : null}
99
98
  {!isPriceDescInFront && !isHideSmallPrice && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.smallStyle, styles.missPriceDesc, missColorStyle, childrenClassName, priceDescClassName)} key="descBack" style={{...itemCommonStyle}}>{priceText}</Text>}
100
99
  </view>
101
100
  ]
102
101
  ]
103
102
  }
104
103
  </View>
105
104
  )
105
+ import React from 'react';
106
106
  console.warn("🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:", {type, data, text})
107
107
  sgmCustomReport({
108
108
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
109
109
  msg: {
110
110
  type,
111
111
  data,
112
112
  text: '[双价格组件]' + text
113
113
  },
114
114
  })
115
115
  return rest.some(item => item === undefined || item === '')
116
116
  const numPrice = Number(strPrice)
117
117
  if(isNaN(numPrice)){
118
118
  reportException({
119
119
  type: 'isNotNumericType',
120
120
  data: props,
121
121
  text: `传入价格字段值“${strPrice}”转换数字报错`
122
122
  })
123
123
  return false
124
124
  }
125
125
  else if(numPrice <= 0){
126
126
  reportException({
127
127
  type: 'isNotPositiveNumber',
128
128
  data: props,
129
129
  text: `传入价格字段值“${strPrice}”不是一个正数`
130
130
  })
131
131
  return false
132
132
  }
133
133
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/)
134
134
  if(result && result[3]?.length > 2){
135
135
  reportException({
136
136
  type: 'decimalPlaceTooLong',
137
137
  data: props,
138
138
  text: `传入价格字段值“${strPrice}”小数位不能超过2位`
139
139
  })
140
140
  return false
141
141
  }
142
142
  if(/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)){
143
143
  reportException({
144
144
  type: 'findScientificNotation',
145
145
  data: props,
146
146
  text: `传入价格字段值“${strPrice}”是一个科学计数法格式`
147
147
  })
148
148
  }
149
149
  return true
150
150
  const {jdPrice, finalPrice} = props
151
151
  if(jdPrice && finalPrice && Number(jdPrice) <= Number(finalPrice)){
152
152
  reportException({
153
153
  type: 'pricesCompareException',
154
154
  data: props,
155
155
  text: `身份/到手价必须小于松果价`
156
156
  })
157
157
  return false
158
158
  }else{
159
159
  return true
160
160
  }
161
161
  const numPrice = Number(strPrice)
162
162
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/)
163
163
  if(result){
164
164
  return {
165
165
  integerPrice: result[1],
166
166
  decimalPrice: (result[3] || '').replace(/0+$/, '')
167
167
  }
168
168
  }else{
169
169
  reportException({
170
170
  type: 'deconstructException',
171
171
  data: props,
172
172
  text: `解构传入价格字段值“${strPrice}”解构发生异常`
173
173
  })
174
174
  return null
175
175
  }
176
176
  const {
177
177
  jdPrice,
178
178
  finalPrice,
179
179
  priceText = '',
180
180
  priceType,
181
181
  hitUserIdentity = false,
182
182
  fallbackRender = null,
183
183
  className = null,
184
184
  style = {},
185
185
  childrenClassName = null,
186
186
  bigNoPriceClassName = null,
187
187
  bigSymbolClassName = null,
188
188
  bigIntegerClassName = null,
189
189
  bigDecimalClassName = null,
190
190
  priceDescClassName = null,
191
191
  smallPriceClassName = null,
192
192
  lineNumber = 1,
193
193
  size = 'M',
194
194
  isDefaultRemoveSmallPrice = false
195
195
  } = props
196
196
  let useBackstop = false
197
197
  if(isNull(props.jdPrice, props.priceType)){
198
198
  useBackstop = true
199
199
  reportException({
200
200
  type: 'paramMiss',
201
201
  data: props,
202
202
  text: '缺少必要入参:jdPrice、priceType'
203
203
  })
204
204
  }else if(!allowedNoHitUserIdentityTypes.includes(props.priceType) && props.hitUserIdentity === undefined){
205
205
  useBackstop = true
206
206
  reportException({
207
207
  type: 'paramMiss',
208
208
  data: props,
209
209
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`
210
210
  })
211
211
  }
212
212
  const especialHitStyleType = {
213
213
  7: 'plusStyle',
214
214
  9: 'samStyle'
215
215
  }
216
216
  const especialMissStyleType = {
217
217
  7: 'plusStyle',
218
218
  8: 'fansStyle',
219
219
  9: 'samStyle',
220
220
  10: 'studentStyle',
221
221
  12: 'yhdStyle',
222
222
  13: 'memberStyle'
223
223
  }
224
224
  const isTextPrice = priceType === 4
225
225
  if(!isTextPrice && !useBackstop){
226
226
  if(finalPrice && !numericPriceValidate(finalPrice, props)){
227
227
  useBackstop = true
228
228
  }else if(!numericPriceValidate(jdPrice, props)){
229
229
  useBackstop = true
230
230
  }
231
231
  if(!useBackstop && !pricesCompareValidate(props)){
232
232
  useBackstop = true
233
233
  }
234
234
  }
235
235
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType)
236
236
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity
237
237
  const bigPriceObj = (isTextPrice || useBackstop)? {}: getDeconstructPrice(isEquivalentHit && !isNull(finalPrice)? finalPrice: jdPrice, props)
238
238
  const {integerPrice = '', decimalPrice = ''} = bigPriceObj || {}
239
239
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice)
240
240
  const smallPrice = isEquivalentHit? jdPrice: finalPrice
241
241
  const isHideSmallPrice = priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice))
242
242
  const isPriceDescInFront = isEquivalentHit
243
243
  const hitColorStyle = isEquivalentHit? styles[especialHitStyleType[priceType]]: null
244
244
  const missColorStyle = isEquivalentHit? null: styles[especialMissStyleType[priceType]]
245
245
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice)
246
246
  const sizeLineHeight = {
247
247
  'XS': 28,
248
248
  'S': 34,
249
249
  'M': 40,
250
250
  'L': 46,
251
251
  'XL': 52
252
252
  }
253
253
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25)
254
254
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber)
255
255
  const computedHeightStyle = {
256
256
  height: wrapHeight
257
257
  }
258
258
  const itemCommonStyle = {
259
259
  height: lineHeight
260
260
  }
261
261
  const needSizeStyles = ['bigNoPrice', 'bigSymbol', 'bigInteger', 'bigDecimal', 'priceDesc', 'smallPrice']
262
262
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
263
263
  acc[cur] = styles[cur + size]
264
264
  return acc
265
265
  }, {})
266
266
  const finalFallbackText = '暂无报价'
267
267
  const noPriceShowText = priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice)? jdPrice: finalFallbackText)
268
268
  if(useBackstop && fallbackRender){
269
269
  return fallbackRender
270
270
  }
271
271
  return (
272
272
  <View className={classNames(styles.wrap, className)} style={{...computedHeightStyle, ...style}}>
273
273
  {isTextPrice || useBackstop?
274
274
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigNoPrice, sizeStyles['bigNoPrice'], childrenClassName, bigNoPriceClassName)} style={{...itemCommonStyle}}>{useBackstop? finalFallbackText: noPriceShowText}</Text>
275
275
  :
276
276
  [
277
277
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigSymbol, sizeStyles['bigSymbol'], hitColorStyle, childrenClassName, bigSymbolClassName)} key="bigSymbol" style={{...itemCommonStyle}}>¥</Text>,
278
278
  <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>,
279
279
  isBigPriceHasDecimal?
280
280
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigDecimal, sizeStyles['bigDecimal'], hitColorStyle, isPriceDescInFront ? null : styles.rightMargin, childrenClassName, bigDecimalClassName)} key="bigDecimal" style={{...itemCommonStyle}}>.{decimalPrice}</Text>
281
281
  :
282
282
  null
283
283
  ,
284
284
  !isOnlyShowBigPrice && [
285
285
  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>,
286
286
  <view style={{
287
287
  display: 'inline-flex'
288
288
  }}>
289
289
  {smallPrice && !isHideSmallPrice ? <Text className={classNames(styles.childStyle, styles.smallPrice, sizeStyles['smallPrice'], styles.smallStyle, missColorStyle, childrenClassName, smallPriceClassName)} key="smallPrice" style={{...itemCommonStyle}}>¥{Number(smallPrice)}</Text> : null}
290
290
  {!isPriceDescInFront && !isHideSmallPrice && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.smallStyle, styles.missPriceDesc, missColorStyle, childrenClassName, priceDescClassName)} key="descBack" style={{...itemCommonStyle}}>{priceText}</Text>}
291
291
  </view>
292
292
  ]
293
293
  ]
294
294
  }
295
295
  </View>
296
296
  )
@@ -11,7 +11,18 @@
11
11
  display: none;
12
12
  }
13
13
  }
14
+ .d-container-item-cover {
15
+ &:first-child {
16
+ z-index: 99;
17
+ top: 22px;
18
+ // top: 21px;
19
+ width: 98.5%;
20
+ left: 6px;
21
+ }
14
22
 
23
+ width: 100%;
24
+ position: absolute;
25
+ }
15
26
  .d-container-item{
16
27
  &.d-container-item-active {
17
28
  :global {
@@ -1 +1 @@
1
- import { View } from '@tarojs/components'
2
1
  const {
3
2
  selectContainerId,
4
3
  placeHolderPreContainerId,
5
4
  containerData,
6
5
  children,
7
6
  style,
8
7
  shopTotalInfo,
9
8
  urlQueryData
10
9
  } = props;
11
10
  const { isTrusteeship = false } = urlQueryData || {}
12
11
  const selectContainerState = selectContainerId == containerData?.containerId
13
12
  const ChildrenComponent = useCallback(() => {
14
13
  return children ? children : null;
15
14
  }, [containerData, shopTotalInfo]);
16
15
  const isHideFloor = isTrusteeship && containerData?.floors?.[0]?.status === -1
17
16
  return (
18
17
  <View
19
18
  className={classNames(
20
19
  decorateModuleStyle[isTrusteeship ? 'd-container-item-trusteeship' : 'd-container-item'],
21
20
  'J_container',
22
21
  {
23
22
  [decorateModuleStyle['d-container-item-active']]:
24
23
  selectContainerState,
25
24
  },
26
25
  {
27
26
  J_floorItemActive: selectContainerState,
28
27
  },
29
28
  {
30
29
  [decorateModuleStyle['d-container-item-hide']]:
31
30
  isHideFloor,
32
31
  }
33
32
  )}
34
33
  id={`J_container_${containerData?.containerId}`}
35
34
  data-container-id={containerData?.containerId}
36
35
  data-container-type={containerData?.typeCode}
37
36
  data-container-cn={containerData?.typeCn}
38
37
  data-container-floorFlag={containerData?.extInfo?.floorFlag || ''}
39
38
  data-container-moduleInstanceType={containerData?.extInfo?.moduleInstanceType || ''}
40
39
  data-container-position={containerData?.containerPosition}
41
40
  data-container-alias={
42
41
  containerData?.containerAlias
43
42
  ? containerData?.containerAlias
44
43
  : ''
45
44
  }
46
45
  data-container-empty={containerData?.floors?.[0]?.configEmpty || 'false'}
47
46
  style={
48
47
  containerData?.typeCode !== ContainerShopHeaderType ? style : {}
49
48
  }
50
49
  >
51
50
  <input
52
51
  type="hidden"
53
52
  value={`container_${containerData?.containerId}`}
54
53
  />
55
54
  <ChildrenComponent />
56
55
  <PlaceHolder
57
56
  placeHolderPreContainerId={placeHolderPreContainerId}
58
57
  containerId={containerData?.containerId}
59
58
  />
60
59
  </View>
61
60
  )
61
+ import { View } from '@tarojs/components'
62
62
  const {
63
63
  selectContainerId,
64
64
  placeHolderPreContainerId,
65
65
  containerData,
66
66
  children,
67
67
  style,
68
68
  shopTotalInfo,
69
69
  urlQueryData,
70
70
  containerIndex = -1,
71
71
  luxuryFixed = false
72
72
  } = props;
73
73
  const { isTrusteeship = false } = urlQueryData || {}
74
74
  const selectContainerState = selectContainerId == containerData?.containerId
75
75
  const ChildrenComponent = useCallback(() => {
76
76
  return children ? children : null;
77
77
  }, [containerData, shopTotalInfo]);
78
78
  const isHideFloor = isTrusteeship && containerData?.floors?.[0]?.status === -1
79
79
  return (
80
80
  <View
81
81
  className={classNames(
82
82
  decorateModuleStyle[isTrusteeship ? 'd-container-item-trusteeship' : 'd-container-item'],
83
83
  'J_container',
84
84
  {
85
85
  [decorateModuleStyle['d-container-item-active']]:
86
86
  selectContainerState,
87
87
  },
88
88
  {
89
89
  J_floorItemActive: selectContainerState,
90
90
  },
91
91
  {
92
92
  [decorateModuleStyle['d-container-item-hide']]:
93
93
  isHideFloor,
94
94
  },
95
95
  {
96
96
  [decorateModuleStyle['d-container-item-cover']]:
97
97
  containerIndex === 0 && luxuryFixed && !isTrusteeship,
98
98
  },
99
99
  )}
100
100
  id={`J_container_${containerData?.containerId}`}
101
101
  data-container-id={containerData?.containerId}
102
102
  data-container-type={containerData?.typeCode}
103
103
  data-container-cn={containerData?.typeCn}
104
104
  data-container-floorFlag={containerData?.extInfo?.floorFlag || ''}
105
105
  data-container-moduleInstanceType={containerData?.extInfo?.moduleInstanceType || ''}
106
106
  data-container-position={containerData?.containerPosition}
107
107
  data-container-alias={
108
108
  containerData?.containerAlias
109
109
  ? containerData?.containerAlias
110
110
  : ''
111
111
  }
112
112
  data-container-empty={containerData?.floors?.[0]?.configEmpty || 'false'}
113
113
  style={
114
114
  containerData?.typeCode !== ContainerShopHeaderType ? style : {}
115
115
  }
116
116
  >
117
117
  <input
118
118
  type="hidden"
119
119
  value={`container_${containerData?.containerId}`}
120
120
  />
121
121
  <ChildrenComponent />
122
122
  <PlaceHolder
123
123
  placeHolderPreContainerId={placeHolderPreContainerId}
124
124
  containerId={containerData?.containerId}
125
125
  {...(selectContainerId === "luxuryHeader-isUpperHalf" && { isShowPlaceHolder: false })}
126
126
  />
127
127
  </View>
128
128
  )
@@ -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 {
4
3
  moduleType,
5
4
  configEmpty,
6
5
  previewUri = null,
7
6
  uid,
8
7
  moduleFlag,
9
8
  moduleName,
10
9
  } = props.floorData
11
10
  let previewUrl = previewUri
12
11
  const newModuleFloorTypeList = [100, 101, 100000, 99999]
13
12
  const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
14
13
  if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
15
14
  previewUrl = decorateModulePrevDefaultUrl
16
15
  }
17
16
  const loadImageErr = e => {
18
17
  e.target.src = decorateModulePrevDefaultUrl
19
18
  }
20
19
  if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1)
21
20
  return null
22
21
  return isNewFloorState && configEmpty && previewUrl ? (
23
22
  <View
24
23
  className={emptyModuleStyle['d-empty-module']}
25
24
  data-floor-uid={uid}
26
25
  data-floor-type={moduleFlag}
27
26
  data-floor-modulename={moduleName}
28
27
  >
29
28
  {}
30
29
  {}
31
30
  {}
32
31
  {}
33
32
  {}
34
33
  {}
35
34
  {}
36
35
  <View className={classNames(emptyModuleStyle['d-empty-img'])}>
37
36
  <img
38
37
  width={355}
39
38
  className={classNames('J_floorEmptyDataImg')}
40
39
  src={previewUrl}
41
40
  onError={loadImageErr.bind(this)}
42
41
  />
43
42
  </View>
44
43
  </View>
45
44
  ) : (
46
45
  <View
47
46
  className={classNames(
48
47
  emptyModuleStyle['d-empty-module'],
49
48
  emptyModuleStyle['d-empty-text-warp'],
50
49
  )}
51
50
  data-floor-uid={uid}
52
51
  data-floor-type={moduleFlag}
53
52
  data-floor-modulename={moduleName}
54
53
  >
55
54
  <Text className={emptyModuleStyle['d-empty-text']}>
56
55
  该楼层还未配置数据
57
56
  </Text>
58
57
  </View>
59
58
  )
59
+ import { View, Text } from '@tarojs/components'
60
60
  '//img11.360buyimg.com/imagetools/jfs/t1/141506/22/31698/7923/637b6db9E2af80265/10e76e2c31e0e356.png'
61
61
  '//img14.360buyimg.com/imagetools/jfs/t1/247708/11/19310/58975/66ecefa4Fe36ade02/370c18c961aceef1.png'
62
62
  const {
63
63
  moduleType,
64
64
  configEmpty,
65
65
  previewUri = null,
66
66
  uid,
67
67
  moduleFlag,
68
68
  moduleName,
69
69
  } = props.floorData
70
70
  const { luxuryFixed = false } = props
71
71
  let previewUrl = previewUri
72
72
  const newModuleFloorTypeList = [100, 101, 100000, 99999]
73
73
  const isNewFloorState = newModuleFloorTypeList.includes(moduleType)
74
74
  if ((moduleType == 99999 || moduleType == 101) && !previewUri) {
75
75
  previewUrl = luxuryFixed ? luxuryDecorateModulePrevDefaultUrl : decorateModulePrevDefaultUrl
76
76
  }
77
77
  const loadImageErr = e => {
78
78
  e.target.src = decorateModulePrevDefaultUrl
79
79
  }
80
80
  if (moduleFlag && TRUSTEESHIP_MODULE_FLAG_LIST.indexOf(moduleFlag) !== -1)
81
81
  return null
82
82
  return isNewFloorState && configEmpty && previewUrl ? (
83
83
  <View
84
84
  className={emptyModuleStyle['d-empty-module']}
85
85
  data-floor-uid={uid}
86
86
  data-floor-type={moduleFlag}
87
87
  data-floor-modulename={moduleName}
88
88
  >
89
89
  {}
90
90
  {}
91
91
  {}
92
92
  {}
93
93
  {}
94
94
  {}
95
95
  {}
96
96
  <View className={classNames(emptyModuleStyle['d-empty-img'])}>
97
97
  <img
98
98
  width={luxuryFixed ? 375 : 355}
99
99
  className={classNames('J_floorEmptyDataImg')}
100
100
  src={previewUrl}
101
101
  onError={loadImageErr.bind(this)}
102
102
  />
103
103
  </View>
104
104
  </View>
105
105
  ) : (
106
106
  <View
107
107
  className={classNames(
108
108
  emptyModuleStyle['d-empty-module'],
109
109
  emptyModuleStyle['d-empty-text-warp'],
110
110
  )}
111
111
  data-floor-uid={uid}
112
112
  data-floor-type={moduleFlag}
113
113
  data-floor-modulename={moduleName}
114
114
  >
115
115
  <Text className={emptyModuleStyle['d-empty-text']}>
116
116
  该楼层还未配置数据
117
117
  </Text>
118
118
  </View>
119
119
  )
@@ -1 +1 @@
1
- import { View, Text } from '@tarojs/components'
1
+ import { View, Text } from '@tarojs/components'
@@ -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
  const {
8
8
  floorData,
9
9
  renderSourceType = BUSINESS_TYPE.ONLINE,
10
10
  builtInComponents = {},
11
11
  updateContainerFloorListDataFn,
12
12
  } = props
13
13
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
14
14
  const floorModuleType = floorData?.floorExtInfo?.moduleFlag
15
15
  const FloorContentItem =
16
16
  (floorModuleType && builtInComponents[floorModuleType]) || null
17
17
  const dataDefines = getFloorDataToDataDefines(floorData)
18
18
 
19
19
  const renderDecorateDefaultModule = () => {
20
20
  return (
21
21
  <View
22
22
  style={{
23
23
  lineHeight: '120px',
24
24
  textAlign: 'center',
25
25
  }}
26
26
  >
27
27
  当前模块是{floorData.moduleName}
28
28
  </View>
29
29
  )
30
30
  }
31
31
  return FloorContentItem ? (
32
32
  <FloorContentItem {...props} dataDefines={dataDefines} />
33
33
  ) : isDevMode ? (
34
34
  renderDecorateDefaultModule()
35
35
  ) : null
36
36
  switch (moduleId) {
37
37
  case 83158:
38
38
  return 'freeLayout'
39
39
  case 99654:
40
40
  return 'activeText'
41
41
  case 100382:
42
42
  return 'superGoods'
43
43
  }
44
44
  floorList.map((item) => {
45
45
  if (!item.floorExtInfo) {
46
46
  return null
47
47
  }
48
48
  const moduleFlag = item.floorExtInfo.moduleFlag
49
49
  if (!moduleFlag) {
50
50
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
51
51
  if (newModuleFlag) {
52
52
  item.floorExtInfo.moduleFlag = newModuleFlag
53
53
  }
54
54
  }
55
55
  })