@conecli/cone-render 0.10.1-shop3.24 → 0.10.1-shop3.26

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.
@@ -1 +1 @@
1
- import React from 'react';
2
1
  console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
3
2
  type,
4
3
  data,
5
4
  text,
6
5
  });
7
6
  sgmCustomReport({
8
7
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
9
8
  msg: {
10
9
  type,
11
10
  data,
12
11
  text: '[双价格组件]' + text,
13
12
  },
14
13
  });
15
14
  return rest.some((item) => item === undefined || item === '');
16
15
  const numPrice = Number(strPrice);
17
16
  if (isNaN(numPrice)) {
18
17
  reportException({
19
18
  type: 'isNotNumericType',
20
19
  data: props,
21
20
  text: `传入价格字段值“${strPrice}”转换数字报错`,
22
21
  });
23
22
  return false;
24
23
  }
25
24
  else if (numPrice <= 0) {
26
25
  reportException({
27
26
  type: 'isNotPositiveNumber',
28
27
  data: props,
29
28
  text: `传入价格字段值“${strPrice}”不是一个正数`,
30
29
  });
31
30
  return false;
32
31
  }
33
32
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
34
33
  if (result && result[3]?.length > 2) {
35
34
  reportException({
36
35
  type: 'decimalPlaceTooLong',
37
36
  data: props,
38
37
  text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
39
38
  });
40
39
  return false;
41
40
  }
42
41
  if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
43
42
  reportException({
44
43
  type: 'findScientificNotation',
45
44
  data: props,
46
45
  text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
47
46
  });
48
47
  }
49
48
  return true;
50
49
  const { jdPrice, finalPrice } = props;
51
50
  if (jdPrice && finalPrice && Number(jdPrice) <= Number(finalPrice)) {
52
51
  reportException({
53
52
  type: 'pricesCompareException',
54
53
  data: props,
55
54
  text: `身份/到手价必须小于松果价`,
56
55
  });
57
56
  return false;
58
57
  } else {
59
58
  return true;
60
59
  }
61
60
  const numPrice = Number(strPrice);
62
61
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
63
62
  if (result) {
64
63
  return {
65
64
  integerPrice: result[1],
66
65
  decimalPrice: (result[3] || '').replace(/0+$/, ''),
67
66
  };
68
67
  } else {
69
68
  reportException({
70
69
  type: 'deconstructException',
71
70
  data: props,
72
71
  text: `解构传入价格字段值“${strPrice}”解构发生异常`,
73
72
  });
74
73
  return null;
75
74
  }
76
75
  const {
77
76
  jdPrice,
78
77
  finalPrice,
79
78
  priceText = '',
80
79
  priceType,
81
80
  hitUserIdentity = false,
82
81
  fallbackRender = null,
83
82
  className = null,
84
83
  style = {},
85
84
  childrenClassName = null,
86
85
  bigNoPriceClassName = null,
87
86
  bigSymbolClassName = null,
88
87
  bigIntegerClassName = null,
89
88
  bigDecimalClassName = null,
90
89
  priceDescClassName = null,
91
90
  smallPriceClassName = null,
92
91
  lineNumber = 1,
93
92
  size = 'M',
94
93
  isDefaultRemoveSmallPrice = false,
95
94
  useFontV2 = false,
96
95
  useFontV2Bold = false,
97
96
  } = props;
98
97
  let useBackstop = false;
99
98
  if (isNull(props.jdPrice, props.priceType)) {
100
99
  useBackstop = true;
101
100
  reportException({
102
101
  type: 'paramMiss',
103
102
  data: props,
104
103
  text: '缺少必要入参:jdPrice、priceType',
105
104
  });
106
105
  } else if (
107
106
  !allowedNoHitUserIdentityTypes.includes(props.priceType) &&
108
107
  props.hitUserIdentity === undefined
109
108
  ) {
110
109
  useBackstop = true;
111
110
  reportException({
112
111
  type: 'paramMiss',
113
112
  data: props,
114
113
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
115
114
  });
116
115
  }
117
116
  const especialHitStyleType = {
118
117
  7: 'plusStyle',
119
118
  9: 'samStyle',
120
119
  };
121
120
  const especialMissStyleType = {
122
121
  7: 'plusStyle',
123
122
  8: 'fansStyle',
124
123
  9: 'samStyle',
125
124
  10: 'studentStyle',
126
125
  12: 'yhdStyle',
127
126
  13: 'memberStyle',
128
127
  };
129
128
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
130
129
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
131
130
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
132
131
  const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
133
132
  const isHideSmallPrice =
134
133
  priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
135
134
  const isTextPrice = priceType === 4;
136
135
  if (!isTextPrice && !useBackstop) {
137
136
  if (finalPrice && !numericPriceValidate(finalPrice, props)) {
138
137
  useBackstop = true;
139
138
  } else if (!numericPriceValidate(jdPrice, props)) {
140
139
  useBackstop = true;
141
140
  }
142
141
  if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
143
142
  useBackstop = true;
144
143
  }
145
144
  }
146
145
  const bigPriceObj =
147
146
  isTextPrice || useBackstop
148
147
  ? {}
149
148
  : getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
150
149
  const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
151
150
  const isPriceDescInFront = isEquivalentHit;
152
151
  const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
153
152
  const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
154
153
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
155
154
  const sizeLineHeight = {
156
155
  XS: 28,
157
156
  S: 34,
158
157
  M: 40,
159
158
  L: 46,
160
159
  XL: 52,
161
160
  };
162
161
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
163
162
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
164
163
  const computedHeightStyle = {
165
164
  height: wrapHeight,
166
165
  };
167
166
  const itemCommonStyle = {
168
167
  height: lineHeight,
169
168
  };
170
169
  const needSizeStyles = [
171
170
  'bigNoPrice',
172
171
  'bigSymbol',
173
172
  'bigInteger',
174
173
  'bigDecimal',
175
174
  'priceDesc',
176
175
  'smallPrice',
177
176
  ];
178
177
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
179
178
  acc[cur] = styles[cur + size];
180
179
  return acc;
181
180
  }, {});
182
181
  const finalFallbackText = !isLanguageForEn ? '暂无报价' : 'Unpriced';
183
182
  const noPriceShowText =
184
183
  priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
185
184
  if (useBackstop && fallbackRender) {
186
185
  return fallbackRender;
187
186
  }
188
187
  return (
189
188
  <View
190
189
  className={classNames(styles.wrap, className)}
191
190
  style={{ ...computedHeightStyle, ...style }}
192
191
  >
193
192
  {isTextPrice || useBackstop ? (
194
193
  <Text
195
194
  className={classNames(
196
195
  styles.childStyle,
197
196
  styles.bigStyle,
198
197
  styles.bigNoPrice,
199
198
  sizeStyles['bigNoPrice'],
200
199
  childrenClassName,
201
200
  bigNoPriceClassName,
202
201
  )}
203
202
  style={{ ...itemCommonStyle }}
204
203
  >
205
204
  {useBackstop ? finalFallbackText : noPriceShowText}
206
205
  </Text>
207
206
  ) : (
208
207
  [
209
208
  <Text
210
209
  className={classNames(
211
210
  styles.childStyle,
212
211
  styles.bigStyle,
213
212
  styles.bigSymbol,
214
213
  sizeStyles['bigSymbol'],
215
214
  hitColorStyle,
216
215
  childrenClassName,
217
216
  bigSymbolClassName,
218
217
  {
219
218
  [styles.fontV2]: useFontV2,
220
219
  [styles.fontV2Bold]: useFontV2Bold,
221
220
  },
222
221
  )}
223
222
  key="bigSymbol"
224
223
  style={{ ...itemCommonStyle }}
225
224
  >
226
225
  ¥
227
226
  </Text>,
228
227
  <Text
229
228
  className={classNames(
230
229
  styles.childStyle,
231
230
  styles.bigStyle,
232
231
  styles.bigInteger,
233
232
  sizeStyles['bigInteger'],
234
233
  hitColorStyle,
235
234
  !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront
236
235
  ? styles.rightMargin
237
236
  : null,
238
237
  childrenClassName,
239
238
  bigIntegerClassName,
240
239
  {
241
240
  [styles.fontV2]: useFontV2,
242
241
  [styles.fontV2Bold]: useFontV2Bold,
243
242
  },
244
243
  )}
245
244
  key="bigInteger"
246
245
  style={{ ...itemCommonStyle }}
247
246
  >
248
247
  {integerPrice}
249
248
  </Text>,
250
249
  isBigPriceHasDecimal ? (
251
250
  <Text
252
251
  className={classNames(
253
252
  styles.childStyle,
254
253
  styles.bigStyle,
255
254
  styles.bigDecimal,
256
255
  sizeStyles['bigDecimal'],
257
256
  hitColorStyle,
258
257
  isPriceDescInFront ? null : styles.rightMargin,
259
258
  childrenClassName,
260
259
  bigDecimalClassName,
261
260
  {
262
261
  [styles.fontV2]: useFontV2,
263
262
  [styles.fontV2Bold]: useFontV2Bold,
264
263
  },
265
264
  )}
266
265
  key="bigDecimal"
267
266
  style={{ ...itemCommonStyle }}
268
267
  >
269
268
  .{decimalPrice}
270
269
  </Text>
271
270
  ) : null,
272
271
  !isOnlyShowBigPrice && [
273
272
  isPriceDescInFront && (
274
273
  <Text
275
274
  className={classNames(
276
275
  styles.childStyle,
277
276
  styles.priceDesc,
278
277
  {
279
278
  [styles['priceEnDesc']]: isLanguageForEn,
280
279
  },
281
280
  {
282
281
  [styles['priceHiddenDesc']]: priceText === '',
283
282
  },
284
283
  sizeStyles['priceDesc'],
285
284
  styles.bigStyle,
286
285
  hitColorStyle,
287
286
  isPriceDescInFront ? styles.rightMargin : null,
288
287
  childrenClassName,
289
288
  priceDescClassName,
290
289
  )}
291
290
  key="descFront"
292
291
  style={{ ...itemCommonStyle }}
293
292
  >
294
293
  {priceText === '' ? '_' : priceText}
295
294
  </Text>
296
295
  ),
297
296
  <View
298
297
  style={{
299
298
  display: 'inline-flex',
300
299
  }}
301
300
  >
302
301
  {smallPrice && !isHideSmallPrice ? (
303
302
  <Text
304
303
  className={classNames(
305
304
  styles.childStyle,
306
305
  styles.smallPrice,
307
306
  sizeStyles['smallPrice'],
308
307
  styles.smallStyle,
309
308
  missColorStyle,
310
309
  childrenClassName,
311
310
  smallPriceClassName,
312
311
  {
313
312
  [styles.fontV2]: useFontV2,
314
313
  [styles.fontV2Bold]: useFontV2Bold,
315
314
  },
316
315
  )}
317
316
  key="smallPrice"
318
317
  style={{ ...itemCommonStyle }}
319
318
  >
320
319
  ¥{Number(smallPrice)}
321
320
  </Text>
322
321
  ) : null}
323
322
  {!isPriceDescInFront && !isHideSmallPrice && (
324
323
  <Text
325
324
  className={classNames(
326
325
  styles.childStyle,
327
326
  styles.priceDesc,
328
327
  {
329
328
  [styles['priceEnDesc']]: isLanguageForEn,
330
329
  },
331
330
  {
332
331
  [styles['priceHiddenDesc']]: priceText === '',
333
332
  },
334
333
  sizeStyles['priceDesc'],
335
334
  styles.smallStyle,
336
335
  styles.missPriceDesc,
337
336
  missColorStyle,
338
337
  childrenClassName,
339
338
  priceDescClassName,
340
339
  )}
341
340
  key="descBack"
342
341
  style={{ ...itemCommonStyle }}
343
342
  >
344
343
  {priceText === '' ? '_' : priceText}
345
344
  </Text>
346
345
  )}
347
346
  </View>,
348
347
  ],
349
348
  ]
350
349
  )}
351
350
  </View>
352
351
  );
352
+ import React from 'react';
353
353
  console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
354
354
  type,
355
355
  data,
356
356
  text,
357
357
  });
358
358
  sgmCustomReport({
359
359
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
360
360
  msg: {
361
361
  type,
362
362
  data,
363
363
  text: '[双价格组件]' + text,
364
364
  },
365
365
  });
366
366
  return rest.some((item) => item === undefined || item === '');
367
367
  const numPrice = Number(strPrice);
368
368
  if (isNaN(numPrice)) {
369
369
  reportException({
370
370
  type: 'isNotNumericType',
371
371
  data: props,
372
372
  text: `传入价格字段值“${strPrice}”转换数字报错`,
373
373
  });
374
374
  return false;
375
375
  }
376
376
  else if (numPrice <= 0) {
377
377
  reportException({
378
378
  type: 'isNotPositiveNumber',
379
379
  data: props,
380
380
  text: `传入价格字段值“${strPrice}”不是一个正数`,
381
381
  });
382
382
  return false;
383
383
  }
384
384
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
385
385
  if (result && result[3]?.length > 2) {
386
386
  reportException({
387
387
  type: 'decimalPlaceTooLong',
388
388
  data: props,
389
389
  text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
390
390
  });
391
391
  return false;
392
392
  }
393
393
  if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
394
394
  reportException({
395
395
  type: 'findScientificNotation',
396
396
  data: props,
397
397
  text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
398
398
  });
399
399
  }
400
400
  return true;
401
401
  const { jdPrice, finalPrice } = props;
402
402
  if (jdPrice && finalPrice && Number(jdPrice) <= Number(finalPrice)) {
403
403
  reportException({
404
404
  type: 'pricesCompareException',
405
405
  data: props,
406
406
  text: `身份/到手价必须小于松果价`,
407
407
  });
408
408
  return false;
409
409
  } else {
410
410
  return true;
411
411
  }
412
412
  const numPrice = Number(strPrice);
413
413
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
414
414
  if (result) {
415
415
  return {
416
416
  integerPrice: result[1],
417
417
  decimalPrice: (result[3] || '').replace(/0+$/, ''),
418
418
  };
419
419
  } else {
420
420
  reportException({
421
421
  type: 'deconstructException',
422
422
  data: props,
423
423
  text: `解构传入价格字段值“${strPrice}”解构发生异常`,
424
424
  });
425
425
  return null;
426
426
  }
427
427
  const {
428
428
  jdPrice,
429
429
  finalPrice,
430
430
  priceText = '',
431
431
  priceType,
432
432
  hitUserIdentity = false,
433
433
  fallbackRender = null,
434
434
  className = null,
435
435
  style = {},
436
436
  childrenClassName = null,
437
437
  bigNoPriceClassName = null,
438
438
  bigSymbolClassName = null,
439
439
  bigIntegerClassName = null,
440
440
  bigDecimalClassName = null,
441
441
  priceDescClassName = null,
442
442
  smallPriceClassName = null,
443
443
  lineNumber = 1,
444
444
  size = 'M',
445
445
  isDefaultRemoveSmallPrice = false,
446
446
  useFontV2 = false,
447
447
  useFontV2Bold = false,
448
448
  } = props;
449
449
  let useBackstop = false;
450
450
  if (isNull(props.jdPrice, props.priceType)) {
451
451
  useBackstop = true;
452
452
  reportException({
453
453
  type: 'paramMiss',
454
454
  data: props,
455
455
  text: '缺少必要入参:jdPrice、priceType',
456
456
  });
457
457
  } else if (
458
458
  !allowedNoHitUserIdentityTypes.includes(props.priceType) &&
459
459
  props.hitUserIdentity === undefined
460
460
  ) {
461
461
  useBackstop = true;
462
462
  reportException({
463
463
  type: 'paramMiss',
464
464
  data: props,
465
465
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
466
466
  });
467
467
  }
468
468
  const especialHitStyleType = {
469
469
  7: 'plusStyle',
470
470
  9: 'samStyle',
471
471
  };
472
472
  const especialMissStyleType = {
473
473
  7: 'plusStyle',
474
474
  8: 'fansStyle',
475
475
  9: 'samStyle',
476
476
  10: 'studentStyle',
477
477
  12: 'yhdStyle',
478
478
  13: 'memberStyle',
479
479
  };
480
480
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
481
481
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
482
482
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
483
483
  const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
484
484
  const isHideSmallPrice =
485
485
  priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
486
486
  const isTextPrice = priceType === 4;
487
487
  if (!isTextPrice && !useBackstop) {
488
488
  if (finalPrice && !numericPriceValidate(finalPrice, props)) {
489
489
  useBackstop = true;
490
490
  } else if (!numericPriceValidate(jdPrice, props)) {
491
491
  useBackstop = true;
492
492
  }
493
493
  if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
494
494
  useBackstop = true;
495
495
  }
496
496
  }
497
497
  const bigPriceObj =
498
498
  isTextPrice || useBackstop
499
499
  ? {}
500
500
  : getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
501
501
  const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
502
502
  const isPriceDescInFront = isEquivalentHit;
503
503
  const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
504
504
  const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
505
505
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
506
506
  const sizeLineHeight = {
507
507
  XS: 28,
508
508
  S: 34,
509
509
  M: 40,
510
510
  L: 46,
511
511
  XL: 52,
512
512
  };
513
513
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
514
514
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
515
515
  const computedHeightStyle = {
516
516
  height: wrapHeight,
517
517
  };
518
518
  const itemCommonStyle = {
519
519
  height: lineHeight,
520
520
  };
521
521
  const needSizeStyles = [
522
522
  'bigNoPrice',
523
523
  'bigSymbol',
524
524
  'bigInteger',
525
525
  'bigDecimal',
526
526
  'priceDesc',
527
527
  'smallPrice',
528
528
  ];
529
529
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
530
530
  acc[cur] = styles[cur + size];
531
531
  return acc;
532
532
  }, {});
533
533
  const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
534
534
  const noPriceShowText =
535
535
  priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
536
536
  if (useBackstop && fallbackRender) {
537
537
  return fallbackRender;
538
538
  }
539
539
  return (
540
540
  <View
541
541
  className={classNames(styles.wrap, className)}
542
542
  style={{ ...computedHeightStyle, ...style }}
543
543
  >
544
544
  {isTextPrice || useBackstop ? (
545
545
  <Text
546
546
  className={classNames(
547
547
  styles.childStyle,
548
548
  styles.bigStyle,
549
549
  styles.bigNoPrice,
550
550
  sizeStyles['bigNoPrice'],
551
551
  childrenClassName,
552
552
  bigNoPriceClassName,
553
553
  )}
554
554
  style={{ ...itemCommonStyle }}
555
555
  >
556
556
  {useBackstop ? finalFallbackText : noPriceShowText}
557
557
  </Text>
558
558
  ) : (
559
559
  [
560
560
  <Text
561
561
  className={classNames(
562
562
  styles.childStyle,
563
563
  styles.bigStyle,
564
564
  styles.bigSymbol,
565
565
  sizeStyles['bigSymbol'],
566
566
  hitColorStyle,
567
567
  childrenClassName,
568
568
  bigSymbolClassName,
569
569
  {
570
570
  [styles.fontV2]: useFontV2,
571
571
  [styles.fontV2Bold]: useFontV2Bold,
572
572
  },
573
573
  )}
574
574
  key="bigSymbol"
575
575
  style={{ ...itemCommonStyle }}
576
576
  >
577
577
  ¥
578
578
  </Text>,
579
579
  <Text
580
580
  className={classNames(
581
581
  styles.childStyle,
582
582
  styles.bigStyle,
583
583
  styles.bigInteger,
584
584
  sizeStyles['bigInteger'],
585
585
  hitColorStyle,
586
586
  !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront
587
587
  ? styles.rightMargin
588
588
  : null,
589
589
  childrenClassName,
590
590
  bigIntegerClassName,
591
591
  {
592
592
  [styles.fontV2]: useFontV2,
593
593
  [styles.fontV2Bold]: useFontV2Bold,
594
594
  },
595
595
  )}
596
596
  key="bigInteger"
597
597
  style={{ ...itemCommonStyle }}
598
598
  >
599
599
  {integerPrice}
600
600
  </Text>,
601
601
  isBigPriceHasDecimal ? (
602
602
  <Text
603
603
  className={classNames(
604
604
  styles.childStyle,
605
605
  styles.bigStyle,
606
606
  styles.bigDecimal,
607
607
  sizeStyles['bigDecimal'],
608
608
  hitColorStyle,
609
609
  isPriceDescInFront ? null : styles.rightMargin,
610
610
  childrenClassName,
611
611
  bigDecimalClassName,
612
612
  {
613
613
  [styles.fontV2]: useFontV2,
614
614
  [styles.fontV2Bold]: useFontV2Bold,
615
615
  },
616
616
  )}
617
617
  key="bigDecimal"
618
618
  style={{ ...itemCommonStyle }}
619
619
  >
620
620
  .{decimalPrice}
621
621
  </Text>
622
622
  ) : null,
623
623
  !isOnlyShowBigPrice && [
624
624
  isPriceDescInFront && (
625
625
  <Text
626
626
  className={classNames(
627
627
  styles.childStyle,
628
628
  styles.priceDesc,
629
629
  {
630
630
  [styles['priceEnDesc']]: isLanguageForEn,
631
631
  },
632
632
  {
633
633
  [styles['priceHiddenDesc']]: priceText === '',
634
634
  },
635
635
  sizeStyles['priceDesc'],
636
636
  styles.bigStyle,
637
637
  hitColorStyle,
638
638
  isPriceDescInFront ? styles.rightMargin : null,
639
639
  childrenClassName,
640
640
  priceDescClassName,
641
641
  )}
642
642
  key="descFront"
643
643
  style={{ ...itemCommonStyle }}
644
644
  >
645
645
  {priceText === '' ? '_' : priceText}
646
646
  </Text>
647
647
  ),
648
648
  <View
649
649
  style={{
650
650
  display: 'inline-flex',
651
651
  }}
652
652
  >
653
653
  {smallPrice && !isHideSmallPrice ? (
654
654
  <Text
655
655
  className={classNames(
656
656
  styles.childStyle,
657
657
  styles.smallPrice,
658
658
  sizeStyles['smallPrice'],
659
659
  styles.smallStyle,
660
660
  missColorStyle,
661
661
  childrenClassName,
662
662
  smallPriceClassName,
663
663
  {
664
664
  [styles.fontV2]: useFontV2,
665
665
  [styles.fontV2Bold]: useFontV2Bold,
666
666
  },
667
667
  )}
668
668
  key="smallPrice"
669
669
  style={{ ...itemCommonStyle }}
670
670
  >
671
671
  ¥{Number(smallPrice)}
672
672
  </Text>
673
673
  ) : null}
674
674
  {!isPriceDescInFront && !isHideSmallPrice && (
675
675
  <Text
676
676
  className={classNames(
677
677
  styles.childStyle,
678
678
  styles.priceDesc,
679
679
  {
680
680
  [styles['priceEnDesc']]: isLanguageForEn,
681
681
  },
682
682
  {
683
683
  [styles['priceHiddenDesc']]: priceText === '',
684
684
  },
685
685
  sizeStyles['priceDesc'],
686
686
  styles.smallStyle,
687
687
  styles.missPriceDesc,
688
688
  missColorStyle,
689
689
  childrenClassName,
690
690
  priceDescClassName,
691
691
  )}
692
692
  key="descBack"
693
693
  style={{ ...itemCommonStyle }}
694
694
  >
695
695
  {priceText === '' ? '_' : priceText}
696
696
  </Text>
697
697
  )}
698
698
  </View>,
699
699
  ],
700
700
  ]
701
701
  )}
702
702
  </View>
703
703
  );