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