@conecli/cone-render 0.10.1-shop3.42 → 0.10.1-shop3.43

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