@conecli/cone-render 0.8.19 → 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 (183) 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/isvStorage/index.h5.ts +1 -0
  11. package/dist/common/isvStorage/index.ts +1 -0
  12. package/dist/common/jdplayerSdk.ts +1 -0
  13. package/dist/common/jssdk.ts +1 -0
  14. package/dist/common/pageType.ts +1 -0
  15. package/dist/common/sgmCustomCode.ts +1 -0
  16. package/dist/common/token/const.ts +1 -0
  17. package/dist/common/token/index.h5.ts +1 -0
  18. package/dist/common/token/index.ts +1 -0
  19. package/dist/common/token/token.jd.ts +1 -0
  20. package/dist/common/token/token.ts +1 -0
  21. package/dist/common/token/token.wxapp.ts +1 -0
  22. package/dist/common/wxappApi.jd.ts +1 -0
  23. package/dist/common/wxappApi.ts +1 -1
  24. package/dist/components/ErrorBoundary.tsx +1 -1
  25. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  26. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  27. package/dist/components/base/CountDown/index.module.scss +49 -44
  28. package/dist/components/base/CountDown/index.tsx +1 -1
  29. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  30. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  31. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  32. package/dist/components/base/CustomVideo/common.ts +1 -0
  33. package/dist/components/base/CustomVideo/const.ts +1 -0
  34. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  35. package/dist/components/base/CustomVideo/index.tsx +1 -1
  36. package/dist/components/base/Dialog/index.module.scss +22 -2
  37. package/dist/components/base/Dialog/index.tsx +1 -1
  38. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  39. package/dist/components/base/ExposureSmart/const.ts +1 -0
  40. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  41. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  42. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  43. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  44. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  45. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  46. package/dist/components/base/InViewRender/index.tsx +1 -1
  47. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  48. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  49. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  50. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  51. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  52. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  53. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  54. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  55. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  56. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  57. package/dist/components/base/NetworkDataError/const.ts +1 -1
  58. package/dist/components/base/NetworkDataError/index.module.scss +128 -69
  59. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  60. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  61. package/dist/components/base/Price/Base/index.module.scss +148 -0
  62. package/dist/components/base/Price/Base/index.tsx +1 -0
  63. package/dist/components/base/Price/Double/index.module.scss +190 -0
  64. package/dist/components/base/Price/Double/index.tsx +1 -0
  65. package/dist/components/base/Price/index.tsx +1 -1
  66. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  67. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  68. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  69. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  70. package/dist/components/base/Skeleton/index.tsx +1 -1
  71. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  72. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  73. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  74. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  75. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  76. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  77. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  78. package/dist/components/floorItem.jd.tsx +1 -0
  79. package/dist/components/floorItem.tsx +1 -1
  80. package/dist/components/floorItem.weapp.tsx +1 -1
  81. package/dist/components/isv/Floor/index.tsx +1 -1
  82. package/dist/components/remoteFloorItem.tsx +1 -0
  83. package/dist/interface/common.ts +1 -1
  84. package/dist/interface/component.ts +1 -1
  85. package/dist/interface/jumpEventReport.ts +1 -1
  86. package/dist/interface/service.ts +1 -1
  87. package/dist/interface/utils.ts +1 -1
  88. package/dist/jumpEventReport/base.ts +1 -1
  89. package/dist/jumpEventReport/const.ts +1 -1
  90. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  91. package/dist/jumpEventReport/index.h5.ts +1 -1
  92. package/dist/jumpEventReport/index.jd.ts +1 -1
  93. package/dist/jumpEventReport/index.ts +1 -1
  94. package/dist/jumpEventReport/index.weapp.ts +1 -1
  95. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  96. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  97. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  98. package/dist/jumpEventReport/web/report.ts +1 -1
  99. package/dist/jumpEventReport/web.base.ts +1 -1
  100. package/dist/jumpEventReport/web.jd.ts +1 -1
  101. package/dist/jumpEventReport/web.jdb.ts +1 -0
  102. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  103. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  104. package/dist/jumpEventReport/web.pc.ts +1 -0
  105. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  106. package/dist/jumpEventReport/web.tjm.ts +1 -0
  107. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  108. package/dist/language/en_US.json +231 -0
  109. package/dist/language/zh_CN.json +231 -0
  110. package/dist/language/zh_HK.json +231 -0
  111. package/dist/libs/taroAppReport.js +2 -2
  112. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  113. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  114. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  115. package/dist/open/api/device.ts +1 -1
  116. package/dist/open/api/environment.ts +1 -1
  117. package/dist/open/api/index.ts +1 -1
  118. package/dist/open/api/jump/business.ts +1 -0
  119. package/dist/open/api/jump/index.ts +1 -0
  120. package/dist/open/api/jump/minPath.ts +1 -0
  121. package/dist/open/api/jump/side.ts +1 -0
  122. package/dist/open/api/jump/webUrl.ts +1 -0
  123. package/dist/open/api/jump copy.ts +1 -0
  124. package/dist/open/api/moduleUtil.ts +1 -1
  125. package/dist/open/api/request.ts +1 -0
  126. package/dist/open/api/shopMember.ts +1 -0
  127. package/dist/open/api/track.ts +1 -1
  128. package/dist/open/api/userToken.ts +1 -0
  129. package/dist/open/api/util.ts +1 -1
  130. package/dist/open/components/index.ts +1 -1
  131. package/dist/sass/app.h5.scss +294 -212
  132. package/dist/sass/base.scss +195 -137
  133. package/dist/service/bMallConst.ts +1 -0
  134. package/dist/service/bMallConst.weapp.ts +1 -0
  135. package/dist/service/fetchGateway.ts +1 -0
  136. package/dist/service/fetchGateway.weapp.ts +1 -0
  137. package/dist/service/fetchJsonp.ts +1 -0
  138. package/dist/service/http/colorSign.ts +1 -0
  139. package/dist/service/http/colorSign.weapp.ts +1 -0
  140. package/dist/service/http/const.ts +1 -0
  141. package/dist/service/http/h5Http.ts +1 -0
  142. package/dist/service/http/http.ts +1 -0
  143. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  144. package/dist/service/http/httpInterceptors.ts +1 -0
  145. package/dist/service/http/index.h5.ts +1 -0
  146. package/dist/service/http/index.ts +1 -0
  147. package/dist/service/requestServer.h5.ts +1 -0
  148. package/dist/service/requestServer.ts +1 -0
  149. package/dist/service/requestServer.weapp.ts +1 -0
  150. package/dist/utils/connectNativeJsBridge.ts +1 -1
  151. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  152. package/dist/utils/draExceptionAndProfile.ts +1 -1
  153. package/dist/utils/h5Utils.ts +1 -1
  154. package/dist/utils/index.h5.ts +1 -1
  155. package/dist/utils/index.ts +1 -1
  156. package/dist/utils/index.weapp.ts +1 -1
  157. package/dist/utils/intersectionObserver.ts +1 -1
  158. package/dist/utils/jm-common.js +1 -1
  159. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  160. package/dist/utils/jumpExtMapUtil.ts +1 -0
  161. package/dist/utils/priceUtils.js +1 -0
  162. package/dist/utils/ready.ts +1 -0
  163. package/dist/utils/sColor.js +1 -0
  164. package/dist/utils/sgmCodeUtils.ts +1 -0
  165. package/dist/utils/taroRenderUtil.ts +1 -0
  166. package/dist/utils/utils.ts +1 -1
  167. package/dist/wxapp/api/helper.js +1 -0
  168. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  169. package/dist/wxapp/common/user_info.js +1 -1
  170. package/dist/wxapp/components/launch-app/index.js +1 -0
  171. package/dist/wxapp/components/launch-app/index.json +5 -0
  172. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  173. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  174. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  175. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  176. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  177. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  178. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  179. package/package.json +145 -114
  180. package/dist/components/base/Price/index.module.scss +0 -136
  181. package/dist/components/base/Skeleton/old.tsx +0 -1
  182. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  183. package/dist/open/api/jump.ts +0 -1
@@ -0,0 +1,190 @@
1
+ .wrap {
2
+ overflow: hidden;
3
+ display: flex;
4
+ flex-direction: row;
5
+ flex-wrap: wrap;
6
+ align-items: baseline;
7
+ line-height: 0; // 这个是保障不同平台(IOS、Android),不同font-size下多个行内元素文案底部还能对齐的基石
8
+ }
9
+ .childStyle {
10
+ transform: translateY(50%);
11
+ }
12
+ .bigStyle {
13
+ color: #fa2c19;
14
+ }
15
+
16
+ .bigNoPrice {
17
+ font-family: PingFang SC;
18
+ }
19
+ .bigNoPriceXL {
20
+ font-size: 48px;
21
+ }
22
+ .bigNoPriceL {
23
+ font-size: 42px;
24
+ }
25
+ .bigNoPriceM {
26
+ font-size: 36px;
27
+ }
28
+ .bigNoPriceS {
29
+ font-size: 30px;
30
+ }
31
+ .bigNoPriceXS {
32
+ font-size: 24px;
33
+ }
34
+
35
+ .bigSymbol {
36
+ font-family: JDZhengHT-Regular;
37
+ }
38
+ .bigSymbolXL {
39
+ font-size: 28px;
40
+ }
41
+ .bigSymbolL {
42
+ font-size: 26px;
43
+ }
44
+ .bigSymbolM {
45
+ font-size: 24px;
46
+ }
47
+ .bigSymbolS {
48
+ font-size: 22px;
49
+ }
50
+ .bigSymbolXS {
51
+ font-size: 20px;
52
+ }
53
+
54
+ .bigInteger {
55
+ font-family: JDZhengHT-Regular;
56
+ }
57
+ .bigIntegerXL {
58
+ font-size: 52px;
59
+ }
60
+ .bigIntegerL {
61
+ font-size: 46px;
62
+ }
63
+ .bigIntegerM {
64
+ font-size: 40px;
65
+ }
66
+ .bigIntegerS {
67
+ font-size: 34px;
68
+ }
69
+ .bigIntegerXS {
70
+ font-size: 28px;
71
+ }
72
+
73
+ .bigDecimal {
74
+ font-family: JDZhengHT-Regular;
75
+ }
76
+
77
+ .bigDecimalXL {
78
+ font-size: 28px;
79
+ }
80
+ .bigDecimalL {
81
+ font-size: 26px;
82
+ }
83
+ .bigDecimalM {
84
+ font-size: 24px;
85
+ }
86
+ .bigDecimalS {
87
+ font-size: 22px;
88
+ }
89
+ .bigDecimalXS {
90
+ font-size: 20px;
91
+ }
92
+
93
+ .priceDesc {
94
+ margin-left: 4px;
95
+ font-family: PingFang SC;
96
+ &.priceHiddenDesc {
97
+ width: 0;
98
+ visibility: hidden;
99
+ }
100
+ &.priceEnDesc {
101
+ width: 0;
102
+ visibility: hidden;
103
+ }
104
+ }
105
+ .priceDescXL {
106
+ font-size: 28px;
107
+ }
108
+ .priceDescL {
109
+ font-size: 26px;
110
+ }
111
+ .priceDescM {
112
+ font-size: 24px;
113
+ }
114
+ .priceDescS {
115
+ font-size: 22px;
116
+ }
117
+ .priceDescXS {
118
+ font-size: 20px;
119
+ }
120
+ .priceUnit {
121
+ font-family: PingFang SC;
122
+ }
123
+ .priceUnitXL {
124
+ font-size: 26px;
125
+ }
126
+ .priceUnitL {
127
+ font-size: 24px;
128
+ }
129
+ .priceUnitM {
130
+ font-size: 22px;
131
+ }
132
+ .priceUnitS {
133
+ font-size: 20px;
134
+ }
135
+ .priceUnitXS {
136
+ font-size: 18px;
137
+ }
138
+
139
+ .missPriceDesc {
140
+ }
141
+ .smallStyle {
142
+ color: #8c8c8c;
143
+ }
144
+
145
+ .smallPrice {
146
+ font-family: JDZhengHT-Regular;
147
+ }
148
+ .smallPriceXL {
149
+ font-size: 28px;
150
+ }
151
+ .smallPriceL {
152
+ font-size: 26px;
153
+ }
154
+ .smallPriceM {
155
+ font-size: 24px;
156
+ }
157
+ .smallPriceS {
158
+ font-size: 22px;
159
+ }
160
+ .smallPriceXS {
161
+ font-size: 20px;
162
+ }
163
+
164
+ .rightMargin {
165
+ margin-right: 16px;
166
+ }
167
+ .plusStyle {
168
+ color: #1c4b8c;
169
+ }
170
+ .fansStyle {
171
+ color: #8450e5;
172
+ }
173
+ .samStyle {
174
+ color: #3981e5;
175
+ }
176
+ .studentStyle {
177
+ color: #30bf26;
178
+ }
179
+ .yhdStyle {
180
+ color: #674431;
181
+ }
182
+ .memberStyle {
183
+ color: #f6b303;
184
+ }
185
+ .fontV2 {
186
+ font-family: 'JDZhengHeiV2-Regular';
187
+ }
188
+ .fontV2Bold {
189
+ font-family: 'JDZhengHeiV2-Bold';
190
+ }
@@ -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, forceShowFinalPrice } = props;
49
51
  if (jdPrice && finalPrice) {
50
52
  const getLastPassValidateState = forceShowFinalPrice || Number(finalPrice) < Number(jdPrice);
51
53
  !getLastPassValidateState &&
52
54
  reportException({
53
55
  type: 'pricesCompareException',
54
56
  data: props,
55
57
  text: `身份/到手价必须小于松果价`,
56
58
  });
57
59
  return getLastPassValidateState;
58
60
  } else {
59
61
  return true;
60
62
  }
61
63
  const numPrice = Number(strPrice);
62
64
  const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
63
65
  if (result) {
64
66
  return {
65
67
  integerPrice: result[1],
66
68
  decimalPrice: (result[3] || '').replace(/0+$/, ''),
67
69
  };
68
70
  } else {
69
71
  reportException({
70
72
  type: 'deconstructException',
71
73
  data: props,
72
74
  text: `解构传入价格字段值“${strPrice}”解构发生异常`,
73
75
  });
74
76
  return null;
75
77
  }
76
78
  const {
77
79
  jdPrice,
78
80
  finalPrice,
79
81
  priceText = '',
80
82
  priceTextColor = '',
81
83
  priceUnit = '',
82
84
  priceType,
83
85
  hitUserIdentity = false,
84
86
  forceShowFinalPrice = false,
85
87
  hideSmallPrice = false,
86
88
  fallbackRender = null,
87
89
  className = null,
88
90
  style = {},
89
91
  childrenClassName = null,
90
92
  bigNoPriceClassName = null,
91
93
  bigSymbolClassName = null,
92
94
  bigIntegerClassName = null,
93
95
  bigDecimalClassName = null,
94
96
  priceDescClassName = null,
95
97
  smallPriceClassName = null,
96
98
  smallPriceDescClassName = null,
97
99
  lineNumber = 1,
98
100
  size = 'M',
99
101
  isDefaultRemoveSmallPrice = false,
100
102
  useFontV2 = false,
101
103
  useFontV2Bold = false,
102
104
  useSmallFontV2 = false,
103
105
  useSmallFontV2Bold = false,
104
106
  } = props;
105
107
  let useBackstop = false;
106
108
  const isShowPriceUnit = priceUnit && priceUnit !== '';
107
109
  if (isNull(props.priceType)) {
108
110
  useBackstop = true;
109
111
  reportException({
110
112
  type: 'paramMiss',
111
113
  data: props,
112
114
  text: '缺少必要入参:priceType',
113
115
  });
114
116
  } else if (
115
117
  !allowedNoHitUserIdentityTypes.includes(props.priceType) &&
116
118
  props.hitUserIdentity === undefined
117
119
  ) {
118
120
  useBackstop = true;
119
121
  reportException({
120
122
  type: 'paramMiss',
121
123
  data: props,
122
124
  text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
123
125
  });
124
126
  }
125
127
  const especialHitStyleType = {
126
128
  7: 'plusStyle',
127
129
  9: 'samStyle',
128
130
  };
129
131
  const especialMissStyleType = {
130
132
  7: 'plusStyle',
131
133
  8: 'fansStyle',
132
134
  9: 'samStyle',
133
135
  10: 'studentStyle',
134
136
  12: 'yhdStyle',
135
137
  13: 'memberStyle',
136
138
  };
137
139
  const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
138
140
  const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
139
141
  const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
140
142
  const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
141
143
  const isHideSmallPrice =
142
144
  hideSmallPrice || priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
143
145
  const isTextPrice = priceType === 4;
144
146
  if (!isTextPrice && !useBackstop) {
145
147
  if (finalPrice && !numericPriceValidate(finalPrice, props)) {
146
148
  useBackstop = true;
147
149
  } else if (jdPrice && !numericPriceValidate(jdPrice, props)) {
148
150
  useBackstop = true;
149
151
  }
150
152
  if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
151
153
  useBackstop = true;
152
154
  }
153
155
  }
154
156
  const bigPriceObj =
155
157
  isTextPrice || useBackstop
156
158
  ? {}
157
159
  : getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
158
160
  const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
159
161
  const isPriceDescInFront = isEquivalentHit;
160
162
  const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
161
163
  const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
162
164
  const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
163
165
  const sizeLineHeight = {
164
166
  XS: 28,
165
167
  S: 34,
166
168
  M: 40,
167
169
  L: 46,
168
170
  XL: 52,
169
171
  };
170
172
  const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
171
173
  const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
172
174
  const computedHeightStyle = {
173
175
  height: wrapHeight,
174
176
  };
175
177
  const itemCommonStyle = {
176
178
  height: lineHeight,
177
179
  };
178
180
  const priceTextStyle = priceTextColor ? { color: priceTextColor } : {};
179
181
  const needSizeStyles = [
180
182
  'bigNoPrice',
181
183
  'bigSymbol',
182
184
  'bigInteger',
183
185
  'bigDecimal',
184
186
  'priceDesc',
185
187
  'smallPrice',
186
188
  'priceUnit',
187
189
  ];
188
190
  const sizeStyles = needSizeStyles.reduce((acc, cur) => {
189
191
  acc[cur] = styles[cur + size];
190
192
  return acc;
191
193
  }, {});
192
194
  const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
193
195
  const noPriceShowText =
194
196
  priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
195
197
  if (useBackstop && fallbackRender) {
196
198
  return fallbackRender;
197
199
  }
198
200
  return (
199
201
  <View
200
202
  className={classNames(styles.wrap, className)}
201
203
  style={{ ...computedHeightStyle, ...style }}
202
204
  >
203
205
  {isTextPrice || useBackstop ? (
204
206
  <Text
205
207
  className={classNames(
206
208
  styles.childStyle,
207
209
  styles.bigStyle,
208
210
  styles.bigNoPrice,
209
211
  sizeStyles['bigNoPrice'],
210
212
  childrenClassName,
211
213
  bigNoPriceClassName,
212
214
  )}
213
215
  style={{ ...itemCommonStyle }}
214
216
  >
215
217
  {useBackstop ? finalFallbackText : noPriceShowText}
216
218
  </Text>
217
219
  ) : (
218
220
  [
219
221
  <Text
220
222
  className={classNames(
221
223
  styles.childStyle,
222
224
  styles.bigStyle,
223
225
  styles.bigSymbol,
224
226
  sizeStyles['bigSymbol'],
225
227
  hitColorStyle,
226
228
  childrenClassName,
227
229
  bigSymbolClassName,
228
230
  {
229
231
  [styles.fontV2]: useFontV2,
230
232
  [styles.fontV2Bold]: useFontV2Bold,
231
233
  },
232
234
  )}
233
235
  key="bigSymbol"
234
236
  style={{ ...itemCommonStyle }}
235
237
  >
236
238
  ¥
237
239
  </Text>,
238
240
  <Text
239
241
  className={classNames(
240
242
  styles.childStyle,
241
243
  styles.bigStyle,
242
244
  styles.bigInteger,
243
245
  sizeStyles['bigInteger'],
244
246
  hitColorStyle,
245
247
  !isOnlyShowBigPrice &&
246
248
  !isBigPriceHasDecimal &&
247
249
  !isPriceDescInFront &&
248
250
  !isShowPriceUnit
249
251
  ? styles.rightMargin
250
252
  : null,
251
253
  childrenClassName,
252
254
  bigIntegerClassName,
253
255
  {
254
256
  [styles.fontV2]: useFontV2,
255
257
  [styles.fontV2Bold]: useFontV2Bold,
256
258
  },
257
259
  )}
258
260
  key="bigInteger"
259
261
  style={{ ...itemCommonStyle }}
260
262
  >
261
263
  {integerPrice}
262
264
  </Text>,
263
265
  isBigPriceHasDecimal ? (
264
266
  <Text
265
267
  className={classNames(
266
268
  styles.childStyle,
267
269
  styles.bigStyle,
268
270
  styles.bigDecimal,
269
271
  sizeStyles['bigDecimal'],
270
272
  hitColorStyle,
271
273
  isPriceDescInFront || priceText === '' || isShowPriceUnit
272
274
  ? null
273
275
  : styles.rightMargin,
274
276
  childrenClassName,
275
277
  bigDecimalClassName,
276
278
  {
277
279
  [styles.fontV2]: useFontV2,
278
280
  [styles.fontV2Bold]: useFontV2Bold,
279
281
  },
280
282
  )}
281
283
  key="bigDecimal"
282
284
  style={{ ...itemCommonStyle }}
283
285
  >
284
286
  .{decimalPrice}
285
287
  </Text>
286
288
  ) : null,
287
289
  isShowPriceUnit ? (
288
290
  <Text
289
291
  className={classNames(
290
292
  styles.childStyle,
291
293
  styles.priceUnit,
292
294
  styles.rightMargin,
293
295
  sizeStyles['priceUnit'],
294
296
  styles.bigStyle,
295
297
  hitColorStyle,
296
298
  childrenClassName,
297
299
  priceDescClassName,
298
300
  )}
299
301
  key="descFrontUnit"
300
302
  style={{ ...itemCommonStyle }}
301
303
  >
302
304
  {priceUnit}
303
305
  </Text>
304
306
  ) : null,
305
307
  !isOnlyShowBigPrice && [
306
308
  isPriceDescInFront && (
307
309
  <Text
308
310
  className={classNames(
309
311
  styles.childStyle,
310
312
  styles.priceDesc,
311
313
  {
312
314
  [styles['priceEnDesc']]: isLanguageForEn,
313
315
  },
314
316
  {
315
317
  [styles['priceHiddenDesc']]: priceText === '',
316
318
  },
317
319
  sizeStyles['priceDesc'],
318
320
  styles.bigStyle,
319
321
  hitColorStyle,
320
322
  isPriceDescInFront && !isShowPriceUnit && !isHideSmallPrice
321
323
  ? styles.rightMargin
322
324
  : null,
323
325
  childrenClassName,
324
326
  priceDescClassName,
325
327
  )}
326
328
  key="descFront"
327
329
  style={{ ...itemCommonStyle, ...priceTextStyle }}
328
330
  >
329
331
  {priceText === '' ? '_' : priceText}
330
332
  </Text>
331
333
  ),
332
334
  <View
333
335
  style={{
334
336
  display: 'inline-flex',
335
337
  }}
336
338
  >
337
339
  {smallPrice && !isHideSmallPrice ? (
338
340
  <Text
339
341
  className={classNames(
340
342
  styles.childStyle,
341
343
  styles.smallPrice,
342
344
  sizeStyles['smallPrice'],
343
345
  styles.smallStyle,
344
346
  missColorStyle,
345
347
  childrenClassName,
346
348
  smallPriceClassName,
347
349
  {
348
350
  [styles.fontV2]: useSmallFontV2Bold ? false : useSmallFontV2 || useFontV2,
349
351
  [styles.fontV2Bold]: useSmallFontV2
350
352
  ? false
351
353
  : useSmallFontV2Bold || useFontV2Bold,
352
354
  },
353
355
  )}
354
356
  key="smallPrice"
355
357
  style={{ ...itemCommonStyle }}
356
358
  >
357
359
  ¥{Number(smallPrice)}
358
360
  </Text>
359
361
  ) : null}
360
362
  {isShowPriceUnit && !isHideSmallPrice ? (
361
363
  <Text
362
364
  className={classNames(
363
365
  styles.childStyle,
364
366
  styles.priceUnit,
365
367
  sizeStyles['priceUnit'],
366
368
  styles.smallStyle,
367
369
  styles.missPriceDesc,
368
370
  missColorStyle,
369
371
  childrenClassName,
370
372
  smallPriceDescClassName || priceDescClassName,
371
373
  )}
372
374
  key="descFrontUnit"
373
375
  style={{ ...itemCommonStyle }}
374
376
  >
375
377
  {priceUnit}
376
378
  </Text>
377
379
  ) : null}
378
380
  {!isPriceDescInFront && !isHideSmallPrice && (
379
381
  <Text
380
382
  className={classNames(
381
383
  styles.childStyle,
382
384
  styles.priceDesc,
383
385
  {
384
386
  [styles['priceEnDesc']]: isLanguageForEn,
385
387
  },
386
388
  {
387
389
  [styles['priceHiddenDesc']]: priceText === '',
388
390
  },
389
391
  sizeStyles['priceDesc'],
390
392
  styles.smallStyle,
391
393
  styles.missPriceDesc,
392
394
  missColorStyle,
393
395
  childrenClassName,
394
396
  smallPriceDescClassName || priceDescClassName,
395
397
  )}
396
398
  key="descBack"
397
399
  style={{ ...itemCommonStyle }}
398
400
  >
399
401
  {priceText === '' ? '_' : priceText}
400
402
  </Text>
401
403
  )}
402
404
  </View>,
403
405
  ],
404
406
  ]
405
407
  )}
406
408
  </View>
407
409
  );
@@ -1 +1 @@
1
- import React from 'react'
2
1
  priceLabelText: "到手价"
2
+ import React from 'react'
3
3
  if (props.priceType === undefined) {
4
4
  if (props.value === undefined) {
5
5
  if (props.jdPrice === undefined) {
6
6
  return null
7
7
  } else {
8
8
  return <BasePrice {...props} value={props.jdPrice} />
9
9
  }
10
10
  } else {
11
11
  return <BasePrice {...props} />
12
12
  }
13
13
  } else {
14
14
  return <DoublePrice {...props} />
15
15
  }
@@ -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;