@conecli/cone-render 0.8.20-beta.0 → 0.8.20-beta.2

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 (160) hide show
  1. package/README.md +7 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/assets/icon_blue_info.svg +1 -0
  4. package/dist/common/const.ts +1 -1
  5. package/dist/common/environmentType.ts +1 -0
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.ts +1 -0
  11. package/dist/common/jssdk.ts +1 -0
  12. package/dist/common/pageType.ts +1 -0
  13. package/dist/common/sgmCustomCode.ts +1 -0
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/token/token.ts +1 -1
  17. package/dist/common/wxappApi.jd.ts +1 -0
  18. package/dist/common/wxappApi.ts +1 -1
  19. package/dist/components/ErrorBoundary.tsx +1 -1
  20. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  21. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  22. package/dist/components/base/CountDown/index.module.scss +49 -44
  23. package/dist/components/base/CountDown/index.tsx +1 -1
  24. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  25. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  26. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  27. package/dist/components/base/CustomVideo/common.ts +1 -0
  28. package/dist/components/base/CustomVideo/index.tsx +1 -1
  29. package/dist/components/base/Dialog/index.module.scss +16 -0
  30. package/dist/components/base/Dialog/index.tsx +1 -1
  31. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  32. package/dist/components/base/ExposureSmart/const.ts +1 -0
  33. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  34. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  35. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  36. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  37. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  38. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  39. package/dist/components/base/InViewRender/index.tsx +1 -1
  40. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  41. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  42. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  43. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  44. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  45. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  46. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  47. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  48. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  49. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  50. package/dist/components/base/NetworkDataError/const.ts +1 -1
  51. package/dist/components/base/NetworkDataError/index.module.scss +125 -69
  52. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  53. package/dist/components/base/Price/Base/index.module.scss +12 -0
  54. package/dist/components/base/Price/Base/index.tsx +1 -1
  55. package/dist/components/base/Price/Double/index.module.scss +32 -0
  56. package/dist/components/base/Price/Double/index.tsx +1 -1
  57. package/dist/components/base/Price/index.tsx +1 -1
  58. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  59. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  60. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  61. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  62. package/dist/components/base/Skeleton/index.tsx +1 -1
  63. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  64. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  65. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  66. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  67. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  68. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  69. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  70. package/dist/components/floorItem.jd.tsx +1 -1
  71. package/dist/components/floorItem.tsx +1 -1
  72. package/dist/components/floorItem.weapp.tsx +1 -1
  73. package/dist/components/isv/Floor/index.tsx +1 -1
  74. package/dist/components/remoteFloorItem.tsx +1 -0
  75. package/dist/interface/common.ts +1 -1
  76. package/dist/interface/component.ts +1 -1
  77. package/dist/interface/jumpEventReport.ts +1 -1
  78. package/dist/interface/service.ts +1 -1
  79. package/dist/interface/utils.ts +1 -1
  80. package/dist/jumpEventReport/base.ts +1 -1
  81. package/dist/jumpEventReport/const.ts +1 -1
  82. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  83. package/dist/jumpEventReport/index.h5.ts +1 -1
  84. package/dist/jumpEventReport/index.jd.ts +1 -1
  85. package/dist/jumpEventReport/index.ts +1 -1
  86. package/dist/jumpEventReport/index.weapp.ts +1 -1
  87. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  88. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  89. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  90. package/dist/jumpEventReport/web/report.ts +1 -1
  91. package/dist/jumpEventReport/web.base.ts +1 -1
  92. package/dist/jumpEventReport/web.jd.ts +1 -1
  93. package/dist/jumpEventReport/web.jdb.ts +1 -1
  94. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  95. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  96. package/dist/jumpEventReport/web.pc.ts +1 -0
  97. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  98. package/dist/jumpEventReport/web.tjm.ts +1 -0
  99. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  100. package/dist/language/en_US.json +231 -0
  101. package/dist/language/zh_CN.json +231 -0
  102. package/dist/language/zh_HK.json +231 -0
  103. package/dist/libs/taroAppReport.js +2 -2
  104. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  105. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  106. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  107. package/dist/open/api/device.ts +1 -1
  108. package/dist/open/api/environment.ts +1 -1
  109. package/dist/open/api/index.ts +1 -1
  110. package/dist/open/api/jump copy.ts +1 -1
  111. package/dist/open/api/request.ts +1 -1
  112. package/dist/open/api/shopMember.ts +1 -1
  113. package/dist/open/api/track.ts +1 -1
  114. package/dist/open/api/util.ts +1 -1
  115. package/dist/open/components/index.ts +1 -1
  116. package/dist/sass/app.h5.scss +294 -212
  117. package/dist/sass/base.scss +195 -137
  118. package/dist/service/bMallConst.ts +1 -1
  119. package/dist/service/fetchGateway.ts +1 -1
  120. package/dist/service/fetchGateway.weapp.ts +1 -0
  121. package/dist/service/http/colorSign.ts +1 -1
  122. package/dist/service/http/const.ts +1 -1
  123. package/dist/service/http/h5Http.ts +1 -0
  124. package/dist/service/http/index.h5.ts +1 -0
  125. package/dist/service/requestServer.h5.ts +1 -0
  126. package/dist/service/requestServer.ts +1 -1
  127. package/dist/service/requestServer.weapp.ts +1 -0
  128. package/dist/utils/connectNativeJsBridge.ts +1 -1
  129. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  130. package/dist/utils/draExceptionAndProfile.ts +1 -1
  131. package/dist/utils/h5Utils.ts +1 -1
  132. package/dist/utils/index.h5.ts +1 -1
  133. package/dist/utils/index.ts +1 -1
  134. package/dist/utils/index.weapp.ts +1 -1
  135. package/dist/utils/intersectionObserver.ts +1 -1
  136. package/dist/utils/jm-common.js +1 -1
  137. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  138. package/dist/utils/jumpExtMapUtil.ts +1 -0
  139. package/dist/utils/sColor.js +1 -0
  140. package/dist/utils/sgmCodeUtils.ts +1 -0
  141. package/dist/utils/taroRenderUtil.ts +1 -0
  142. package/dist/utils/utils.ts +1 -1
  143. package/dist/wxapp/api/helper.js +1 -0
  144. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  145. package/dist/wxapp/common/user_info.js +1 -1
  146. package/dist/wxapp/components/launch-app/index.js +1 -0
  147. package/dist/wxapp/components/launch-app/index.json +5 -0
  148. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  149. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  150. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  151. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  152. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  153. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  154. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  155. package/package.json +145 -115
  156. package/dist/components/base/Skeleton/old.tsx +0 -1
  157. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  158. package/dist/utils/memberFormatUtils.js +0 -1
  159. /package/dist/service/{bMallConst.wxapp.ts → bMallConst.weapp.ts} +0 -0
  160. /package/dist/service/http/{colorSign.wxapp.ts → colorSign.weapp.ts} +0 -0
@@ -1 +1 @@
1
- import React from 'react';
2
1
  const result = String(strPrice).match(/(-?\d+)\.?(\d+)?/);
3
2
  if(result && Number(result[0]) > 0){
4
3
  return {
5
4
  integerPrice: result[1],
6
5
  decimalPrice: (result[2] || '').replace(/0+$/, '')
7
6
  }
8
7
  }else{
9
8
  return null;
10
9
  }
11
10
  const {
12
11
  jdPrice,
13
12
  finalPrice,
14
13
  priceText = '',
15
14
  priceType,
16
15
  hitUserIdentity = false,
17
16
  isAuctionWare,
18
17
  fallbackRender = null,
19
18
  className = null,
20
19
  style = {},
21
20
  childrenClassName = null,
22
21
  bigNoPriceClassName = null,
23
22
  bigSymbolClassName = null,
24
23
  bigIntegerClassName = null,
25
24
  bigDecimalClassName = null,
26
25
  priceDescClassName = null,
27
26
  smallPriceClassName = null,
28
27
  lineNumber = 1,
29
28
  size = 'M'
30
29
  } = props
31
30
  const especialHitStyleType = {
32
31
  7: 'plusStyle',
33
32
  9: 'samStyle'
34
33
  }
35
34
  const especialMissStyleType = {
36
35
  7: 'plusStyle',
37
36
  8: 'fansStyle',
38
37
  9: 'samStyle',
39
38
  10: 'studentStyle',
40
39
  12: 'yhdStyle',
41
40
  13: 'memberStyle'
42
41
  }
43
42
  const isNoPrice = priceType === 4
44
43
  const isUseFinalPriceAsBigPrice = [1, 2, 6, 14, 16, 17, 18].includes(priceType)
45
44
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity
46
45
  const bigPriceObj = getDeconstructPrice(isEquivalentHit? finalPrice: jdPrice)
47
46
  if(isAuctionWare || (!isNoPrice && bigPriceObj === null)){
48
47
  return fallbackRender
49
48
  }
50
49
  const {integerPrice, decimalPrice = ''} = bigPriceObj || {}
51
50
  const isOnlyShowBigPrice = priceType === 3
52
51
  const isHideSmallPrice = priceType === 14
53
52
  const smallPrice = isEquivalentHit? jdPrice: finalPrice
54
53
  const isPriceDescInFront = isEquivalentHit
55
54
  const hitColorStyle = isEquivalentHit? styles[especialHitStyleType[priceType]]: null
56
55
  const missColorStyle = isEquivalentHit? null: styles[especialMissStyleType[priceType]]
57
56
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice)
58
57
  const sizeLineHeight = {
59
58
  'XS': 28,
60
59
  'S': 34,
61
60
  'M': 40,
62
61
  'L': 46,
63
62
  'XL': 52
64
63
  }
65
64
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25)
66
65
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber)
67
66
  const computedHeightStyle = {
68
67
  height: wrapHeight
69
68
  }
70
69
  const itemCommonStyle = {
71
70
  height: lineHeight
72
71
  }
73
72
  const needSizeStyles = ['bigNoPrice', 'bigSymbol', 'bigInteger', 'bigDecimal', 'priceDesc', 'smallPrice']
74
73
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
75
74
  acc[cur] = styles[cur + size]
76
75
  return acc
77
76
  }, {})
78
77
  const noPriceShowText = priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice)? jdPrice: '')
79
78
  return (
80
79
  <View className={classNames(styles.wrap, className)} style={{...computedHeightStyle, ...style}}>
81
80
  {isNoPrice?
82
81
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigNoPrice, sizeStyles['bigNoPrice'], childrenClassName, bigNoPriceClassName)} style={{...itemCommonStyle}}>{noPriceShowText}</Text>
83
82
  :
84
83
  [
85
84
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigSymbol, sizeStyles['bigSymbol'], hitColorStyle, childrenClassName, bigSymbolClassName)} key="bigSymbol" style={{...itemCommonStyle}}>¥</Text>,
86
85
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigInteger, sizeStyles['bigInteger'], hitColorStyle, !isOnlyShowBigPrice && !isBigPriceHasDecimal && !isPriceDescInFront ? styles.rightMargin : null, childrenClassName, bigIntegerClassName)} key="bigInteger" style={{...itemCommonStyle}}>{integerPrice}</Text>,
87
86
  isBigPriceHasDecimal?
88
87
  <Text className={classNames(styles.childStyle, styles.bigStyle, styles.bigDecimal, sizeStyles['bigDecimal'], hitColorStyle, isPriceDescInFront ? null : styles.rightMargin, childrenClassName, bigDecimalClassName)} key="bigDecimal" style={{...itemCommonStyle}}>.{decimalPrice}</Text>
89
88
  :
90
89
  null
91
90
  ,
92
91
  !isOnlyShowBigPrice && [
93
92
  isPriceDescInFront && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.bigStyle, hitColorStyle, isPriceDescInFront ? styles.rightMargin : null, childrenClassName, priceDescClassName)} key="descFront" style={{...itemCommonStyle}}>{priceText}</Text>,
94
93
  smallPrice && !isHideSmallPrice ? <Text className={classNames(styles.childStyle, styles.smallPrice, sizeStyles['smallPrice'], styles.smallStyle, missColorStyle, childrenClassName, smallPriceClassName)} key="smallPrice" style={{...itemCommonStyle}}>¥{smallPrice}</Text> : null,
95
94
  !isPriceDescInFront && <Text className={classNames(styles.childStyle, styles.priceDesc, sizeStyles['priceDesc'], styles.smallStyle, styles.missPriceDesc, missColorStyle, childrenClassName, priceDescClassName)} key="descBack" style={{...itemCommonStyle}}>{priceText}</Text>
96
95
  ]
97
96
  ]
98
97
  }
99
98
  </View>
100
99
  )
100
+ import React from 'react';
101
101
  console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
102
102
  type,
103
103
  data,
104
104
  text,
105
105
  });
106
106
  sgmCustomReport({
107
107
  code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
108
108
  msg: {
109
109
  type,
110
110
  data,
111
111
  text: '[双价格组件]' + text,
112
112
  },
113
113
  });
114
114
  return rest.some((item) => item === undefined || item === '');
115
115
  const numPrice = Number(strPrice);
116
116
  if (isNaN(numPrice)) {
117
117
  reportException({
118
118
  type: 'isNotNumericType',
119
119
  data: props,
120
120
  text: `传入价格字段值“${strPrice}”转换数字报错`,
121
121
  });
122
122
  return false;
123
123
  }
124
124
  else if (numPrice <= 0) {
125
125
  reportException({
126
126
  type: 'isNotPositiveNumber',
127
127
  data: props,
128
128
  text: `传入价格字段值“${strPrice}”不是一个正数`,
129
129
  });
130
130
  return false;
131
131
  }
132
132
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
133
133
  if (result && result[3]?.length > 2) {
134
134
  reportException({
135
135
  type: 'decimalPlaceTooLong',
136
136
  data: props,
137
137
  text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
138
138
  });
139
139
  return false;
140
140
  }
141
141
  if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
142
142
  reportException({
143
143
  type: 'findScientificNotation',
144
144
  data: props,
145
145
  text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
146
146
  });
147
147
  }
148
148
  return true;
149
149
  const { jdPrice, finalPrice, forceShowFinalPrice } = props;
150
150
  if (jdPrice && finalPrice) {
151
151
  const getLastPassValidateState = forceShowFinalPrice || Number(finalPrice) < Number(jdPrice);
152
152
  !getLastPassValidateState &&
153
153
  reportException({
154
154
  type: 'pricesCompareException',
155
155
  data: props,
156
156
  text: `身份/到手价必须小于松果价`,
157
157
  });
158
158
  return getLastPassValidateState;
159
159
  } else {
160
160
  return true;
161
161
  }
162
162
  const numPrice = Number(strPrice);
163
163
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
164
164
  if (result) {
165
165
  return {
166
166
  integerPrice: result[1],
167
167
  decimalPrice: (result[3] || '').replace(/0+$/, ''),
168
168
  };
169
169
  } else {
170
170
  reportException({
171
171
  type: 'deconstructException',
172
172
  data: props,
173
173
  text: `解构传入价格字段值“${strPrice}”解构发生异常`,
174
174
  });
175
175
  return null;
176
176
  }
177
177
  const {
178
178
  jdPrice,
179
179
  finalPrice,
180
180
  priceText = '',
181
181
  priceTextColor = '',
182
182
  priceUnit = '',
183
183
  priceType,
184
184
  hitUserIdentity = false,
185
185
  forceShowFinalPrice = false,
186
186
  hideSmallPrice = false,
187
187
  fallbackRender = null,
188
188
  className = null,
189
189
  style = {},
190
190
  childrenClassName = null,
191
191
  bigNoPriceClassName = null,
192
192
  bigSymbolClassName = null,
193
193
  bigIntegerClassName = null,
194
194
  bigDecimalClassName = null,
195
195
  priceDescClassName = null,
196
196
  smallPriceClassName = null,
197
197
  smallPriceDescClassName = null,
198
198
  lineNumber = 1,
199
199
  size = 'M',
200
200
  isDefaultRemoveSmallPrice = false,
201
201
  useFontV2 = false,
202
202
  useFontV2Bold = false,
203
203
  useSmallFontV2 = false,
204
204
  useSmallFontV2Bold = false,
205
205
  } = props;
206
206
  let useBackstop = false;
207
207
  const isShowPriceUnit = priceUnit && priceUnit !== '';
208
208
  if (isNull(props.priceType)) {
209
209
  useBackstop = true;
210
210
  reportException({
211
211
  type: 'paramMiss',
212
212
  data: props,
213
213
  text: '缺少必要入参:priceType',
214
214
  });
215
215
  } else if (
216
216
  !allowedNoHitUserIdentityTypes.includes(props.priceType) &&
217
217
  props.hitUserIdentity === undefined
218
218
  ) {
219
219
  useBackstop = true;
220
220
  reportException({
221
221
  type: 'paramMiss',
222
222
  data: props,
223
223
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
224
224
  });
225
225
  }
226
226
  const especialHitStyleType = {
227
227
  7: 'plusStyle',
228
228
  9: 'samStyle',
229
229
  };
230
230
  const especialMissStyleType = {
231
231
  7: 'plusStyle',
232
232
  8: 'fansStyle',
233
233
  9: 'samStyle',
234
234
  10: 'studentStyle',
235
235
  12: 'yhdStyle',
236
236
  13: 'memberStyle',
237
237
  };
238
238
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
239
239
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
240
240
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
241
241
  const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
242
242
  const isHideSmallPrice =
243
243
  hideSmallPrice || priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
244
244
  const isTextPrice = priceType === 4;
245
245
  if (!isTextPrice && !useBackstop) {
246
246
  if (finalPrice && !numericPriceValidate(finalPrice, props)) {
247
247
  useBackstop = true;
248
248
  } else if (jdPrice && !numericPriceValidate(jdPrice, props)) {
249
249
  useBackstop = true;
250
250
  }
251
251
  if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
252
252
  useBackstop = true;
253
253
  }
254
254
  }
255
255
  const bigPriceObj =
256
256
  isTextPrice || useBackstop
257
257
  ? {}
258
258
  : getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
259
259
  const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
260
260
  const isPriceDescInFront = isEquivalentHit;
261
261
  const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
262
262
  const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
263
263
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
264
264
  const sizeLineHeight = {
265
265
  XS: 28,
266
266
  S: 34,
267
267
  M: 40,
268
268
  L: 46,
269
269
  XL: 52,
270
270
  };
271
271
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
272
272
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
273
273
  const computedHeightStyle = {
274
274
  height: wrapHeight,
275
275
  };
276
276
  const itemCommonStyle = {
277
277
  height: lineHeight,
278
278
  };
279
279
  const priceTextStyle = priceTextColor ? { color: priceTextColor } : {};
280
280
  const needSizeStyles = [
281
281
  'bigNoPrice',
282
282
  'bigSymbol',
283
283
  'bigInteger',
284
284
  'bigDecimal',
285
285
  'priceDesc',
286
286
  'smallPrice',
287
287
  'priceUnit',
288
288
  ];
289
289
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
290
290
  acc[cur] = styles[cur + size];
291
291
  return acc;
292
292
  }, {});
293
293
  const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
294
294
  const noPriceShowText =
295
295
  priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
296
296
  if (useBackstop && fallbackRender) {
297
297
  return fallbackRender;
298
298
  }
299
299
  return (
300
300
  <View
301
301
  className={classNames(styles.wrap, className)}
302
302
  style={{ ...computedHeightStyle, ...style }}
303
303
  >
304
304
  {isTextPrice || useBackstop ? (
305
305
  <Text
306
306
  className={classNames(
307
307
  styles.childStyle,
308
308
  styles.bigStyle,
309
309
  styles.bigNoPrice,
310
310
  sizeStyles['bigNoPrice'],
311
311
  childrenClassName,
312
312
  bigNoPriceClassName,
313
313
  )}
314
314
  style={{ ...itemCommonStyle }}
315
315
  >
316
316
  {useBackstop ? finalFallbackText : noPriceShowText}
317
317
  </Text>
318
318
  ) : (
319
319
  [
320
320
  <Text
321
321
  className={classNames(
322
322
  styles.childStyle,
323
323
  styles.bigStyle,
324
324
  styles.bigSymbol,
325
325
  sizeStyles['bigSymbol'],
326
326
  hitColorStyle,
327
327
  childrenClassName,
328
328
  bigSymbolClassName,
329
329
  {
330
330
  [styles.fontV2]: useFontV2,
331
331
  [styles.fontV2Bold]: useFontV2Bold,
332
332
  },
333
333
  )}
334
334
  key="bigSymbol"
335
335
  style={{ ...itemCommonStyle }}
336
336
  >
337
337
  ¥
338
338
  </Text>,
339
339
  <Text
340
340
  className={classNames(
341
341
  styles.childStyle,
342
342
  styles.bigStyle,
343
343
  styles.bigInteger,
344
344
  sizeStyles['bigInteger'],
345
345
  hitColorStyle,
346
346
  !isOnlyShowBigPrice &&
347
347
  !isBigPriceHasDecimal &&
348
348
  !isPriceDescInFront &&
349
349
  !isShowPriceUnit
350
350
  ? styles.rightMargin
351
351
  : null,
352
352
  childrenClassName,
353
353
  bigIntegerClassName,
354
354
  {
355
355
  [styles.fontV2]: useFontV2,
356
356
  [styles.fontV2Bold]: useFontV2Bold,
357
357
  },
358
358
  )}
359
359
  key="bigInteger"
360
360
  style={{ ...itemCommonStyle }}
361
361
  >
362
362
  {integerPrice}
363
363
  </Text>,
364
364
  isBigPriceHasDecimal ? (
365
365
  <Text
366
366
  className={classNames(
367
367
  styles.childStyle,
368
368
  styles.bigStyle,
369
369
  styles.bigDecimal,
370
370
  sizeStyles['bigDecimal'],
371
371
  hitColorStyle,
372
372
  isPriceDescInFront || priceText === '' || isShowPriceUnit
373
373
  ? null
374
374
  : styles.rightMargin,
375
375
  childrenClassName,
376
376
  bigDecimalClassName,
377
377
  {
378
378
  [styles.fontV2]: useFontV2,
379
379
  [styles.fontV2Bold]: useFontV2Bold,
380
380
  },
381
381
  )}
382
382
  key="bigDecimal"
383
383
  style={{ ...itemCommonStyle }}
384
384
  >
385
385
  .{decimalPrice}
386
386
  </Text>
387
387
  ) : null,
388
388
  isShowPriceUnit ? (
389
389
  <Text
390
390
  className={classNames(
391
391
  styles.childStyle,
392
392
  styles.priceUnit,
393
393
  styles.rightMargin,
394
394
  sizeStyles['priceUnit'],
395
395
  styles.bigStyle,
396
396
  hitColorStyle,
397
397
  childrenClassName,
398
398
  priceDescClassName,
399
399
  )}
400
400
  key="descFrontUnit"
401
401
  style={{ ...itemCommonStyle }}
402
402
  >
403
403
  {priceUnit}
404
404
  </Text>
405
405
  ) : null,
406
406
  !isOnlyShowBigPrice && [
407
407
  isPriceDescInFront && (
408
408
  <Text
409
409
  className={classNames(
410
410
  styles.childStyle,
411
411
  styles.priceDesc,
412
412
  {
413
413
  [styles['priceEnDesc']]: isLanguageForEn,
414
414
  },
415
415
  {
416
416
  [styles['priceHiddenDesc']]: priceText === '',
417
417
  },
418
418
  sizeStyles['priceDesc'],
419
419
  styles.bigStyle,
420
420
  hitColorStyle,
421
421
  isPriceDescInFront && !isShowPriceUnit && !isHideSmallPrice
422
422
  ? styles.rightMargin
423
423
  : null,
424
424
  childrenClassName,
425
425
  priceDescClassName,
426
426
  )}
427
427
  key="descFront"
428
428
  style={{ ...itemCommonStyle, ...priceTextStyle }}
429
429
  >
430
430
  {priceText === '' ? '_' : priceText}
431
431
  </Text>
432
432
  ),
433
433
  <View
434
434
  style={{
435
435
  display: 'inline-flex',
436
436
  }}
437
437
  >
438
438
  {smallPrice && !isHideSmallPrice ? (
439
439
  <Text
440
440
  className={classNames(
441
441
  styles.childStyle,
442
442
  styles.smallPrice,
443
443
  sizeStyles['smallPrice'],
444
444
  styles.smallStyle,
445
445
  missColorStyle,
446
446
  childrenClassName,
447
447
  smallPriceClassName,
448
448
  {
449
449
  [styles.fontV2]: useSmallFontV2Bold ? false : useSmallFontV2 || useFontV2,
450
450
  [styles.fontV2Bold]: useSmallFontV2
451
451
  ? false
452
452
  : useSmallFontV2Bold || useFontV2Bold,
453
453
  },
454
454
  )}
455
455
  key="smallPrice"
456
456
  style={{ ...itemCommonStyle }}
457
457
  >
458
458
  ¥{Number(smallPrice)}
459
459
  </Text>
460
460
  ) : null}
461
461
  {isShowPriceUnit && !isHideSmallPrice ? (
462
462
  <Text
463
463
  className={classNames(
464
464
  styles.childStyle,
465
465
  styles.priceUnit,
466
466
  sizeStyles['priceUnit'],
467
467
  styles.smallStyle,
468
468
  styles.missPriceDesc,
469
469
  missColorStyle,
470
470
  childrenClassName,
471
471
  smallPriceDescClassName || priceDescClassName,
472
472
  )}
473
473
  key="descFrontUnit"
474
474
  style={{ ...itemCommonStyle }}
475
475
  >
476
476
  {priceUnit}
477
477
  </Text>
478
478
  ) : null}
479
479
  {!isPriceDescInFront && !isHideSmallPrice && (
480
480
  <Text
481
481
  className={classNames(
482
482
  styles.childStyle,
483
483
  styles.priceDesc,
484
484
  {
485
485
  [styles['priceEnDesc']]: isLanguageForEn,
486
486
  },
487
487
  {
488
488
  [styles['priceHiddenDesc']]: priceText === '',
489
489
  },
490
490
  sizeStyles['priceDesc'],
491
491
  styles.smallStyle,
492
492
  styles.missPriceDesc,
493
493
  missColorStyle,
494
494
  childrenClassName,
495
495
  smallPriceDescClassName || priceDescClassName,
496
496
  )}
497
497
  key="descBack"
498
498
  style={{ ...itemCommonStyle }}
499
499
  >
500
500
  {priceText === '' ? '_' : priceText}
501
501
  </Text>
502
502
  )}
503
503
  </View>,
504
504
  ],
505
505
  ]
506
506
  )}
507
507
  </View>
508
508
  );
@@ -1 +1 @@
1
- import React from 'react'
2
1
  <BasePrice {...props}/>
3
2
  :
4
3
  <DoublePrice {...props} />
4
+ import React from 'react'
5
5
  if (props.priceType === undefined) {
6
6
  if (props.value === undefined) {
7
7
  if (props.jdPrice === undefined) {
8
8
  return null
9
9
  } else {
10
10
  return <BasePrice {...props} value={props.jdPrice} />
11
11
  }
12
12
  } else {
13
13
  return <BasePrice {...props} />
14
14
  }
15
15
  } else {
16
16
  return <DoublePrice {...props} />
17
17
  }
@@ -0,0 +1,35 @@
1
+
2
+ // 默认标签高度14 部分特殊的16,因此设置最大高度16
3
+
4
+ .d-shop-tag-list {
5
+ display: flex;
6
+ flex-direction: row;
7
+ flex-wrap: wrap;
8
+ justify-content: flex-start;
9
+ align-content: flex-start;
10
+ align-items: center;
11
+ align-self: flex-start;
12
+ overflow: hidden;
13
+ font-size: 0;
14
+ line-height: 10px; // 解决换行后上下无间隙导致看到线条的问题
15
+ max-height: 16PX;
16
+
17
+ &.d-shop-sku-tag-list{
18
+ margin: -2PX 8px 0 0;
19
+ display: inline-flex;
20
+ //height: 14PX;
21
+ //line-height: 14PX;
22
+ vertical-align: middle;
23
+ }
24
+
25
+ .d-tag-item{
26
+ margin-right: 8px;
27
+ &:last-child{
28
+ margin-right: 0;
29
+ }
30
+ .d-tag-item-canvas{
31
+ display: inline-flex;
32
+ height: 100%;
33
+ }
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ import React, { useMemo } from 'react';
2
  const getThisLeGaoTagKey = `${tagId}-${tagText}}`;
1
3
  const getLeGaoTagCacheNode = shopLeGaoTagNodeMap.get(getThisLeGaoTagKey) || false;
2
4
  return getLeGaoTagCacheNode
3
5
  ? getLeGaoTagCacheNode
4
6
  : useMemo(() => {
5
7
  const createCanVasTag = (
6
8
  <canvas-tag
7
9
  className={classNames(shopTagStyle['d-tag-item-canvas'])}
8
10
  tagId={tagId}
9
11
  text={tagText}
10
12
  appVersion={getJdAppVersionStr}
11
13
  lang={languageNowType}
12
14
  />
13
15
  );
14
16
  shopLeGaoTagNodeMap.set(getThisLeGaoTagKey, createCanVasTag);
15
17
  return createCanVasTag;
16
18
  }, [tagId, tagText]);
17
19
  const {
18
20
  tagInfoList = [],
19
21
  className,
20
22
  itemClassName,
21
23
  isSkuBaseTag = false,
22
24
  itemClickCallback,
23
25
  } = props;
24
26
  const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
25
27
  const getTagInfoListNum = getTagInfoList.length;
26
28
  const isCallBackFn = typeof itemClickCallback === 'function';
27
29
  return getTagInfoListNum > 0 ? (
28
30
  <View
29
31
  className={classNames(
30
32
  shopTagStyle['d-shop-tag-list'],
31
33
  {
32
34
  [shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag,
33
35
  },
34
36
  className,
35
37
  )}
36
38
  >
37
39
  {}
38
40
  <View style={{ width: '1px', height: '100%' }} />
39
41
  {getTagInfoList.map((item, index) => {
40
42
  const { tagId, tabIconId, tagText, type, tabIconType, tabText } = item;
41
43
  const getTagId = tagId || tabIconId;
42
44
  const getTagType = type || tabIconType;
43
45
  const getTagText = tagText || tabText;
44
46
  return getTagId ? (
45
47
  <View
46
48
  key={getTagId + getTagType + index}
47
49
  className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
48
50
  onClick={isCallBackFn && itemClickCallback.bind(this, item, index)}
49
51
  >
50
52
  <LeGaoTagComponent tagId={getTagId} tagText={getTagText} />
51
53
  </View>
52
54
  ) : null;
53
55
  })}
54
56
  </View>
55
57
  ) : null;
@@ -0,0 +1,33 @@
1
+
2
+ // 默认标签高度14 部分特殊的16,因此设置最大高度16
3
+
4
+ .d-shop-tag-list {
5
+ display: flex;
6
+ flex-direction: row;
7
+ flex-wrap: wrap;
8
+ justify-content: flex-start;
9
+ align-content: flex-start;
10
+ align-items: center;
11
+ align-self: flex-start;
12
+ overflow: hidden;
13
+ font-size: 0;
14
+ line-height: 10px; // 解决换行后上下无间隙导致看到线条的问题
15
+ max-height: 32px;
16
+
17
+ &.d-shop-sku-tag-list{
18
+ margin: -6px 8px 0 0;
19
+ display: inline-flex;
20
+ height: 28px;
21
+ line-height: 28px;
22
+ vertical-align: middle;
23
+ }
24
+ .d-tag-item{
25
+ display: inline-flex;
26
+ margin-right: 8px;
27
+ width: auto;
28
+ height: 28px;
29
+ &:last-child{
30
+ margin-right: 0;
31
+ }
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ import React from 'react';
2
  "tab_054": "https://m.360buyimg.com/cc/jfs/t1/88382/20/39502/894/64d36235Fc720ec9d/908e4378fec75555.png",
1
3
  "tab_054_home": "https://m.360buyimg.com/cc/jfs/t1/88382/20/39502/894/64d36235Fc720ec9d/908e4378fec75555.png",
2
4
  "tab_665": "https://m.360buyimg.com/cc/jfs/t1/252765/17/9937/2555/677c9155F246ead31/55243d94eb9ca8db.png",
3
5
  "tab_6209_dp": "https://m.360buyimg.com/cc/jfs/t1/252765/17/9937/2555/677c9155F246ead31/55243d94eb9ca8db.png",
4
6
  const { tagInfoList = [], className, itemClassName, isSkuBaseTag = false } = props;
5
7
  const getTagInfoList = Array.isArray(tagInfoList) ? tagInfoList : [];
6
8
  const getTagInfoListNum = getTagInfoList.length;
7
9
  return getTagInfoListNum > 0 ? (
8
10
  <View className={classNames(shopTagStyle['d-shop-tag-list'],{
9
11
  [shopTagStyle['d-shop-sku-tag-list']]: isSkuBaseTag
10
12
  }, className)}>
11
13
  {}
12
14
  <View style={{ width: '1px', height: '100%' }} />
13
15
  {getTagInfoList.map((item, index) => {
14
16
  const { tabIconId,tagId, tabImageUrl,type, tabIconType} = item;
15
17
  const getTagId = tagId || tabIconId;
16
18
  const getTagType = type || tabIconType;
17
19
  const getUrl =
18
20
  typeof tabImageUrl === 'string' ? tabImageUrl : shopTagIconDefaultUrl[getTagId];
19
21
  return getUrl && getUrl !== "" ? (
20
22
  <Image
21
23
  key={index + getTagId + getTagType}
22
24
  className={classNames(shopTagStyle['d-tag-item'], itemClassName)}
23
25
  mode="heightFix"
24
26
  src={getUrl}
25
27
  />
26
28
  ) : null;
27
29
  })}
28
30
  </View>
29
31
  ) : null;