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
|
@@ -1,78 +1,27 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import { memo
|
|
12
|
-
import { useComponent } from '@brushes/qj-simulate-component';
|
|
13
|
-
import { queryPromotionListByGoodsCode } from '@brushes/api';
|
|
2
|
+
import { memo } from 'react';
|
|
14
3
|
import { _ } from '@brushes/tools';
|
|
15
4
|
import { getEnv } from '@brushes/api';
|
|
16
5
|
import GoodsDetailPromotion from './components/goodsDetailPromotion';
|
|
17
6
|
import GoodsDetailCoupon from './components/goodsDetailCoupon';
|
|
18
|
-
import { goodsDetailFake } from '../../common/mock';
|
|
19
7
|
import GoodsDetailCollection from './components/goodsDetailCollection';
|
|
20
8
|
import GoodsDetailHandleBar from './components/goodsDetailHandleBar';
|
|
21
9
|
import { Slider } from '../Slider';
|
|
22
10
|
import GoodsDetailInfo from './components/goodsDetailInfo';
|
|
23
11
|
import GoodsDetailEvaluate from './components/goodsDetailEvaluate';
|
|
24
12
|
import GoodsDetailSize from './components/goodsDetailSize';
|
|
13
|
+
import { useGoodsDetailmpl } from './hooks';
|
|
25
14
|
const flag = getEnv();
|
|
26
|
-
const { isEmpty
|
|
27
|
-
const GoodsDetailJsx = () => {
|
|
15
|
+
const { isEmpty } = _;
|
|
16
|
+
const GoodsDetailJsx = ({ skuCode = '' }) => {
|
|
28
17
|
var _a;
|
|
29
|
-
const
|
|
30
|
-
const { View, Text, Skeleton } = useComponent();
|
|
31
|
-
const [promotionArr, setPromotionArr] = useState([]);
|
|
32
|
-
const [checkCollectionObj, setCheckCollectionObj] = useState({});
|
|
33
|
-
const [sliderArr, setSliderArr] = useState([]);
|
|
34
|
-
const [tabActive, setTabActive] = useState(1);
|
|
35
|
-
const [popupVisible, setPopupVisible] = useState(false);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
getGoodsDetailData();
|
|
38
|
-
}, []);
|
|
39
|
-
const getGoodsDetailData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
// const result = await getResourceGoodsInfoBySkuCode({
|
|
41
|
-
// skuCode: '639978727769698312'
|
|
42
|
-
// });
|
|
43
|
-
const goodsDetailResult = goodsDetailFake;
|
|
44
|
-
const promotionListParams = {
|
|
45
|
-
skuNo: goodsDetailResult.skuNo || '',
|
|
46
|
-
skuCode: goodsDetailResult.rsSkuDomainList[0].skuCode || '',
|
|
47
|
-
classtreeCode: goodsDetailResult.classtreeCode || '',
|
|
48
|
-
brandCode: goodsDetailResult.brandCode || '',
|
|
49
|
-
pntreeCode: goodsDetailResult.pntreeCode || '',
|
|
50
|
-
memberCode: goodsDetailResult.memberCode || ''
|
|
51
|
-
};
|
|
52
|
-
console.log(22, goodsDetailResult.rsGoodsFileDomainList);
|
|
53
|
-
const arr = get(goodsDetailResult, 'rsGoodsFileDomainList', []);
|
|
54
|
-
if (isEmpty(arr))
|
|
55
|
-
return;
|
|
56
|
-
const sliderData = arr.map((item) => {
|
|
57
|
-
return {
|
|
58
|
-
imgUrl: item.goodsFileUrl,
|
|
59
|
-
link: ''
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
setSliderArr(sliderData);
|
|
63
|
-
setGoods(goodsDetailResult);
|
|
64
|
-
getPromotionData(promotionListParams);
|
|
65
|
-
});
|
|
66
|
-
const getPromotionData = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
-
const result = yield queryPromotionListByGoodsCode(params);
|
|
68
|
-
setPromotionArr(result);
|
|
69
|
-
});
|
|
18
|
+
const { View, Text, Skeleton, goods, promotionArr, checkCollectionObj, setCheckCollectionObj, sliderArr, tabActive, setTabActive, popupVisible, setPopupVisible } = useGoodsDetailmpl(skuCode);
|
|
70
19
|
return (_jsx(View, Object.assign({ className: 'GoodsDetailWrap', style: {
|
|
71
20
|
height: flag ? '100vh' : '600px',
|
|
72
21
|
paddingBottom: flag ? '100vh' : '60px'
|
|
73
22
|
} }, { children: isEmpty(goods) ? (_jsxs(View, Object.assign({ className: 'skeleton' }, { children: [_jsx(Skeleton, { animated: true, style: {
|
|
74
23
|
'--width': '100%',
|
|
75
24
|
'--height': '300px'
|
|
76
|
-
} }), _jsx(Skeleton.Title, { animated: true }), _jsx(Skeleton.Paragraph, { lineCount: 10, animated: true })] }))) : (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'topSlider' }, { children: _jsx(Slider, { selectImg: sliderArr }) })), _jsxs(View, Object.assign({ className: 'goodsDetail-topInfo' }, { children: [_jsxs(View, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: goods === null || goods === void 0 ? void 0 : goods.goodsName })), _jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5", (_a = goods === null || goods === void 0 ? void 0 : goods.pricesetNprice) === null || _a === void 0 ? void 0 : _a.toFixed(2)] }))] }), _jsx(View, Object.assign({ className: 'rPart' }, { children: _jsx(GoodsDetailCollection, { goods: goods, checkCollectionObj: checkCollectionObj, setCheckCollectionObj: setCheckCollectionObj }) }))] })), _jsx(GoodsDetailSize, { goods: goods, popupVisible: popupVisible, setPopupVisible: setPopupVisible }), _jsx(GoodsDetailPromotion, { promotionList: promotionArr }), _jsx(GoodsDetailCoupon, {}), _jsxs(View, Object.assign({ className: 'goodsDetailTab' }, { children: [_jsxs(View, Object.assign({ className: 'tabs' }, { children: [_jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 1 ? 'active' : ''}`, onClick: () => setTabActive(1) }, { children: ["\u5546\u54C1\u8BE6\u60C5", _jsx(Text, { className: 'line' })] })), _jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 2 ? 'active' : ''}`, onClick: () => setTabActive(2) }, { children: ["\u8BC4\u4EF7", _jsx(Text, { className: 'line' })] }))] })), _jsx(View, Object.assign({ className: 'group' }, { children: tabActive === 1 ? _jsx(GoodsDetailInfo, { goods: goods }) : _jsx(GoodsDetailEvaluate, {}) }))] })), _jsx(GoodsDetailHandleBar, {})] })) })));
|
|
25
|
+
} }), _jsx(Skeleton.Title, { animated: true }), _jsx(Skeleton.Paragraph, { lineCount: 10, animated: true })] }))) : (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'topSlider' }, { children: _jsx(Slider, { selectImg: sliderArr }) })), _jsxs(View, Object.assign({ className: 'goodsDetail-topInfo' }, { children: [_jsxs(View, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: goods === null || goods === void 0 ? void 0 : goods.goodsName })), _jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5", (_a = goods === null || goods === void 0 ? void 0 : goods.pricesetNprice) === null || _a === void 0 ? void 0 : _a.toFixed(2)] }))] }), _jsx(View, Object.assign({ className: 'rPart' }, { children: _jsx(GoodsDetailCollection, { goods: goods, checkCollectionObj: checkCollectionObj, setCheckCollectionObj: setCheckCollectionObj }) }))] })), _jsx(GoodsDetailSize, { goods: goods, popupVisible: popupVisible, setPopupVisible: setPopupVisible }), _jsx(GoodsDetailPromotion, { promotionList: promotionArr }), _jsx(GoodsDetailCoupon, {}), _jsxs(View, Object.assign({ className: 'goodsDetailTab' }, { children: [_jsxs(View, Object.assign({ className: 'tabs' }, { children: [_jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 1 ? 'active' : ''}`, onClick: () => setTabActive(1) }, { children: ["\u5546\u54C1\u8BE6\u60C5", _jsx(Text, { className: 'line' })] })), _jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 2 ? 'active' : ''}`, onClick: () => setTabActive(2) }, { children: ["\u8BC4\u4EF7", _jsx(Text, { className: 'line' })] }))] })), _jsx(View, Object.assign({ className: 'group' }, { children: tabActive === 1 ? (_jsx(GoodsDetailInfo, { tabActive: tabActive, goods: goods })) : (_jsx(GoodsDetailEvaluate, {})) }))] })), _jsx(GoodsDetailHandleBar, {})] })) })));
|
|
77
26
|
};
|
|
78
27
|
export const GoodsDetail = memo(GoodsDetailJsx);
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
|
+
import { QjMobileIcon } from '../../../common/icon';
|
|
4
5
|
const dataConfig = [
|
|
5
6
|
{
|
|
6
7
|
name: '默认',
|
|
7
|
-
|
|
8
|
+
sortField: 'pricesetNprice'
|
|
8
9
|
},
|
|
9
10
|
{
|
|
10
11
|
name: '新品',
|
|
11
|
-
|
|
12
|
+
sortField: ''
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
name: '销量',
|
|
15
|
-
|
|
16
|
+
sortField: 'goodsSalesvolume',
|
|
17
|
+
order: 'asc'
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
name: '价格',
|
|
19
|
-
|
|
21
|
+
sortField: 'pricesetNprice',
|
|
22
|
+
order: 'asc'
|
|
20
23
|
}
|
|
21
24
|
];
|
|
22
|
-
export const Filter = () => {
|
|
25
|
+
export const Filter = ({ setParams }) => {
|
|
23
26
|
const { View } = useComponent();
|
|
24
27
|
const [active, setActive] = useState(0);
|
|
25
|
-
const
|
|
26
|
-
|
|
28
|
+
const [config, setConfig] = useState(dataConfig);
|
|
29
|
+
const handleSort = (sortField, index, order) => {
|
|
27
30
|
setActive(index);
|
|
28
|
-
|
|
31
|
+
if (order) {
|
|
32
|
+
setConfig((prevState) => {
|
|
33
|
+
prevState[index].order = order === 'asc' ? 'desc' : 'asc';
|
|
34
|
+
return [...prevState];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
setParams({
|
|
38
|
+
sortField,
|
|
39
|
+
order
|
|
40
|
+
});
|
|
29
41
|
};
|
|
30
|
-
return (_jsx(View, Object.assign({ className: 'sortWrap' }, { children:
|
|
42
|
+
return (_jsx(View, Object.assign({ className: 'sortWrap' }, { children: config.map(({ order, sortField, name }, index) => (_jsxs(View, Object.assign({ className: `sortItem ${active === index ? 'active' : ''}`, onClick: () => handleSort(sortField, index, order) }, { children: [name, order && (_jsx(QjMobileIcon, { style: { color: active === index ? '#f00' : '#444', fontSize: 20 }, value: order === 'desc' ? 'jiangxu' : 'shengxu' }))] }), index))) })));
|
|
31
43
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { FilterType } from '../index';
|
|
2
|
+
export interface ListType {
|
|
3
|
+
skuCode: string;
|
|
4
|
+
dataPic: string;
|
|
5
|
+
goodsName: string;
|
|
6
|
+
pricesetNprice: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function useGoodsList(classtreeCode: string, filterParmas: FilterType): {
|
|
2
9
|
loading: boolean;
|
|
3
|
-
getData: (
|
|
4
|
-
list:
|
|
10
|
+
getData: (...args: any[]) => any;
|
|
11
|
+
list: ListType[];
|
|
5
12
|
};
|
|
@@ -9,38 +9,42 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useEffect, useRef, useState } from 'react';
|
|
11
11
|
import { find } from '@brushes/api';
|
|
12
|
-
import { _ } from '@brushes/tools';
|
|
12
|
+
import { _, useImmutableCallback } from '@brushes/tools';
|
|
13
13
|
const { isEmpty } = _;
|
|
14
|
-
export function useGoodsList(classtreeCode) {
|
|
14
|
+
export function useGoodsList(classtreeCode, filterParmas) {
|
|
15
15
|
const isCanScroll = useRef(true);
|
|
16
16
|
const num = useRef(0);
|
|
17
17
|
const [list, setList] = useState([]);
|
|
18
|
-
// const sortField = useRef('pricesetNprice');
|
|
19
|
-
// const order = useRef('asc');
|
|
20
18
|
const [loading, setLoading] = useState(false);
|
|
21
19
|
useEffect(() => {
|
|
22
|
-
|
|
23
|
-
}, []);
|
|
24
|
-
const
|
|
20
|
+
resetImpl();
|
|
21
|
+
}, [filterParmas]);
|
|
22
|
+
const resetImpl = useImmutableCallback(() => {
|
|
23
|
+
num.current = 0;
|
|
24
|
+
isCanScroll.current = true;
|
|
25
|
+
setList([]);
|
|
26
|
+
getData(filterParmas);
|
|
27
|
+
});
|
|
28
|
+
const getData = useImmutableCallback(({ sortField = 'pricesetNprice', order = '' }) => __awaiter(this, void 0, void 0, function* () {
|
|
25
29
|
if (!isCanScroll.current)
|
|
26
30
|
return;
|
|
27
31
|
++num.current;
|
|
28
32
|
setLoading(true);
|
|
29
33
|
const response = yield find({
|
|
30
34
|
distinctField: 'goodsNo',
|
|
31
|
-
sortField
|
|
35
|
+
sortField,
|
|
32
36
|
order: order,
|
|
33
37
|
goodsType: '00,50',
|
|
34
38
|
page: num.current,
|
|
35
|
-
rows: 10
|
|
36
|
-
|
|
39
|
+
rows: 10,
|
|
40
|
+
classtreeCode
|
|
37
41
|
});
|
|
38
42
|
if (isEmpty(response.list)) {
|
|
39
43
|
isCanScroll.current = false;
|
|
40
44
|
}
|
|
41
45
|
setLoading(false);
|
|
42
46
|
setList((prevState) => prevState.concat(response.list));
|
|
43
|
-
});
|
|
47
|
+
}));
|
|
44
48
|
return {
|
|
45
49
|
loading,
|
|
46
50
|
getData,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { memo, useState } from 'react';
|
|
3
3
|
import { Loading, navigatorImpl, ScrollView, useComponent } from '@brushes/qj-simulate-component';
|
|
4
4
|
import { QjMobileIcon } from '../../common/icon';
|
|
5
5
|
import { Filter } from './components/filter';
|
|
@@ -7,9 +7,10 @@ import { useGoodsList } from './hooks/useGoodsList';
|
|
|
7
7
|
import { routerMap } from '../../routerMap';
|
|
8
8
|
const GoodsListJsx = ({ classtreeCode = '' }) => {
|
|
9
9
|
const { View, Text } = useComponent();
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const [filterParmas, setFilterParams] = useState({});
|
|
11
|
+
const { loading, getData, list } = useGoodsList(classtreeCode, filterParmas);
|
|
12
|
+
return (_jsxs(View, Object.assign({ className: 'goodsList' }, { children: [_jsxs(View, Object.assign({ className: 'top-info' }, { children: [_jsxs(View, Object.assign({ className: 'top-info-search', onClick: () => navigatorImpl(routerMap.search) }, { children: [_jsx(QjMobileIcon, { value: "fenxiang" }), _jsx(Text, { children: "\u641C\u7D22\u5546\u54C1" })] })), _jsx(Filter, { setParams: setFilterParams })] })), _jsx(View, Object.assign({ className: 'listWrap' }, { children: _jsxs(ScrollView, Object.assign({ onScroll: () => getData(filterParmas), style: { height: '100vh' } }, { children: [_jsx(View, Object.assign({ className: 'list' }, { children: list.map((item) => {
|
|
13
|
+
return (_jsxs(View, Object.assign({ onClick: () => navigatorImpl(`${routerMap.goodDetail}?skuCode=${item.skuCode}`), className: 'listItem' }, { children: [_jsx(View, { className: 'img', style: { backgroundImage: `url(${item.dataPic})` } }), _jsx(Text, Object.assign({ className: 'name' }, { children: item.goodsName })), _jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5 ", item.pricesetNprice.toFixed(2)] }))] }), item.skuCode));
|
|
13
14
|
}) })), loading ? _jsx(Loading, {}) : null] })) }))] })));
|
|
14
15
|
};
|
|
15
16
|
export const GoodsList = memo(GoodsListJsx);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
|
-
const LineJsx = ({ borderRadius, height, width, backgroundColor,
|
|
4
|
+
const LineJsx = ({ borderRadius, height, width, backgroundColor, paddingTop, paddingBottom }) => {
|
|
5
5
|
const { View } = useComponent();
|
|
6
|
-
return (_jsx(View, { style: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
return (_jsx(View, Object.assign({ style: {
|
|
7
|
+
paddingTop,
|
|
8
|
+
paddingBottom
|
|
9
|
+
} }, { children: _jsx(View, { style: {
|
|
10
|
+
borderRadius: borderRadius + '%',
|
|
11
|
+
width: width + '%',
|
|
12
|
+
height: height + 'px',
|
|
13
|
+
backgroundColor,
|
|
14
|
+
marginLeft: 'auto',
|
|
15
|
+
marginRight: 'auto'
|
|
16
|
+
} }) })));
|
|
16
17
|
};
|
|
17
18
|
export const Line = memo(LineJsx);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Notice: ({ text, backgroundColor, color, fontSize,
|
|
2
|
+
export declare const Notice: ({ text, backgroundColor, color, fontSize, borderColor, paddingTop, paddingBottom, paddingLeft, paddingRight }: {
|
|
3
3
|
fontSize: string;
|
|
4
4
|
borderColor: string;
|
|
5
|
-
marginBottom: string;
|
|
6
5
|
color: string;
|
|
7
6
|
text: React.ReactNode;
|
|
8
7
|
backgroundColor: string;
|
|
8
|
+
paddingTop: number;
|
|
9
|
+
paddingBottom: number;
|
|
10
|
+
paddingLeft: number;
|
|
11
|
+
paddingRight: number;
|
|
9
12
|
}) => JSX.Element | null;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
3
|
-
|
|
4
|
-
export const Notice = ({ text, backgroundColor, color, fontSize, marginBottom, borderColor }) => {
|
|
5
|
-
const flag = getEnv();
|
|
3
|
+
export const Notice = ({ text, backgroundColor, color, fontSize, borderColor, paddingTop, paddingBottom, paddingLeft, paddingRight }) => {
|
|
6
4
|
const { View, NoticeBar } = useComponent();
|
|
7
|
-
console.log(22, flag);
|
|
8
5
|
if (!View)
|
|
9
6
|
return null;
|
|
10
|
-
return (_jsx(View, Object.assign({ style: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, { children: _jsx(NoticeBar, { speed: 50, style: {
|
|
8
|
+
'--border-color': borderColor,
|
|
9
|
+
'--font-size': fontSize + 'px',
|
|
10
|
+
'--background-color': backgroundColor,
|
|
11
|
+
'--text-color': color,
|
|
12
|
+
paddingLeft,
|
|
13
|
+
paddingRight
|
|
14
|
+
}, content: text, color: "alert" }) }) })));
|
|
16
15
|
};
|
|
@@ -5,8 +5,10 @@ interface SearchType {
|
|
|
5
5
|
fontColor: string;
|
|
6
6
|
backgroundColor: string;
|
|
7
7
|
borderRadius: number;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
paddingTop: number;
|
|
9
|
+
paddingBottom: number;
|
|
10
|
+
paddingLeft: number;
|
|
11
|
+
paddingRight: number;
|
|
10
12
|
}
|
|
11
13
|
export declare const Search: React.NamedExoticComponent<SearchType>;
|
|
12
14
|
export {};
|
|
@@ -2,29 +2,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
4
|
import { SEARCH } from '../../static';
|
|
5
|
-
const SearchJsx = ({ value, iconShow, fontColor, backgroundColor, borderRadius,
|
|
6
|
-
const { View } = useComponent();
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
const SearchJsx = ({ value, iconShow, fontColor, backgroundColor, borderRadius, paddingTop, paddingBottom, paddingLeft, paddingRight }) => {
|
|
6
|
+
const { View, Image } = useComponent();
|
|
7
|
+
return (_jsx(View, Object.assign({ style: {
|
|
8
|
+
paddingTop,
|
|
9
|
+
paddingBottom,
|
|
10
|
+
paddingLeft,
|
|
11
|
+
paddingRight
|
|
12
|
+
} }, { children: _jsxs(View, Object.assign({ className: 'components-search', style: {
|
|
13
|
+
backgroundColor,
|
|
14
|
+
borderRadius: borderRadius + 'px',
|
|
15
|
+
height: '32px',
|
|
16
|
+
lineHeight: '32px',
|
|
17
|
+
width: '100%',
|
|
18
|
+
display: 'inline-block',
|
|
19
|
+
textAlign: 'center'
|
|
20
|
+
} }, { children: [_jsx(Image, { src: SEARCH, alt: "", mode: 'fill', style: {
|
|
21
|
+
height: '16px',
|
|
22
|
+
width: '16px',
|
|
23
|
+
display: iconShow ? 'inline-block' : 'none',
|
|
24
|
+
verticalAlign: 'top',
|
|
25
|
+
marginTop: '8px',
|
|
26
|
+
marginRight: '10px'
|
|
27
|
+
} }), _jsx(View, Object.assign({ className: 'txt', style: {
|
|
28
|
+
color: fontColor,
|
|
29
|
+
display: 'inline-block',
|
|
30
|
+
fontSize: '14px'
|
|
31
|
+
} }, { children: value }))] })) })));
|
|
29
32
|
};
|
|
30
33
|
export const Search = memo(SearchJsx);
|
|
@@ -10,8 +10,10 @@ interface SwiperType {
|
|
|
10
10
|
autoplayInterval?: number;
|
|
11
11
|
direction?: 'horizontal' | 'vertical';
|
|
12
12
|
loop?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
paddingTop?: number;
|
|
14
|
+
paddingBottom?: number;
|
|
15
|
+
paddingLeft?: number;
|
|
16
|
+
paddingRight?: number;
|
|
15
17
|
selectImg?: Array<itemType>;
|
|
16
18
|
imgHeight?: {
|
|
17
19
|
height: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
-
import { SmoothSwiper } from '@brushes/qj-simulate-component';
|
|
4
|
+
import { SmoothSwiper, View } from '@brushes/qj-simulate-component';
|
|
5
5
|
import { getEnv } from '@brushes/api';
|
|
6
6
|
import { _ } from '@brushes/tools';
|
|
7
7
|
import { Items } from './item';
|
|
8
8
|
const { isUndefined, isEmpty } = _;
|
|
9
|
-
const SwiperJsx = ({ defaultValue = [], type, autoplay, autoplayInterval, direction, loop,
|
|
9
|
+
const SwiperJsx = ({ defaultValue = [], type, autoplay, autoplayInterval, direction, loop, paddingTop, paddingBottom, paddingLeft, paddingRight, selectImg, imgHeight }) => {
|
|
10
10
|
const [list, setList] = useState(defaultValue);
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
const computedArr = selectImg
|
|
@@ -18,9 +18,11 @@ const SwiperJsx = ({ defaultValue = [], type, autoplay, autoplayInterval, direct
|
|
|
18
18
|
}
|
|
19
19
|
setList(arr);
|
|
20
20
|
}, [selectImg]);
|
|
21
|
-
return (_jsx(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return (_jsx(View, Object.assign({ style: {
|
|
22
|
+
paddingTop,
|
|
23
|
+
paddingBottom,
|
|
24
|
+
paddingLeft,
|
|
25
|
+
paddingRight
|
|
26
|
+
} }, { children: _jsx(SmoothSwiper, { className: getEnv() ? 'slider-block' : 'pc', imgHeight: imgHeight, data: list, type: type, autoplay: autoplay, autoplayInterval: autoplayInterval, direction: direction, loop: loop, render: (item) => _jsx(Items, { type: type, item: item }) }) })));
|
|
25
27
|
};
|
|
26
28
|
export const Slider = memo(SwiperJsx);
|
|
@@ -2,14 +2,16 @@ import React from 'react';
|
|
|
2
2
|
interface TitleType {
|
|
3
3
|
value: string;
|
|
4
4
|
fontSize: number;
|
|
5
|
-
textAlign:
|
|
5
|
+
textAlign: any;
|
|
6
6
|
color: string;
|
|
7
7
|
backgroundColor: string;
|
|
8
8
|
fontWeight: string;
|
|
9
9
|
textDecoration: string;
|
|
10
10
|
fontStyle: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
paddingTop: number;
|
|
12
|
+
paddingLeft: number;
|
|
13
|
+
paddingRight: number;
|
|
14
|
+
paddingBottom: number;
|
|
13
15
|
}
|
|
14
16
|
export declare const Title: React.NamedExoticComponent<TitleType>;
|
|
15
17
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
|
-
const TitleJsx = ({ value, fontSize, textAlign, color, backgroundColor, fontWeight, textDecoration, fontStyle,
|
|
4
|
+
const TitleJsx = ({ value, fontSize, textAlign, color, backgroundColor, fontWeight, textDecoration, fontStyle, paddingTop, paddingLeft, paddingRight, paddingBottom }) => {
|
|
5
5
|
const { View } = useComponent();
|
|
6
|
-
return (_jsx(View, Object.assign({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, Object.assign({ style: {
|
|
7
|
+
fontSize,
|
|
8
|
+
textAlign,
|
|
9
|
+
color,
|
|
10
|
+
backgroundColor,
|
|
11
|
+
fontWeight,
|
|
12
|
+
textDecoration,
|
|
13
|
+
fontStyle,
|
|
14
|
+
paddingLeft,
|
|
15
|
+
paddingRight
|
|
16
|
+
} }, { children: value })) })));
|
|
17
17
|
};
|
|
18
18
|
export const Title = memo(TitleJsx);
|
|
@@ -4,8 +4,10 @@ interface VideoType {
|
|
|
4
4
|
poster: string;
|
|
5
5
|
autoplay: boolean;
|
|
6
6
|
loop: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
paddingBottom: number;
|
|
9
|
+
paddingLeft: number;
|
|
10
|
+
paddingRight: number;
|
|
9
11
|
}
|
|
10
12
|
export declare const Video: React.NamedExoticComponent<VideoType>;
|
|
11
13
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { useComponent } from '@brushes/qj-simulate-component';
|
|
4
|
+
const VideoJsx = ({ url, poster, autoplay, loop, paddingTop, paddingBottom, paddingLeft, paddingRight }) => {
|
|
5
|
+
const { View } = useComponent();
|
|
6
|
+
return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx("video", { className: 'components-video', src: 'https://www.runoob.com/try/demo_source/movie.ogg', poster: poster, autoPlay: autoplay, loop: loop, controls: true, "object-fit": "contain", style: {
|
|
5
7
|
width: '100%',
|
|
6
8
|
height: '240px',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} }) }));
|
|
9
|
+
paddingLeft,
|
|
10
|
+
paddingRight
|
|
11
|
+
} }) })));
|
|
10
12
|
};
|
|
11
13
|
export const Video = memo(VideoJsx);
|
package/dist/routerMap/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "s-material-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "'组件库'",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@brushes/api": "^0.
|
|
30
|
+
"@brushes/api": "^0.3.3",
|
|
31
31
|
"@brushes/qj-simulate-component": "^0.0.9",
|
|
32
32
|
"@brushes/tools": "^1.0.25",
|
|
33
33
|
"@stencil/core": "^2.19.1",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"@types/react": "^18.0.0",
|
|
36
36
|
"china-division": "^2.5.0",
|
|
37
37
|
"classnames": "^2.3.2",
|
|
38
|
-
"flyio": "^0.6.14",
|
|
39
38
|
"nodemon": "^2.0.19",
|
|
40
39
|
"prettier": "^2.7.1",
|
|
41
40
|
"react": "^18.0.0",
|