@conecli/cone-render 0.10.1-shop-beta.16 → 0.10.1-shop-beta.18
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/common/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.dynamic.module.scss +39 -0
- package/dist/components/base/LazyLoadImage/index.dynamic.tsx +1 -0
- package/dist/components/base/NetworkDataError/index.dynamic.module.scss +5 -4
- package/dist/components/base/Price/Double/index.dynamic.module.scss +1 -1
- package/dist/components/base/Price/Double/index.dynamic.tsx +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
.d-lazy-image {
|
|
3
|
+
position: relative;
|
|
4
|
+
//background: #F8F8F8 url("../../resoure/jd_logo_bg.png") center center/50% no-repeat;
|
|
5
|
+
//background: #fff
|
|
6
|
+
//url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAeCAMAAABT0xOcAAAAe1BMVEUAAADx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fELy0NOAAAAKHRSTlMApwmfFtYm9rWveHDm70yJHYJaD2k8IeIr6pY2X0HHfsGRZDHdu1XNmO+CqgAAAu9JREFUSMfNlNmymzAQRAchkCUhdrMZbLze/v8vjIRMKN8kRR7ykFNeVIPV9Ewj039P1TR8+eILjL7RdLFFJUO8QMS7ZmyDJvZ0nDYGY+aKKDSJpY3OwWX6uFUEY/peCNEbY4Rp6AABixFYkLQRAK3VOmAjUrawMt1GrfWtXD7rlFF3uiA6HV/p0TF1tBECEVskYe+7qqW08mqT1jruneu21/72JfHoSZ7faj2bJu6mOlgEa3qjEXKeL/ACV1s5YSbqYP6stXUeX2FZnV3wuBSZqnVWqDNCIvaFRzZIiGAIw+CS/1brQCslgOQdUBoW10C2EFJei7AkygOlAnmGeMprJq/NjhZpAIrepOpOte2Oq9EXjupIMVoiXduQ9rTo7KsODhxJYaAGuJPjgRvdkRD1KP9CawRwettyF5SbVLZ49ZbuMJxGW93XisXPKA/oXNMDEReJT6N0OfZ2V4RqX4tFQPbOQbntwrl8oXCOQmu2hVosSr6j5QcW+uvukZJP37CWzL7tQs2lH8B53Nd6eq192N/72mdfa52XhdXPx6zcXKYgikLXbaNP66M27edoAO2X+RkQ9tVRhoWC6IZkCZAbHHa1SgDHNdHDsbrLr0ojKTkfDWp6+WPh1APakMAXbVrb6B/Mn+311zlETJZOCJYChttWxedUIyvyi9bLt+J4IPcLvVYypBNaDG5TguCzmct3rUkAPSdHJRLyDEjXQ6Un3GZQBamxaU09gJg+/r+4gqV0uzixXjBfLnDzixrjhDJGNoDXXqvK76OEJaO3L1bx/FQOCSxqcfJVUWiXCydEPowHeIqaZnf3wmvNRsBiC28ttEnS+1oy+lNtOMVAzayZCwsQ5ESNREgvKKuNjjI/ewNHr9Y4N5Is98llx2U8iOQXcKczhDwAM6ObayaanfWDDwhJcMvpU8ucr6+cPji5a8+UEVMCMNo97tLm0MU2uoMmi850yrc8s8Khyzuj7+Q6U7GPMCt8mOtGljP6l/wAUcBZ6lceL/8AAAAASUVORK5CYII=')
|
|
7
|
+
//0 0 / 75px 30px no-repeat;
|
|
8
|
+
//&:before{
|
|
9
|
+
// content: '';
|
|
10
|
+
// position: absolute;
|
|
11
|
+
// top: 0;
|
|
12
|
+
// left: 0;
|
|
13
|
+
// right: 0;
|
|
14
|
+
// bottom: 0;
|
|
15
|
+
// display: inline-block;
|
|
16
|
+
// margin: auto;
|
|
17
|
+
// width: 75px;
|
|
18
|
+
// height: 30px;
|
|
19
|
+
// background: url('https://img10.360buyimg.com/cms/jfs/t1/328840/6/11913/995/68afbf0bF9ec30819/def24889cbb231ec.png')
|
|
20
|
+
// 0 0 / 75px 30px no-repeat;
|
|
21
|
+
//}
|
|
22
|
+
background: url('https://img10.360buyimg.com/cms/jfs/t1/328840/6/11913/995/68afbf0bF9ec30819/def24889cbb231ec.png') center center / 75px 30px no-repeat;
|
|
23
|
+
&.d-lazy-sku-image {
|
|
24
|
+
background-image: url('https://img14.360buyimg.com/imagetools/jfs/t1/222907/25/7012/5824/61c4797cEbcd17c7f/6c76fc71e4fdb5a5.png');
|
|
25
|
+
background-size: 100% 100%;
|
|
26
|
+
background-position: 0 0;
|
|
27
|
+
}
|
|
28
|
+
&.d-load-completed {
|
|
29
|
+
background: none;
|
|
30
|
+
}
|
|
31
|
+
&.d-hide-image-error {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
.d-lazy-image-content{
|
|
35
|
+
display: block;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
const {
|
|
1
3
|
src = null,
|
|
2
4
|
lazyLoad = true,
|
|
3
5
|
imagRenderingSet = true,
|
|
4
6
|
width = null,
|
|
5
7
|
height = null,
|
|
6
8
|
className = null,
|
|
7
9
|
isSkuImage = false,
|
|
8
10
|
hideErrorImage = false,
|
|
9
11
|
style = null,
|
|
10
12
|
backgroundColor = null,
|
|
11
13
|
errorSrc = null,
|
|
12
14
|
onLoad = null,
|
|
13
15
|
onError = null,
|
|
14
16
|
...otherOption
|
|
15
17
|
} = props;
|
|
16
18
|
getNetWorkType === NetWorkTypeQuality.default &&
|
|
17
19
|
(getNetWorkType = taroJdBaseInfo.info.sysInfo.netWorkType);
|
|
18
20
|
const [loadSuccess, setLoadSuccess] = useState(false);
|
|
19
21
|
const [imgSrc, setImgSrc] = useState(src);
|
|
20
22
|
const [imageErrState, setImageErrState] = useState(false);
|
|
21
23
|
const imageError = useCallback(
|
|
22
24
|
(e) => {
|
|
23
25
|
console.log('图片加载错误', e);
|
|
24
26
|
errorSrc && setImgSrc(errorSrc);
|
|
25
27
|
hideErrorImage && setImageErrState(true);
|
|
26
28
|
typeof onError === 'function' && onError(e, src, props);
|
|
27
29
|
},
|
|
28
30
|
[src],
|
|
29
31
|
);
|
|
30
32
|
|
|
31
33
|
const imageLoad = useCallback(
|
|
32
34
|
(event) => {
|
|
33
35
|
setLoadSuccess(true);
|
|
34
36
|
typeof onLoad === 'function' && onLoad(event, src, props);
|
|
35
37
|
},
|
|
36
38
|
[src],
|
|
37
39
|
);
|
|
38
40
|
|
|
39
41
|
const changeStyleIncludeWidthAndHeightAndBgColor = () => {
|
|
40
42
|
const changeStyle = {};
|
|
41
43
|
width && (changeStyle['width'] = width);
|
|
42
44
|
height && (changeStyle['height'] = height);
|
|
43
45
|
backgroundColor && (changeStyle['backgroundColor'] = backgroundColor);
|
|
44
46
|
return changeStyle;
|
|
45
47
|
};
|
|
46
48
|
const getLastStyle = () => {
|
|
47
49
|
return {
|
|
48
50
|
...style,
|
|
49
51
|
...changeStyleIncludeWidthAndHeightAndBgColor(),
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
return (
|
|
53
55
|
<View
|
|
54
56
|
className={classNames(
|
|
55
57
|
imageStyle['d-lazy-image'],
|
|
56
58
|
{
|
|
57
59
|
[imageStyle['d-lazy-sku-image']]: isSkuImage,
|
|
58
60
|
},
|
|
59
61
|
{
|
|
60
62
|
[imageStyle['d-hide-image-error']]: imageErrState,
|
|
61
63
|
},
|
|
62
64
|
{
|
|
63
65
|
[imageStyle['d-load-completed']]: loadSuccess,
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
68
|
'd-imag-rendering-crisp-edges': imagRenderingSet,
|
|
67
69
|
},
|
|
68
70
|
className,
|
|
69
71
|
)}
|
|
70
72
|
style={getLastStyle()}
|
|
71
73
|
>
|
|
72
74
|
<Image
|
|
73
75
|
className={classNames(imageStyle['d-lazy-image-content'])}
|
|
74
76
|
src={getQualityImage(imgSrc, NetWorkTypeQuality[getNetWorkType])}
|
|
75
77
|
lazyLoad={lazyLoad}
|
|
76
78
|
onError={imageError}
|
|
77
79
|
placeholder={placeholderImg}
|
|
78
80
|
onLoad={imageLoad}
|
|
79
81
|
{...otherOption}
|
|
80
82
|
/>
|
|
81
83
|
</View>
|
|
82
84
|
);
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
0 0 /320px 320px no-repeat;
|
|
22
22
|
}
|
|
23
23
|
.d-opt-btn {
|
|
24
|
-
display: inline-
|
|
24
|
+
display: inline-block;
|
|
25
25
|
margin-top: 32px;
|
|
26
26
|
padding: 0 24px;
|
|
27
|
+
//min-width: 160px;
|
|
27
28
|
height: 64px;
|
|
28
29
|
line-height: 64px;
|
|
29
30
|
font-size: 24px;
|
|
@@ -37,16 +38,16 @@
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
.d-error-tip {
|
|
40
|
-
|
|
41
|
-
line-height: 36px;
|
|
41
|
+
line-height: 38px;
|
|
42
42
|
font-size: 32px;
|
|
43
43
|
font-weight: 600;
|
|
44
44
|
color: #1A1A1A;
|
|
45
|
+
text-align: center;
|
|
45
46
|
}
|
|
46
47
|
.d-error-no-sub-tip,
|
|
47
48
|
.d-error-sub-tip {
|
|
48
49
|
margin-top: 20px;
|
|
49
|
-
line-height:
|
|
50
|
+
line-height: 28px;
|
|
50
51
|
font-size: 24px;
|
|
51
52
|
text-align: center;
|
|
52
53
|
color: #505259;
|