@conecli/cone-render 0.10.1-shop-beta.11 → 0.10.1-shop-beta.13

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.
Files changed (78) hide show
  1. package/README.md +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.dynamic.ts +1 -0
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/jssdk.ts +1 -1
  9. package/dist/common/token/index.h5.ts +1 -1
  10. package/dist/common/wxappApi.ts +1 -1
  11. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  14. package/dist/components/base/Dialog/index.dynamic.module.scss +126 -0
  15. package/dist/components/base/Dialog/index.dynamic.tsx +1 -0
  16. package/dist/components/base/DynamicTest/index.dynamic.module.scss +15 -0
  17. package/dist/components/base/DynamicTest/index.module.scss +16 -0
  18. package/dist/components/base/DynamicTest/index.tsx +1 -0
  19. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  20. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  21. package/dist/components/base/JdLoading/index.module.scss +2 -0
  22. package/dist/components/base/JdLoading/index.tsx +1 -1
  23. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  24. package/dist/components/base/NetworkDataError/const.ts +1 -1
  25. package/dist/components/base/NetworkDataError/index.module.scss +116 -70
  26. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  27. package/dist/components/base/Price/Base/index.dynamic.module.scss +63 -0
  28. package/dist/components/base/Price/Base/index.dynamic.tsx +1 -0
  29. package/dist/components/base/Price/Base/index.module.scss +6 -0
  30. package/dist/components/base/Price/Base/index.tsx +1 -1
  31. package/dist/components/base/Price/Double/index.dynamic.module.scss +172 -0
  32. package/dist/components/base/Price/Double/index.dynamic.tsx +1 -0
  33. package/dist/components/base/Price/Double/index.module.scss +6 -0
  34. package/dist/components/base/Price/Double/index.tsx +1 -1
  35. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  36. package/dist/config/env.ts +1 -1
  37. package/dist/interface/common.ts +1 -1
  38. package/dist/interface/component.ts +1 -1
  39. package/dist/interface/jumpEventReport.ts +1 -1
  40. package/dist/jumpEventReport/const.ts +1 -1
  41. package/dist/jumpEventReport/index.dynamic.ts +1 -0
  42. package/dist/jumpEventReport/index.h5.ts +1 -1
  43. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  44. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  45. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  46. package/dist/jumpEventReport/web.base.ts +1 -1
  47. package/dist/jumpEventReport/web.jd.ts +1 -1
  48. package/dist/language/zh_CN.json +162 -0
  49. package/dist/open/api/index.ts +1 -1
  50. package/dist/open/api/shopMember.dynamic.ts +1 -0
  51. package/dist/open/api/shopMember.ts +1 -1
  52. package/dist/open/components/index.dynamic.ts +1 -0
  53. package/dist/open/components/index.ts +1 -1
  54. package/dist/sass/app.dynamic.scss +306 -0
  55. package/dist/service/fetchGateway.h5.ts +1 -0
  56. package/dist/service/fetchGateway.ts +1 -1
  57. package/dist/service/fetchGateway.weapp.ts +1 -1
  58. package/dist/service/fetchJsonp.h5.ts +1 -0
  59. package/dist/service/fetchJsonp.ts +1 -1
  60. package/dist/service/http/colorSign.dynamic.ts +1 -0
  61. package/dist/service/http/http.ts +1 -1
  62. package/dist/service/requestServer.h5.ts +1 -1
  63. package/dist/service/requestServer.ts +1 -1
  64. package/dist/service/requestServer.weapp.ts +1 -1
  65. package/dist/utils/connectNativeJsBridge.dynamic.ts +1 -0
  66. package/dist/utils/connectNativeJsBridge.ts +1 -1
  67. package/dist/utils/h5Utils.ts +1 -1
  68. package/dist/utils/index.h5.ts +1 -1
  69. package/dist/utils/index.ts +1 -1
  70. package/dist/utils/index.weapp.ts +1 -1
  71. package/dist/utils/intersectionObserver.ts +1 -1
  72. package/dist/utils/jumpExtMapUtil.ts +1 -0
  73. package/dist/utils/log.ts +1 -0
  74. package/dist/utils/utils.ts +1 -1
  75. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  76. package/dist/wxapp/common/user_info.js +1 -1
  77. package/package.json +51 -31
  78. /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
@@ -0,0 +1 @@
1
+ import React from 'react';
2
  console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
1
3
  type,
2
4
  data,
3
5
  text,
4
6
  });
5
7
  sgmCustomReport({
6
8
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
7
9
  msg: {
8
10
  type,
9
11
  data,
10
12
  text: '[双价格组件]' + text,
11
13
  },
12
14
  });
13
15
  return rest.some((item) => item === undefined || item === '');
14
16
  const numPrice = Number(strPrice);
15
17
  if (isNaN(numPrice)) {
16
18
  reportException({
17
19
  type: 'isNotNumericType',
18
20
  data: props,
19
21
  text: `传入价格字段值“${strPrice}”转换数字报错`,
20
22
  });
21
23
  return false;
22
24
  }
23
25
  else if (numPrice <= 0) {
24
26
  reportException({
25
27
  type: 'isNotPositiveNumber',
26
28
  data: props,
27
29
  text: `传入价格字段值“${strPrice}”不是一个正数`,
28
30
  });
29
31
  return false;
30
32
  }
31
33
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
32
34
  if (result && result[3]?.length > 2) {
33
35
  reportException({
34
36
  type: 'decimalPlaceTooLong',
35
37
  data: props,
36
38
  text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
37
39
  });
38
40
  return false;
39
41
  }
40
42
  if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
41
43
  reportException({
42
44
  type: 'findScientificNotation',
43
45
  data: props,
44
46
  text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
45
47
  });
46
48
  }
47
49
  return true;
48
50
  const { jdPrice, finalPrice } = props;
49
51
  if (jdPrice && finalPrice && Number(jdPrice) <= Number(finalPrice)) {
50
52
  reportException({
51
53
  type: 'pricesCompareException',
52
54
  data: props,
53
55
  text: `身份/到手价必须小于松果价`,
54
56
  });
55
57
  return false;
56
58
  } else {
57
59
  return true;
58
60
  }
59
61
  const numPrice = Number(strPrice);
60
62
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
61
63
  if (result) {
62
64
  return {
63
65
  integerPrice: result[1],
64
66
  decimalPrice: (result[3] || '').replace(/0+$/, ''),
65
67
  };
66
68
  } else {
67
69
  reportException({
68
70
  type: 'deconstructException',
69
71
  data: props,
70
72
  text: `解构传入价格字段值“${strPrice}”解构发生异常`,
71
73
  });
72
74
  return null;
73
75
  }
74
76
  const {
75
77
  jdPrice,
76
78
  finalPrice,
77
79
  priceText = '',
78
80
  priceType,
79
81
  hitUserIdentity = false,
80
82
  fallbackRender = null,
81
83
  className = null,
82
84
  style = {},
83
85
  childrenClassName = null,
84
86
  bigNoPriceClassName = null,
85
87
  bigSymbolClassName = null,
86
88
  bigIntegerClassName = null,
87
89
  bigDecimalClassName = null,
88
90
  priceDescClassName = null,
89
91
  smallPriceClassName = null,
90
92
  lineNumber = 1,
91
93
  size = 'M',
92
94
  isDefaultRemoveSmallPrice = false,
93
95
  useFontV2 = false,
94
96
  useFontV2Bold = false,
95
97
  useFontV2ForMain = false,
96
98
  useFontV2BoldForMain = false,
97
99
  } = props;
98
100
  let useBackstop = false;
99
101
  if (isNull(props.jdPrice, props.priceType)) {
100
102
  useBackstop = true;
101
103
  reportException({
102
104
  type: 'paramMiss',
103
105
  data: props,
104
106
  text: '缺少必要入参:jdPrice、priceType',
105
107
  });
106
108
  } else if (
107
109
  !allowedNoHitUserIdentityTypes.includes(props.priceType) &&
108
110
  props.hitUserIdentity === undefined
109
111
  ) {
110
112
  useBackstop = true;
111
113
  reportException({
112
114
  type: 'paramMiss',
113
115
  data: props,
114
116
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
115
117
  });
116
118
  }
117
119
  const especialHitStyleType = {
118
120
  7: 'plusStyle',
119
121
  9: 'samStyle',
120
122
  };
121
123
  const especialMissStyleType = {
122
124
  7: 'plusStyle',
123
125
  8: 'fansStyle',
124
126
  9: 'samStyle',
125
127
  10: 'studentStyle',
126
128
  12: 'yhdStyle',
127
129
  13: 'memberStyle',
128
130
  };
129
131
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
130
132
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
131
133
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
132
134
  const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
133
135
  const isHideSmallPrice =
134
136
  priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
135
137
  const isTextPrice = priceType === 4;
136
138
  if (!isTextPrice && !useBackstop) {
137
139
  if (finalPrice && !numericPriceValidate(finalPrice, props)) {
138
140
  useBackstop = true;
139
141
  } else if (!numericPriceValidate(jdPrice, props)) {
140
142
  useBackstop = true;
141
143
  }
142
144
  if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
143
145
  useBackstop = true;
144
146
  }
145
147
  }
146
148
  const bigPriceObj =
147
149
  isTextPrice || useBackstop
148
150
  ? {}
149
151
  : getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
150
152
  const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
151
153
  const isPriceDescInFront = isEquivalentHit;
152
154
  const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
153
155
  const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
154
156
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
155
157
  const sizeLineHeight = {
156
158
  XS: 28,
157
159
  S: 34,
158
160
  M: 40,
159
161
  L: 46,
160
162
  XL: 52,
161
163
  };
162
164
  const needSizeStyles = [
163
165
  'bigNoPrice',
164
166
  'bigSymbol',
165
167
  'bigInteger',
166
168
  'bigDecimal',
167
169
  'priceDesc',
168
170
  'smallPrice',
169
171
  ];
170
172
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
171
173
  acc[cur] = styles[cur + size];
172
174
  return acc;
173
175
  }, {});
174
176
  const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
175
177
  const noPriceShowText =
176
178
  priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
177
179
  if (useBackstop && fallbackRender) {
178
180
  return fallbackRender
179
181
  }
180
182
  return (
181
183
  <View
182
184
  className={classNames(styles.wrap, className)}
183
185
  style={{ ...style }}
184
186
  >
185
187
  {isTextPrice || useBackstop ? (
186
188
  <Text
187
189
  className={classNames(
188
190
  styles.childStyle,
189
191
  styles.bigStyle,
190
192
  styles.bigNoPrice,
191
193
  sizeStyles['bigNoPrice'],
192
194
  childrenClassName,
193
195
  bigNoPriceClassName,
194
196
  )}
195
197
  >
196
198
  {useBackstop ? finalFallbackText : noPriceShowText}
197
199
  </Text>
198
200
  ) : (
199
201
  [
200
202
  <Text
201
203
  className={classNames(
202
204
  styles.childStyle,
203
205
  styles.bigStyle,
204
206
  styles.bigSymbol,
205
207
  sizeStyles['bigSymbol'],
206
208
  hitColorStyle,
207
209
  childrenClassName,
208
210
  bigSymbolClassName,
209
211
  {
210
212
  [styles.fontV2]: useFontV2 || useFontV2ForMain,
211
213
  [styles.fontV2Bold]: useFontV2Bold || useFontV2BoldForMain,
212
214
  },
213
215
  )}
214
216
  key="bigSymbol"
215
217
  >
216
218
  ¥
217
219
  </Text>,
218
220
  <Text
219
221
  className={classNames(
220
222
  styles.childStyle,
221
223
  styles.bigStyle,
222
224
  styles.bigInteger,
223
225
  sizeStyles['bigInteger'],
224
226
  hitColorStyle,
225
227
  !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront
226
228
  ? styles.rightMargin
227
229
  : null,
228
230
  childrenClassName,
229
231
  bigIntegerClassName,
230
232
  {
231
233
  [styles.fontV2]: useFontV2 || useFontV2ForMain,
232
234
  [styles.fontV2Bold]: useFontV2Bold || useFontV2BoldForMain,
233
235
  },
234
236
  )}
235
237
  key="bigInteger"
236
238
  >
237
239
  {integerPrice}
238
240
  </Text>,
239
241
  isBigPriceHasDecimal ? (
240
242
  <Text
241
243
  className={classNames(
242
244
  styles.childStyle,
243
245
  styles.bigStyle,
244
246
  styles.bigDecimal,
245
247
  sizeStyles['bigDecimal'],
246
248
  hitColorStyle,
247
249
  isPriceDescInFront ? null : styles.rightMargin,
248
250
  childrenClassName,
249
251
  bigDecimalClassName,
250
252
  {
251
253
  [styles.fontV2]: useFontV2 || useFontV2ForMain,
252
254
  [styles.fontV2Bold]: useFontV2Bold || useFontV2BoldForMain,
253
255
  },
254
256
  )}
255
257
  key="bigDecimal"
256
258
  >
257
259
  .{decimalPrice}
258
260
  </Text>
259
261
  ) : null,
260
262
  !isOnlyShowBigPrice && [
261
263
  isPriceDescInFront && (
262
264
  <Text
263
265
  className={classNames(
264
266
  styles.childStyle,
265
267
  styles.priceDesc,
266
268
  {
267
269
  [styles['priceEnDesc']]: isLanguageForEn,
268
270
  },
269
271
  {
270
272
  [styles['priceHiddenDesc']]: priceText === '',
271
273
  },
272
274
  sizeStyles['priceDesc'],
273
275
  styles.bigStyle,
274
276
  hitColorStyle,
275
277
  isPriceDescInFront ? styles.rightMargin : null,
276
278
  childrenClassName,
277
279
  priceDescClassName,
278
280
  )}
279
281
  key="descFront"
280
282
  >
281
283
  {priceText === '' ? '_' : priceText}
282
284
  </Text>
283
285
  ),
284
286
  <View
285
287
  style={{
286
288
  display: 'inline-flex',
287
289
  }}
288
290
  >
289
291
  {smallPrice && !isHideSmallPrice ? (
290
292
  <Text
291
293
  className={classNames(
292
294
  styles.childStyle,
293
295
  styles.smallPrice,
294
296
  sizeStyles['smallPrice'],
295
297
  styles.smallStyle,
296
298
  missColorStyle,
297
299
  childrenClassName,
298
300
  smallPriceClassName,
299
301
  {
300
302
  [styles.fontV2]: useFontV2,
301
303
  [styles.fontV2Bold]: useFontV2Bold,
302
304
  },
303
305
  )}
304
306
  key="smallPrice"
305
307
  >
306
308
  ¥{Number(smallPrice)}
307
309
  </Text>
308
310
  ) : null}
309
311
  {!isPriceDescInFront && !isHideSmallPrice && (
310
312
  <Text
311
313
  className={classNames(
312
314
  styles.childStyle,
313
315
  styles.priceDesc,
314
316
  {
315
317
  [styles['priceEnDesc']]: isLanguageForEn,
316
318
  },
317
319
  {
318
320
  [styles['priceHiddenDesc']]: priceText === '',
319
321
  },
320
322
  sizeStyles['priceDesc'],
321
323
  styles.smallStyle,
322
324
  styles.missPriceDesc,
323
325
  missColorStyle,
324
326
  childrenClassName,
325
327
  priceDescClassName,
326
328
  )}
327
329
  key="descBack"
328
330
  >
329
331
  {priceText === '' ? '_' : priceText}
330
332
  </Text>
331
333
  )}
332
334
  </View>,
333
335
  ],
334
336
  ]
335
337
  )}
336
338
  </View>
337
339
  );
@@ -164,3 +164,9 @@
164
164
  .memberStyle {
165
165
  color: #f6b303;
166
166
  }
167
+ .fontV2 {
168
+ font-family: 'JDZhengHeiV2-Regular';
169
+ }
170
+ .fontV2Bold {
171
+ font-family: 'JDZhengHeiV2-Bold';
172
+ }