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.
Files changed (48) hide show
  1. package/css/common/icon.scss +28 -4
  2. package/css/font/iconfont.ttf +0 -0
  3. package/css/font/iconfont.woff +0 -0
  4. package/css/font/iconfont.woff2 +0 -0
  5. package/css/pages/goodsClassify.scss +1 -1
  6. package/css/pages/goodsDetail.scss +34 -20
  7. package/css/pages/goodsList.scss +10 -16
  8. package/css/pages/index.scss +4 -0
  9. package/css/pages/searchPage.scss +2 -1
  10. package/dist/common/evaluateItem/index.js +3 -3
  11. package/dist/common/icon/index.d.ts +0 -1
  12. package/dist/common/icon/index.js +1 -1
  13. package/dist/components/ClassifyNav/index.d.ts +2 -2
  14. package/dist/components/ClassifyNav/index.js +4 -5
  15. package/dist/components/Cube/index.d.ts +4 -2
  16. package/dist/components/Cube/index.js +20 -17
  17. package/dist/components/Goods/index.d.ts +4 -0
  18. package/dist/components/Goods/index.js +12 -10
  19. package/dist/components/GoodsClassify/index.js +3 -2
  20. package/dist/components/GoodsDetail/components/goodsDetailEvaluate.js +2 -3
  21. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.js +2 -1
  22. package/dist/components/GoodsDetail/components/goodsDetailInfo.d.ts +1 -1
  23. package/dist/components/GoodsDetail/components/goodsDetailInfo.js +10 -2
  24. package/dist/components/GoodsDetail/components/goodsDetailPopup.js +3 -4
  25. package/dist/components/GoodsDetail/components/goodsDetailSize.js +2 -3
  26. package/dist/components/GoodsDetail/hooks/index.js +75 -0
  27. package/dist/components/GoodsDetail/index.js +6 -57
  28. package/dist/components/GoodsList/components/filter.d.ts +5 -1
  29. package/dist/components/GoodsList/components/filter.js +22 -10
  30. package/dist/components/GoodsList/hooks/useGoodsList.d.ts +10 -3
  31. package/dist/components/GoodsList/hooks/useGoodsList.js +15 -11
  32. package/dist/components/GoodsList/index.d.ts +4 -0
  33. package/dist/components/GoodsList/index.js +5 -4
  34. package/dist/components/Line/index.d.ts +2 -2
  35. package/dist/components/Line/index.js +12 -11
  36. package/dist/components/Notice/index.d.ts +5 -2
  37. package/dist/components/Notice/index.js +9 -10
  38. package/dist/components/Search/index.d.ts +4 -2
  39. package/dist/components/Search/index.js +27 -24
  40. package/dist/components/Slider/index.d.ts +4 -2
  41. package/dist/components/Slider/index.js +8 -6
  42. package/dist/components/Title/index.d.ts +5 -3
  43. package/dist/components/Title/index.js +12 -12
  44. package/dist/components/Video/index.d.ts +4 -2
  45. package/dist/components/Video/index.js +8 -6
  46. package/dist/routerMap/index.d.ts +1 -0
  47. package/dist/routerMap/index.js +2 -1
  48. 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, useEffect, useState } from 'react';
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, get } = _;
27
- const GoodsDetailJsx = () => {
15
+ const { isEmpty } = _;
16
+ const GoodsDetailJsx = ({ skuCode = '' }) => {
28
17
  var _a;
29
- const [goods, setGoods] = useState({});
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 +1,5 @@
1
- export declare const Filter: () => JSX.Element;
1
+ import { Dispatch } from 'react';
2
+ import { FilterType } from '../index';
3
+ export declare const Filter: ({ setParams }: {
4
+ setParams: Dispatch<FilterType>;
5
+ }) => JSX.Element;
@@ -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
- code: 'pricesetNprice'
8
+ sortField: 'pricesetNprice'
8
9
  },
9
10
  {
10
11
  name: '新品',
11
- code: ''
12
+ sortField: ''
12
13
  },
13
14
  {
14
15
  name: '销量',
15
- code: 'goodsSalesvolume'
16
+ sortField: 'goodsSalesvolume',
17
+ order: 'asc'
16
18
  },
17
19
  {
18
20
  name: '价格',
19
- code: 'pricesetNprice'
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 handleSort = (e) => {
26
- const { index, type } = e.target.dataset;
28
+ const [config, setConfig] = useState(dataConfig);
29
+ const handleSort = (sortField, index, order) => {
27
30
  setActive(index);
28
- console.log(30, type);
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: dataConfig.map((item, index) => (_jsx(View, Object.assign({ "data-index": index, "data-type": item.code, className: `sortItem ${active === index ? 'active' : ''}`, onClick: handleSort }, { children: item.name }), index))) })));
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
- export declare function useGoodsList(classtreeCode: string): {
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: (sortField?: string, order?: string) => Promise<void>;
4
- list: never[];
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
- getData();
23
- }, []);
24
- const getData = (sortField = 'pricesetNprice', order = 'asc') => __awaiter(this, void 0, void 0, function* () {
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: sortField,
35
+ sortField,
32
36
  order: order,
33
37
  goodsType: '00,50',
34
38
  page: num.current,
35
- rows: 10
36
- // classtreeCode,
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,2 +1,6 @@
1
1
  import React from 'react';
2
+ export interface FilterType {
3
+ sortField: string;
4
+ order?: string | undefined;
5
+ }
2
6
  export declare const GoodsList: React.NamedExoticComponent<{}>;
@@ -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 { loading, getData, list } = useGoodsList(classtreeCode);
11
- return (_jsxs(View, Object.assign({ className: 'goodsList' }, { children: [_jsxs(View, Object.assign({ className: 'topInfo' }, { children: [_jsxs(View, Object.assign({ className: 'search' }, { children: [_jsx(QjMobileIcon, { value: "fenxiang" }), _jsx(Text, Object.assign({ className: 'title' }, { children: "\u641C\u7D22\u5546\u54C1" }))] })), _jsx(Filter, {})] })), _jsx(View, Object.assign({ className: 'listWrap' }, { children: _jsxs(ScrollView, Object.assign({ onScroll: () => getData(), style: { height: '100vh' } }, { children: [_jsx(View, Object.assign({ className: 'list' }, { children: list.map((item) => {
12
- return (_jsxs(View, Object.assign({ onClick: () => navigatorImpl(routerMap.goodDetail), 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));
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);
@@ -4,8 +4,8 @@ interface LineType {
4
4
  height: number;
5
5
  width: number;
6
6
  backgroundColor: string;
7
- marginTop: number;
8
- marginBottom: number;
7
+ paddingTop: number;
8
+ paddingBottom: number;
9
9
  }
10
10
  export declare const Line: React.NamedExoticComponent<LineType>;
11
11
  export {};
@@ -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, marginTop, marginBottom }) => {
4
+ const LineJsx = ({ borderRadius, height, width, backgroundColor, paddingTop, paddingBottom }) => {
5
5
  const { View } = useComponent();
6
- return (_jsx(View, { style: {
7
- borderRadius: borderRadius + '%',
8
- width: width + '%',
9
- height: height + 'px',
10
- backgroundColor,
11
- marginLeft: 'auto',
12
- marginRight: 'auto',
13
- marginTop: marginTop + 'px',
14
- marginBottom: marginBottom + 'px'
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, marginBottom, borderColor }: {
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
- import { getEnv } from '@brushes/api';
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: { marginBottom } }, { children: _jsx(NoticeBar, { speed: 50, style: {
11
- '--border-color': borderColor,
12
- '--font-size': fontSize + 'px',
13
- '--background-color': backgroundColor,
14
- '--text-color': color
15
- }, content: text, color: "alert" }) })));
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
- marginTop: number;
9
- marginBottom: number;
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, marginTop, marginBottom }) => {
6
- const { View } = useComponent();
7
- return (_jsxs(View, Object.assign({ className: 'components-search', style: {
8
- backgroundColor,
9
- borderRadius: borderRadius + 'px',
10
- marginTop: marginTop + 'px',
11
- marginBottom: marginBottom + 'px',
12
- height: '32px',
13
- lineHeight: '32px',
14
- width: '100%',
15
- display: 'inline-block',
16
- textAlign: 'center'
17
- } }, { children: [_jsx("img", { src: SEARCH, alt: "", mode: 'fill', style: {
18
- height: '16px',
19
- width: '16px',
20
- display: iconShow ? 'inline-block' : 'none',
21
- verticalAlign: 'top',
22
- marginTop: '8px',
23
- marginRight: '10px'
24
- } }), _jsx(View, Object.assign({ className: 'txt', style: {
25
- color: fontColor,
26
- display: 'inline-block',
27
- fontSize: '14px'
28
- } }, { children: value }))] })));
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
- marginTop?: number;
14
- marginBottom?: number;
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, marginTop, marginBottom, selectImg, imgHeight }) => {
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(SmoothSwiper, { className: getEnv() ? 'slider-block' : 'pc', style: {
22
- marginTop: marginTop + 'px',
23
- marginBottom: marginBottom + 'px'
24
- }, imgHeight: imgHeight, data: list, type: type, autoplay: autoplay, autoplayInterval: autoplayInterval, direction: direction, loop: loop, render: (item) => _jsx(Items, { type: type, item: item }) }));
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: number;
5
+ textAlign: any;
6
6
  color: string;
7
7
  backgroundColor: string;
8
8
  fontWeight: string;
9
9
  textDecoration: string;
10
10
  fontStyle: string;
11
- marginTop: number;
12
- marginBottom: number;
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, marginTop, marginBottom }) => {
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({ className: 'components-title', style: {
7
- fontSize,
8
- textAlign,
9
- color,
10
- backgroundColor,
11
- fontWeight,
12
- textDecoration,
13
- fontStyle,
14
- marginTop,
15
- marginBottom
16
- } }, { children: value })));
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
- marginTop: number;
8
- marginBottom: number;
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, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
- const VideoJsx = ({ url, poster, autoplay, loop, marginTop, marginBottom }) => {
4
- return (_jsx(_Fragment, { 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: {
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
- marginTop,
8
- marginBottom
9
- } }) }));
9
+ paddingLeft,
10
+ paddingRight
11
+ } }) })));
10
12
  };
11
13
  export const Video = memo(VideoJsx);
@@ -5,4 +5,5 @@ export declare const routerMap: {
5
5
  goodDetail: string;
6
6
  result: string;
7
7
  rate: string;
8
+ search: string;
8
9
  };
@@ -4,5 +4,6 @@ export const routerMap = {
4
4
  goodList: '/subpackage/goodlist/index',
5
5
  goodDetail: '/subpackage/gooddetail/index',
6
6
  result: '/subpackage/result/index',
7
- rate: '/subpackage/rate/index'
7
+ rate: '/subpackage/rate/index',
8
+ search: '/subpackage/search/index'
8
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s-material-react",
3
- "version": "0.1.6",
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.2.6",
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",