s-material-react 0.1.20 → 0.1.21

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 (174) hide show
  1. package/dist/common/addressItem/index.d.ts +1 -1
  2. package/dist/common/card/index.d.ts +8 -8
  3. package/dist/common/coupon/index.d.ts +2 -2
  4. package/dist/common/evaluateItem/index.d.ts +2 -2
  5. package/dist/common/evaluateList/index.d.ts +5 -5
  6. package/dist/common/icon/index.d.ts +7 -7
  7. package/dist/common/mock/index.d.ts +300 -300
  8. package/dist/common/stepNum/index.d.ts +5 -5
  9. package/dist/components/AddressDetail/components/index.d.ts +1 -1
  10. package/dist/components/AddressDetail/components/skull.d.ts +2 -2
  11. package/dist/components/AddressDetail/config.d.ts +51 -51
  12. package/dist/components/AddressDetail/index.d.ts +2 -2
  13. package/dist/components/AddressList/components/index.d.ts +1 -1
  14. package/dist/components/AddressList/components/skull.d.ts +2 -2
  15. package/dist/components/AddressList/index.d.ts +2 -2
  16. package/dist/components/Cart/components/cartItem.d.ts +3 -3
  17. package/dist/components/Cart/components/index.d.ts +1 -1
  18. package/dist/components/Cart/index.d.ts +2 -2
  19. package/dist/components/ClassifyNav/index.d.ts +15 -15
  20. package/dist/components/CouponList/components/index.d.ts +4 -4
  21. package/dist/components/CouponList/components/overdue.d.ts +5 -5
  22. package/dist/components/CouponList/components/skull.d.ts +2 -2
  23. package/dist/components/CouponList/components/unUsed.d.ts +5 -5
  24. package/dist/components/CouponList/components/used.d.ts +5 -5
  25. package/dist/components/CouponList/index.d.ts +2 -2
  26. package/dist/components/Cube/index.d.ts +17 -17
  27. package/dist/components/EvaluateList/index.d.ts +2 -2
  28. package/dist/components/Goods/index.d.ts +24 -24
  29. package/dist/components/GoodsClassify/components/classifyFloor.d.ts +1 -1
  30. package/dist/components/GoodsClassify/components/classifySkeleton.d.ts +1 -1
  31. package/dist/components/GoodsClassify/components/index.d.ts +2 -2
  32. package/dist/components/GoodsClassify/index.d.ts +2 -2
  33. package/dist/components/GoodsDetail/components/evaluateEntry.d.ts +2 -2
  34. package/dist/components/GoodsDetail/components/goodsDetailCollection.d.ts +1 -1
  35. package/dist/components/GoodsDetail/components/goodsDetailCoupon.d.ts +1 -1
  36. package/dist/components/GoodsDetail/components/goodsDetailEvaluate.d.ts +1 -1
  37. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.d.ts +1 -1
  38. package/dist/components/GoodsDetail/components/goodsDetailInfo.d.ts +1 -1
  39. package/dist/components/GoodsDetail/components/goodsDetailPopup.d.ts +1 -1
  40. package/dist/components/GoodsDetail/components/goodsDetailPromotion.d.ts +1 -1
  41. package/dist/components/GoodsDetail/components/goodsDetailSize.d.ts +1 -1
  42. package/dist/components/GoodsDetail/components/index.d.ts +9 -9
  43. package/dist/components/GoodsDetail/index.d.ts +6 -6
  44. package/dist/components/GoodsDetailPromotion/index.d.ts +2 -2
  45. package/dist/components/GoodsDetailTopInfo/index.d.ts +2 -2
  46. package/dist/components/GoodsGroup/index.d.ts +25 -25
  47. package/dist/components/GoodsList/components/filter.d.ts +5 -5
  48. package/dist/components/GoodsList/components/index.d.ts +1 -1
  49. package/dist/components/GoodsList/index.d.ts +6 -6
  50. package/dist/components/Line/index.d.ts +11 -11
  51. package/dist/components/Mine/components/index.d.ts +2 -2
  52. package/dist/components/Mine/components/menuList.d.ts +1 -1
  53. package/dist/components/Mine/components/orderEntry.d.ts +1 -1
  54. package/dist/components/Mine/index.d.ts +7 -7
  55. package/dist/components/Notice/index.d.ts +12 -12
  56. package/dist/components/OrderDetail/index.d.ts +2 -2
  57. package/dist/components/OrderList/components/index.d.ts +3 -3
  58. package/dist/components/OrderList/components/mock.d.ts +1647 -1647
  59. package/dist/components/OrderList/components/orderItem.d.ts +15 -15
  60. package/dist/components/OrderList/components/orderListItem.d.ts +7 -7
  61. package/dist/components/OrderList/index.d.ts +2 -2
  62. package/dist/components/PaymentMode/config.d.ts +6 -6
  63. package/dist/components/PaymentMode/hooks/useOrderResult.d.ts +10 -11
  64. package/dist/components/PaymentMode/index.d.ts +4 -4
  65. package/dist/components/PlaceOrder/components/address.d.ts +12 -12
  66. package/dist/components/PlaceOrder/components/index.d.ts +3 -3
  67. package/dist/components/PlaceOrder/components/orderPrice.d.ts +12 -12
  68. package/dist/components/PlaceOrder/components/shop.d.ts +3 -3
  69. package/dist/components/PlaceOrder/index.d.ts +7 -7
  70. package/dist/components/PlaceOrderResult/index.d.ts +4 -4
  71. package/dist/components/Search/index.d.ts +14 -14
  72. package/dist/components/SearchPage/index.d.ts +8 -8
  73. package/dist/components/Service/index.d.ts +12 -12
  74. package/dist/components/Slider/index.d.ts +24 -24
  75. package/dist/components/Slider/item.d.ts +6 -6
  76. package/dist/components/Title/index.d.ts +17 -17
  77. package/dist/components/Video/index.d.ts +13 -13
  78. package/dist/components/index.d.ts +29 -29
  79. package/dist/index.d.ts +1 -1
  80. package/dist/index.js +1 -1
  81. package/dist/routerMap/index.d.ts +16 -16
  82. package/dist/static/icon/index.d.ts +7 -7
  83. package/dist/static/index.d.ts +1 -1
  84. package/dist/utils/checkImgUrl.d.ts +1 -1
  85. package/dist/utils/index.d.ts +1 -1
  86. package/dist/utils/payment.d.ts +14 -14
  87. package/dist/utils/serviceActionSheet.d.ts +1 -1
  88. package/package.json +2 -2
  89. package/dist/common/addressItem/index.js +0 -10
  90. package/dist/common/card/index.js +0 -6
  91. package/dist/common/coupon/index.js +0 -8
  92. package/dist/common/evaluateItem/index.js +0 -13
  93. package/dist/common/evaluateList/index.js +0 -12
  94. package/dist/common/icon/index.js +0 -13
  95. package/dist/common/mock/index.js +0 -658
  96. package/dist/common/stepNum/index.js +0 -9
  97. package/dist/components/AddressDetail/components/index.js +0 -1
  98. package/dist/components/AddressDetail/components/skull.js +0 -9
  99. package/dist/components/AddressDetail/config.js +0 -66
  100. package/dist/components/AddressDetail/index.js +0 -30
  101. package/dist/components/AddressList/components/index.js +0 -1
  102. package/dist/components/AddressList/components/skull.js +0 -9
  103. package/dist/components/AddressList/index.js +0 -17
  104. package/dist/components/Cart/components/cartItem.js +0 -34
  105. package/dist/components/Cart/components/index.js +0 -1
  106. package/dist/components/Cart/index.js +0 -25
  107. package/dist/components/ClassifyNav/index.js +0 -13
  108. package/dist/components/CouponList/components/index.js +0 -4
  109. package/dist/components/CouponList/components/overdue.js +0 -6
  110. package/dist/components/CouponList/components/skull.js +0 -9
  111. package/dist/components/CouponList/components/unUsed.js +0 -6
  112. package/dist/components/CouponList/components/used.js +0 -6
  113. package/dist/components/CouponList/index.js +0 -23
  114. package/dist/components/Cube/index.js +0 -29
  115. package/dist/components/EvaluateList/index.js +0 -40
  116. package/dist/components/Goods/index.js +0 -70
  117. package/dist/components/GoodsClassify/components/classifyFloor.js +0 -12
  118. package/dist/components/GoodsClassify/components/classifySkeleton.js +0 -12
  119. package/dist/components/GoodsClassify/components/index.js +0 -2
  120. package/dist/components/GoodsClassify/index.js +0 -45
  121. package/dist/components/GoodsDetail/components/evaluateEntry.js +0 -43
  122. package/dist/components/GoodsDetail/components/goodsDetailCollection.js +0 -64
  123. package/dist/components/GoodsDetail/components/goodsDetailCoupon.js +0 -46
  124. package/dist/components/GoodsDetail/components/goodsDetailEvaluate.js +0 -6
  125. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.js +0 -27
  126. package/dist/components/GoodsDetail/components/goodsDetailInfo.js +0 -14
  127. package/dist/components/GoodsDetail/components/goodsDetailPopup.js +0 -11
  128. package/dist/components/GoodsDetail/components/goodsDetailPromotion.js +0 -9
  129. package/dist/components/GoodsDetail/components/goodsDetailSize.js +0 -18
  130. package/dist/components/GoodsDetail/components/index.js +0 -9
  131. package/dist/components/GoodsDetail/index.js +0 -29
  132. package/dist/components/GoodsDetailPromotion/index.js +0 -8
  133. package/dist/components/GoodsDetailTopInfo/index.js +0 -9
  134. package/dist/components/GoodsGroup/index.js +0 -28
  135. package/dist/components/GoodsList/components/filter.js +0 -43
  136. package/dist/components/GoodsList/components/index.js +0 -1
  137. package/dist/components/GoodsList/index.js +0 -17
  138. package/dist/components/Line/index.js +0 -18
  139. package/dist/components/Mine/components/index.js +0 -2
  140. package/dist/components/Mine/components/menuList.js +0 -22
  141. package/dist/components/Mine/components/orderEntry.js +0 -48
  142. package/dist/components/Mine/index.js +0 -15
  143. package/dist/components/Notice/index.js +0 -15
  144. package/dist/components/OrderDetail/index.js +0 -16
  145. package/dist/components/OrderList/components/index.js +0 -3
  146. package/dist/components/OrderList/components/mock.js +0 -4417
  147. package/dist/components/OrderList/components/orderItem.js +0 -7
  148. package/dist/components/OrderList/components/orderListItem.js +0 -38
  149. package/dist/components/OrderList/index.js +0 -17
  150. package/dist/components/PaymentMode/config.js +0 -14
  151. package/dist/components/PaymentMode/hooks/useOrderResult.js +0 -99
  152. package/dist/components/PaymentMode/index.js +0 -18
  153. package/dist/components/PlaceOrder/components/address.js +0 -33
  154. package/dist/components/PlaceOrder/components/index.js +0 -3
  155. package/dist/components/PlaceOrder/components/orderPrice.js +0 -7
  156. package/dist/components/PlaceOrder/components/shop.js +0 -8
  157. package/dist/components/PlaceOrder/index.js +0 -16
  158. package/dist/components/PlaceOrderResult/index.js +0 -18
  159. package/dist/components/Search/index.js +0 -35
  160. package/dist/components/SearchPage/index.js +0 -60
  161. package/dist/components/Service/index.js +0 -8
  162. package/dist/components/Slider/index.js +0 -17
  163. package/dist/components/Slider/item.js +0 -14
  164. package/dist/components/Title/index.js +0 -18
  165. package/dist/components/Video/index.js +0 -13
  166. package/dist/components/index.js +0 -29
  167. package/dist/options/index.js +0 -36
  168. package/dist/routerMap/index.js +0 -16
  169. package/dist/static/icon/index.js +0 -14
  170. package/dist/static/index.js +0 -1
  171. package/dist/utils/checkImgUrl.js +0 -9
  172. package/dist/utils/index.js +0 -1
  173. package/dist/utils/payment.js +0 -56
  174. package/dist/utils/serviceActionSheet.js +0 -31
@@ -1,66 +0,0 @@
1
- //@ts-nocheck
2
- const checkMobile = (_, value) => {
3
- return new Promise((resolve, reject) => {
4
- if (!/^1[3456789]\d{9}$/.test(value) && value) {
5
- reject('请输入正确手机号');
6
- }
7
- else {
8
- resolve('');
9
- }
10
- });
11
- };
12
- export const config = [
13
- {
14
- type: 'input',
15
- props: {
16
- onlyShowClearWhenFocus: true,
17
- placeholder: '请填写收货人姓名'
18
- },
19
- label: '收货人',
20
- name: 'addressMember',
21
- rules: [{ required: true, message: '收货人姓名不能为空' }]
22
- },
23
- {
24
- type: 'input',
25
- props: {
26
- type: 'number',
27
- onlyShowClearWhenFocus: true,
28
- placeholder: '请填写收货人手机号码'
29
- },
30
- label: '手机号码',
31
- name: 'addressPhone',
32
- rules: [{ required: true, message: '收货人手机号码不能为空' }, { validator: checkMobile }]
33
- },
34
- {
35
- type: 'cascader',
36
- label: '所在地区',
37
- name: 'area',
38
- rules: [{ required: true, message: '所在地区不能为空' }]
39
- },
40
- {
41
- type: 'input',
42
- props: {
43
- onlyShowClearWhenFocus: true,
44
- placeholder: '街道/楼牌号等'
45
- },
46
- label: '详细地址',
47
- name: 'addressDetail',
48
- rules: [{ required: true, message: '收货人详细地址不能为空' }]
49
- },
50
- // {
51
- // type: 'input',
52
- // props: {
53
- // type: 'number',
54
- // onlyShowClearWhenFocus: true,
55
- // placeholder: '请填写邮政编码'
56
- // },
57
- // label: '邮政编码',
58
- // name: 'zipCode'
59
- // },
60
- {
61
- type: 'switch',
62
- props: {},
63
- label: '设置默认地址',
64
- name: 'addressDefault'
65
- }
66
- ];
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- //@ts-nocheck
3
- import { memo } from 'react';
4
- import { getEnv } from '@brushes/api';
5
- import { config } from './config';
6
- import { useEditAddress } from 'qj-mobile-store';
7
- import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
8
- import { Skull } from './components';
9
- const flag = getEnv();
10
- const AddressDetailJsx = ({ addressId = undefined }) => {
11
- const { View } = useComponent();
12
- const { Form, Button, Input } = antdMobile;
13
- const { skullShow, form, area, defaultAddress, handleArea, handleDefaultAddress, handleFinish } = useEditAddress(addressId, Form);
14
- return (_jsx(View, Object.assign({ className: 'addressDetail', style: { height: flag ? '100%' : '667px' } }, { children: skullShow ? (_jsx(Skull, {})) : (_jsx(Form, Object.assign({ form: form, layout: "horizontal", mode: "card", onFinish: handleFinish, footer: _jsx(Button, Object.assign({ block: true, type: "submit", color: "primary", size: "large" }, { children: "\u63D0\u4EA4" })) }, { children: config.map((item, index) => {
15
- return (_jsx(Form.Item, Object.assign({ label: item.label, name: item.name, rules: item.rules, trigger: item.type === 'cascader' ? 'onConfirm' : 'onChange', arrow: false }, { children: (() => {
16
- if (item.type === 'input') {
17
- return _jsx(Input, Object.assign({}, item.props));
18
- }
19
- else if (item.type === 'switch') {
20
- return (_jsx("switch", Object.assign({}, item.props, { color: '#000', onChange: handleDefaultAddress, checked: defaultAddress === '1' })));
21
- }
22
- else if (item.type === 'cascader') {
23
- return (_jsx(_Fragment, { children: flag ? (_jsx("picker", Object.assign({ mode: 'region', onChange: handleArea, value: '123' }, { children: _jsx(View, Object.assign({ className: 'areaWrap' }, { children: !area.provinceName
24
- ? '请选择所在地区'
25
- : `${area.provinceName}—${area.cityName}-${area.areaName}` })) }))) : ('请选择所在地区') }));
26
- }
27
- })() }), index));
28
- }) }))) })));
29
- };
30
- export const AddressDetail = memo(AddressDetailJsx);
@@ -1 +0,0 @@
1
- export * from './skull';
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { memo, useRef } from 'react';
3
- import { useComponent } from '@brushes/qj-simulate-component';
4
- const SkullJsx = () => {
5
- const { View, Skeleton } = useComponent();
6
- const coe = useRef(new Array(3).fill(0));
7
- return (_jsx(_Fragment, { children: _jsx(View, Object.assign({ className: 'skullWrap' }, { children: _jsx(View, Object.assign({ className: 'skull' }, { children: coe.current.map((item, index) => (_jsx(Skeleton, { className: 'skullItem', animated: true }, index))) })) })) }));
8
- };
9
- export const Skull = memo(SkullJsx);
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo } from 'react';
3
- import { navigatorImpl, useComponent } from '@brushes/qj-simulate-component';
4
- import { getEnv } from '@brushes/api';
5
- import { AddressItem } from '../../common/addressItem';
6
- import { useAddressList } from 'qj-mobile-store';
7
- import { routerMap } from '../../routerMap';
8
- import { Skull } from './components';
9
- const AddressListJsx = () => {
10
- const { View } = useComponent();
11
- const flag = getEnv();
12
- const { list, delAddress, setDefault, skullShow } = useAddressList();
13
- return (_jsxs(View, Object.assign({ className: 'addressListWrap', style: {
14
- height: flag ? 'inherit' : '667px'
15
- } }, { children: [skullShow ? (_jsx(Skull, {})) : (_jsx(View, Object.assign({ className: 'addressList' }, { children: list.map((item, index) => (_jsx(AddressItem, { itemData: item, setDefault: setDefault.bind(null, item, index), delAddress: delAddress.bind(null, item) }, item === null || item === void 0 ? void 0 : item.addressId))) }))), _jsx(View, Object.assign({ className: 'addBtnWrap' }, { children: _jsx(View, Object.assign({ className: 'addBtn', onClick: () => navigatorImpl(`${routerMap.addressEditor}`) }, { children: "+ \u65B0\u589E\u5730\u5740" })) }))] })));
16
- };
17
- export const AddressList = memo(AddressListJsx);
@@ -1,34 +0,0 @@
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
- //@ts-nocheck
12
- import { useComponent, NumStep, SmoothCheckbox } from '@brushes/qj-simulate-component';
13
- import { useDispatchImpl, useStore, useCartList } from 'qj-mobile-store';
14
- export function CartItem({ list }) {
15
- const { View, Text, Image, Checkbox } = useComponent();
16
- const { updateImpl } = useCartList();
17
- const dispatch = useDispatchImpl();
18
- const { select } = useStore();
19
- const handleStep = (id, amount, type) => __awaiter(this, void 0, void 0, function* () {
20
- const count = type === 'plus' ? ++amount : --amount;
21
- updateImpl(id, count);
22
- });
23
- const onChange = (e) => {
24
- dispatch({
25
- type: 'select',
26
- payload: e.detail.value
27
- });
28
- };
29
- return (_jsx(SmoothCheckbox, Object.assign({ onChange: onChange }, { children: list.map((item, index) => (_jsxs(View, Object.assign({ className: 'cartItem' }, { children: [_jsx(View, Object.assign({ className: 'checkBoxWrap' }, { children: _jsx(Checkbox, { checked: select.includes(item.shoppingGoodsId + ''), value: item.shoppingGoodsId, style: {
30
- '--icon-size': '16px',
31
- '--font-size': '14px',
32
- '--gap': '6px'
33
- } }) })), _jsx(Image, { className: 'img', src: item.dataPic }), _jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(Text, Object.assign({ className: 'goodsName' }, { children: item.goodsName })), _jsxs(View, Object.assign({ className: 'size' }, { children: ["\u89C4\u683C\uFF1A", item.skuName, " X ", item.goodsCamount] })), _jsxs(View, Object.assign({ className: 'handleWrap' }, { children: [_jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5", item.pricesetNprice] })), _jsx(NumStep, { count: item.goodsCamount, handleStep: handleStep.bind(null, item.shoppingGoodsId, item.goodsCamount) })] }))] }))] }), index))) })));
34
- }
@@ -1 +0,0 @@
1
- export * from './cartItem';
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- //@ts-nocheck
3
- import { memo, useState } from 'react';
4
- import { useComponent, SmoothCheckbox } from '@brushes/qj-simulate-component';
5
- import { getEnv } from '@brushes/api';
6
- import { CartItem } from './components';
7
- import { StoreProvider, useStore, useCartList } from 'qj-mobile-store';
8
- const flag = getEnv();
9
- const CartJsx = () => {
10
- const [editState, setEditState] = useState(true);
11
- const { View, Text, Checkbox } = useComponent();
12
- const { select } = useStore();
13
- const { cartList, amount, selectAll, allCart, toOrderImpl } = useCartList();
14
- return (_jsxs(View, Object.assign({ className: 'cart', style: {
15
- height: flag ? '100%' : '667px'
16
- } }, { children: [_jsx(View, Object.assign({ className: 'edit' }, { children: _jsx(View, Object.assign({ className: 'btn', onClick: () => setEditState(!editState) }, { children: editState ? '编辑' : '完成' })) })), _jsx(View, Object.assign({ className: 'itemGroup' }, { children: _jsx(CartItem, { list: cartList.shoppingGoodsList }) })), _jsxs(View, Object.assign({ className: 'dashboard' }, { children: [_jsx(View, Object.assign({ className: 'choose' }, { children: _jsx(SmoothCheckbox, Object.assign({ onChange: selectAll }, { children: _jsx(Checkbox, Object.assign({ checked: allCart.current.length === select.length, value: 'true', style: {
17
- '--icon-size': '16px',
18
- '--font-size': '14px',
19
- '--gap': '6px'
20
- } }, { 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: ", _jsxs(Text, Object.assign({ className: 'data' }, { children: ["\uFFE5 ", cartList.disMoney || 0] }))] })), _jsxs(View, Object.assign({ className: 'all' }, { children: ["\u5408\u8BA1: ", _jsxs(Text, Object.assign({ className: 'data' }, { children: ["\uFFE5 ", amount.amount] }))] }))] })), _jsxs(View, Object.assign({ onClick: toOrderImpl, className: 'btn' }, { children: ["\u7ED3\u7B97(", amount.num, ")"] }))] }))) : (_jsx(View, Object.assign({ className: 'del' }, { children: _jsx(View, Object.assign({ className: 'btn' }, { children: "\u5220\u9664" })) })))] }))] })));
21
- };
22
- const WrapCartJsx = () => {
23
- return (_jsx(StoreProvider, { children: _jsx(CartJsx, {}) }));
24
- };
25
- export const Cart = memo(WrapCartJsx);
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- //@ts-ignore
3
- import { memo } from 'react';
4
- import { useComponent } from '@brushes/qj-simulate-component';
5
- import { useCube } from 'qj-mobile-store';
6
- const ClassifyNavJsx = ({ defaultValue, borderRadius, paddingTop, paddingBottom, selectClassifyNav }) => {
7
- const { View, Text } = useComponent();
8
- const list = useCube(defaultValue, selectClassifyNav);
9
- return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, Object.assign({ className: 'classifyNav' }, { children: list.map((item, index) => {
10
- 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));
11
- }) })) })));
12
- };
13
- export const ClassifyNav = memo(ClassifyNavJsx);
@@ -1,4 +0,0 @@
1
- export * from './overdue';
2
- export * from './skull';
3
- export * from './unUsed';
4
- export * from './used';
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
3
- export const Overdue = ({ coe }) => {
4
- const { View, Text } = useComponent();
5
- return (_jsx(_Fragment, { children: coe === 3 ? (_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" }))] }))] })) }))) : null }));
6
- };
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { memo, useRef } from 'react';
3
- import { useComponent } from '@brushes/qj-simulate-component';
4
- const SkullJsx = () => {
5
- const { View, Skeleton } = useComponent();
6
- const coe = useRef(new Array(3).fill(0));
7
- return (_jsx(_Fragment, { children: _jsx(View, Object.assign({ className: 'skullWrap' }, { children: _jsx(View, Object.assign({ className: 'skull' }, { children: coe.current.map((item, index) => (_jsx(Skeleton, { className: 'skullItem', animated: true }, index))) })) })) }));
8
- };
9
- export const Skull = memo(SkullJsx);
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
3
- export const UnUsed = ({ coe }) => {
4
- const { View, Text } = useComponent();
5
- return (_jsx(_Fragment, { children: coe === 1 ? (_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" }))] }))] })) }))) : null }));
6
- };
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
3
- export const Used = ({ coe }) => {
4
- const { View, Text } = useComponent();
5
- return (_jsx(_Fragment, { children: coe === 2 ? (_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" }))] }))] })) }))) : null }));
6
- };
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- //@ts-nocheck
3
- import { memo, useEffect } from 'react';
4
- import { useComponent } from '@brushes/qj-simulate-component';
5
- import { getEnv, queryUsercouponNember } from '@brushes/api';
6
- import { useCouponList } from 'qj-mobile-store';
7
- import { UnUsed, Overdue, Used } from './components';
8
- const CouponListJsx = () => {
9
- const { View, Text } = useComponent();
10
- const { coe, setCoe, config } = useCouponList();
11
- const flag = getEnv();
12
- useEffect(() => {
13
- queryUsercouponNember().then((res) => {
14
- console.log(26, res);
15
- });
16
- }, []);
17
- return (_jsxs(View, Object.assign({ className: 'couponList', style: {
18
- height: flag ? '100vh' : '667px'
19
- } }, { children: [_jsx(View, Object.assign({ className: 'couponTab' }, { children: config.current.map((item) => {
20
- return (_jsxs(View, Object.assign({ className: `couponTabItem ${coe === item.id ? 'active' : ''}`, onClick: () => setCoe(item.id) }, { children: [item.label, _jsx(Text, { className: 'icon' })] }), item.id));
21
- }) })), _jsxs(View, Object.assign({ className: 'couponListContent' }, { children: [_jsx(UnUsed, { coe: coe }), _jsx(Used, { coe: coe }), _jsx(Overdue, { coe: coe })] }))] })));
22
- };
23
- export const CouponList = memo(CouponListJsx);
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- //@ts-nocheck
3
- import { memo } from 'react';
4
- import { useComponent } from '@brushes/qj-simulate-component';
5
- import { useCube } from 'qj-mobile-store';
6
- const CubeJsx = ({ defaultValue, type, borderRadius, paddingTop, paddingLeft, paddingRight, paddingBottom, selectImg }) => {
7
- const { View, Image } = useComponent();
8
- const list = useCube(defaultValue, selectImg);
9
- return (_jsx(View, Object.assign({ style: {
10
- paddingTop,
11
- paddingBottom
12
- } }, { children: _jsx(View, Object.assign({ className: `cube-type${type}`, style: { paddingLeft, paddingRight } }, { children: list.map((item, index) => {
13
- return type === 1 ? (_jsx(Image, { mode: 'widthFix', src: item.imgUrl, style: {
14
- width: '100%',
15
- borderRadius: borderRadius + 'px'
16
- } }, index)) : (_jsx(View, { className: 'block', style: {
17
- backgroundImage: `url(${item.imgUrl})`,
18
- width: '100%',
19
- borderRadius: borderRadius + 'px'
20
- }, onClick: () => {
21
- if (process.env.TARO_ENV === 'weapp') {
22
- // Taro?.navigateTo({
23
- // url: item.link,
24
- // })
25
- }
26
- } }, index));
27
- }) })) })));
28
- };
29
- export const Cube = memo(CubeJsx);
@@ -1,40 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { memo, useRef, useState } from 'react';
3
- import { useComponent } from '@brushes/qj-simulate-component';
4
- import EvaluateItem from '../../common/evaluateItem';
5
- import { evaluateListFake } from '../../common/mock';
6
- const EvaluateListJsx = () => {
7
- const [active, setActive] = useState('1');
8
- const { View } = useComponent();
9
- const tabs = useRef([
10
- {
11
- label: '全部',
12
- num: '900+',
13
- index: '1'
14
- },
15
- {
16
- label: '好评',
17
- num: '800+',
18
- index: '2'
19
- },
20
- {
21
- label: '中评',
22
- num: '99+',
23
- index: '3'
24
- },
25
- {
26
- label: '差评',
27
- num: '12',
28
- index: '4'
29
- }
30
- ]);
31
- const handleTab = (coe) => {
32
- setActive(coe);
33
- };
34
- return (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'evaluateListTab' }, { children: tabs.current.map((item) => {
35
- return (_jsxs(View, Object.assign({ className: `evaluateListTabItem ${item.index === active ? 'active' : ''}`, "data-index": item.index, onClick: handleTab.bind(null, item.index) }, { children: [item.label, " ", item.num] }), item.index));
36
- }) })), _jsx(View, Object.assign({ className: 'evaluateListContent' }, { children: evaluateListFake.map((item, index) => {
37
- return _jsx(EvaluateItem, { itemData: item }, index);
38
- }) }))] }));
39
- };
40
- export const EvaluateList = memo(EvaluateListJsx);
@@ -1,70 +0,0 @@
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
- //@ts-nocheck
12
- import { useEffect, useState, memo, useRef } from 'react';
13
- import { navigatorImpl, useComponent } from '@brushes/qj-simulate-component';
14
- import { querySkuNotOnShelf } from '@brushes/api';
15
- import { _ } from '@brushes/tools';
16
- import classNames from 'classnames';
17
- import { QjMobileIcon } from '../../common/icon';
18
- import { routerMap } from '../../routerMap';
19
- const { isEqual, isEmpty } = _;
20
- const GoodsJsx = ({ defaultValue = [], classCode = '', margin, circular, cell, gap = 10, goods = [], markedPrice, paddingTop, paddingBottom, paddingLeft, paddingRight }) => {
21
- const [list, setList] = useState(defaultValue);
22
- const preGoods = useRef();
23
- const { View, Text } = useComponent();
24
- useEffect(() => {
25
- if (isEqual(preGoods.current, goods))
26
- return;
27
- preGoods.current = goods;
28
- if (isEmpty(goods)) {
29
- setList(defaultValue);
30
- return;
31
- }
32
- (() => __awaiter(void 0, void 0, void 0, function* () {
33
- const arr = [];
34
- for (let i of goods) {
35
- arr.push(querySkuNotOnShelf({
36
- goodsCode: i
37
- }));
38
- }
39
- try {
40
- const data = yield Promise.all(arr);
41
- let result = [];
42
- data.forEach((item) => {
43
- if (item.rows) {
44
- result = result.concat(item.rows);
45
- }
46
- });
47
- setList(result);
48
- }
49
- catch (err) {
50
- console.log(59, err);
51
- setList(defaultValue);
52
- }
53
- }))();
54
- return () => {
55
- console.log(54, goods, preGoods.current);
56
- };
57
- }, [goods]);
58
- return (_jsx(View, Object.assign({ style: { paddingTop, paddingBottom } }, { children: _jsx(View, Object.assign({ className: classNames({ [`goods-${classCode}`]: true }), style: {
59
- display: 'grid',
60
- gap,
61
- marginBottom: margin,
62
- gridTemplateColumns: `repeat(${cell}, 1fr)`,
63
- paddingLeft,
64
- paddingRight
65
- } }, { children: list.map((item, index) => (_jsxs(View, Object.assign({ style: {
66
- overflow: 'hidden',
67
- borderRadius: circular === 2 ? 0 : '8px'
68
- }, onClick: () => navigatorImpl(`${routerMap.goodDetail}?skuCode=${item.skuCode}`), 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))) })) })));
69
- };
70
- export const Goods = memo(GoodsJsx);
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useComponent, navigatorImpl } from '@brushes/qj-simulate-component';
3
- import { checkImgUrl } from '../../../utils/checkImgUrl';
4
- import { routerMap } from '../../../routerMap';
5
- export const ClassifyFloor = ({ navList, activeKey }) => {
6
- const { View, Text } = useComponent();
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) => {
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));
10
- }) }))] }), classifyItem.goodsClassCode));
11
- }) }), item.goodsClassCode)));
12
- };
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
3
- import { getEnv } from '@brushes/api';
4
- import { useRef } from 'react';
5
- export const ClassifySkeleton = () => {
6
- const flag = getEnv();
7
- const { View, Skeleton } = useComponent();
8
- const lBlcArr = useRef(Array(3).fill(1));
9
- return (_jsxs(View, Object.assign({ className: 'classifySkeleton', style: { height: flag ? 'calc(100vh - 51px)' : '667px' } }, { children: [_jsx(View, Object.assign({ className: 'lPart' }, { children: lBlcArr.current.map((item, index) => {
10
- return _jsx(Skeleton, { animated: true, className: 'blc' }, index);
11
- }) })), _jsx(View, Object.assign({ className: 'rPart' }, { children: _jsx(Skeleton.Paragraph, { lineCount: 5, animated: true }) }))] })));
12
- };
@@ -1,2 +0,0 @@
1
- export * from './classifyFloor';
2
- export * from './classifySkeleton';
@@ -1,45 +0,0 @@
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, useState } from 'react';
12
- import { useComponent, antdMobile, navigatorImpl } from '@brushes/qj-simulate-component';
13
- import { ClassifyFloor } from './components/';
14
- // import {SEARCH} from "../../static";
15
- import { getEnv } from '@brushes/api';
16
- import { queryGoodsClassTree } from '@brushes/api';
17
- import { QjMobileIcon } from '../../common/icon';
18
- import { _ } from '@brushes/tools';
19
- import { routerMap } from '../../routerMap';
20
- const { get } = _;
21
- const { SideBar } = antdMobile;
22
- const GoodsClassifyJsx = () => {
23
- const { View, Text } = useComponent();
24
- const [activeKey, setActiveKey] = useState('');
25
- const [navList, setNavList] = useState([]);
26
- const flag = getEnv();
27
- useEffect(() => {
28
- getData();
29
- }, []);
30
- const getData = () => __awaiter(void 0, void 0, void 0, function* () {
31
- try {
32
- let commits = yield queryGoodsClassTree();
33
- setNavList(commits || []);
34
- const code = get(commits, '[0].goodsClassCode');
35
- setActiveKey(code);
36
- }
37
- catch (err) {
38
- console.log(err);
39
- }
40
- });
41
- return (_jsxs(View, Object.assign({ className: 'goodsClassifyWrap', style: { height: flag ? '100%' : '667px' } }, { children: [_jsx(View, Object.assign({ className: 'goods-classify' }, { children: _jsxs(View, Object.assign({ className: 'goods-classify-search', onClick: () => navigatorImpl(routerMap.search) }, { children: [_jsx(QjMobileIcon, { value: "fenxiang" }), _jsx(Text, { children: "\u641C\u7D22\u5546\u54C1" })] })) })), _jsxs(View, Object.assign({ className: 'goodsClassifyContainer' }, { children: [_jsx(View, Object.assign({ className: 'side' }, { children: _jsx(SideBar, Object.assign({ activeKey: activeKey, onChange: setActiveKey, style: {
42
- '--width': '88px'
43
- } }, { children: navList.map((item) => (_jsx(SideBar.Item, { title: item.goodsClassName }, item.goodsClassCode))) })) })), _jsx(View, Object.assign({ className: 'main' }, { children: _jsx(ClassifyFloor, { navList: navList, activeKey: activeKey }) }))] }))] })));
44
- };
45
- export const GoodsClassify = memo(GoodsClassifyJsx);
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useComponent } from '@brushes/qj-simulate-component';
3
- import EvaluateItem from '../../../common/evaluateItem';
4
- const fake = [
5
- {
6
- avatar: 'http://www.qianjiangcloud.com/images/centerimga/pic%EF%BC%8Flogo+@2x.png',
7
- userName: '张三李四王五',
8
- rate: 4.5,
9
- size: '一大通',
10
- evaluate: '实物与描述的一样,质量相当好,卖家态度也好,有问必答,发货速度杠杠的,值得购买哦。外观设计漂亮,尺寸大小合适,包装仔细完整,宝贝手感不错,感觉很好,发货速度快,服务态度一流,给力!5星好评!',
11
- imgUrls: [
12
- {
13
- imgUrl: 'https://img12.360buyimg.com/n1/jfs/t1/137059/18/27631/76566/635fc607E0b9e9c60/762dac6802e989d3.jpg'
14
- },
15
- {
16
- imgUrl: 'https://img12.360buyimg.com/n1/jfs/t1/137059/18/27631/76566/635fc607E0b9e9c60/762dac6802e989d3.jpg'
17
- },
18
- {
19
- imgUrl: 'https://img12.360buyimg.com/n1/jfs/t1/137059/18/27631/76566/635fc607E0b9e9c60/762dac6802e989d3.jpg'
20
- },
21
- {
22
- imgUrl: 'https://img12.360buyimg.com/n1/jfs/t1/137059/18/27631/76566/635fc607E0b9e9c60/762dac6802e989d3.jpg'
23
- }
24
- ]
25
- },
26
- {
27
- avatar: 'http://www.qianjiangcloud.com/images/centerimga/pic%EF%BC%8Flogo+@2x.png',
28
- userName: '张三李四王五',
29
- rate: 4.5,
30
- size: '一大通',
31
- evaluate: '实物与描述的一样,质量相当好,卖家态度也好,有问必答,发货速度杠杠的,值得购买哦。外观设计漂亮,尺寸大小合适,包装仔细完整,宝贝手感不错,感觉很好,发货速度快,服务态度一流,给力!5星好评!',
32
- imgUrls: [
33
- {
34
- imgUrl: 'https://img12.360buyimg.com/n1/jfs/t1/137059/18/27631/76566/635fc607E0b9e9c60/762dac6802e989d3.jpg'
35
- }
36
- ]
37
- }
38
- ];
39
- const EvaluateEntry = () => {
40
- const { View, Text } = useComponent();
41
- return (_jsxs(View, Object.assign({ className: 'evaluateEntry' }, { children: [_jsxs(View, Object.assign({ className: 'topInfo' }, { children: [_jsx(Text, Object.assign({ className: 'title' }, { children: "\u8BC4\u4EF7\uFF08109\uFF09" })), _jsx(View, { children: _jsx(Text, Object.assign({ className: 'txt' }, { children: "\u597D\u8BC4\u5EA6 99%" })) })] })), fake.map((item, index) => (_jsx(EvaluateItem, { itemData: item }, index)))] })));
42
- };
43
- export default EvaluateEntry;
@@ -1,64 +0,0 @@
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
- export const GoodsDetailCollection = ({ checkCollectionObj, setCheckCollectionObj, goods }) => {
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
- try {
28
- const result = yield checkCollectExit(checkCollectionParams);
29
- setCheckCollectionObj(result);
30
- }
31
- catch (err) {
32
- console.log(err);
33
- }
34
- });
35
- const handleSaveCollect = () => __awaiter(void 0, void 0, void 0, function* () {
36
- const saveCollectParmas = {
37
- collectType: 0,
38
- collectOpcode: goods.rsSkuDomainList[0].skuCode || '',
39
- collectOppic: goods.dataPic,
40
- collectOpcont: goods.goodsName,
41
- collectOpnum: goods.pricesetNprice,
42
- goodsOrigin: 0
43
- };
44
- yield saveCollect(saveCollectParmas);
45
- });
46
- const handleDeleteCollectByCode = () => __awaiter(void 0, void 0, void 0, function* () {
47
- const deleteCollectByCodeParams = {
48
- collectType: 0,
49
- collectOpcode: goods.rsSkuDomainList[0].skuCode || ''
50
- };
51
- yield deleteCollectByCode(deleteCollectByCodeParams);
52
- });
53
- const handleCollect = () => {
54
- console.log(123);
55
- if (isEmpty(checkCollectionObj.dataObj)) {
56
- handleSaveCollect();
57
- }
58
- else {
59
- handleDeleteCollectByCode();
60
- }
61
- checkCollection();
62
- };
63
- 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) ? '收藏' : '已收藏' }))] })));
64
- };