@conecli/cone-render 0.9.1-shop2.26 → 0.9.1-shop2.28

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 (33) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/assets/icon_blue_info.svg +1 -0
  3. package/dist/common/const.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/pageType.ts +1 -1
  8. package/dist/common/sgmCustomCode.ts +1 -1
  9. package/dist/common/token/token.jd.ts +1 -1
  10. package/dist/components/base/CustomVideo/common.ts +1 -0
  11. package/dist/components/base/CustomVideo/index.tsx +1 -1
  12. package/dist/components/base/Price/Base/index.tsx +1 -1
  13. package/dist/components/base/Price/Double/index.tsx +1 -1
  14. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  15. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  16. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  17. package/dist/components/floorItem.tsx +1 -1
  18. package/dist/components/isv/Floor/index.tsx +1 -1
  19. package/dist/interface/component.ts +1 -1
  20. package/dist/interface/service.ts +1 -1
  21. package/dist/jumpEventReport/index.weapp.ts +1 -1
  22. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  23. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  24. package/dist/service/http/colorSign.ts +1 -1
  25. package/dist/service/http/h5Http.ts +1 -0
  26. package/dist/service/http/index.h5.ts +1 -0
  27. package/dist/service/requestServer.h5.ts +1 -0
  28. package/dist/utils/h5Utils.ts +1 -1
  29. package/dist/utils/index.h5.ts +1 -1
  30. package/dist/utils/index.ts +1 -1
  31. package/dist/utils/index.weapp.ts +1 -1
  32. package/dist/utils/utils.ts +1 -1
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- import React from 'react'
2
1
  priceLabelText: "到手价"
2
+ import React from 'react'
3
3
  if(/^\d+(\.\d+)?[eE][+-]?\d+$/.test(value)){
4
4
  sgmCustomReport({
5
5
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
6
6
  msg: {
7
7
  price: value,
8
8
  originalPrice: initValue,
9
9
  msg: "当前价格为科学计数数据,上报关注该价格"
10
10
  },
11
11
  })
12
12
  }
13
13
  if(value === "NaN"){
14
14
  sgmCustomReport({
15
15
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
16
16
  msg: {
17
17
  price: value,
18
18
  originalPrice: initValue,
19
19
  msg: "价格转换异常,兜底展示暂无报价"
20
20
  },
21
21
  })
22
22
  value = "暂无报价"
23
23
  }
24
24
  priceLabelText: "到手价"
@@ -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
  )
@@ -0,0 +1,67 @@
1
+
2
+ .debug-layout-warp {
3
+ position: absolute;
4
+ border-radius: 12PX;
5
+ top: 0;
6
+ left: 0;
7
+ right: 0;
8
+ bottom: 0;
9
+ z-index: 50;
10
+
11
+ .debug-layout {
12
+ position: absolute;
13
+ border-radius: 12PX;
14
+ top: 0;
15
+ left: 0;
16
+ right: 0;
17
+ bottom: 0;
18
+
19
+ border: 1PX solid #f50707;
20
+ background-color: rgba(219, 38, 38, 0.2);
21
+
22
+ &[data-module-type='JOINT'] {
23
+ border: 1PX solid #f507c9;
24
+ background-color: rgba(219, 38, 150, 0.2);
25
+ }
26
+
27
+ &.green {
28
+ border: 1PX solid #04a607;
29
+ background-color: rgba(38, 219, 71, 0.2);
30
+ }
31
+
32
+ .cd-version-list {
33
+ pointer-events: none;
34
+ position: absolute;
35
+ font-size: 0;
36
+ top: 0;
37
+ left: 0;
38
+ right: 0;
39
+ background-color: transparent;
40
+ text-align: center;
41
+ overflow: hidden;
42
+ }
43
+
44
+ .cd-version-item {
45
+ display: inline-block;
46
+ background-color: #00c853;
47
+ font-size: 30px;
48
+ color: white;
49
+ padding: 1PX 3PX;
50
+ border-radius: 4PX;
51
+ margin: 0 5PX;
52
+ &[data-version='3.5.4'] {
53
+ background-color: #999;
54
+ }
55
+ }
56
+ }
57
+
58
+ .d-info {
59
+ position: relative;
60
+ cursor: pointer;
61
+ z-index: 3;
62
+ margin: 3PX 3PX;
63
+ width: 22PX;
64
+ height: 22PX;
65
+ background: url('../../../assets/icon_blue_info.svg') center center / 22PX 22PX no-repeat;
66
+ }
67
+ }
@@ -0,0 +1 @@
1
+ import React from 'react'
2
  const { debug } = global.info.queryInfo
1
3
  const { floorData, index } = props
2
4
  if (debug != '1' || !floorData) {
3
5
  return null
4
6
  }
5
7
  const renderRemoteLayout = () => {
6
8
  const isRemote = isRemoteFloor(floorData)
7
9
  if (isRemote) {
8
10
  const moduleType = getModuleType(floorData)
9
11
  const packResult = floorData?.floorExtInfo?.modularPackResult
10
12
  const packResultObj = JSONParse(packResult)
11
13
  const taroVersionList = getTaroVersionList(packResultObj)
12
14
  const layoutClass = classNames(style['debug-layout'], {
13
15
  [style['green']]: taroVersionList.length >= 2,
14
16
  })
15
17
  return (
16
18
  <View data-module-type={moduleType} className={layoutClass}>
17
19
  <View className={style['cd-version-list']}>
18
20
  {taroVersionList.map(item => {
19
21
  return (
20
22
  <Text className={style['cd-version-item']} data-version={item}>
21
23
  v{item}
22
24
  </Text>
23
25
  )
24
26
  })}
25
27
  </View>
26
28
  </View>
27
29
  )
28
30
  } else {
29
31
  return null
30
32
  }
31
33
  }
32
34
  return (
33
35
  <View className={style['debug-layout-warp']}>
34
36
  <View
35
37
  className={style['d-info']}
36
38
  onClick={() => {
37
39
  Messager && Messager.trigger('openDebugLayout', { floorData, index })
38
40
  }}
39
41
  />
40
42
  {renderRemoteLayout()}
41
43
  </View>
42
44
  )
@@ -0,0 +1 @@
1
+ import { RemoteLoadFloorList, FloorModuleType } from '../../../common/const'
2
  if (!packResultObj) {
1
3
  return []
2
4
  }
3
5
  const result: string[] = []
4
6
  if (packResultObj.bundleUrl) {
5
7
  result.push(packResultObj.taroVersion || '3.5.4')
6
8
  }
7
9
  if (packResultObj.bundleUrlV2) {
8
10
  result.push(packResultObj.taroVersionV2)
9
11
  }
10
12
  return result
11
13
  if (!floorData) {
12
14
  return false
13
15
  }
14
16
  const moduleFlag = floorData.floorExtInfo?.moduleFlag
15
17
  const floorLoadWay = floorData.floorExtInfo?.floorLoadWay
16
18
  return RemoteLoadFloorList.includes(moduleFlag) || floorLoadWay === 2
17
19
  if (!floorData) {
18
20
  return ''
19
21
  }
20
22
  const moduleFlag = floorData.floorExtInfo?.moduleFlag
21
23
  const floorLoadWay = floorData.floorExtInfo?.floorLoadWay
22
24
  if (moduleFlag === FloorModuleType.ISVDESIGNERH5MODULE) {
23
25
  return 'ISV'
24
26
  } else if (
25
27
  moduleFlag === FloorModuleType.JOINT_MODULE ||
26
28
  floorLoadWay === 2
27
29
  ) {
28
30
  return 'JOINT'
29
31
  } else {
30
32
  return 'SYSTEM'
31
33
  }
@@ -1 +1 @@
1
- import React from 'react'
2
1
  const { floorData, renderSourceType, builtInComponents = {} } = props
3
2
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
4
3
  const specificModuleFlag = ['mHeaderVideo']
5
4
  const frontEndSpecificModuleFlag = ['header_mVideo']
6
5
  const luxuryContainerPosition = 'luxuryFixed'
7
6
  const floorPosition = floorData?.floorPosition
8
7
  let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
9
8
  specificModuleFlag.includes(floorModuleType) && floorPosition === luxuryContainerPosition && (floorModuleType = frontEndSpecificModuleFlag)
10
9
  const FloorContentItem =
11
10
  (floorModuleType && builtInComponents[floorModuleType]) || null
12
11
  const dataDefines = getFloorDataToDataDefines(floorData)
13
12
 
14
13
  const renderDecorateDefaultModule = () => {
15
14
  return (
16
15
  <View
17
16
  style={{
18
17
  lineHeight: '120px',
19
18
  textAlign: 'center',
20
19
  }}
21
20
  >
22
21
  当前模块是{floorData.moduleName}
23
22
  </View>
24
23
  )
25
24
  }
26
25
  if (floorModuleType && (RemoteLoadFloorList.includes(floorModuleType) || floorData?.floorExtInfo?.floorLoadWay === 2)) {
27
26
  return (
28
27
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
29
28
  )
30
29
  } else {
31
30
  return FloorContentItem ? (
32
31
  <ErrorBoundary {...props}>
33
32
  <FloorContentItem {...props} dataDefines={dataDefines} />
34
33
  </ErrorBoundary>
35
34
  ) : isDevMode ? (
36
35
  renderDecorateDefaultModule()
37
36
  ) : null
38
37
  }
39
38
  renderSourceType: BUSINESS_TYPE.ONLINE,
40
39
  switch (moduleId) {
41
40
  case 83158:
42
41
  return 'freeLayout'
43
42
  case 99654:
44
43
  return 'activeText'
45
44
  case 100382:
46
45
  return 'superGoods'
47
46
  }
48
47
  floorList.map((item) => {
49
48
  if (!item.floorExtInfo) {
50
49
  return null
51
50
  }
52
51
  const moduleFlag = item.floorExtInfo.moduleFlag
53
52
  if (!moduleFlag) {
54
53
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
55
54
  if (newModuleFlag) {
56
55
  item.floorExtInfo.moduleFlag = newModuleFlag
57
56
  }
58
57
  }
59
58
  })
59
+ import React from 'react'
60
60
  const { floorData, renderSourceType, builtInComponents = {} } = props
61
61
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
62
62
  const specificModuleFlag = ['mHeaderVideo']
63
63
  const frontEndSpecificModuleFlag = ['header_mVideo']
64
64
  const luxuryContainerPosition = 'luxuryFixed'
65
65
  const floorPosition = floorData?.floorPosition
66
66
  let floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
67
67
  specificModuleFlag.includes(floorModuleType) &&
68
68
  floorPosition === luxuryContainerPosition &&
69
69
  (floorModuleType = frontEndSpecificModuleFlag)
70
70
  const FloorContentItem =
71
71
  (floorModuleType && builtInComponents[floorModuleType]) || null
72
72
  const dataDefines = getFloorDataToDataDefines(floorData)
73
73
 
74
74
  const renderDecorateDefaultModule = () => {
75
75
  return (
76
76
  <View
77
77
  style={{
78
78
  lineHeight: '120px',
79
79
  textAlign: 'center',
80
80
  }}
81
81
  >
82
82
  当前模块是{floorData.moduleName}
83
83
  </View>
84
84
  )
85
85
  }
86
86
  if (
87
87
  floorModuleType &&
88
88
  (RemoteLoadFloorList.includes(floorModuleType) ||
89
89
  floorData?.floorExtInfo?.floorLoadWay === 2)
90
90
  ) {
91
91
  return (
92
92
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
93
93
  )
94
94
  } else {
95
95
  return FloorContentItem ? (
96
96
  <ErrorBoundary {...props}>
97
97
  <FloorContentItem {...props} dataDefines={dataDefines} />
98
98
  </ErrorBoundary>
99
99
  ) : isDevMode ? (
100
100
  renderDecorateDefaultModule()
101
101
  ) : null
102
102
  }
103
103
  renderSourceType: BUSINESS_TYPE.ONLINE,
104
104
  switch (moduleId) {
105
105
  case 83158:
106
106
  return 'freeLayout'
107
107
  case 99654:
108
108
  return 'activeText'
109
109
  case 100382:
110
110
  return 'superGoods'
111
111
  }
112
112
  floorList.map((item) => {
113
113
  if (!item.floorExtInfo) {
114
114
  return null
115
115
  }
116
116
  const moduleFlag = item.floorExtInfo.moduleFlag
117
117
  if (!moduleFlag) {
118
118
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
119
119
  if (newModuleFlag) {
120
120
  item.floorExtInfo.moduleFlag = newModuleFlag
121
121
  }
122
122
  }
123
123
  })
@@ -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
  containerBorderRadius
27
26
  ? {
28
27
  borderRadius: containerBorderRadius + 'px',
29
28
  }
30
29
  : {}
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, { 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
  } = props
52
52
  const getRenderRealTimeKeyObj = {
53
53
  key: isRealTimeRender ? Date.now() : forceRenderTime,
54
54
  }
55
55
  console.log('远程加载楼层渲染key信息', getRenderRealTimeKeyObj)
56
56
  return (
57
57
  <View className={floorStyle['wrap']} style={style}>
58
58
  {floorData?.showCommonFloorHead === false ? null : (
59
59
  <CommonFloorHead
60
60
  dataDefines={dataDefines}
61
61
  floorData={floorData}
62
62
  {...getRenderRealTimeKeyObj}
63
63
  />
64
64
  )}
65
65
  <View
66
66
  className={floorStyle['wrap']}
67
67
  style={
68
68
  typeof containerBorderRadius === 'number'
69
69
  ? {
70
70
  borderRadius: containerBorderRadius + 'px',
71
71
  }
72
72
  : containerBorderRadius
73
73
  }
74
74
  >
75
75
  {}
76
76
  {props.children &&
77
77
  React.cloneElement(props.children, {
78
78
  dataDefines: dataDefines,
79
79
  ...getRenderRealTimeKeyObj,
80
80
  })}
81
81
  </View>
82
82
  </View>
83
83
  )
84
84
  isRealTimeRender: false,
85
85
  forceRenderTime: 1,