@conecli/cone-render 0.10.1-shop-beta.21 → 0.10.1-shop-beta.23

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