s-material-react 0.1.6 → 0.1.8
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/css/common/icon.scss +28 -4
- package/css/font/iconfont.ttf +0 -0
- package/css/font/iconfont.woff +0 -0
- package/css/font/iconfont.woff2 +0 -0
- package/css/pages/goodsClassify.scss +1 -1
- package/css/pages/goodsDetail.scss +34 -20
- package/css/pages/goodsList.scss +10 -16
- package/css/pages/index.scss +4 -0
- package/css/pages/searchPage.scss +2 -1
- package/dist/common/evaluateItem/index.js +3 -3
- package/dist/common/icon/index.d.ts +0 -1
- package/dist/common/icon/index.js +1 -1
- package/dist/components/ClassifyNav/index.d.ts +2 -2
- package/dist/components/ClassifyNav/index.js +4 -5
- package/dist/components/Cube/index.d.ts +4 -2
- package/dist/components/Cube/index.js +20 -17
- package/dist/components/Goods/index.d.ts +4 -0
- package/dist/components/Goods/index.js +12 -10
- package/dist/components/GoodsClassify/index.js +3 -2
- package/dist/components/GoodsDetail/components/goodsDetailEvaluate.js +2 -3
- package/dist/components/GoodsDetail/components/goodsDetailHandleBar.js +2 -1
- package/dist/components/GoodsDetail/components/goodsDetailInfo.d.ts +1 -1
- package/dist/components/GoodsDetail/components/goodsDetailInfo.js +10 -2
- package/dist/components/GoodsDetail/components/goodsDetailPopup.js +3 -4
- package/dist/components/GoodsDetail/components/goodsDetailSize.js +2 -3
- package/dist/components/GoodsDetail/hooks/index.js +75 -0
- package/dist/components/GoodsDetail/index.js +6 -57
- package/dist/components/GoodsList/components/filter.d.ts +5 -1
- package/dist/components/GoodsList/components/filter.js +22 -10
- package/dist/components/GoodsList/hooks/useGoodsList.d.ts +10 -3
- package/dist/components/GoodsList/hooks/useGoodsList.js +15 -11
- package/dist/components/GoodsList/index.d.ts +4 -0
- package/dist/components/GoodsList/index.js +5 -4
- package/dist/components/Line/index.d.ts +2 -2
- package/dist/components/Line/index.js +12 -11
- package/dist/components/Notice/index.d.ts +5 -2
- package/dist/components/Notice/index.js +9 -10
- package/dist/components/Search/index.d.ts +4 -2
- package/dist/components/Search/index.js +27 -24
- package/dist/components/Slider/index.d.ts +4 -2
- package/dist/components/Slider/index.js +8 -6
- package/dist/components/Title/index.d.ts +5 -3
- package/dist/components/Title/index.js +12 -12
- package/dist/components/Video/index.d.ts +4 -2
- package/dist/components/Video/index.js +8 -6
- package/dist/routerMap/index.d.ts +1 -0
- package/dist/routerMap/index.js +2 -1
- package/package.json +2 -3
package/css/common/icon.scss
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: 'iconfont'; /* Project id 3540782 */
|
|
3
|
-
src: url('//at.alicdn.com/t/c/
|
|
4
|
-
url('//at.alicdn.com/t/c/
|
|
5
|
-
url('//at.alicdn.com/t/c/
|
|
3
|
+
src: url('//at.alicdn.com/t/c/font_3540782_w0k03fwojrs.woff2?t=1669970496419') format('woff2'),
|
|
4
|
+
url('//at.alicdn.com/t/c/font_3540782_w0k03fwojrs.woff?t=1669970496419') format('woff'),
|
|
5
|
+
url('//at.alicdn.com/t/c/font_3540782_w0k03fwojrs.ttf?t=1669970496419') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.iconfont {
|
|
9
|
-
display: inline-block;
|
|
9
|
+
//display: inline-block;
|
|
10
10
|
font: {
|
|
11
11
|
family: iconfont;
|
|
12
12
|
variant: normal;
|
|
@@ -21,6 +21,30 @@
|
|
|
21
21
|
-moz-osx-font-smoothing: grayscale;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.icon-jiangxu:before {
|
|
25
|
+
content: '\e618';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-shengxu:before {
|
|
29
|
+
content: '\e61b';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-paixusort-jiang:before {
|
|
33
|
+
content: '\e7c6';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-paixusort-sheng:before {
|
|
37
|
+
content: '\e7c7';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-gouwuche:before {
|
|
41
|
+
content: '\e73d';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon-kefu:before {
|
|
45
|
+
content: '\ec2e';
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
.icon-my:before {
|
|
25
49
|
content: '\e66f';
|
|
26
50
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.GoodsDetailWrap {
|
|
2
|
-
overflow: scroll;
|
|
2
|
+
//overflow: scroll;
|
|
3
3
|
background-color: #f6f6f6;
|
|
4
4
|
padding-top: 12px;
|
|
5
5
|
padding-bottom: 12px;
|
|
@@ -122,25 +122,18 @@
|
|
|
122
122
|
position: fixed;
|
|
123
123
|
bottom: 0;
|
|
124
124
|
left: 0;
|
|
125
|
+
box-sizing: border-box;
|
|
125
126
|
padding: 7px 10px;
|
|
126
127
|
display: grid;
|
|
127
128
|
grid-template-columns: 30px 40px 1fr;
|
|
128
129
|
gap: 20px;
|
|
129
130
|
|
|
131
|
+
.txt {
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
margin-top: 6px;
|
|
134
|
+
}
|
|
130
135
|
.linkGroup {
|
|
131
136
|
text-align: center;
|
|
132
|
-
|
|
133
|
-
.icon {
|
|
134
|
-
display: block;
|
|
135
|
-
width: 20px;
|
|
136
|
-
height: 20px;
|
|
137
|
-
background-color: yellowgreen;
|
|
138
|
-
margin: 0 auto;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.txt {
|
|
142
|
-
font-size: 12px;
|
|
143
|
-
}
|
|
144
137
|
}
|
|
145
138
|
|
|
146
139
|
.btnGroup {
|
|
@@ -182,11 +175,10 @@
|
|
|
182
175
|
line-height: 50px;
|
|
183
176
|
text-align: center;
|
|
184
177
|
margin-bottom: 10px;
|
|
185
|
-
|
|
178
|
+
display: flex;
|
|
186
179
|
.tabsItem {
|
|
187
|
-
|
|
180
|
+
flex: 1;
|
|
188
181
|
display: inline-block;
|
|
189
|
-
padding: 0 30px;
|
|
190
182
|
font-size: 16px;
|
|
191
183
|
position: relative;
|
|
192
184
|
|
|
@@ -211,6 +203,13 @@
|
|
|
211
203
|
}
|
|
212
204
|
|
|
213
205
|
.goodsDetail-info {
|
|
206
|
+
.mystyle {
|
|
207
|
+
width: 100% !important;
|
|
208
|
+
height: auto;
|
|
209
|
+
display: block;
|
|
210
|
+
background-size: cover !important;
|
|
211
|
+
}
|
|
212
|
+
|
|
214
213
|
width: 100%;
|
|
215
214
|
background-color: #ffffff;
|
|
216
215
|
|
|
@@ -230,7 +229,7 @@
|
|
|
230
229
|
|
|
231
230
|
.stampWrap {
|
|
232
231
|
max-height: 40vh;
|
|
233
|
-
overflow: scroll;
|
|
232
|
+
overflow-y: scroll;
|
|
234
233
|
|
|
235
234
|
.stamp {
|
|
236
235
|
width: 100%;
|
|
@@ -318,7 +317,21 @@
|
|
|
318
317
|
}
|
|
319
318
|
}
|
|
320
319
|
|
|
320
|
+
@keyframes popup {
|
|
321
|
+
0% {
|
|
322
|
+
transform: translateY(50vh);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
100% {
|
|
326
|
+
transform: translateY(0);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
321
330
|
.goodsDetail-size-popup {
|
|
331
|
+
animation: popup 300ms cubic-bezier(0.36, 0.66, 0.04, 1);
|
|
332
|
+
position: fixed;
|
|
333
|
+
bottom: 0;
|
|
334
|
+
background: #fff;
|
|
322
335
|
height: 50vh;
|
|
323
336
|
display: grid;
|
|
324
337
|
grid-template-rows: calc(50vh - 88px) 88px;
|
|
@@ -339,7 +352,7 @@
|
|
|
339
352
|
}
|
|
340
353
|
|
|
341
354
|
.content {
|
|
342
|
-
overflow: scroll;
|
|
355
|
+
overflow-y: scroll;
|
|
343
356
|
|
|
344
357
|
.goodsInfo {
|
|
345
358
|
width: 100%;
|
|
@@ -348,7 +361,7 @@
|
|
|
348
361
|
display: grid;
|
|
349
362
|
grid-template-columns: 72px 1fr;
|
|
350
363
|
gap: 10px;
|
|
351
|
-
|
|
364
|
+
box-sizing: border-box;
|
|
352
365
|
.lPart {
|
|
353
366
|
.goodsImg {
|
|
354
367
|
width: 70px;
|
|
@@ -400,7 +413,8 @@
|
|
|
400
413
|
color: #a7a7a7;
|
|
401
414
|
|
|
402
415
|
&.active {
|
|
403
|
-
|
|
416
|
+
background: #346fc2;
|
|
417
|
+
color: #fff;
|
|
404
418
|
border-color: #1a1a1a;
|
|
405
419
|
}
|
|
406
420
|
}
|
package/css/pages/goodsList.scss
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
@import '../basic/textLine.scss';
|
|
2
2
|
|
|
3
3
|
.goodsList {
|
|
4
|
-
.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
.top-info {
|
|
5
|
+
&-search {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
margin: 0 15px 17px;
|
|
7
8
|
height: 34px;
|
|
8
|
-
line-height: 34px;
|
|
9
9
|
background-color: #f4f4f4;
|
|
10
10
|
border-radius: 20px;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
text-align: center;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
.icon {
|
|
14
16
|
width: 14px;
|
|
15
17
|
height: 14px;
|
|
16
|
-
|
|
17
|
-
margin-left: 14px;
|
|
18
|
-
margin-right: 8px;
|
|
19
|
-
margin-top: -2px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.title {
|
|
23
|
-
font-size: 14px;
|
|
24
|
-
color: #999999;
|
|
18
|
+
margin-right: 5px;
|
|
25
19
|
}
|
|
26
20
|
}
|
|
27
21
|
|
package/css/pages/index.scss
CHANGED
|
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
3
|
import { Rate } from 'antd-mobile';
|
|
4
4
|
const EvaluateItem = ({ starColor = '#FF0934', starSize = '12px', itemData }) => {
|
|
5
|
-
const { View, Text } = useComponent();
|
|
6
|
-
return (_jsxs(View, Object.assign({ className: 'evaluateItem' }, { children: [_jsxs(View, Object.assign({ className: 'userInfo' }, { children: [_jsx(
|
|
5
|
+
const { View, Text, Image } = useComponent();
|
|
6
|
+
return (_jsxs(View, Object.assign({ className: 'evaluateItem' }, { children: [_jsxs(View, Object.assign({ className: 'userInfo' }, { children: [_jsx(Image, { src: itemData.avatar, className: 'avatar' }), _jsxs(View, Object.assign({ className: 'userNameWrap' }, { children: [_jsx(Text, Object.assign({ className: 'userName' }, { children: itemData.userName })), _jsx(Rate, { readOnly: true, value: itemData.rate, style: {
|
|
7
7
|
'--star-size': starSize,
|
|
8
8
|
'--active-color': starColor
|
|
9
9
|
} })] }))] })), _jsxs(View, Object.assign({ className: 'size' }, { children: ["\u89C4\u683C\uFF1A ", itemData.size] })), _jsx(View, Object.assign({ className: 'content' }, { children: itemData.evaluate })), _jsx(View, Object.assign({ className: 'img-group' }, { children: itemData.imgUrls.map((item, index) => {
|
|
10
|
-
return _jsx(
|
|
10
|
+
return _jsx(Image, { src: item.imgUrl, className: 'img' }, index);
|
|
11
11
|
}) }))] })));
|
|
12
12
|
};
|
|
13
13
|
export default EvaluateItem;
|
|
@@ -8,5 +8,5 @@ export const QjMobileIcon = ({ className = 'iconfont', prefixClass = 'icon', sty
|
|
|
8
8
|
}, value }) => {
|
|
9
9
|
const { Text } = useComponent();
|
|
10
10
|
const iconName = value ? `${prefixClass}-${value}` : '';
|
|
11
|
-
return
|
|
11
|
+
return _jsx(Text, { className: classNames(prefixClass, iconName, className), style: style });
|
|
12
12
|
};
|
|
@@ -7,8 +7,8 @@ interface ClassifyItemType {
|
|
|
7
7
|
interface ClassifyNavType {
|
|
8
8
|
defaultValue: Array<ClassifyItemType>;
|
|
9
9
|
borderRadius: number;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
paddingTop: number;
|
|
11
|
+
paddingBottom: number;
|
|
12
12
|
selectClassifyNav: Array<ClassifyItemType>;
|
|
13
13
|
}
|
|
14
14
|
export declare const ClassifyNav: React.NamedExoticComponent<ClassifyNavType>;
|
|
@@ -3,11 +3,10 @@ import { memo, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
4
|
import { _ } from '@brushes/tools';
|
|
5
5
|
const { isUndefined, isEmpty } = _;
|
|
6
|
-
const ClassifyNavJsx = ({ defaultValue, borderRadius,
|
|
6
|
+
const ClassifyNavJsx = ({ defaultValue, borderRadius, paddingTop, paddingBottom, selectClassifyNav }) => {
|
|
7
7
|
const [list, setList] = useState(defaultValue);
|
|
8
8
|
const { View, Text } = useComponent();
|
|
9
9
|
useEffect(() => {
|
|
10
|
-
console.log(1111, selectClassifyNav);
|
|
11
10
|
const computedArr = selectClassifyNav
|
|
12
11
|
.filter((item) => !isUndefined(item))
|
|
13
12
|
.filter((item) => !Object.values(item).every((citem) => isUndefined(citem)));
|
|
@@ -17,8 +16,8 @@ const ClassifyNavJsx = ({ defaultValue, borderRadius, marginTop, marginBottom, s
|
|
|
17
16
|
}
|
|
18
17
|
setList(arr);
|
|
19
18
|
}, [selectClassifyNav]);
|
|
20
|
-
return (_jsx(View, Object.assign({ className: 'classifyNav' }, { children: list.map((item, index) => {
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, Object.assign({ className: 'classifyNav' }, { children: list.map((item, index) => {
|
|
20
|
+
return (_jsxs(View, Object.assign({ className: 'classifyNavItem' }, { children: [_jsx("img", { src: item.imgUrl, alt: "", className: 'img' }), _jsx(Text, Object.assign({ className: 'label' }, { children: item.title }))] }), index));
|
|
21
|
+
}) })) })));
|
|
23
22
|
};
|
|
24
23
|
export const ClassifyNav = memo(ClassifyNavJsx);
|
|
@@ -7,8 +7,10 @@ interface CubeType {
|
|
|
7
7
|
defaultValue: Array<ImgType>;
|
|
8
8
|
type: number;
|
|
9
9
|
borderRadius: number;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
paddingTop: number;
|
|
11
|
+
paddingBottom: number;
|
|
12
|
+
paddingLeft: number;
|
|
13
|
+
paddingRight: number;
|
|
12
14
|
selectImg: Array<ImgType>;
|
|
13
15
|
}
|
|
14
16
|
export declare const Cube: React.NamedExoticComponent<CubeType>;
|
|
@@ -3,7 +3,7 @@ import { memo, useEffect, useState } from 'react';
|
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
4
|
import { _ } from '@brushes/tools';
|
|
5
5
|
const { isUndefined, isEmpty } = _;
|
|
6
|
-
const CubeJsx = ({ defaultValue, type, borderRadius,
|
|
6
|
+
const CubeJsx = ({ defaultValue, type, borderRadius, paddingTop, paddingLeft, paddingRight, paddingBottom, selectImg }) => {
|
|
7
7
|
const [list, setList] = useState(defaultValue);
|
|
8
8
|
const { View, Image } = useComponent();
|
|
9
9
|
useEffect(() => {
|
|
@@ -16,21 +16,24 @@ const CubeJsx = ({ defaultValue, type, borderRadius, marginBottom, marginTop, se
|
|
|
16
16
|
}
|
|
17
17
|
setList(arr);
|
|
18
18
|
}, [selectImg]);
|
|
19
|
-
return (_jsx(View, Object.assign({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
return (_jsx(View, Object.assign({ style: {
|
|
20
|
+
paddingTop,
|
|
21
|
+
paddingBottom
|
|
22
|
+
} }, { children: _jsx(View, Object.assign({ className: `cube-type${type}`, style: { paddingLeft, paddingRight } }, { children: list.map((item, index) => {
|
|
23
|
+
return type === 1 ? (_jsx(Image, { mode: 'widthFix', src: item.imgUrl, style: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
borderRadius: borderRadius + 'px'
|
|
26
|
+
} }, index)) : (_jsx(View, { className: 'block', style: {
|
|
27
|
+
backgroundImage: `url(${item.imgUrl})`,
|
|
28
|
+
width: '100%',
|
|
29
|
+
borderRadius: borderRadius + 'px'
|
|
30
|
+
}, onClick: () => {
|
|
31
|
+
if (process.env.TARO_ENV === 'weapp') {
|
|
32
|
+
// Taro?.navigateTo({
|
|
33
|
+
// url: item.link,
|
|
34
|
+
// })
|
|
35
|
+
}
|
|
36
|
+
} }, index));
|
|
37
|
+
}) })) })));
|
|
35
38
|
};
|
|
36
39
|
export const Cube = memo(CubeJsx);
|
|
@@ -15,6 +15,10 @@ interface GoodsType {
|
|
|
15
15
|
circular?: number;
|
|
16
16
|
markedPrice?: number;
|
|
17
17
|
classCode?: string;
|
|
18
|
+
paddingTop: number;
|
|
19
|
+
paddingBottom: number;
|
|
20
|
+
paddingLeft: number;
|
|
21
|
+
paddingRight: number;
|
|
18
22
|
}
|
|
19
23
|
export declare const Goods: import("react").NamedExoticComponent<GoodsType>;
|
|
20
24
|
export {};
|
|
@@ -16,7 +16,7 @@ import { _ } from '@brushes/tools';
|
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import { QjMobileIcon } from '../../common/icon';
|
|
18
18
|
const { isEqual, isEmpty } = _;
|
|
19
|
-
const GoodsJsx = ({ defaultValue = [], classCode = '', margin, circular, cell, gap = 10, goods = [], markedPrice }) => {
|
|
19
|
+
const GoodsJsx = ({ defaultValue = [], classCode = '', margin, circular, cell, gap = 10, goods = [], markedPrice, paddingTop, paddingBottom, paddingLeft, paddingRight }) => {
|
|
20
20
|
const [list, setList] = useState(defaultValue);
|
|
21
21
|
const preGoods = useRef();
|
|
22
22
|
const { View, Text } = useComponent();
|
|
@@ -54,14 +54,16 @@ const GoodsJsx = ({ defaultValue = [], classCode = '', margin, circular, cell, g
|
|
|
54
54
|
console.log(54, goods, preGoods.current);
|
|
55
55
|
};
|
|
56
56
|
}, [goods]);
|
|
57
|
-
return (_jsx(View, Object.assign({ className: classNames({ [`goods-${classCode}`]: true }), style: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, Object.assign({ className: classNames({ [`goods-${classCode}`]: true }), style: {
|
|
58
|
+
display: 'grid',
|
|
59
|
+
gap,
|
|
60
|
+
marginBottom: margin,
|
|
61
|
+
gridTemplateColumns: `repeat(${cell}, 1fr)`,
|
|
62
|
+
paddingLeft,
|
|
63
|
+
paddingRight
|
|
64
|
+
} }, { children: list.map((item, index) => (_jsxs(View, Object.assign({ style: {
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
borderRadius: circular === 2 ? 0 : '8px'
|
|
67
|
+
}, className: 'goods' }, { children: [_jsx(View, { className: `goods-img`, style: { backgroundImage: `url(${item.dataPic})` } }), _jsxs(View, Object.assign({ className: 'space' }, { children: [_jsx(View, Object.assign({ className: 'titleType' }, { children: item.goodsName })), _jsx(View, Object.assign({ className: 'subTitle' }, { children: item.brandName })), _jsxs(View, Object.assign({ className: 'price' }, { children: [_jsx(Text, Object.assign({ className: 'subPrice' }, { children: "\u00A5" })), item.pricesetNprice, markedPrice === 1 && (_jsxs(Text, Object.assign({ className: 'markedPrice' }, { children: [_jsx(Text, Object.assign({ className: 'subPrice' }, { children: "\u00A5" })), item.pricesetMakeprice] })))] })), _jsx(View, Object.assign({ className: 'anticon' }, { children: _jsx(QjMobileIcon, { style: { fontSize: 30, color: '#f00' }, value: 'cart' }) }))] }))] }), index))) })) })));
|
|
66
68
|
};
|
|
67
69
|
export const Goods = memo(GoodsJsx);
|
|
@@ -9,13 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
import { memo, useEffect, useState } from 'react';
|
|
12
|
-
import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
|
|
12
|
+
import { useComponent, antdMobile, navigatorImpl } from '@brushes/qj-simulate-component';
|
|
13
13
|
import { ClassifyFloor } from './components/classifyFloor';
|
|
14
14
|
// import {SEARCH} from "../../static";
|
|
15
15
|
import { getEnv } from '@brushes/api';
|
|
16
16
|
import { queryGoodsClassTree } from '@brushes/api';
|
|
17
17
|
import { QjMobileIcon } from '../../common/icon';
|
|
18
18
|
import { _ } from '@brushes/tools';
|
|
19
|
+
import { routerMap } from '../../routerMap';
|
|
19
20
|
const { get } = _;
|
|
20
21
|
const { SideBar } = antdMobile;
|
|
21
22
|
const GoodsClassifyJsx = () => {
|
|
@@ -37,7 +38,7 @@ const GoodsClassifyJsx = () => {
|
|
|
37
38
|
console.log(err);
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
return (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'goods-classify' }, { children: _jsxs(View, Object.assign({ className: 'goods-classify-search' }, { children: [_jsx(QjMobileIcon, { value: "fenxiang" }), _jsx(Text, { children: "\u641C\u7D22\u5546\u54C1" })] })) })), _jsxs(View, Object.assign({ className: 'goodsClassifyContainer', style: { height: flag ? 'calc(100vh - 51px)' : '600px' } }, { children: [_jsx(View, Object.assign({ className: 'side' }, { children: _jsx(SideBar, Object.assign({ activeKey: activeKey, onChange: setActiveKey, style: {
|
|
41
|
+
return (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'goods-classify' }, { children: _jsxs(View, Object.assign({ className: 'goods-classify-search', onClick: () => navigatorImpl(routerMap.search) }, { children: [_jsx(QjMobileIcon, { value: "fenxiang" }), _jsx(Text, { children: "\u641C\u7D22\u5546\u54C1" })] })) })), _jsxs(View, Object.assign({ className: 'goodsClassifyContainer', style: { height: flag ? 'calc(100vh - 51px)' : '600px' } }, { children: [_jsx(View, Object.assign({ className: 'side' }, { children: _jsx(SideBar, Object.assign({ activeKey: activeKey, onChange: setActiveKey, style: {
|
|
41
42
|
'--width': '88px'
|
|
42
43
|
} }, { children: navList.map((item) => (_jsx(SideBar.Item, { title: item.goodsClassName }, item.goodsClassCode))) })) })), _jsx(View, Object.assign({ className: 'main' }, { children: _jsx(ClassifyFloor, { navList: navList, activeKey: activeKey }) }))] }))] }));
|
|
43
44
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
|
-
import EvaluateItem from '../../../common/evaluateItem';
|
|
4
3
|
const GoodsDetailEvaluate = () => {
|
|
5
4
|
const { View } = useComponent();
|
|
6
|
-
return (
|
|
5
|
+
return (_jsx(View, Object.assign({ className: 'goodsDetailEvaluate' }, { children: "1231232" })));
|
|
7
6
|
};
|
|
8
7
|
export default GoodsDetailEvaluate;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { navigatorImpl, useComponent } from '@brushes/qj-simulate-component';
|
|
3
|
+
import { QjMobileIcon } from '../../../common/icon';
|
|
3
4
|
const GoodsDetailHandleBar = () => {
|
|
4
5
|
const { Text, View } = useComponent();
|
|
5
|
-
return (_jsxs(View, Object.assign({ className: 'goodsDetailHandleBar' }, { children: [_jsxs(View, Object.assign({ className: 'linkGroup' }, { children: [_jsx(
|
|
6
|
+
return (_jsxs(View, Object.assign({ className: 'goodsDetailHandleBar' }, { children: [_jsxs(View, Object.assign({ className: 'linkGroup' }, { children: [_jsx(QjMobileIcon, { value: 'kefu', style: { fontSize: 22, display: 'block' } }), _jsx(Text, Object.assign({ className: 'txt' }, { children: "\u5BA2\u670D" }))] })), _jsxs(View, Object.assign({ className: 'linkGroup' }, { children: [_jsx(QjMobileIcon, { value: 'gouwuche', style: { fontSize: 22, display: 'block' } }), _jsx(Text, Object.assign({ className: 'txt' }, { children: "\u8D2D\u7269\u8F66" }))] })), _jsxs(View, Object.assign({ className: 'btnGroup' }, { children: [_jsx(View, Object.assign({ className: 'btn addCart', onClick: () => navigatorImpl('/subpackage/orderconfirm/index') }, { children: "\u52A0\u5165\u8D2D\u7269\u8F66" })), _jsx(View, Object.assign({ onClick: () => navigatorImpl('/subpackage/orderconfirm/index'), className: 'btn buy' }, { children: "\u7ACB\u5373\u8D2D\u4E70" }))] }))] })));
|
|
6
7
|
};
|
|
7
8
|
export default GoodsDetailHandleBar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const GoodsDetailInfo: ({ goods }: any) => JSX.Element;
|
|
1
|
+
declare const GoodsDetailInfo: ({ goods, tabActive }: any) => JSX.Element;
|
|
2
2
|
export default GoodsDetailInfo;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
|
-
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
const GoodsDetailInfo = ({ goods, tabActive }) => {
|
|
4
5
|
const { View } = useComponent();
|
|
5
|
-
|
|
6
|
+
const [goodsDetail, setDetail] = useState('');
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setDetail(goods.goodsRemark
|
|
9
|
+
.replace(/<style>[\s\S]*<\/style>/gi, '')
|
|
10
|
+
.replace(/\<img/gi, `<img class="mystyle" mode="widthFix"`)
|
|
11
|
+
.replace(/<!--[\s\S]*-->/gi, ''));
|
|
12
|
+
}, [goods.goodsRemark, tabActive]);
|
|
13
|
+
return (_jsx(View, Object.assign({ className: 'goodsDetail-info' }, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: goodsDetail || '' } }) })));
|
|
6
14
|
};
|
|
7
15
|
export default GoodsDetailInfo;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useComponent
|
|
2
|
+
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
const { Popup, Radio } = antdMobile;
|
|
5
4
|
const GoodsDetailPopup = ({ popupVisible, setPopupVisible, goods }) => {
|
|
6
|
-
const { View, Text, Image } = useComponent();
|
|
5
|
+
const { View, Text, Image, RootPortal } = useComponent();
|
|
7
6
|
const [selectSizeCoe, setSelectSizeCoe] = useState(0);
|
|
8
7
|
const [count, setCount] = useState(1);
|
|
9
8
|
const handleChooseSize = (index) => {
|
|
@@ -20,7 +19,7 @@ const GoodsDetailPopup = ({ popupVisible, setPopupVisible, goods }) => {
|
|
|
20
19
|
break;
|
|
21
20
|
}
|
|
22
21
|
};
|
|
23
|
-
return (_jsx(_Fragment, { children:
|
|
22
|
+
return (_jsx(_Fragment, { children: popupVisible && (_jsx(RootPortal, { children: _jsxs(View, Object.assign({ className: 'goodsDetail-size-popup' }, { children: [_jsxs(View, Object.assign({ className: 'content' }, { children: [_jsx(View, Object.assign({ className: 'closeWrap' }, { children: _jsx(Text, { className: 'icon', onClick: () => setPopupVisible(false) }) })), _jsxs(View, Object.assign({ className: 'goodsInfo' }, { children: [_jsx(View, Object.assign({ className: 'lPart' }, { children: _jsx(Image, { mode: 'widthFix', src: "", alt: "", className: 'goodsImg' }) })), _jsxs(View, Object.assign({ className: 'rPart' }, { children: [_jsx(View, Object.assign({ className: 'name' }, { children: goods.goodsShowname || '' })), _jsxs(View, Object.assign({ className: 'price' }, { children: ["\uFFE5: ", goods.pricesetNprice.toFixed(2) || ''] })), _jsx(View, Object.assign({ className: 'chosen' }, { children: "\u5DF2\u9009\u62E9: 15ml" }))] }))] })), _jsxs(View, Object.assign({ className: 'sizeArr' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: "\u9009\u62E9\u989C\u8272" })), _jsx(View, Object.assign({ className: 'sizeArrItemWrap' }, { children: goods.rsSpecValueDomainList.map((item, index) => {
|
|
24
23
|
return (_jsx(View, Object.assign({ className: `sizeItem ${index === selectSizeCoe ? 'active' : ''}`, "data-index": index, onClick: handleChooseSize.bind(null, index) }, { children: item.specValueValue }), index));
|
|
25
24
|
}) }))] })), _jsxs(View, Object.assign({ className: 'countWrap' }, { children: [_jsx(View, Object.assign({ className: 'label' }, { children: "\u8D2D\u4E70\u6570\u91CF" })), _jsxs(View, Object.assign({ className: 'numStep' }, { children: [_jsx(Text, Object.assign({ className: 'btn minus', onClick: handleStep.bind(null, 'minus') }, { children: "-" })), _jsx(Text, Object.assign({ className: 'content' }, { children: count })), _jsx(Text, Object.assign({ className: 'btn plus', onClick: handleStep.bind(null, 'plus') }, { children: "+" }))] }))] }))] })), _jsx(View, Object.assign({ className: 'btnWrap' }, { children: _jsx(Text, Object.assign({ className: 'btn' }, { children: "\u786E\u8BA4" })) }))] })) })) }));
|
|
26
25
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useComponent
|
|
2
|
+
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
3
|
import { THREE_DOTS } from '../../../static';
|
|
4
4
|
import GoodsDetailPopup from './goodsDetailPopup';
|
|
5
|
-
const { Popup, Radio } = antdMobile;
|
|
6
5
|
const GoodsDetailSize = ({ goods, popupVisible, setPopupVisible }) => {
|
|
7
|
-
const { View, Text
|
|
6
|
+
const { View, Text } = useComponent();
|
|
8
7
|
return (_jsxs(_Fragment, { children: [_jsxs(View, Object.assign({ className: 'goodsDetail-size', onClick: () => setPopupVisible(true) }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u89C4\u683C" })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u8BF7\u9009\u62E9 \u89C4\u683C" })), _jsx("img", { src: THREE_DOTS, alt: "", className: 'icon' })] }))] })), _jsx(GoodsDetailPopup, { popupVisible: popupVisible, setPopupVisible: setPopupVisible, goods: goods })] }));
|
|
9
8
|
};
|
|
10
9
|
export default GoodsDetailSize;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { useEffect, useState } from 'react';
|
|
11
|
+
import { useComponent } from '@brushes/qj-simulate-component';
|
|
12
|
+
import { getResourceGoodsInfoBySkuCode, queryPromotionListByGoodsCode } from '@brushes/api';
|
|
13
|
+
import { _ } from '@brushes/tools';
|
|
14
|
+
const { isEmpty, get } = _;
|
|
15
|
+
export function useGoodsDetailmpl(skuCode) {
|
|
16
|
+
const [goods, setGoods] = useState({});
|
|
17
|
+
const { View, Text, Skeleton } = useComponent();
|
|
18
|
+
const [promotionArr, setPromotionArr] = useState([]);
|
|
19
|
+
const [checkCollectionObj, setCheckCollectionObj] = useState({});
|
|
20
|
+
const [sliderArr, setSliderArr] = useState([]);
|
|
21
|
+
const [tabActive, setTabActive] = useState(1);
|
|
22
|
+
const [popupVisible, setPopupVisible] = useState(false);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
getGoodsDetailData();
|
|
25
|
+
}, []);
|
|
26
|
+
const getGoodsDetailData = () => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
try {
|
|
28
|
+
const goodsDetailResult = yield getResourceGoodsInfoBySkuCode({
|
|
29
|
+
skuCode
|
|
30
|
+
});
|
|
31
|
+
const promotionListParams = {
|
|
32
|
+
skuNo: goodsDetailResult.skuNo || '',
|
|
33
|
+
skuCode: goodsDetailResult.rsSkuDomainList[0].skuCode || '',
|
|
34
|
+
classtreeCode: goodsDetailResult.classtreeCode || '',
|
|
35
|
+
brandCode: goodsDetailResult.brandCode || '',
|
|
36
|
+
pntreeCode: goodsDetailResult.pntreeCode || '',
|
|
37
|
+
memberCode: goodsDetailResult.memberCode || ''
|
|
38
|
+
};
|
|
39
|
+
console.log(22, goodsDetailResult.rsGoodsFileDomainList);
|
|
40
|
+
const arr = get(goodsDetailResult, 'rsGoodsFileDomainList', []);
|
|
41
|
+
if (isEmpty(arr))
|
|
42
|
+
return;
|
|
43
|
+
const sliderData = arr.map((item) => {
|
|
44
|
+
return {
|
|
45
|
+
imgUrl: item.goodsFileUrl,
|
|
46
|
+
link: ''
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
setSliderArr(sliderData);
|
|
50
|
+
setGoods(goodsDetailResult);
|
|
51
|
+
getPromotionData(promotionListParams);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
console.log(59, err);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const getPromotionData = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const result = yield queryPromotionListByGoodsCode(params);
|
|
59
|
+
setPromotionArr(result);
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
View,
|
|
63
|
+
Text,
|
|
64
|
+
Skeleton,
|
|
65
|
+
goods,
|
|
66
|
+
promotionArr,
|
|
67
|
+
checkCollectionObj,
|
|
68
|
+
setCheckCollectionObj,
|
|
69
|
+
sliderArr,
|
|
70
|
+
tabActive,
|
|
71
|
+
setTabActive,
|
|
72
|
+
popupVisible,
|
|
73
|
+
setPopupVisible
|
|
74
|
+
};
|
|
75
|
+
}
|