s-material-react 0.1.1 → 0.1.3

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 (86) hide show
  1. package/css/common/coupon.scss +73 -0
  2. package/css/common/index.scss +2 -0
  3. package/css/common/stepNum.scss +20 -0
  4. package/css/pages/cart.scss +130 -0
  5. package/css/pages/couponList.scss +204 -0
  6. package/css/pages/goodsDetail.scss +262 -2
  7. package/css/pages/index.scss +8 -3
  8. package/css/pages/mine.scss +96 -0
  9. package/css/pages/orderEntry.scss +3 -0
  10. package/css/pages/placeOrder.scss +104 -0
  11. package/css/pages/placeOrderResult.scss +100 -0
  12. package/dist/common/coupon/index.d.ts +2 -0
  13. package/dist/common/coupon/index.js +9 -0
  14. package/dist/common/mock/index.d.ts +283 -0
  15. package/dist/common/mock/index.js +571 -1
  16. package/dist/common/stepNum/index.d.ts +5 -0
  17. package/dist/common/stepNum/index.js +9 -0
  18. package/dist/components/AddressDetail/index.js +31 -16
  19. package/dist/components/AddressDetail/option.d.ts +2 -17
  20. package/dist/components/AddressDetail/option.js +31 -147
  21. package/dist/components/AddressList/index.js +2 -2
  22. package/dist/components/Cart/index.d.ts +2 -0
  23. package/dist/components/Cart/index.js +29 -0
  24. package/dist/components/Cart/useNumStep.d.ts +1 -0
  25. package/dist/components/Cart/useNumStep.js +7 -0
  26. package/dist/components/CouponList/index.d.ts +2 -0
  27. package/dist/components/CouponList/index.js +29 -0
  28. package/dist/components/Cube/index.js +2 -2
  29. package/dist/components/GoodsClassify/components/classifyFloor.js +4 -3
  30. package/dist/components/GoodsClassify/index.js +13 -5
  31. package/dist/components/GoodsDetail/components/goodsDetailCollection.d.ts +2 -0
  32. package/dist/components/GoodsDetail/components/goodsDetailCollection.js +60 -0
  33. package/dist/components/GoodsDetail/components/goodsDetailCoupon.js +5 -5
  34. package/dist/components/GoodsDetail/components/goodsDetailEvaluate.js +3 -2
  35. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.d.ts +2 -0
  36. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.js +7 -0
  37. package/dist/components/GoodsDetail/components/goodsDetailInfo.d.ts +1 -1
  38. package/dist/components/GoodsDetail/components/goodsDetailInfo.js +2 -2
  39. package/dist/components/GoodsDetail/components/goodsDetailPopup.d.ts +2 -0
  40. package/dist/components/GoodsDetail/components/goodsDetailPopup.js +27 -0
  41. package/dist/components/GoodsDetail/components/goodsDetailPromotion.d.ts +1 -1
  42. package/dist/components/GoodsDetail/components/goodsDetailPromotion.js +3 -3
  43. package/dist/components/GoodsDetail/components/goodsDetailSize.d.ts +1 -1
  44. package/dist/components/GoodsDetail/components/goodsDetailSize.js +6 -6
  45. package/dist/components/GoodsDetail/index.js +54 -14
  46. package/dist/components/GoodsGroup/index.js +2 -1
  47. package/dist/components/GoodsList/components/filter.d.ts +1 -0
  48. package/dist/components/GoodsList/components/filter.js +31 -0
  49. package/dist/components/GoodsList/hooks/useGoodsList.d.ts +5 -0
  50. package/dist/components/GoodsList/hooks/useGoodsList.js +49 -0
  51. package/dist/components/GoodsList/index.js +9 -60
  52. package/dist/components/Mine/components/menuList.d.ts +1 -0
  53. package/dist/components/Mine/components/menuList.js +21 -0
  54. package/dist/components/Mine/components/orderEntry.d.ts +1 -0
  55. package/dist/components/Mine/components/orderEntry.js +41 -0
  56. package/dist/components/Mine/index.d.ts +7 -0
  57. package/dist/components/Mine/index.js +14 -0
  58. package/dist/components/Notice/index.js +7 -11
  59. package/dist/components/OrderDetail/index.js +2 -2
  60. package/dist/components/OrderList/components/OrderListItem.js +0 -1
  61. package/dist/components/OrderList/components/orderItem.js +2 -2
  62. package/dist/components/OrderList/index.js +3 -2
  63. package/dist/components/PlaceOrder/index.d.ts +2 -0
  64. package/dist/components/PlaceOrder/index.js +12 -0
  65. package/dist/components/PlaceOrderResult/index.d.ts +2 -0
  66. package/dist/components/PlaceOrderResult/index.js +12 -0
  67. package/dist/components/SearchPage/index.d.ts +7 -1
  68. package/dist/components/SearchPage/index.js +5 -6
  69. package/dist/components/Slider/index.d.ts +10 -10
  70. package/dist/components/index.d.ts +5 -1
  71. package/dist/components/index.js +5 -1
  72. package/dist/options/index.js +1 -0
  73. package/dist/routerMap/index.d.ts +5 -0
  74. package/dist/routerMap/index.js +5 -0
  75. package/dist/utils/checkImgUrl.d.ts +1 -0
  76. package/dist/utils/checkImgUrl.js +9 -0
  77. package/dist/utils/index.d.ts +0 -0
  78. package/dist/utils/index.js +1 -0
  79. package/package.json +3 -5
  80. package/css/pages.zip +0 -0
  81. package/dist/components/AddressDetail/a.d.ts +0 -2
  82. package/dist/components/AddressDetail/a.js +0 -40
  83. package/dist/components/OrderEntry/index.d.ts +0 -2
  84. package/dist/components/OrderEntry/index.js +0 -9
  85. package/dist/components/Stamp/index.d.ts +0 -2
  86. package/dist/components/Stamp/index.js +0 -9
@@ -1,17 +1,2 @@
1
- export declare const options: {
2
- label: string;
3
- value: string;
4
- children: {
5
- label: string;
6
- value: string;
7
- children: ({
8
- label: string;
9
- value: string;
10
- disabled?: undefined;
11
- } | {
12
- label: string;
13
- value: string;
14
- disabled: boolean;
15
- })[];
16
- }[];
17
- }[];
1
+ declare const options: any;
2
+ export default options;
@@ -1,148 +1,32 @@
1
- export const options = [
2
- {
3
- label: '浙江',
4
- value: '浙江',
5
- children: [
6
- {
7
- label: '杭州',
8
- value: '杭州',
9
- children: [
10
- {
11
- label: '西湖区',
12
- value: '西湖区'
13
- },
14
- {
15
- label: '上城区',
16
- value: '上城区'
17
- },
18
- {
19
- label: '余杭区',
20
- value: '余杭区',
21
- disabled: true
22
- }
23
- ]
24
- },
25
- {
26
- label: '温州',
27
- value: '温州',
28
- children: [
29
- {
30
- label: '鹿城区',
31
- value: '鹿城区'
32
- },
33
- {
34
- label: '龙湾区',
35
- value: '龙湾区',
36
- disabled: true
37
- },
38
- {
39
- label: '瓯海区',
40
- value: '瓯海区'
41
- }
42
- ]
43
- },
44
- {
45
- label: '宁波',
46
- value: '宁波',
47
- children: [
48
- {
49
- label: '海曙区',
50
- value: '海曙区'
51
- },
52
- {
53
- label: '江北区',
54
- value: '江北区'
55
- },
56
- {
57
- label: '镇海区',
58
- value: '镇海区'
59
- }
60
- ]
61
- }
62
- ]
63
- },
64
- {
65
- label: '安徽',
66
- value: '安徽',
67
- children: [
68
- {
69
- label: '合肥',
70
- value: '合肥',
71
- children: [
72
- {
73
- label: '包河区',
74
- value: '包河区'
75
- },
76
- {
77
- label: '蜀山区',
78
- value: '蜀山区'
79
- },
80
- {
81
- label: '瑶海区',
82
- value: '瑶海区'
83
- }
84
- ]
85
- },
86
- {
87
- label: '芜湖',
88
- value: '芜湖',
89
- children: [
90
- {
91
- label: '镜湖区',
92
- value: '镜湖区'
93
- },
94
- {
95
- label: '弋江区',
96
- value: '弋江区'
97
- },
98
- {
99
- label: '湾沚区',
100
- value: '湾沚区'
101
- }
102
- ]
103
- }
104
- ]
105
- },
106
- {
107
- label: '江苏',
108
- value: '江苏',
109
- children: [
110
- {
111
- label: '南京',
112
- value: '南京',
113
- children: [
114
- {
115
- label: '玄武区',
116
- value: '玄武区'
117
- },
118
- {
119
- label: '秦淮区',
120
- value: '秦淮区'
121
- },
122
- {
123
- label: '建邺区',
124
- value: '建邺区'
125
- }
126
- ]
127
- },
128
- {
129
- label: '苏州',
130
- value: '苏州',
131
- children: [
132
- {
133
- label: '虎丘区',
134
- value: '虎丘区'
135
- },
136
- {
137
- label: '吴中区',
138
- value: '吴中区'
139
- },
140
- {
141
- label: '相城区',
142
- value: '相城区'
143
- }
144
- ]
145
- }
146
- ]
1
+ import provinces from 'china-division/dist/provinces.json';
2
+ import cities from 'china-division/dist/cities.json';
3
+ import areas from 'china-division/dist/areas.json';
4
+ areas.forEach((area) => {
5
+ const matchCity = cities.filter((city) => city.code === area.cityCode)[0];
6
+ if (matchCity) {
7
+ matchCity.children = matchCity.children || [];
8
+ matchCity.children.push({
9
+ label: area.name,
10
+ value: area.code
11
+ });
147
12
  }
148
- ];
13
+ });
14
+ cities.forEach((city) => {
15
+ const matchProvince = provinces.filter((province) => province.code === city.provinceCode)[0];
16
+ if (matchProvince) {
17
+ matchProvince.children = matchProvince.children || [];
18
+ matchProvince.children.push({
19
+ label: city.name,
20
+ value: city.code,
21
+ children: city.children
22
+ });
23
+ }
24
+ });
25
+ const options = provinces.map((province) => {
26
+ return {
27
+ label: province.name,
28
+ value: province.code,
29
+ children: province.children
30
+ };
31
+ });
32
+ export default options;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
- import { useComponent } from '@brushes/qj-simulate-component';
3
+ import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
4
4
  import { getEnv } from '@brushes/api';
5
5
  import { addressListFake } from '../../common/mock';
6
6
  import { AddressItem } from '../../common/addressItem';
7
- import { Radio } from 'antd-mobile';
7
+ const { Radio } = antdMobile;
8
8
  const AddressListJsx = () => {
9
9
  const { View } = useComponent();
10
10
  const flag = getEnv();
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Cart: import("react").MemoExoticComponent<() => JSX.Element>;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useState } from 'react';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ import { Button, Checkbox, Radio } from 'antd-mobile';
5
+ import { StepNum } from '../../common/stepNum';
6
+ import { getEnv } from '@brushes/api';
7
+ const imgUrl = 'https://img14.360buyimg.com/n1/s450x450_jfs/t1/177530/39/29764/47605/6370a433E997313e3/08d21e654aa6b02a.jpg';
8
+ const flag = getEnv();
9
+ const CartJsx = () => {
10
+ const [editState, setEditState] = useState(true);
11
+ const { View, Text } = useComponent();
12
+ const [num, setNum] = useState(1);
13
+ return (_jsxs(View, Object.assign({ className: 'cart', style: {
14
+ height: flag ? '100vh' : '600px'
15
+ } }, { children: [_jsx(View, Object.assign({ className: 'edit' }, { children: _jsx(Button, Object.assign({ className: 'btn', fill: "none", style: {
16
+ '--text-color': '#333333'
17
+ }, onClick: () => setEditState(!editState) }, { children: editState ? '编辑' : '完成' })) })), _jsx(View, Object.assign({ className: 'itemGroup' }, { children: _jsx(Checkbox.Group, { children: _jsxs(View, Object.assign({ className: 'cartItem' }, { children: [_jsx(Checkbox, { style: {
18
+ '--icon-size': '16px',
19
+ '--font-size': '14px',
20
+ '--gap': '6px'
21
+ } }), _jsx("img", { className: 'img', src: imgUrl }), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'goodsName' }, { children: "VERSO HYDRATION SERUMVERSO HYDRATION SERUM" })), _jsx(View, Object.assign({ className: 'size' }, { children: "\u89C4\u683C\uFF1A30ml" })), _jsxs(View, Object.assign({ className: 'handleWrap' }, { children: [_jsx(Text, Object.assign({ className: 'price' }, { children: "\uFFE5809" })), _jsx(StepNum, { num: num, onChange: (val) => {
22
+ setNum(val);
23
+ } })] }))] }))] })) }) })), _jsxs(View, Object.assign({ className: 'dashboard' }, { children: [_jsx(View, Object.assign({ className: 'choose' }, { children: _jsx(Radio, Object.assign({ style: {
24
+ '--icon-size': '18px',
25
+ '--font-size': '14px',
26
+ '--gap': '6px'
27
+ } }, { children: "\u5168\u9009" })) })), editState ? (_jsxs(View, Object.assign({ className: 'check' }, { children: [_jsxs(View, Object.assign({ className: 'priceGroup' }, { children: [_jsxs(View, Object.assign({ className: 'discount' }, { children: ["\u4F18\u60E0: ", _jsx(Text, Object.assign({ className: 'data' }, { children: "\uFFE5 0.00" }))] })), _jsxs(View, Object.assign({ className: 'all' }, { children: ["\u5408\u8BA1: ", _jsx(Text, Object.assign({ className: 'data' }, { children: "\uFFE5 9999.99" }))] }))] })), _jsx(View, Object.assign({ className: 'btn' }, { children: "\u7ED3\u7B97(10)" }))] }))) : (_jsx(View, Object.assign({ className: 'del' }, { children: _jsx(View, Object.assign({ className: 'btn' }, { children: "\u5220\u9664" })) })))] }))] })));
28
+ };
29
+ export const Cart = memo(CartJsx);
@@ -0,0 +1 @@
1
+ export declare function useNumStep(): void;
@@ -0,0 +1,7 @@
1
+ import { useState } from 'react';
2
+ export function useNumStep() {
3
+ const [num, setNum] = useState(1);
4
+ const onChagne = (value) => {
5
+ setNum(value);
6
+ };
7
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const CouponList: import("react").MemoExoticComponent<() => JSX.Element>;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useRef, useState } from 'react';
3
+ import { useComponent } from '@brushes/qj-simulate-component';
4
+ import { getEnv } from '@brushes/api';
5
+ const CouponListJsx = () => {
6
+ const { View, Text } = useComponent();
7
+ const [coe, setCoe] = useState(1);
8
+ const flag = getEnv();
9
+ const config = useRef([
10
+ {
11
+ id: 1,
12
+ label: '未使用'
13
+ },
14
+ {
15
+ id: 2,
16
+ label: '已使用'
17
+ },
18
+ {
19
+ id: 3,
20
+ label: '已失效'
21
+ }
22
+ ]);
23
+ return (_jsxs(View, Object.assign({ className: 'couponList', style: {
24
+ height: flag ? '100vh' : '600px'
25
+ } }, { children: [_jsx(View, Object.assign({ className: 'couponTab' }, { children: config.current.map((item) => {
26
+ return (_jsxs(View, Object.assign({ className: `couponTabItem ${coe === item.id ? 'active' : ''}`, onClick: () => setCoe(item.id) }, { children: [item.label, _jsx(Text, { className: 'icon' })] }), item.id));
27
+ }) })), _jsxs(View, Object.assign({ className: 'couponListContent' }, { children: [_jsx(View, Object.assign({ className: 'couponListItem unused' }, { children: _jsxs(View, Object.assign({ className: 'coupon-content' }, { children: [_jsxs(View, Object.assign({ className: 'price' }, { children: [_jsx(Text, Object.assign({ className: 'symbol' }, { children: "\uFFE5" })), _jsx(Text, Object.assign({ className: 'num' }, { children: "123" }))] })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: "\u6574\u5355\u7ACB\u51CF10\u5143 \u6EE1199\u53EF\u7528" })), _jsx(Text, Object.assign({ className: 'date' }, { children: "\u6709\u6548\u671F\u81F3\uFF1A2022-10-01" })), _jsx(View, Object.assign({ className: 'btn' }, { children: "\u5DF2\u4F7F\u7528" }))] }))] })) })), _jsx(View, Object.assign({ className: 'couponListItem used' }, { children: _jsxs(View, Object.assign({ className: 'coupon-content' }, { children: [_jsxs(View, Object.assign({ className: 'price' }, { children: [_jsx(Text, Object.assign({ className: 'symbol' }, { children: "\uFFE5" })), _jsx(Text, Object.assign({ className: 'num' }, { children: "123" }))] })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: "\u6574\u5355\u7ACB\u51CF10\u5143 \u6EE1199\u53EF\u7528" })), _jsx(Text, Object.assign({ className: 'date' }, { children: "\u6709\u6548\u671F\u81F3\uFF1A2022-10-01" })), _jsx(View, Object.assign({ className: 'btn' }, { children: "\u5DF2\u4F7F\u7528" }))] }))] })) })), _jsx(View, Object.assign({ className: 'couponListItem overdue' }, { children: _jsxs(View, Object.assign({ className: 'coupon-content' }, { children: [_jsxs(View, Object.assign({ className: 'price' }, { children: [_jsx(Text, Object.assign({ className: 'symbol' }, { children: "\uFFE5" })), _jsx(Text, Object.assign({ className: 'num' }, { children: "123" }))] })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: "\u6574\u5355\u7ACB\u51CF10\u5143 \u6EE1199\u53EF\u7528" })), _jsx(Text, Object.assign({ className: 'date' }, { children: "\u6709\u6548\u671F\u81F3\uFF1A2022-10-01" })), _jsx(View, Object.assign({ className: 'btn' }, { children: "\u5DF2\u4F7F\u7528" })), _jsx(View, Object.assign({ className: 'round' }, { children: "\u5DF2\u5931\u6548" }))] }))] })) }))] }))] })));
28
+ };
29
+ export const CouponList = memo(CouponListJsx);
@@ -5,7 +5,7 @@ import { _ } from '@brushes/tools';
5
5
  const { isUndefined, isEmpty } = _;
6
6
  const CubeJsx = ({ defaultValue, type, borderRadius, marginBottom, marginTop, selectImg }) => {
7
7
  const [list, setList] = useState(defaultValue);
8
- const { View } = useComponent();
8
+ const { View, Image } = useComponent();
9
9
  useEffect(() => {
10
10
  const computedArr = selectImg
11
11
  .filter((item) => !isUndefined(item))
@@ -17,7 +17,7 @@ const CubeJsx = ({ defaultValue, type, borderRadius, marginBottom, marginTop, se
17
17
  setList(arr);
18
18
  }, [selectImg]);
19
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: {
20
+ return type === 1 ? (_jsx(Image, { mode: 'widthFix', src: item.imgUrl, style: {
21
21
  width: '100%',
22
22
  borderRadius: borderRadius + 'px'
23
23
  } }, index)) : (_jsx(View, { className: 'block', style: {
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useComponent, navigatorImpl } from '@brushes/qj-simulate-component';
3
+ import { checkImgUrl } from '../../../utils/checkImgUrl';
4
+ import { routerMap } from '../../../routerMap';
3
5
  export const ClassifyFloor = ({ navList, activeKey }) => {
4
6
  const { View, Text } = useComponent();
5
- console.log(4, navList);
6
7
  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({ onClick: () => navigatorImpl('/subpackage/goods/index'), className: 'classifyFloorGoodsItem' }, { children: [_jsx("img", { src: goodsItem.goodsClassLogo, className: 'logo' }), _jsx(Text, Object.assign({ className: 'title' }, { children: goodsItem.goodsClassName }))] }), goodsItem.goodsClassCode));
8
+ 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(({ classtreeCode, goodsClassCode, goodsClassLogo, goodsClassName }) => {
9
+ return (_jsxs(View, Object.assign({ onClick: () => navigatorImpl(`${routerMap.goodList}?classtreeCode=${classtreeCode}`), className: 'classifyFloorGoodsItem' }, { children: [_jsx("img", { src: checkImgUrl(goodsClassLogo), className: 'logo' }), _jsx(Text, Object.assign({ className: 'title' }, { children: goodsClassName }))] }), goodsClassCode));
9
10
  }) }))] }), classifyItem.goodsClassCode));
10
11
  }) }), item.goodsClassCode)));
11
12
  };
@@ -9,13 +9,15 @@ 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 { SideBar } from 'antd-mobile';
13
- import { useComponent } from '@brushes/qj-simulate-component';
12
+ import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
14
13
  import { ClassifyFloor } from './components/classifyFloor';
15
14
  // import {SEARCH} from "../../static";
16
15
  import { getEnv } from '@brushes/api';
17
16
  import { queryGoodsClassTree } from '@brushes/api';
18
17
  import { QjMobileIcon } from '../../common/icon';
18
+ import { _ } from '@brushes/tools';
19
+ const { get } = _;
20
+ const { SideBar } = antdMobile;
19
21
  const GoodsClassifyJsx = () => {
20
22
  const { View, Text } = useComponent();
21
23
  const [activeKey, setActiveKey] = useState('');
@@ -25,9 +27,15 @@ const GoodsClassifyJsx = () => {
25
27
  getData();
26
28
  }, []);
27
29
  const getData = () => __awaiter(void 0, void 0, void 0, function* () {
28
- let commits = yield queryGoodsClassTree();
29
- setNavList(commits);
30
- setActiveKey(commits[0].goodsClassCode);
30
+ try {
31
+ let commits = yield queryGoodsClassTree();
32
+ setNavList(commits || []);
33
+ const code = get(commits, 'commits[0].goodsClassCode');
34
+ setActiveKey(code);
35
+ }
36
+ catch (err) {
37
+ console.log(err);
38
+ }
31
39
  });
32
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: {
33
41
  '--width': '88px'
@@ -0,0 +1,2 @@
1
+ declare const GoodsDetailCollection: ({ goods, checkCollectionObj, setCheckCollectionObj }: any) => JSX.Element;
2
+ export default GoodsDetailCollection;
@@ -0,0 +1,60 @@
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 { SEARCH } from '../../../static';
12
+ import { useComponent } from '@brushes/qj-simulate-component';
13
+ import { checkCollectExit, saveCollect, deleteCollectByCode } from '@brushes/api';
14
+ import { _ } from '@brushes/tools';
15
+ import { useEffect } from 'react';
16
+ const { isEmpty } = _;
17
+ const GoodsDetailCollection = ({ goods, checkCollectionObj, setCheckCollectionObj }) => {
18
+ const { Text, View } = useComponent();
19
+ useEffect(() => {
20
+ checkCollection();
21
+ }, []);
22
+ const checkCollection = () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const checkCollectionParams = {
24
+ collectType: 0,
25
+ collectOpcode: goods.rsSkuDomainList[0].skuCode || ''
26
+ };
27
+ const result = yield checkCollectExit(checkCollectionParams);
28
+ setCheckCollectionObj(result);
29
+ });
30
+ const handleSaveCollect = () => __awaiter(void 0, void 0, void 0, function* () {
31
+ const saveCollectParmas = {
32
+ collectType: 0,
33
+ collectOpcode: goods.rsSkuDomainList[0].skuCode || '',
34
+ collectOppic: goods.dataPic,
35
+ collectOpcont: goods.goodsName,
36
+ collectOpnum: goods.pricesetNprice,
37
+ goodsOrigin: 0
38
+ };
39
+ yield saveCollect(saveCollectParmas);
40
+ });
41
+ const handleDeleteCollectByCode = () => __awaiter(void 0, void 0, void 0, function* () {
42
+ const deleteCollectByCodeParams = {
43
+ collectType: 0,
44
+ collectOpcode: goods.rsSkuDomainList[0].skuCode || ''
45
+ };
46
+ yield deleteCollectByCode(deleteCollectByCodeParams);
47
+ });
48
+ const handleCollect = () => {
49
+ console.log(123);
50
+ if (isEmpty(checkCollectionObj.dataObj)) {
51
+ handleSaveCollect();
52
+ }
53
+ else {
54
+ handleDeleteCollectByCode();
55
+ }
56
+ checkCollection();
57
+ };
58
+ return (_jsxs(View, Object.assign({ onClick: handleCollect }, { children: [_jsx("img", { src: SEARCH, alt: "", className: 'icon' }), _jsx(Text, Object.assign({ className: 'txt' }, { children: isEmpty(checkCollectionObj.dataObj) ? '收藏' : '已收藏' }))] })));
59
+ };
60
+ export default GoodsDetailCollection;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
2
+ import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
3
3
  import { THREE_DOTS } from '../../../static';
4
- import { Popup, Radio } from 'antd-mobile';
5
4
  import { useState } from 'react';
6
- import { Stamp } from '../../Stamp';
5
+ import { Coupon } from '../../../common/coupon';
6
+ const { Popup, Radio } = antdMobile;
7
7
  const fake = [
8
8
  {
9
9
  title: '五一大促疯抢 满100立减10',
@@ -49,8 +49,8 @@ const fake = [
49
49
  const GoodsDetailCoupon = () => {
50
50
  const { View, Text } = useComponent();
51
51
  const [visible, setVisible] = useState(false);
52
- return (_jsxs(_Fragment, { children: [_jsxs(View, Object.assign({ className: 'goodsDetail-coupon', onClick: () => setVisible(true) }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u4FC3\u9500" })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u8BF7\u9009\u62E9\u4F18\u60E0\u5238" })), _jsx("img", { src: THREE_DOTS, alt: "", className: 'icon' })] }))] })), _jsx(Popup, Object.assign({ visible: visible, onMaskClick: () => setVisible(false) }, { children: _jsxs(View, Object.assign({ className: 'goodsDetail-coupon-popup' }, { children: [_jsx(View, Object.assign({ className: 'stampWrap' }, { children: _jsx(Radio.Group, Object.assign({ defaultValue: 0 }, { children: fake.map((item, index) => {
53
- return _jsx(Stamp, { index: index, item: item }, index);
52
+ return (_jsxs(_Fragment, { children: [_jsxs(View, Object.assign({ className: 'goodsDetail-coupon', onClick: () => setVisible(true) }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u4F18\u60E0\u5238" })), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u8BF7\u9009\u62E9\u4F18\u60E0\u5238" })), _jsx("img", { src: THREE_DOTS, alt: "", className: 'icon' })] }))] })), _jsx(Popup, Object.assign({ visible: visible, onMaskClick: () => setVisible(false) }, { children: _jsxs(View, Object.assign({ className: 'goodsDetail-coupon-popup' }, { children: [_jsx(View, Object.assign({ className: 'stampWrap' }, { children: _jsx(Radio.Group, Object.assign({ defaultValue: 0 }, { children: fake.map((item, index) => {
53
+ return _jsx(Coupon, { index: index, item: item }, index);
54
54
  }) })) })), _jsx(View, Object.assign({ className: 'confirm' }, { children: "\u786E\u5B9A" }))] })) }))] }));
55
55
  };
56
56
  export default GoodsDetailCoupon;
@@ -1,7 +1,8 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useComponent } from '@brushes/qj-simulate-component';
3
+ import EvaluateItem from '../../../common/evaluateItem';
3
4
  const GoodsDetailEvaluate = () => {
4
5
  const { View } = useComponent();
5
- return _jsx(View, Object.assign({ className: 'goodsDetailEvaluate' }, { children: "\u8BC4\u4EF7" }));
6
+ return (_jsxs(View, Object.assign({ className: 'goodsDetailEvaluate' }, { children: ["\u8BC4\u4EF7", _jsx(EvaluateItem, {})] })));
6
7
  };
7
8
  export default GoodsDetailEvaluate;
@@ -0,0 +1,2 @@
1
+ declare const GoodsDetailHandleBar: () => JSX.Element;
2
+ export default GoodsDetailHandleBar;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { navigatorImpl, useComponent } from '@brushes/qj-simulate-component';
3
+ const GoodsDetailHandleBar = () => {
4
+ const { Text, View } = useComponent();
5
+ return (_jsxs(View, Object.assign({ className: 'goodsDetailHandleBar' }, { children: [_jsxs(View, Object.assign({ className: 'linkGroup' }, { children: [_jsx(Text, { className: 'icon' }), _jsx(Text, Object.assign({ className: 'txt' }, { children: "\u5BA2\u670D" }))] })), _jsxs(View, Object.assign({ className: 'linkGroup' }, { children: [_jsx(Text, { className: 'icon' }), _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({ className: 'btn buy' }, { children: "\u7ACB\u5373\u8D2D\u4E70" }))] }))] })));
6
+ };
7
+ export default GoodsDetailHandleBar;
@@ -1,2 +1,2 @@
1
- declare const GoodsDetailInfo: ({ goodsData }: any) => JSX.Element;
1
+ declare const GoodsDetailInfo: ({ goods }: any) => JSX.Element;
2
2
  export default GoodsDetailInfo;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useComponent } from '@brushes/qj-simulate-component';
3
- const GoodsDetailInfo = ({ goodsData }) => {
3
+ const GoodsDetailInfo = ({ goods }) => {
4
4
  const { View } = useComponent();
5
- return (_jsx(View, Object.assign({ className: 'goodsDetail-info' }, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: goodsData.goodsRemark } }) })));
5
+ return (_jsx(View, Object.assign({ className: 'goodsDetail-info' }, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: goods.goodsRemark || '' } }) })));
6
6
  };
7
7
  export default GoodsDetailInfo;
@@ -0,0 +1,2 @@
1
+ declare const GoodsDetailPopup: ({ popupVisible, setPopupVisible, goods }: any) => JSX.Element;
2
+ export default GoodsDetailPopup;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
3
+ import { useState } from 'react';
4
+ const { Popup, Radio } = antdMobile;
5
+ const GoodsDetailPopup = ({ popupVisible, setPopupVisible, goods }) => {
6
+ const { View, Text, Image } = useComponent();
7
+ const [selectSizeCoe, setSelectSizeCoe] = useState(0);
8
+ const [count, setCount] = useState(1);
9
+ const handleChooseSize = (index) => {
10
+ setSelectSizeCoe(index);
11
+ console.log(12, selectSizeCoe);
12
+ };
13
+ const handleStep = (type) => {
14
+ switch (type) {
15
+ case 'minus':
16
+ setCount((count) => count - 1);
17
+ break;
18
+ case 'plus':
19
+ setCount((count) => count + 1);
20
+ break;
21
+ }
22
+ };
23
+ return (_jsx(_Fragment, { children: _jsx(Popup, Object.assign({ visible: popupVisible, onMaskClick: () => setPopupVisible(false) }, { 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
+ return (_jsx(View, Object.assign({ className: `sizeItem ${index === selectSizeCoe ? 'active' : ''}`, "data-index": index, onClick: handleChooseSize.bind(null, index) }, { children: item.specValueValue }), index));
25
+ }) }))] })), _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
+ };
27
+ export default GoodsDetailPopup;
@@ -1,2 +1,2 @@
1
- declare const GoodsDetailPromotion: () => JSX.Element;
1
+ declare const GoodsDetailPromotion: ({ promotionList }: any) => JSX.Element;
2
2
  export default GoodsDetailPromotion;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useComponent } from '@brushes/qj-simulate-component';
3
3
  const fake = ['促销', '大促销', '大大促销', '大大大大促销', '大大大大大促销', '大促销', '大促销'];
4
- const GoodsDetailPromotion = () => {
4
+ const GoodsDetailPromotion = ({ promotionList }) => {
5
5
  const { View, Text } = useComponent();
6
- return (_jsxs(View, Object.assign({ className: 'goodsDetail-promotion' }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u4FC3\u9500" })), _jsx(View, Object.assign({ className: 'group' }, { children: fake.map((item, index) => {
6
+ return (_jsxs(View, Object.assign({ className: 'goodsDetail-promotion' }, { children: [_jsx(Text, Object.assign({ className: 'label' }, { children: "\u4FC3\u9500" })), _jsx(View, Object.assign({ className: 'group' }, { children: promotionList.length ? (fake.map((item, index) => {
7
7
  return (_jsx(View, Object.assign({ className: 'item' }, { children: item }), index));
8
- }) }))] })));
8
+ })) : (_jsx(View, Object.assign({ className: 'noPromotion' }, { children: "\u6682\u65E0\u4FC3\u9500\u6D3B\u52A8" }))) }))] })));
9
9
  };
10
10
  export default GoodsDetailPromotion;
@@ -1,2 +1,2 @@
1
- declare const GoodsDetailSize: () => JSX.Element;
1
+ declare const GoodsDetailSize: ({ goods, popupVisible, setPopupVisible }: any) => JSX.Element;
2
2
  export default GoodsDetailSize;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
2
3
  import { THREE_DOTS } from '../../../static';
3
- import { useComponent } from '@brushes/qj-simulate-component';
4
- import { useState } from 'react';
5
- const GoodsDetailSize = () => {
6
- const { View, Text } = useComponent();
7
- const [visible, setVisible] = useState(false);
8
- return (_jsx(_Fragment, { children: _jsxs(View, Object.assign({ className: 'goodsDetail-coupon', onClick: () => setVisible(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' })] }))] })) }));
4
+ import GoodsDetailPopup from './goodsDetailPopup';
5
+ const { Popup, Radio } = antdMobile;
6
+ const GoodsDetailSize = ({ goods, popupVisible, setPopupVisible }) => {
7
+ const { View, Text, Image } = useComponent();
8
+ 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
9
  };
10
10
  export default GoodsDetailSize;