s-material-react 0.0.4

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 (78) hide show
  1. package/css/basic/textLine.scss +13 -0
  2. package/css/common/card.scss +52 -0
  3. package/css/common/icon.scss +42 -0
  4. package/css/common/index.scss +2 -0
  5. package/css/index.scss +3 -0
  6. package/css/pages/classifyNav.scss +19 -0
  7. package/css/pages/cube.scss +76 -0
  8. package/css/pages/goods.scss +90 -0
  9. package/css/pages/goodsClassify.scss +108 -0
  10. package/css/pages/goodsGroup.scss +0 -0
  11. package/css/pages/goodsList.scss +83 -0
  12. package/css/pages/index.scss +17 -0
  13. package/css/pages/notice.scss +25 -0
  14. package/css/pages/order-goodsItem.scss +17 -0
  15. package/css/pages/orderDetail.scss +144 -0
  16. package/css/pages/orderEntry.scss +41 -0
  17. package/css/pages/orderList.scss +72 -0
  18. package/css/pages/service.scss +9 -0
  19. package/css/pages/slider.scss +17 -0
  20. package/css/pages/title.scss +3 -0
  21. package/css/variables/default.scss +55 -0
  22. package/dist/common/card/index.d.ts +8 -0
  23. package/dist/common/card/index.js +6 -0
  24. package/dist/common/icon/index.d.ts +7 -0
  25. package/dist/common/icon/index.js +12 -0
  26. package/dist/components/ClassifyNav/index.d.ts +15 -0
  27. package/dist/components/ClassifyNav/index.js +24 -0
  28. package/dist/components/Cube/index.d.ts +15 -0
  29. package/dist/components/Cube/index.js +36 -0
  30. package/dist/components/Goods/index.d.ts +20 -0
  31. package/dist/components/Goods/index.js +67 -0
  32. package/dist/components/GoodsClassify/components/classifyFloor.d.ts +1 -0
  33. package/dist/components/GoodsClassify/components/classifyFloor.js +11 -0
  34. package/dist/components/GoodsClassify/index.d.ts +2 -0
  35. package/dist/components/GoodsClassify/index.js +36 -0
  36. package/dist/components/GoodsDetail/index.d.ts +2 -0
  37. package/dist/components/GoodsDetail/index.js +6 -0
  38. package/dist/components/GoodsGroup/index.d.ts +25 -0
  39. package/dist/components/GoodsGroup/index.js +26 -0
  40. package/dist/components/GoodsList/index.d.ts +2 -0
  41. package/dist/components/GoodsList/index.js +66 -0
  42. package/dist/components/Line/index.d.ts +11 -0
  43. package/dist/components/Line/index.js +17 -0
  44. package/dist/components/Notice/index.d.ts +9 -0
  45. package/dist/components/Notice/index.js +20 -0
  46. package/dist/components/OrderDetail/index.d.ts +2 -0
  47. package/dist/components/OrderDetail/index.js +12 -0
  48. package/dist/components/OrderEntry/index.d.ts +2 -0
  49. package/dist/components/OrderEntry/index.js +9 -0
  50. package/dist/components/OrderList/components/OrderListItem.d.ts +7 -0
  51. package/dist/components/OrderList/components/OrderListItem.js +35 -0
  52. package/dist/components/OrderList/components/mock.d.ts +1647 -0
  53. package/dist/components/OrderList/components/mock.js +4417 -0
  54. package/dist/components/OrderList/components/orderItem.d.ts +15 -0
  55. package/dist/components/OrderList/components/orderItem.js +8 -0
  56. package/dist/components/OrderList/index.d.ts +2 -0
  57. package/dist/components/OrderList/index.js +16 -0
  58. package/dist/components/Search/index.d.ts +12 -0
  59. package/dist/components/Search/index.js +30 -0
  60. package/dist/components/Service/index.d.ts +2 -0
  61. package/dist/components/Service/index.js +7 -0
  62. package/dist/components/Slider/index.d.ts +22 -0
  63. package/dist/components/Slider/index.js +26 -0
  64. package/dist/components/Slider/item.d.ts +6 -0
  65. package/dist/components/Slider/item.js +13 -0
  66. package/dist/components/Title/index.d.ts +15 -0
  67. package/dist/components/Title/index.js +18 -0
  68. package/dist/components/Video/index.d.ts +11 -0
  69. package/dist/components/Video/index.js +11 -0
  70. package/dist/components/index.d.ts +18 -0
  71. package/dist/components/index.js +18 -0
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.js +1 -0
  74. package/dist/static/icon/index.d.ts +6 -0
  75. package/dist/static/icon/index.js +12 -0
  76. package/dist/static/index.d.ts +1 -0
  77. package/dist/static/index.js +1 -0
  78. package/package.json +48 -0
@@ -0,0 +1,41 @@
1
+ .orderEntry {
2
+ background: #fff;
3
+ box-shadow: 0 0 10px 0 rgba(231, 227, 227, 0.5);
4
+ .title {
5
+ height: 46px;
6
+ line-height: 46px;
7
+ display: flex;
8
+ justify-content: space-between;
9
+ border: 1px solid #f8f8f8;
10
+
11
+ .name {
12
+ font-size: 15px;
13
+ margin-left: 13px;
14
+ font-weight: bold;
15
+ }
16
+
17
+ .more {
18
+ font-size: 12px;
19
+ margin-right: 13px;
20
+ }
21
+ }
22
+
23
+ .content {
24
+ display: grid;
25
+ grid-template-columns: repeat(5, 1fr);
26
+ height: 73px;
27
+ text-align: center;
28
+ padding-top: 14px;
29
+
30
+ .contentItem {
31
+ .icon {
32
+ width: 22px;
33
+ margin-bottom: 7px;
34
+ }
35
+ .subTitle {
36
+ display: block;
37
+ font-size: 11px;
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,72 @@
1
+ @import './order-goodsItem.scss';
2
+
3
+ .order-container {
4
+ background: #f5f5f5;
5
+ .qj-tabs {
6
+ background: #fff;
7
+ }
8
+ .orderList {
9
+ .tabTitle {
10
+ --title-font-size: 15px;
11
+ }
12
+ .orderListItemWrap {
13
+ overflow-y: auto;
14
+ margin-bottom: 20px;
15
+ .orderListItem {
16
+ margin: 12px;
17
+ background: #fff;
18
+ padding: 15px 15px 10px 15px;
19
+ border-radius: 8px;
20
+ .topInfo {
21
+ display: flex;
22
+ height: 20px;
23
+ line-height: 20px;
24
+ justify-content: space-between;
25
+ margin-bottom: 12px;
26
+
27
+ .orderNo {
28
+ font-size: 12px;
29
+
30
+ .copy {
31
+ font-size: 9px;
32
+ padding: 0 4px;
33
+ margin-left: 5px;
34
+ color: #999;
35
+ border-color: #999;
36
+ border-radius: 10px;
37
+ }
38
+ }
39
+
40
+ .status {
41
+ font-size: 14px;
42
+ font-weight: bold;
43
+ color: #ff1643;
44
+ }
45
+ }
46
+
47
+ .goodsItemWrap {
48
+ padding-bottom: 6px;
49
+ border-bottom: 1px solid #f0f0f0;
50
+ margin-bottom: 10px;
51
+ }
52
+
53
+ .allInfo {
54
+ display: flex;
55
+ justify-content: space-between;
56
+ margin-bottom: 14px;
57
+
58
+ .totalNum {
59
+ font-size: 12px;
60
+ color: #999;
61
+ }
62
+
63
+ .totalPrice {
64
+ font-size: 14px;
65
+ color: #000;
66
+ line-height: 20px;
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,9 @@
1
+ .components-service {
2
+ width: 100px;
3
+ height: 100px;
4
+ background-color: green;
5
+ border-radius: 100%;
6
+ position: absolute;
7
+ bottom: 10px;
8
+ left: 10px;
9
+ }
@@ -0,0 +1,17 @@
1
+ .slider-block {
2
+ height: 100vh;
3
+ width: 100%;
4
+ overflow: hidden;
5
+ background-size: cover;
6
+ background-repeat: no-repeat;
7
+ background-position: center center;
8
+ }
9
+
10
+ .pc {
11
+ height: 600px;
12
+ width: 100%;
13
+ overflow: hidden;
14
+ background-size: cover;
15
+ background-repeat: no-repeat;
16
+ background-position: center center;
17
+ }
@@ -0,0 +1,3 @@
1
+ .components-title {
2
+ word-break: break-all;
3
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Default variables
3
+ */
4
+
5
+ /* The Color of O2Team Brand */
6
+ $color-brand: #6190e8 !default;
7
+ $color-brand-light: #78a4f4 !default;
8
+ $color-brand-dark: #346fc2 !default;
9
+
10
+ /* Color */
11
+ $color-success: #13ce66 !default;
12
+ $color-error: #ff4949 !default;
13
+ $color-warning: #ffc82c !default;
14
+ $color-info: #78a4fa !default;
15
+
16
+ /* Color Palette */
17
+ $color-black-0: #000 !default;
18
+ $color-black-1: #333 !default;
19
+ $color-black-2: #7f7f7f !default;
20
+ $color-black-3: #b2b2b2 !default;
21
+
22
+ $color-grey-0: #333 !default;
23
+ $color-grey-1: #666 !default;
24
+ $color-grey-2: #999 !default;
25
+ $color-grey-3: #ccc !default;
26
+ $color-grey-4: #e5e5e5 !default;
27
+ $color-grey-5: #f0f0f0 !default;
28
+ $color-grey-6: #f7f7f7 !default;
29
+
30
+ $color-white: #fff !default;
31
+
32
+ /* Text Color */
33
+ $color-text-base: #333 !default; // 文字的基本色
34
+ $color-text-base-inverse: #fff !default; // 反色
35
+ $color-text-secondary: #36d57d !default; // 辅助色
36
+ $color-text-placeholder: #c9c9c9 !default;
37
+ $color-text-disabled: #ccc !default;
38
+ $color-text-title: #2c405a !default; // 文章标题
39
+ $color-text-paragraph: #3f536e !default; // 文章段落
40
+
41
+ /* Link */
42
+ $color-link: #6190e8 !default;
43
+ $color-link-hover: #79a1eb !default;
44
+ $color-link-active: #4f7de2 !default;
45
+ $color-link-disabled: #bfbfbf !default;
46
+
47
+ /* 背景色 */
48
+ $color-bg: #fff !default;
49
+ $color-bg-base: #fafbfc !default;
50
+ $color-bg-light: #ecf5fd !default;
51
+ $color-bg-grey: #f7f7f7 !default;
52
+
53
+ /* Loading */
54
+ $at-loading-size: 18px !default;
55
+ $at-loading-color: $color-brand !default;
@@ -0,0 +1,8 @@
1
+ export interface CardItemType {
2
+ dataPic: string;
3
+ goodsName: number;
4
+ dataBmoney: number;
5
+ goodsCamount: number;
6
+ contractGoodsId: number;
7
+ }
8
+ export declare const CardJsx: ({ dataPic, goodsName, dataBmoney, goodsCamount }: CardItemType) => JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useComponent } from '@brushes/qj-simulate-component';
3
+ export const CardJsx = ({ dataPic, goodsName, dataBmoney, goodsCamount }) => {
4
+ const { View, Image } = useComponent();
5
+ return (_jsxs(View, Object.assign({ className: 'card-item' }, { children: [_jsx(Image, { src: dataPic, alt: "", className: 'card-item-img' }), _jsxs(View, Object.assign({ className: 'card-item-info' }, { children: [_jsxs(View, Object.assign({ className: 'card-item-info-container' }, { children: [_jsx(View, Object.assign({ className: 'card-item-info-container-title' }, { children: goodsName })), _jsxs(View, Object.assign({ className: 'card-item-info-container-price' }, { children: ["\uFFE5", dataBmoney || 1231] }))] })), _jsxs(View, Object.assign({ className: 'card-item-info-sub' }, { children: [_jsx(View, Object.assign({ className: 'sku' }, { children: "30ml" })), _jsxs(View, Object.assign({ className: 'count' }, { children: ["x ", goodsCamount] }))] }))] }))] })));
6
+ };
@@ -0,0 +1,7 @@
1
+ export declare const QjMobileIcon: ({ className, prefixClass, style, value }: {
2
+ className?: string | any[] | undefined;
3
+ prefixClass?: string | undefined;
4
+ style?: Object | undefined;
5
+ value: string;
6
+ onClick?: Function | undefined;
7
+ }) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ export const QjMobileIcon = ({ className = 'iconfont', prefixClass = 'icon', style = {
5
+ fontSize: 16,
6
+ color: '#444',
7
+ fontWeight: 900
8
+ }, value }) => {
9
+ const { Text } = useComponent();
10
+ const iconName = value ? `${prefixClass}-${value}` : '';
11
+ return (_jsx(Text, { className: classNames(prefixClass, iconName, className), style: style }));
12
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface ClassifyItemType {
3
+ imgUrl: string;
4
+ title: string;
5
+ link: string;
6
+ }
7
+ interface ClassifyNavType {
8
+ defaultValue: Array<ClassifyItemType>;
9
+ borderRadius: number;
10
+ marginTop: number;
11
+ marginBottom: number;
12
+ selectClassifyNav: Array<ClassifyItemType>;
13
+ }
14
+ export declare const ClassifyNav: React.NamedExoticComponent<ClassifyNavType>;
15
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useEffect, useState } from 'react';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ import { _ } from '@brushes/tools';
5
+ const { isUndefined, isEmpty } = _;
6
+ const ClassifyNavJsx = ({ defaultValue, borderRadius, marginTop, marginBottom, selectClassifyNav }) => {
7
+ const [list, setList] = useState(defaultValue);
8
+ const { View, Text } = useComponent();
9
+ useEffect(() => {
10
+ console.log(1111, selectClassifyNav);
11
+ const computedArr = selectClassifyNav
12
+ .filter((item) => !isUndefined(item))
13
+ .filter((item) => !Object.values(item).every((citem) => isUndefined(citem)));
14
+ let arr = defaultValue;
15
+ if (!isEmpty(computedArr)) {
16
+ arr = computedArr;
17
+ }
18
+ setList(arr);
19
+ }, [selectClassifyNav]);
20
+ return (_jsx(View, Object.assign({ className: 'classifyNav' }, { children: list.map((item, index) => {
21
+ 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));
22
+ }) })));
23
+ };
24
+ export const ClassifyNav = memo(ClassifyNavJsx);
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface ImgType {
3
+ imgUrl: string;
4
+ link: string;
5
+ }
6
+ interface CubeType {
7
+ defaultValue: Array<ImgType>;
8
+ type: number;
9
+ borderRadius: number;
10
+ marginTop: number;
11
+ marginBottom: number;
12
+ selectImg: Array<ImgType>;
13
+ }
14
+ export declare const Cube: React.NamedExoticComponent<CubeType>;
15
+ export {};
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo, useEffect, useState } from 'react';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ import { _ } from '@brushes/tools';
5
+ const { isUndefined, isEmpty } = _;
6
+ const CubeJsx = ({ defaultValue, type, borderRadius, marginBottom, marginTop, selectImg }) => {
7
+ const [list, setList] = useState(defaultValue);
8
+ const { View } = useComponent();
9
+ useEffect(() => {
10
+ const computedArr = selectImg
11
+ .filter((item) => !isUndefined(item))
12
+ .filter((item) => !Object.values(item).every((citem) => isUndefined(citem)));
13
+ let arr = defaultValue;
14
+ if (!isEmpty(computedArr)) {
15
+ arr = computedArr;
16
+ }
17
+ setList(arr);
18
+ }, [selectImg]);
19
+ return (_jsx(View, Object.assign({ className: `cube-type${type}` }, { children: list.map((item, index) => {
20
+ return type === 1 ? (_jsx("img", { src: item.imgUrl, style: {
21
+ width: '100%',
22
+ borderRadius: borderRadius + 'px'
23
+ } }, index)) : (_jsx(View, { className: 'block', style: {
24
+ backgroundImage: `url(${item.imgUrl})`,
25
+ width: '100%',
26
+ borderRadius: borderRadius + 'px'
27
+ }, onClick: () => {
28
+ if (process.env.TARO_ENV === 'weapp') {
29
+ // Taro?.navigateTo({
30
+ // url: item.link,
31
+ // })
32
+ }
33
+ } }, index));
34
+ }) })));
35
+ };
36
+ export const Cube = memo(CubeJsx);
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ interface GoodsType {
3
+ defaultValue: Array<{
4
+ goodsCode: string | number;
5
+ goodsName: string | number;
6
+ dataPic: string;
7
+ brandName: string | number;
8
+ pricesetNprice: number;
9
+ pricesetMakeprice?: number;
10
+ }>;
11
+ margin?: number;
12
+ cell: number;
13
+ gap?: number;
14
+ goods: Array<never> | undefined;
15
+ circular?: number;
16
+ markedPrice?: number;
17
+ classCode?: string;
18
+ }
19
+ export declare const Goods: import("react").NamedExoticComponent<GoodsType>;
20
+ export {};
@@ -0,0 +1,67 @@
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { useEffect, useState, memo, useRef } from 'react';
12
+ import { useComponent } from '@brushes/qj-simulate-component';
13
+ import { querySkuNotOnShelf } from '@brushes/api';
14
+ import { _ } from '@brushes/tools';
15
+ // import { QjIcon } from '@brushes/share-resource';
16
+ import classNames from 'classnames';
17
+ import { QjMobileIcon } from '../../common/icon';
18
+ const { isEqual, isEmpty } = _;
19
+ const GoodsJsx = ({ defaultValue = [], classCode = '', margin, circular, cell, gap = 10, goods = [], markedPrice }) => {
20
+ const [list, setList] = useState(defaultValue);
21
+ const preGoods = useRef();
22
+ const { View, Text } = useComponent();
23
+ useEffect(() => {
24
+ if (isEqual(preGoods.current, goods))
25
+ return;
26
+ preGoods.current = goods;
27
+ if (isEmpty(goods)) {
28
+ setList(defaultValue);
29
+ return;
30
+ }
31
+ (() => __awaiter(void 0, void 0, void 0, function* () {
32
+ const arr = [];
33
+ for (let i of goods) {
34
+ arr.push(querySkuNotOnShelf({
35
+ goodsCode: i
36
+ }));
37
+ }
38
+ try {
39
+ const data = yield Promise.all(arr);
40
+ let result = [];
41
+ data.forEach((item) => {
42
+ if (item.rows) {
43
+ result = result.concat(item.rows);
44
+ }
45
+ });
46
+ setList(result);
47
+ }
48
+ catch (err) {
49
+ console.log(59, err);
50
+ setList(defaultValue);
51
+ }
52
+ }))();
53
+ return () => {
54
+ console.log(54, goods, preGoods.current);
55
+ };
56
+ }, [goods]);
57
+ return (_jsx(View, Object.assign({ className: classNames({ [`goods-${classCode}`]: true }), style: {
58
+ display: 'grid',
59
+ gap,
60
+ marginBottom: margin,
61
+ gridTemplateColumns: `repeat(${cell}, 1fr)`
62
+ } }, { children: list.map((item, index) => (_jsxs(View, Object.assign({ style: {
63
+ overflow: 'hidden',
64
+ borderRadius: circular === 2 ? 0 : '8px'
65
+ }, 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
+ };
67
+ export const Goods = memo(GoodsJsx);
@@ -0,0 +1 @@
1
+ export declare const ClassifyFloor: ({ navList, activeKey }: any) => any;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useComponent } from '@brushes/qj-simulate-component';
3
+ export const ClassifyFloor = ({ navList, activeKey }) => {
4
+ const { View, Text } = useComponent();
5
+ console.log(4, navList);
6
+ return navList.map((item) => (_jsx(View, Object.assign({ className: ['content', activeKey === `${item.goodsClassCode}` ? ' active' : ''].join('') }, { children: item === null || item === void 0 ? void 0 : item.childList.map((classifyItem) => {
7
+ return (_jsxs(View, Object.assign({ className: 'classifyFloor' }, { children: [_jsxs(View, Object.assign({ className: 'titleWrap' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: classifyItem.goodsClassName })), _jsx(Text, { className: 'line' })] })), _jsx(View, Object.assign({ className: 'container' }, { children: classifyItem.childList.map((goodsItem) => {
8
+ return (_jsxs(View, Object.assign({ className: 'classifyFloorGoodsItem' }, { children: [_jsx("img", { src: goodsItem.goodsClassLogo, className: 'logo' }), _jsx(Text, Object.assign({ className: 'title' }, { children: goodsItem.goodsClassName }))] }), goodsItem.goodsClassCode));
9
+ }) }))] }), classifyItem.goodsClassCode));
10
+ }) }), item.goodsClassCode)));
11
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const GoodsClassify: React.NamedExoticComponent<{}>;
@@ -0,0 +1,36 @@
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 { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { memo, useEffect, useState } from 'react';
12
+ import { SideBar } from 'antd-mobile';
13
+ import { useComponent } from '@brushes/qj-simulate-component';
14
+ import { ClassifyFloor } from './components/classifyFloor';
15
+ // import {SEARCH} from "../../static";
16
+ import { getEnv } from '@brushes/api';
17
+ import { queryGoodsClassTree } from '@brushes/api';
18
+ import { QjMobileIcon } from '../../common/icon';
19
+ const GoodsClassifyJsx = () => {
20
+ const { View, Text } = useComponent();
21
+ const [activeKey, setActiveKey] = useState('');
22
+ const [navList, setNavList] = useState([]);
23
+ const flag = getEnv();
24
+ useEffect(() => {
25
+ getData();
26
+ }, []);
27
+ const getData = () => __awaiter(void 0, void 0, void 0, function* () {
28
+ let commits = yield queryGoodsClassTree();
29
+ setNavList(commits);
30
+ setActiveKey(commits[0].goodsClassCode);
31
+ });
32
+ 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: {
33
+ '--width': '88px'
34
+ } }, { 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 }) }))] }))] }));
35
+ };
36
+ export const GoodsClassify = memo(GoodsClassifyJsx);
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const GoodsDetail: React.NamedExoticComponent<{}>;
@@ -0,0 +1,6 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ const GoodsDetailJsx = () => {
4
+ return _jsx(_Fragment, { children: "123" });
5
+ };
6
+ export const GoodsDetail = memo(GoodsDetailJsx);
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ interface GoodsType {
3
+ goodsCode: number;
4
+ goodsName: string;
5
+ brandName: string;
6
+ pricesetNprice: number;
7
+ pricesetMakeprice: number;
8
+ dataPic: string;
9
+ }
10
+ interface GroupType {
11
+ title: string;
12
+ subTitle: string;
13
+ defaultValue: Array<GoodsType>;
14
+ goodsList?: Array<GroupType>;
15
+ borderRadius: number;
16
+ }
17
+ interface GoodsGroupType {
18
+ defaultValue: Array<GroupType>;
19
+ type: 1;
20
+ selectGoodsGroup: Array<GroupType>;
21
+ marginTop: number;
22
+ marginBottom: number;
23
+ }
24
+ export declare const GoodsGroup: React.NamedExoticComponent<GoodsGroupType>;
25
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo, useEffect, useState } from 'react';
3
+ import { JumboTabs } from 'antd-mobile';
4
+ import { _ } from '@brushes/tools';
5
+ import { Goods } from '../Goods';
6
+ const { isUndefined, isEmpty } = _;
7
+ const GoodsGroupJsx = ({ defaultValue = [], type, selectGoodsGroup = [], marginTop, marginBottom, borderRadius }) => {
8
+ const [list, setList] = useState(defaultValue);
9
+ useEffect(() => {
10
+ const computedArr = selectGoodsGroup
11
+ .filter((item) => !isUndefined(item))
12
+ .filter((item) => !Object.values(item).every((citem) => isUndefined(citem)));
13
+ let arr = defaultValue;
14
+ if (!isEmpty(computedArr)) {
15
+ arr = computedArr;
16
+ }
17
+ setList(arr);
18
+ }, [selectGoodsGroup]);
19
+ return (_jsx(JumboTabs, Object.assign({ style: {
20
+ marginTop: marginTop + 'px',
21
+ marginBottom: marginBottom + 'px'
22
+ } }, { children: list.map((item, index) => {
23
+ return (_jsx(JumboTabs.Tab, Object.assign({ title: item.title, description: item.subTitle }, { children: _jsx(Goods, { defaultValue: item.defaultValue, cell: 2, goods: item.goodsList, classCode: 'two', circular: borderRadius }) }), index));
24
+ }) })));
25
+ };
26
+ export const GoodsGroup = memo(GoodsGroupJsx);
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const GoodsList: React.NamedExoticComponent<{}>;
@@ -0,0 +1,66 @@
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { memo, useEffect, useRef, useState } from 'react';
12
+ import { Loading, ScrollView, useComponent } from '@brushes/qj-simulate-component';
13
+ import { find } from '@brushes/api';
14
+ import { QjMobileIcon } from '../../common/icon';
15
+ const GoodsListJsx = () => {
16
+ const { View, Text } = useComponent();
17
+ const [list, setList] = useState([]);
18
+ const [active, setActive] = useState('1');
19
+ const sortField = useRef('pricesetNprice');
20
+ const order = useRef('asc');
21
+ const [loading, setLoading] = useState(false);
22
+ useEffect(() => {
23
+ getData();
24
+ }, []);
25
+ const getData = (sortField = 'pricesetNprice', order = 'asc') => __awaiter(void 0, void 0, void 0, function* () {
26
+ setLoading(true);
27
+ const response = yield find({
28
+ distinctField: 'goodsNo',
29
+ sortField: sortField,
30
+ order: order,
31
+ goodsType: '00,50',
32
+ page: 1,
33
+ rows: 10
34
+ });
35
+ setLoading(false);
36
+ setList((prevState) => prevState.concat(response.list));
37
+ });
38
+ const handleSort = (e) => {
39
+ const type = e.target.dataset.type;
40
+ setActive(type);
41
+ console.log(30, sortField, order, type);
42
+ // switch (type) {
43
+ // case '1':
44
+ // sortField.current = 'pricesetNprice';
45
+ // order.current = 'asc';
46
+ // break
47
+ // case '2':
48
+ // sortField.current = '';
49
+ // order.current = 'desc';
50
+ // break;
51
+ // case '3':
52
+ // sortField.current = 'pricesetNprice';
53
+ // order.current = type === '3' && order.current === 'asc' ? 'desc' : 'asc'
54
+ // break
55
+ // case '4':
56
+ // sortField.current = 'pricesetNprice';
57
+ // order.current = type === '4' && order.current === 'asc' ? 'desc' : 'asc'
58
+ // break
59
+ // }
60
+ getData(sortField.current, order.current);
61
+ };
62
+ 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" }))] })), _jsxs(View, Object.assign({ className: 'sortWrap' }, { children: [_jsx(View, Object.assign({ className: `sortItem ${active === '1' ? 'active' : ''}`, onClick: handleSort }, { children: "\u9ED8\u8BA4" })), _jsx(View, Object.assign({ "data-type": 'pricesetNprice', className: `sortItem ${active === '2' ? 'active' : ''}`, onClick: handleSort }, { children: "\u65B0\u54C1" })), _jsx(View, Object.assign({ "data-order": order.current === 'asc' ? 'desc' : 'asc', className: `sortItem ${active === '3' ? 'active' : ''}`, onClick: handleSort }, { children: "\u9500\u91CF" })), _jsx(View, Object.assign({ "data-order": order.current === 'asc' ? 'desc' : 'asc', className: `sortItem ${active === '4' ? 'active' : ''}`, onClick: handleSort }, { children: "\u4EF7\u683C" }))] }))] })), _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) => {
63
+ return (_jsxs(View, Object.assign({ 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));
64
+ }) })), loading ? _jsx(Loading, {}) : null] })) }))] })));
65
+ };
66
+ export const GoodsList = memo(GoodsListJsx);
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface LineType {
3
+ borderRadius: number;
4
+ height: number;
5
+ width: number;
6
+ backgroundColor: string;
7
+ marginTop: number;
8
+ marginBottom: number;
9
+ }
10
+ export declare const Line: React.NamedExoticComponent<LineType>;
11
+ export {};
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ const LineJsx = ({ borderRadius, height, width, backgroundColor, marginTop, marginBottom }) => {
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
+ } }));
16
+ };
17
+ export const Line = memo(LineJsx);