@conecli/cone-render 0.10.1-shop3.50 → 0.10.1-shop3.52

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