@conecli/cone-render 0.10.1-shop3.14 → 0.10.1-shop3.140
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.
- package/README.md +1 -1
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +1 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ascf.ts +1 -0
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CountDownForApp/index.module.scss +52 -0
- package/dist/components/base/CountDownForApp/index.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.module.scss +9 -9
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +26 -2
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/config/env.ts +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +398 -0
- package/dist/language/zh_CN.json +398 -0
- package/dist/language/zh_HK.json +398 -0
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +12 -1
- package/dist/sass/base.scss +8 -4
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/dist/wxapp/pages/shopx/prefetch.js +1 -0
- package/package.json +169 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
- /package/dist/utils/{sColor.js → sColor.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import { Button, View } from '@tarojs/components'
|
|
2
1
|
NetWorkErrorList,
|
|
3
2
|
NetWorkErrorTip,
|
|
4
3
|
NetWorkErrorSubTip,
|
|
5
4
|
NetWorkShowType,
|
|
6
5
|
NetWork_Image_Type,
|
|
7
6
|
const {
|
|
8
7
|
className = '',
|
|
9
8
|
message = '',
|
|
10
9
|
subMessage = '',
|
|
11
10
|
btnLabel = '重新加载',
|
|
12
11
|
backgroundColorWhite = false,
|
|
13
12
|
netWorkDataType = NETWORK_DATA_TYPE.NORMAL,
|
|
14
13
|
netWorkImageType = NetWork_Image_Type.No_Data_Default_Tip,
|
|
15
14
|
netWorkShowType = NetWorkShowType.FULL,
|
|
16
15
|
refreshCallBackFn = null,
|
|
17
16
|
viewMaxHeight = '',
|
|
18
17
|
noPosition = false,
|
|
19
18
|
} = props
|
|
20
19
|
const refershInitData = useCallback(() => {
|
|
21
20
|
refreshCallBackFn && refreshCallBackFn(true)
|
|
22
21
|
}, [])
|
|
23
22
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
|
|
24
23
|
const useErrorSubTip = subMessage
|
|
25
24
|
? subMessage
|
|
26
25
|
: NetWorkErrorSubTip[netWorkDataType]
|
|
27
26
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
28
27
|
const maxHeight = latestRes.displayHeight || 546
|
|
29
28
|
return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
|
|
30
29
|
<View
|
|
31
30
|
style={{
|
|
32
31
|
maxHeight:
|
|
33
32
|
viewMaxHeight !== ''
|
|
34
33
|
? viewMaxHeight
|
|
35
34
|
: isMemberPage || isAppStowShop
|
|
36
35
|
? '100vh'
|
|
37
36
|
: maxHeight,
|
|
38
37
|
}}
|
|
39
38
|
className={classNames(
|
|
40
39
|
netWorkErrorStyle['d-shop-network'],
|
|
41
40
|
{
|
|
42
41
|
[netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
|
|
43
42
|
},
|
|
44
43
|
{
|
|
45
44
|
[netWorkErrorStyle['d-shop-network-part']]:
|
|
46
45
|
netWorkShowType === NetWorkShowType.PART,
|
|
47
46
|
},
|
|
48
47
|
{
|
|
49
48
|
[netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
|
|
50
49
|
},
|
|
51
50
|
{
|
|
52
51
|
[netWorkErrorStyle['d-shop-network-no-position']]: noPosition,
|
|
53
52
|
},
|
|
54
53
|
'flexible-center-box',
|
|
55
54
|
className,
|
|
56
55
|
)}
|
|
57
56
|
>
|
|
58
57
|
<View
|
|
59
58
|
className={classNames(
|
|
60
59
|
netWorkErrorStyle['d-error-content'],
|
|
61
60
|
'd-error-content',
|
|
62
61
|
)}
|
|
63
62
|
>
|
|
64
63
|
<View
|
|
65
64
|
className={classNames(
|
|
66
65
|
netWorkErrorStyle['d-error-type'],
|
|
67
66
|
netWorkErrorStyle[`d-${netWorkDataType}`],
|
|
68
67
|
netWorkErrorStyle[`d-${netWorkImageType}`],
|
|
69
68
|
'd-error-type',
|
|
70
69
|
)}
|
|
71
70
|
/>
|
|
72
71
|
<View
|
|
73
72
|
className={classNames(
|
|
74
73
|
netWorkErrorStyle['d-error-tip'],
|
|
75
74
|
'd-error-tip',
|
|
76
75
|
)}
|
|
77
76
|
>
|
|
78
77
|
{useErrorTip}
|
|
79
78
|
</View>
|
|
80
79
|
{useErrorSubTip ? (
|
|
81
80
|
<View
|
|
82
81
|
className={classNames(
|
|
83
82
|
netWorkErrorStyle['d-error-sub-tip'],
|
|
84
83
|
'd-error-sub-tip',
|
|
85
84
|
)}
|
|
86
85
|
>
|
|
87
86
|
{useErrorSubTip}
|
|
88
87
|
</View>
|
|
89
88
|
) : null}
|
|
90
89
|
<View className={'flexible-horizontal-center-box'}>
|
|
91
90
|
{refreshCallBackFn && (
|
|
92
91
|
<Button
|
|
93
92
|
onClick={refershInitData}
|
|
94
93
|
className={classNames(
|
|
95
94
|
netWorkErrorStyle['d-opt-btn'],
|
|
96
95
|
'd-button-no-border',
|
|
97
96
|
'd-opt-btn',
|
|
98
97
|
)}
|
|
99
98
|
plain
|
|
100
99
|
size="mini"
|
|
101
100
|
>
|
|
102
101
|
{btnLabel}
|
|
103
102
|
</Button>
|
|
104
103
|
)}
|
|
105
104
|
</View>
|
|
106
105
|
</View>
|
|
107
106
|
</View>
|
|
108
107
|
) : null
|
|
108
|
+
import { Button, View } from '@tarojs/components';
|
|
109
109
|
NetWorkErrorList,
|
|
110
110
|
NetWorkErrorTip,
|
|
111
111
|
NetWorkErrorSubTip,
|
|
112
112
|
NetWorkShowType,
|
|
113
113
|
NetWork_Image_Type,
|
|
114
114
|
NetWorkStyleType,
|
|
115
115
|
netWorkDataDraType,
|
|
116
116
|
const {
|
|
117
117
|
className = '',
|
|
118
118
|
message = '',
|
|
119
119
|
subMessage = '',
|
|
120
120
|
btnLabel = global?.languageJsonData?.reload || '重新加载',
|
|
121
121
|
backgroundColorWhite = false,
|
|
122
122
|
netWorkDataType = NETWORK_DATA_TYPE.NORMAL,
|
|
123
123
|
netWorkShowType = NetWorkShowType.FULL,
|
|
124
124
|
netWorkImageType = NetWork_Image_Type.No_Data_Default_Tip,
|
|
125
125
|
netWorkStyleType = NetWorkStyleType.OLD,
|
|
126
126
|
refreshCallBackFn = null,
|
|
127
127
|
viewMaxHeight = '',
|
|
128
128
|
noPosition = false,
|
|
129
129
|
} = props;
|
|
130
130
|
const refershInitData = useCallback(() => {
|
|
131
131
|
refreshCallBackFn && refreshCallBackFn(true);
|
|
132
132
|
}, []);
|
|
133
133
|
const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType];
|
|
134
134
|
const useErrorSubTip = subMessage
|
|
135
135
|
? subMessage
|
|
136
136
|
: message != ''
|
|
137
137
|
? ''
|
|
138
138
|
: NetWorkErrorSubTip[netWorkDataType];
|
|
139
139
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
|
|
140
140
|
const onePlusOneBottomPlaceHeight = global.info?.sysInfo?.onePlusOneBottomPlaceHeight
|
|
141
141
|
? global.info?.sysInfo?.onePlusOneBottomPlaceHeight + 20
|
|
142
142
|
: 0;
|
|
143
143
|
const maxHeight = latestRes.displayHeight || onePlusOneBottomPlaceHeight + 546;
|
|
144
144
|
useEffect(() => {
|
|
145
145
|
if (netWorkDataType && netWorkDataDraType[netWorkDataType]) {
|
|
146
146
|
draBusinessCustomReport({
|
|
147
147
|
eventName: 'business',
|
|
148
148
|
errorName: netWorkDataDraType[netWorkDataType],
|
|
149
149
|
errorMessage: '业务由于各类数据或者网络异常等走到兜底netWorkDataError组件,具体请看详细数据',
|
|
150
150
|
extraData: JSON.stringify({
|
|
151
151
|
message: useErrorTip,
|
|
152
152
|
subMessage: useErrorSubTip,
|
|
153
153
|
netWorkDataType,
|
|
154
154
|
netWorkShowType,
|
|
155
155
|
netWorkImageType,
|
|
156
156
|
btnLabel,
|
|
157
157
|
}),
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}, [netWorkDataType])
|
|
161
161
|
return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
|
|
162
162
|
<View
|
|
163
163
|
style={{
|
|
164
164
|
maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight,
|
|
165
165
|
}}
|
|
166
166
|
className={classNames(
|
|
167
167
|
netWorkErrorStyle['d-shop-network'],
|
|
168
168
|
{
|
|
169
169
|
[netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
[netWorkErrorStyle['d-shop-network-part']]: netWorkShowType === NetWorkShowType.PART,
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
[netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
[netWorkErrorStyle['d-shop-network-no-position']]: noPosition,
|
|
179
179
|
},
|
|
180
180
|
'flexible-center-box',
|
|
181
181
|
'J_shopNetwork',
|
|
182
182
|
className,
|
|
183
183
|
)}
|
|
184
184
|
>
|
|
185
185
|
<View
|
|
186
186
|
className={classNames(
|
|
187
187
|
netWorkErrorStyle['d-error-content'],
|
|
188
188
|
netWorkErrorStyle[`d-${netWorkStyleType}-style-content`],
|
|
189
189
|
'd-error-content',
|
|
190
190
|
)}
|
|
191
191
|
>
|
|
192
192
|
<View
|
|
193
193
|
className={classNames(
|
|
194
194
|
netWorkErrorStyle['d-error-type'],
|
|
195
195
|
netWorkErrorStyle[`d-${netWorkDataType}`],
|
|
196
196
|
netWorkErrorStyle[`d-${netWorkImageType}`],
|
|
197
197
|
`d-${netWorkDataType}`,
|
|
198
198
|
`d-${netWorkImageType}`,
|
|
199
199
|
'd-error-type',
|
|
200
200
|
)}
|
|
201
201
|
/>
|
|
202
202
|
<View
|
|
203
203
|
className={classNames(
|
|
204
204
|
netWorkErrorStyle['d-error-tip'],
|
|
205
205
|
netWorkErrorStyle[`d-${netWorkDataType}-tip`],
|
|
206
206
|
`d-${netWorkDataType}-tip`,
|
|
207
207
|
'd-error-tip',
|
|
208
208
|
)}
|
|
209
209
|
>
|
|
210
210
|
{useErrorTip}
|
|
211
211
|
</View>
|
|
212
212
|
{useErrorSubTip ? (
|
|
213
213
|
<View
|
|
214
214
|
className={classNames(
|
|
215
215
|
netWorkErrorStyle['d-error-sub-tip'],
|
|
216
216
|
netWorkErrorStyle[`d-${netWorkDataType}-sub-tip`],
|
|
217
217
|
`d-${netWorkDataType}-sub-tip`,
|
|
218
218
|
'd-error-sub-tip',
|
|
219
219
|
)}
|
|
220
220
|
>
|
|
221
221
|
{useErrorSubTip}
|
|
222
222
|
</View>
|
|
223
223
|
) : null}
|
|
224
224
|
<View className={'flexible-horizontal-center-box'}>
|
|
225
225
|
{refreshCallBackFn && (
|
|
226
226
|
<Button
|
|
227
227
|
onClick={refershInitData}
|
|
228
228
|
className={classNames(
|
|
229
229
|
netWorkErrorStyle['d-opt-btn'],
|
|
230
230
|
'd-button-no-border',
|
|
231
231
|
'd-opt-btn',
|
|
232
232
|
)}
|
|
233
233
|
plain
|
|
234
234
|
size="mini"
|
|
235
235
|
>
|
|
236
236
|
{btnLabel}
|
|
237
237
|
</Button>
|
|
238
238
|
)}
|
|
239
239
|
</View>
|
|
240
240
|
</View>
|
|
241
241
|
</View>
|
|
242
242
|
) : null;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
:global {
|
|
3
3
|
.d-mini-price {
|
|
4
|
+
--after-ele-color: '';
|
|
4
5
|
position: relative;
|
|
5
6
|
color: #f23030;
|
|
6
7
|
display: inline-block;
|
|
7
8
|
font-family: 'JDZhengHT-Regular';
|
|
9
|
+
&.d-font-v2 {
|
|
10
|
+
font-family: 'JDZhengHeiV2-Regular';
|
|
11
|
+
}
|
|
12
|
+
&.d-font-v2-bold {
|
|
13
|
+
font-family: 'JDZhengHeiV2-Bold';
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
&-sym {
|
|
10
17
|
font-size: 22px;
|
|
@@ -61,6 +68,11 @@
|
|
|
61
68
|
margin-left: 8px;
|
|
62
69
|
}
|
|
63
70
|
}
|
|
71
|
+
&.d-price-text-clor {
|
|
72
|
+
&:after {
|
|
73
|
+
color: var(--after-ele-color) !important;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
64
76
|
&.d-plus-price {
|
|
65
77
|
.int-txt,
|
|
66
78
|
.sym-sub,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
if(/^\d+(\.\d+)?[eE][+-]?\d+$/.test(value)){
|
|
3
2
|
sgmCustomReport({
|
|
4
3
|
code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
|
|
5
4
|
msg: {
|
|
6
5
|
price: value,
|
|
7
6
|
originalPrice: initValue,
|
|
8
7
|
msg: "当前价格为科学计数数据,上报关注该价格"
|
|
9
8
|
},
|
|
10
9
|
})
|
|
11
10
|
}
|
|
12
11
|
if(value === "NaN"){
|
|
13
12
|
sgmCustomReport({
|
|
14
13
|
code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
|
|
15
14
|
msg: {
|
|
16
15
|
price: value,
|
|
17
16
|
originalPrice: initValue,
|
|
18
17
|
msg: "价格转换异常,兜底展示暂无报价"
|
|
19
18
|
},
|
|
20
19
|
})
|
|
21
20
|
value = "暂无报价"
|
|
22
21
|
}
|
|
23
22
|
priceLabelText: "到手价"
|
|
23
|
+
import React, { useEffect, useRef } from 'react';
|
|
24
24
|
let value = `${initValue}`;
|
|
25
25
|
if (!cnPriceTextList.includes(value)) {
|
|
26
26
|
if (value && !/^[0123456789-]*$/.test(value.substring(0, 1))) {
|
|
27
27
|
symbol = value.substring(0, 1);
|
|
28
28
|
value = value.substring(1);
|
|
29
29
|
}
|
|
30
30
|
if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(value)) {
|
|
31
31
|
draBusinessCustomReport({
|
|
32
32
|
eventName: 'business',
|
|
33
33
|
errorName: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
|
|
34
34
|
errorMessage: '当前价格为科学计数数据,上报关注该价格',
|
|
35
35
|
extraData: JSON.stringify({
|
|
36
36
|
price: value,
|
|
37
37
|
originalPrice: initValue,
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
if (!decToIntegerState) {
|
|
42
42
|
value = parseFloat(value).toFixed(decLength);
|
|
43
43
|
} else {
|
|
44
44
|
if (value.indexOf('.') !== -1) {
|
|
45
45
|
value = parseFloat(value).toFixed(decLength);
|
|
46
46
|
value = `${value}`.replace(/0+$/, '');
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
if (value === 'NaN') {
|
|
50
50
|
draBusinessCustomReport({
|
|
51
51
|
eventName: 'business',
|
|
52
52
|
errorName: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_basePrice`),
|
|
53
53
|
errorMessage: '价格转换异常,兜底展示暂无报价',
|
|
54
54
|
extraData: JSON.stringify({
|
|
55
55
|
price: value,
|
|
56
56
|
originalPrice: initValue,
|
|
57
57
|
}),
|
|
58
58
|
});
|
|
59
59
|
value = '暂无报价';
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
const [intVal, decimalVal] = `${value}`.split('.');
|
|
63
63
|
return {
|
|
64
64
|
currencySymbol: !cnPriceTextList.includes(intVal) ? symbol : '',
|
|
65
65
|
intVal,
|
|
66
66
|
decimalVal,
|
|
67
67
|
};
|
|
68
68
|
const {
|
|
69
69
|
prefixCls,
|
|
70
70
|
symPos,
|
|
71
71
|
symbol,
|
|
72
72
|
decPos,
|
|
73
73
|
status,
|
|
74
74
|
className,
|
|
75
75
|
style,
|
|
76
76
|
symClassName,
|
|
77
77
|
intClassName,
|
|
78
78
|
decClassName,
|
|
79
79
|
noPriceClassName,
|
|
80
80
|
value,
|
|
81
81
|
decLength,
|
|
82
82
|
decToIntegerState,
|
|
83
83
|
isPlusPrice,
|
|
84
84
|
isSamsPrice,
|
|
85
85
|
isMemberPrice,
|
|
86
86
|
isSfpPrice,
|
|
87
87
|
memberPriceIcon,
|
|
88
88
|
isShowPriceLabel,
|
|
89
89
|
priceLabelText,
|
|
90
90
|
priceTextColor,
|
|
91
91
|
useFontV2 = false,
|
|
92
92
|
useFontV2Bold = false,
|
|
93
93
|
renderPriceNumber,
|
|
94
94
|
couponDiscountUpAmount,
|
|
95
95
|
nativeProps,
|
|
96
96
|
} = props;
|
|
97
97
|
const cRef = useRef<any>(null);
|
|
98
98
|
useEffect(() => {
|
|
99
99
|
if (isShowPriceLabel && priceTextColor && cRef.current) {
|
|
100
100
|
cRef.current?.style?.setProperty('--after-ele-color', priceTextColor);
|
|
101
101
|
}
|
|
102
102
|
}, [isShowPriceLabel, priceTextColor]);
|
|
103
103
|
const cls = classNames(
|
|
104
104
|
className ? `${className}` : '',
|
|
105
105
|
prefixCls,
|
|
106
106
|
{
|
|
107
107
|
'd-font-v2': useFontV2,
|
|
108
108
|
'd-font-v2-bold': useFontV2Bold,
|
|
109
109
|
},
|
|
110
110
|
'd-imag-rendering-crisp-edges',
|
|
111
111
|
{
|
|
112
112
|
del: status === 'del',
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
'd-plus-price': isPlusPrice,
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
'd-sams-price': isSamsPrice,
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
'd-sfp-price': isSfpPrice,
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
'd-member-price': isMemberPrice,
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
[`d-member-price-${memberPriceIcon}`]: memberPriceIcon,
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
'd-price-label': isShowPriceLabel,
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
'd-price-text-clor': isShowPriceLabel && priceTextColor,
|
|
134
134
|
},
|
|
135
135
|
);
|
|
136
136
|
const symCls = classNames(symClassName ? `${symClassName}` : '', {
|
|
137
137
|
'sym-sub': symPos === 'sub',
|
|
138
138
|
'sym-sup': symPos === 'sup',
|
|
139
139
|
});
|
|
140
140
|
const intCls = classNames(intClassName ? `${intClassName}` : '');
|
|
141
141
|
const decCls = classNames(decClassName ? `${decClassName}` : '', {
|
|
142
142
|
'dec-sub': decPos === 'sub',
|
|
143
143
|
'dec-sup': decPos === 'sup',
|
|
144
144
|
});
|
|
145
145
|
const noPriceCls = classNames(noPriceClassName ? `${noPriceClassName}` : '');
|
|
146
146
|
const { currencySymbol, intVal, decimalVal } = dealPrice(
|
|
147
147
|
value,
|
|
148
148
|
decLength,
|
|
149
149
|
symbol,
|
|
150
150
|
decToIntegerState,
|
|
151
151
|
);
|
|
152
152
|
const TextRender = renderPriceNumber ? renderPriceNumber : Text;
|
|
153
153
|
return (
|
|
154
154
|
<View
|
|
155
155
|
ref={cRef}
|
|
156
156
|
className={cls}
|
|
157
157
|
style={style}
|
|
158
158
|
data-after={isShowPriceLabel ? priceLabelText : ''}
|
|
159
159
|
{...nativeProps}
|
|
160
160
|
>
|
|
161
161
|
{intVal === '-1' ? (
|
|
162
162
|
<Text className={`${prefixCls}-txt int-txt off-shelf ${noPriceCls}`}>{`暂无报价`}</Text>
|
|
163
163
|
) : (
|
|
164
164
|
<>
|
|
165
165
|
<Text className={`${prefixCls}-sym ${symCls}`}>{currencySymbol}</Text>
|
|
166
166
|
<TextRender className={`${prefixCls}-txt int-txt ${intCls}`} couponDiscountUpAmount={couponDiscountUpAmount}>{intVal}</TextRender>
|
|
167
167
|
{!!decimalVal && (
|
|
168
168
|
<TextRender className={`${prefixCls}-txt dec-txt ${decCls}`} couponDiscountUpAmount={couponDiscountUpAmount}>.{decimalVal}</TextRender>
|
|
169
169
|
)}
|
|
170
170
|
</>
|
|
171
171
|
)}
|
|
172
172
|
</View>
|
|
173
173
|
);
|
|
174
174
|
prefixCls: 'd-mini-price',
|
|
175
175
|
style: {},
|
|
176
176
|
status: '',
|
|
177
177
|
symbol: '¥',
|
|
178
178
|
symPos: 'sub',
|
|
179
179
|
decLength: 2,
|
|
180
180
|
decPos: 'sub',
|
|
181
181
|
decToIntegerState: false,
|
|
182
182
|
isPlusPrice: false,
|
|
183
183
|
isShowPriceLabel: false,
|
|
184
184
|
priceLabelText: '到手价',
|
|
185
185
|
priceTextColor: '',
|
|
186
186
|
useFontV2: false,
|
|
187
187
|
useFontV2Bold: false,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.priceDesc {
|
|
94
|
-
margin-left:
|
|
94
|
+
margin-left: 8px;
|
|
95
95
|
font-family: PingFang SC;
|
|
96
96
|
&.priceHiddenDesc {
|
|
97
97
|
width: 0;
|
|
@@ -117,6 +117,24 @@
|
|
|
117
117
|
.priceDescXS {
|
|
118
118
|
font-size: 20px;
|
|
119
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
|
+
}
|
|
120
138
|
|
|
121
139
|
.missPriceDesc {
|
|
122
140
|
}
|
|
@@ -144,7 +162,7 @@
|
|
|
144
162
|
}
|
|
145
163
|
|
|
146
164
|
.rightMargin {
|
|
147
|
-
margin-right:
|
|
165
|
+
margin-right: 12px;
|
|
148
166
|
}
|
|
149
167
|
.plusStyle {
|
|
150
168
|
color: #1c4b8c;
|
|
@@ -164,3 +182,9 @@
|
|
|
164
182
|
.memberStyle {
|
|
165
183
|
color: #f6b303;
|
|
166
184
|
}
|
|
185
|
+
.fontV2 {
|
|
186
|
+
font-family: 'JDZhengHeiV2-Regular';
|
|
187
|
+
}
|
|
188
|
+
.fontV2Bold {
|
|
189
|
+
font-family: 'JDZhengHeiV2-Bold';
|
|
190
|
+
}
|