@conecli/cone-render 0.10.1-shop-beta.18 → 0.10.1-shop-beta.19

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