s-material-react 0.1.13 → 0.1.14

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 (124) hide show
  1. package/css/common/addressItem.scss +41 -1
  2. package/css/common/card.scss +1 -0
  3. package/css/common/coupon.scss +8 -3
  4. package/css/common/icon.scss +79 -3
  5. package/css/pages/addressDetail.scss +79 -0
  6. package/css/pages/addressList.scss +32 -8
  7. package/css/pages/cart.scss +52 -5
  8. package/css/pages/couponList.scss +5 -0
  9. package/css/pages/goodsClassify.scss +32 -6
  10. package/css/pages/goodsDetail.scss +22 -67
  11. package/css/pages/index.scss +2 -0
  12. package/css/pages/mine.scss +2 -6
  13. package/css/pages/orderEntry.scss +4 -2
  14. package/css/pages/paymentMode.scss +75 -0
  15. package/css/pages/placeOrder.scss +30 -8
  16. package/css/pages/service.scss +1 -6
  17. package/css/pages/slider.scss +6 -0
  18. package/dist/common/addressItem/index.d.ts +1 -1
  19. package/dist/common/addressItem/index.js +6 -7
  20. package/dist/common/card/index.js +1 -1
  21. package/dist/common/coupon/index.d.ts +1 -1
  22. package/dist/common/coupon/index.js +4 -5
  23. package/dist/common/icon/index.d.ts +2 -1
  24. package/dist/common/icon/index.js +2 -2
  25. package/dist/common/mock/index.js +35 -0
  26. package/dist/components/AddressDetail/components/index.d.ts +0 -0
  27. package/dist/components/AddressDetail/components/index.js +1 -0
  28. package/dist/components/AddressDetail/components/skull.d.ts +2 -0
  29. package/dist/components/AddressDetail/components/skull.js +9 -0
  30. package/dist/components/AddressDetail/config.d.ts +51 -0
  31. package/dist/components/AddressDetail/config.js +65 -0
  32. package/dist/components/AddressDetail/hooks/index.d.ts +1 -0
  33. package/dist/components/AddressDetail/hooks/index.js +1 -0
  34. package/dist/components/AddressDetail/hooks/useAddAddress.d.ts +26 -0
  35. package/dist/components/AddressDetail/hooks/useAddAddress.js +80 -0
  36. package/dist/components/AddressDetail/index.d.ts +1 -1
  37. package/dist/components/AddressDetail/index.js +17 -107
  38. package/dist/components/AddressList/components/index.d.ts +1 -0
  39. package/dist/components/AddressList/components/index.js +1 -0
  40. package/dist/components/AddressList/components/skull.d.ts +2 -0
  41. package/dist/components/AddressList/components/skull.js +9 -0
  42. package/dist/components/AddressList/hooks/index.d.ts +1 -0
  43. package/dist/components/AddressList/hooks/index.js +1 -0
  44. package/dist/components/AddressList/hooks/useAddressList.d.ts +6 -0
  45. package/dist/components/AddressList/hooks/useAddressList.js +74 -0
  46. package/dist/components/AddressList/index.js +8 -6
  47. package/dist/components/Cart/components/cartItem.d.ts +3 -0
  48. package/dist/components/Cart/components/cartItem.js +34 -0
  49. package/dist/components/Cart/hooks/index.d.ts +19 -0
  50. package/dist/components/Cart/hooks/index.js +90 -0
  51. package/dist/components/Cart/index.js +14 -18
  52. package/dist/components/Cart/store/index.d.ts +10 -0
  53. package/dist/components/Cart/store/index.js +23 -0
  54. package/dist/components/CouponList/index.js +1 -1
  55. package/dist/components/Goods/index.js +3 -3
  56. package/dist/components/GoodsClassify/components/classifySkeleton.d.ts +1 -0
  57. package/dist/components/GoodsClassify/components/classifySkeleton.js +12 -0
  58. package/dist/components/GoodsClassify/index.js +4 -4
  59. package/dist/components/GoodsDetail/components/goodsDetailCollection.d.ts +1 -1
  60. package/dist/components/GoodsDetail/components/goodsDetailCollection.js +8 -3
  61. package/dist/components/GoodsDetail/components/goodsDetailCoupon.js +22 -33
  62. package/dist/components/GoodsDetail/components/goodsDetailHandleBar.js +23 -3
  63. package/dist/components/GoodsDetail/components/goodsDetailInfo.d.ts +1 -1
  64. package/dist/components/GoodsDetail/components/goodsDetailInfo.js +1 -1
  65. package/dist/components/GoodsDetail/components/goodsDetailPopup.d.ts +1 -1
  66. package/dist/components/GoodsDetail/components/goodsDetailPopup.js +9 -23
  67. package/dist/components/GoodsDetail/components/goodsDetailPromotion.js +2 -3
  68. package/dist/components/GoodsDetail/components/goodsDetailSize.d.ts +1 -1
  69. package/dist/components/GoodsDetail/components/goodsDetailSize.js +11 -2
  70. package/dist/components/GoodsDetail/hooks/index.d.ts +2 -0
  71. package/dist/components/GoodsDetail/hooks/index.js +2 -75
  72. package/dist/components/GoodsDetail/hooks/useAddShopping.d.ts +10 -0
  73. package/dist/components/GoodsDetail/hooks/useAddShopping.js +74 -0
  74. package/dist/components/GoodsDetail/hooks/useGoodsDetailImpl.d.ts +13 -0
  75. package/dist/components/GoodsDetail/hooks/useGoodsDetailImpl.js +85 -0
  76. package/dist/components/GoodsDetail/index.d.ts +5 -1
  77. package/dist/components/GoodsDetail/index.js +15 -8
  78. package/dist/components/GoodsDetail/store/index.d.ts +10 -0
  79. package/dist/components/GoodsDetail/store/index.js +34 -0
  80. package/dist/components/Mine/components/menuList.js +7 -6
  81. package/dist/components/Mine/components/orderEntry.js +17 -10
  82. package/dist/components/Mine/index.js +4 -3
  83. package/dist/components/OrderList/components/OrderListItem.js +2 -3
  84. package/dist/components/OrderList/components/orderItem.js +1 -2
  85. package/dist/components/PaymentMode/config.d.ts +6 -0
  86. package/dist/components/PaymentMode/config.js +14 -0
  87. package/dist/components/PaymentMode/hooks/useOrderResult.d.ts +11 -0
  88. package/dist/components/PaymentMode/hooks/useOrderResult.js +100 -0
  89. package/dist/components/PaymentMode/index.d.ts +4 -0
  90. package/dist/components/PaymentMode/index.js +17 -0
  91. package/dist/components/PlaceOrder/components/address.d.ts +12 -0
  92. package/dist/components/PlaceOrder/components/address.js +33 -0
  93. package/dist/components/PlaceOrder/components/orderPrice.d.ts +12 -0
  94. package/dist/components/PlaceOrder/components/orderPrice.js +8 -0
  95. package/dist/components/PlaceOrder/components/shop.d.ts +4 -0
  96. package/dist/components/PlaceOrder/components/shop.js +9 -0
  97. package/dist/components/PlaceOrder/hooks/usePlaceOrder.d.ts +18 -0
  98. package/dist/components/PlaceOrder/hooks/usePlaceOrder.js +234 -0
  99. package/dist/components/PlaceOrder/index.d.ts +6 -1
  100. package/dist/components/PlaceOrder/index.js +8 -3
  101. package/dist/components/PlaceOrderResult/hooks/useOrderResult.d.ts +3 -0
  102. package/dist/components/PlaceOrderResult/hooks/useOrderResult.js +93 -0
  103. package/dist/components/PlaceOrderResult/index.d.ts +3 -1
  104. package/dist/components/PlaceOrderResult/index.js +5 -3
  105. package/dist/components/Search/index.js +3 -2
  106. package/dist/components/SearchPage/index.js +50 -9
  107. package/dist/components/Service/index.d.ts +11 -1
  108. package/dist/components/Service/index.js +4 -3
  109. package/dist/components/index.d.ts +1 -0
  110. package/dist/components/index.js +1 -0
  111. package/dist/options/index.d.ts +0 -2
  112. package/dist/options/index.js +36 -31
  113. package/dist/routerMap/index.d.ts +7 -0
  114. package/dist/routerMap/index.js +8 -1
  115. package/dist/utils/payment.d.ts +14 -0
  116. package/dist/utils/payment.js +56 -0
  117. package/package.json +1 -1
  118. package/css/font/iconfont.ttf +0 -0
  119. package/css/font/iconfont.woff +0 -0
  120. package/css/font/iconfont.woff2 +0 -0
  121. package/dist/components/AddressDetail/option.d.ts +0 -2
  122. package/dist/components/AddressDetail/option.js +0 -32
  123. package/dist/components/Cart/useNumStep.d.ts +0 -1
  124. package/dist/components/Cart/useNumStep.js +0 -7
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import { _ } from '@brushes/tools';
4
- import { getEnv } from '@brushes/api';
5
4
  import GoodsDetailPromotion from './components/goodsDetailPromotion';
6
5
  import GoodsDetailCoupon from './components/goodsDetailCoupon';
7
6
  import GoodsDetailCollection from './components/goodsDetailCollection';
@@ -10,18 +9,26 @@ import { Slider } from '../Slider';
10
9
  import GoodsDetailInfo from './components/goodsDetailInfo';
11
10
  import GoodsDetailEvaluate from './components/goodsDetailEvaluate';
12
11
  import GoodsDetailSize from './components/goodsDetailSize';
13
- import { useGoodsDetailmpl } from './hooks';
14
- const flag = getEnv();
12
+ import { useGoodsDetailImpl } from './hooks';
13
+ import { StoreProvider } from './store';
14
+ import { getEnv } from '@brushes/api';
15
+ import { useComponent } from '@brushes/qj-simulate-component';
15
16
  const { isEmpty } = _;
16
- const GoodsDetailJsx = ({ skuCode = '' }) => {
17
+ const flag = getEnv();
18
+ const GoodsDetailJsx = ({ skuCode }) => {
19
+ return (_jsx(StoreProvider, { children: _jsx(GoodsDetailJsxInner, { skuCode: skuCode }) }));
20
+ };
21
+ const GoodsDetailJsxInner = ({ skuCode }) => {
17
22
  var _a;
18
- const { View, Text, Skeleton, goods, promotionArr, checkCollectionObj, setCheckCollectionObj, sliderArr, tabActive, setTabActive, popupVisible, setPopupVisible } = useGoodsDetailmpl(skuCode);
23
+ const { View, Text, Skeleton } = useComponent();
24
+ const { goods, promotionArr, checkCollectionObj, setCheckCollectionObj, sliderArr, tabActive, setTabActive } = useGoodsDetailImpl(skuCode);
19
25
  return (_jsx(View, Object.assign({ className: 'GoodsDetailWrap', style: {
20
- height: flag ? '100vh' : '600px',
21
- paddingBottom: flag ? '100vh' : '60px'
26
+ minHeight: flag ? '' : '667px',
27
+ height: flag ? '' : 'auto',
28
+ overflow: flag ? '' : 'auto'
22
29
  } }, { children: isEmpty(goods) ? (_jsxs(View, Object.assign({ className: 'skeleton' }, { children: [_jsx(Skeleton, { animated: true, style: {
23
30
  '--width': '100%',
24
31
  '--height': '300px'
25
- } }), _jsx(Skeleton.Title, { animated: true }), _jsx(Skeleton.Paragraph, { lineCount: 10, animated: true })] }))) : (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'topSlider' }, { children: _jsx(Slider, { selectImg: sliderArr }) })), _jsxs(View, Object.assign({ className: 'goodsDetail-topInfo' }, { children: [_jsxs(View, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: goods === null || goods === void 0 ? void 0 : goods.goodsName })), _jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5", (_a = goods === null || goods === void 0 ? void 0 : goods.pricesetNprice) === null || _a === void 0 ? void 0 : _a.toFixed(2)] }))] }), _jsx(View, Object.assign({ className: 'rPart' }, { children: _jsx(GoodsDetailCollection, { goods: goods, checkCollectionObj: checkCollectionObj, setCheckCollectionObj: setCheckCollectionObj }) }))] })), _jsx(GoodsDetailSize, { goods: goods, popupVisible: popupVisible, setPopupVisible: setPopupVisible }), _jsx(GoodsDetailPromotion, { promotionList: promotionArr }), _jsx(GoodsDetailCoupon, {}), _jsxs(View, Object.assign({ className: 'goodsDetailTab' }, { children: [_jsxs(View, Object.assign({ className: 'tabs' }, { children: [_jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 1 ? 'active' : ''}`, onClick: () => setTabActive(1) }, { children: ["\u5546\u54C1\u8BE6\u60C5", _jsx(Text, { className: 'line' })] })), _jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 2 ? 'active' : ''}`, onClick: () => setTabActive(2) }, { children: ["\u8BC4\u4EF7", _jsx(Text, { className: 'line' })] }))] })), _jsx(View, Object.assign({ className: 'group' }, { children: tabActive === 1 ? (_jsx(GoodsDetailInfo, { tabActive: tabActive, goods: goods })) : (_jsx(GoodsDetailEvaluate, {})) }))] })), _jsx(GoodsDetailHandleBar, {})] })) })));
32
+ } }), _jsx(Skeleton.Title, { animated: true }), _jsx(Skeleton.Paragraph, { lineCount: 10, animated: true })] }))) : (_jsxs(_Fragment, { children: [_jsx(View, Object.assign({ className: 'topSlider' }, { children: _jsx(Slider, { selectImg: sliderArr, type: 1, imgHeight: { height: 375, width: 375 } }) })), _jsxs(View, Object.assign({ className: 'goodsDetail-topInfo' }, { children: [_jsxs(View, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: goods === null || goods === void 0 ? void 0 : goods.goodsName })), _jsxs(Text, Object.assign({ className: 'price' }, { children: ["\uFFE5", (_a = goods === null || goods === void 0 ? void 0 : goods.pricesetNprice) === null || _a === void 0 ? void 0 : _a.toFixed(2)] }))] }), _jsx(View, Object.assign({ className: 'rPart' }, { children: _jsx(GoodsDetailCollection, { goods: goods, checkCollectionObj: checkCollectionObj, setCheckCollectionObj: setCheckCollectionObj }) }))] })), _jsx(GoodsDetailSize, { goods: goods }), _jsx(GoodsDetailPromotion, { promotionList: promotionArr }), _jsx(GoodsDetailCoupon, {}), _jsxs(View, Object.assign({ className: 'goodsDetailTab' }, { children: [_jsxs(View, Object.assign({ className: 'tabs' }, { children: [_jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 1 ? 'active' : ''}`, onClick: () => setTabActive(1) }, { children: ["\u5546\u54C1\u8BE6\u60C5", _jsx(Text, { className: 'line' })] })), _jsxs(Text, Object.assign({ className: `tabsItem ${tabActive === 2 ? 'active' : ''}`, onClick: () => setTabActive(2) }, { children: ["\u8BC4\u4EF7", _jsx(Text, { className: 'line' })] }))] })), _jsx(View, Object.assign({ className: 'group' }, { children: tabActive === 1 ? (_jsx(GoodsDetailInfo, { tabActive: tabActive, goods: goods })) : (_jsx(GoodsDetailEvaluate, {})) }))] })), _jsx(GoodsDetailHandleBar, {})] })) })));
26
33
  };
27
34
  export const GoodsDetail = memo(GoodsDetailJsx);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * =========== StoreProvider, useStore, useDispatchImpl ============
3
+ * 导出三个参数
4
+ * 第一个是Provider
5
+ * 第二个是Store
6
+ * 第三个是Dispath
7
+ *
8
+ */
9
+ declare const StoreProvider: any, useStore: any, useDispatchImpl: any;
10
+ export { StoreProvider, useStore, useDispatchImpl };
@@ -0,0 +1,34 @@
1
+ import { makeStore } from 'qj-mobile-store';
2
+ const defaultValues = {
3
+ count: 1,
4
+ orderType: 0,
5
+ isNeedButton: false,
6
+ popupVisible: false,
7
+ goodsNum: 1,
8
+ goodsCode: ''
9
+ };
10
+ function reduceImpl(state, action) {
11
+ switch (action.type) {
12
+ case 'plus':
13
+ return Object.assign(Object.assign({}, state), { count: state.count + 1 });
14
+ case 'minus':
15
+ return Object.assign(Object.assign({}, state), { count: state.count - 1 });
16
+ case 'select':
17
+ case 'initGoods':
18
+ case 'popupImpl':
19
+ return Object.assign(Object.assign({}, state), action.payload);
20
+ default:
21
+ return state;
22
+ }
23
+ }
24
+ /**
25
+ * =========== StoreProvider, useStore, useDispatchImpl ============
26
+ * 导出三个参数
27
+ * 第一个是Provider
28
+ * 第二个是Store
29
+ * 第三个是Dispath
30
+ *
31
+ */
32
+ const [StoreProvider, useStore, useDispatchImpl] = makeStore(reduceImpl, defaultValues);
33
+ // demo
34
+ export { StoreProvider, useStore, useDispatchImpl };
@@ -1,21 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef } from 'react';
3
- import { useComponent } from '@brushes/qj-simulate-component';
3
+ import { useComponent, IconMobile, navigatorImpl } from '@brushes/qj-simulate-component';
4
+ import { routerMap } from '../../../routerMap';
4
5
  export const MenuList = () => {
5
6
  const { View, Text } = useComponent();
6
7
  const config = useRef([
7
8
  {
8
- icon: '',
9
+ icon: 'youhuiquan',
9
10
  label: '优惠券',
10
- link: ''
11
+ link: 'couponList'
11
12
  },
12
13
  {
13
- icon: '',
14
+ icon: 'dizhi',
14
15
  label: '地址管理',
15
- link: ''
16
+ link: 'addressList'
16
17
  }
17
18
  ]);
18
19
  return (_jsx(View, Object.assign({ className: 'menuList' }, { children: config.current.map((item, idx) => {
19
- return (_jsxs(View, Object.assign({ className: 'menuListItem' }, { children: [_jsxs(View, Object.assign({ className: 'lPart' }, { children: [_jsx(Text, { className: 'icon' }), _jsx(Text, Object.assign({ className: 'label' }, { children: item.label }))] })), _jsx(Text, { className: 'tag' })] }), idx));
20
+ return (_jsxs(View, Object.assign({ className: 'menuListItem', onClick: () => navigatorImpl(routerMap[item.link]) }, { children: [_jsxs(View, Object.assign({ className: 'lPart' }, { children: [_jsx(IconMobile, { value: item.icon }), _jsx(Text, Object.assign({ className: 'label' }, { children: item.label }))] })), _jsx(IconMobile, { value: 'xiangyou1' })] }), idx));
20
21
  }) })));
21
22
  };
@@ -1,41 +1,48 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { navigatorImpl, useComponent } from '@brushes/qj-simulate-component';
3
- import { AFTERSALE, FINISH, OBLIGATION, ORDERTOPAY, ORDERTORECEIVE } from '../../../static';
4
- import { useRef } from 'react';
2
+ import { navigatorImpl, useComponent, IconMobile } from '@brushes/qj-simulate-component';
3
+ import { getContractNumbers } from '@brushes/api';
4
+ import { useEffect, useRef } from 'react';
5
5
  import { routerMap } from '../../../routerMap';
6
6
  export const OrderEntry = () => {
7
- const { View, Text, Badge, Image } = useComponent();
7
+ const { View, Text, Badge } = useComponent();
8
+ useEffect(() => {
9
+ getContractNumbers().then((res) => {
10
+ console.log('----------', res);
11
+ });
12
+ }, []);
8
13
  const config = useRef([
9
14
  {
10
15
  badge: 5,
11
16
  label: '待付款',
12
- icon: OBLIGATION,
17
+ icon: 'daifukuan',
13
18
  link: ''
14
19
  },
15
20
  {
16
21
  badge: 0,
17
22
  label: '待发货',
18
- icon: ORDERTOPAY,
23
+ icon: 'daifahuo',
19
24
  link: ''
20
25
  },
21
26
  {
22
27
  badge: 0,
23
28
  label: '待收货',
24
- icon: ORDERTORECEIVE,
29
+ icon: 'daishouhuo',
25
30
  link: ''
26
31
  },
27
32
  {
28
33
  badge: 0,
29
34
  label: '已完成',
30
- icon: FINISH,
35
+ icon: 'yiwancheng',
31
36
  link: ''
32
37
  },
33
38
  {
34
39
  badge: 0,
35
40
  label: '退换/售后',
36
- icon: AFTERSALE,
41
+ icon: 'shouhou',
37
42
  link: ''
38
43
  }
39
44
  ]);
40
- return (_jsxs(View, Object.assign({ className: 'orderEntry' }, { children: [_jsxs(View, Object.assign({ className: 'title' }, { children: [_jsx(View, Object.assign({ className: 'name' }, { children: "\u6211\u7684\u8BA2\u5355" })), _jsx(View, Object.assign({ className: 'more', onClick: () => navigatorImpl(routerMap.order) }, { children: "\u67E5\u770B\u5168\u90E8" }))] })), _jsx(View, Object.assign({ className: 'content' }, { children: config.current.map((item, index) => (_jsxs(View, Object.assign({ onClick: () => navigatorImpl(`${routerMap.order}?id=${index + 1}`), className: 'contentItem' }, { children: [item.badge ? (_jsx(Badge, Object.assign({ content: item.badge, color: '#000', style: { color: '#fff', fontSize: 12 } }, { children: _jsx(Image, { src: item.icon, mode: 'widthFix', className: 'icon' }) }))) : (_jsx(Image, { src: item.icon, mode: 'widthFix', className: 'icon' })), _jsx(Text, Object.assign({ className: 'subTitle' }, { children: item.label }))] }), index))) }))] })));
45
+ return (_jsxs(View, Object.assign({ className: 'orderEntry' }, { children: [_jsxs(View, Object.assign({ className: 'title' }, { children: [_jsx(View, Object.assign({ className: 'name' }, { children: "\u6211\u7684\u8BA2\u5355" })), _jsx(View, Object.assign({ className: 'more', onClick: () => navigatorImpl(routerMap.order) }, { children: "\u67E5\u770B\u5168\u90E8" }))] })), _jsx(View, Object.assign({ className: 'content' }, { children: config.current.map((item, index) => (_jsxs(View, Object.assign({ onClick: () => navigatorImpl(`${routerMap.order}?id=${index + 1}`), className: 'contentItem' }, { children: [item.badge ? (_jsx(Badge, Object.assign({ content: item.badge, color: '#000', style: { color: '#fff', fontSize: 12 } }, { children: _jsx(IconMobile, { value: item.icon }) }))) : (
46
+ // <Image src={item.icon} mode={'widthFix'} className={'icon'}/>
47
+ _jsx(IconMobile, { value: item.icon })), _jsx(Text, Object.assign({ className: 'subTitle' }, { children: item.label }))] }), index))) }))] })));
41
48
  };
@@ -1,14 +1,15 @@
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, IconMobile, navigatorImpl } from '@brushes/qj-simulate-component';
4
4
  import { getEnv } from '@brushes/api';
5
5
  import { OrderEntry } from './components/orderEntry';
6
6
  import { MenuList } from './components/menuList';
7
+ import { routerMap } from '../../routerMap';
7
8
  const MineJsx = ({ avatarStyle, banner }) => {
8
9
  const { View, Text } = useComponent();
9
10
  const flag = getEnv();
10
11
  return (_jsxs(View, Object.assign({ className: 'mine', style: {
11
- height: flag ? '100vh' : '600px'
12
- } }, { children: [_jsxs(View, Object.assign({ className: 'topBoard' }, { children: [_jsx(View, { className: 'icon' }), _jsx(View, { className: 'icon' })] })), _jsxs(View, Object.assign({ className: 'userSetting' }, { children: [_jsxs(View, Object.assign({ className: 'lPart' }, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: "\u5F20\u4E09" })), _jsx(View, Object.assign({ className: 'link' }, { children: '编辑个人资料 >' }))] })), _jsx("img", { src: "", alt: "", className: 'avatar', style: { borderRadius: avatarStyle ? '50%' : '2px' } })] })), _jsx(OrderEntry, {}), _jsx(MenuList, {}), banner ? _jsx("img", { className: 'banner', src: "", alt: "" }) : null] })));
12
+ height: flag ? '100%' : '667px'
13
+ } }, { children: [_jsxs(View, Object.assign({ className: 'topBoard' }, { children: [_jsx(IconMobile, { value: 'shezhi', onClick: () => navigatorImpl(routerMap.setting) }), _jsx(IconMobile, { value: 'kehufuwukefu' })] })), _jsxs(View, Object.assign({ className: 'userSetting' }, { children: [_jsxs(View, Object.assign({ className: 'lPart' }, { children: [_jsx(Text, Object.assign({ className: 'name' }, { children: "\u5F20\u4E09" })), _jsx(View, Object.assign({ className: 'link' }, { children: '编辑个人资料 >' }))] })), _jsx("img", { src: "", alt: "", className: 'avatar', style: { borderRadius: avatarStyle ? '50%' : '2px' }, onClick: () => navigatorImpl(routerMap.setting) })] })), _jsx(OrderEntry, {}), _jsx(MenuList, {}), banner ? _jsx("img", { className: 'banner', src: "", alt: "" }) : null] })));
13
14
  };
14
15
  export const Mine = memo(MineJsx);
@@ -13,7 +13,6 @@ import { memo, useEffect, useState } from 'react';
13
13
  import { getEnv, queryContractPageC } from '@brushes/api';
14
14
  import { useComponent, ScrollView, Loading } from '@brushes/qj-simulate-component';
15
15
  import { Item } from './orderItem';
16
- import { result } from './mock';
17
16
  function OrderListItemJsx({ item }) {
18
17
  const { View } = useComponent();
19
18
  const [loading, setLoading] = useState(false);
@@ -24,16 +23,16 @@ function OrderListItemJsx({ item }) {
24
23
  }, []);
25
24
  const onScroll = (e = {}) => __awaiter(this, void 0, void 0, function* () {
26
25
  setLoading(true);
27
- // console.log(17, e.detail);
28
26
  try {
29
27
  const data = yield queryContractPageC({ page: 1, rows: 10 });
30
- setData((val) => [...val, ...result.rows]);
28
+ setData((val) => val.concat(data.rows));
31
29
  setLoading(false);
32
30
  }
33
31
  catch (err) {
34
32
  console.log(err);
35
33
  }
36
34
  });
35
+ console.log('23=====>', data);
37
36
  return (_jsx(View, Object.assign({ className: 'orderListItemWrap', style: { height: isTaro ? '100vh' : '667px' } }, { children: _jsx(ScrollView, Object.assign({ onScroll: onScroll, style: { height: '100vh' } }, { children: _jsxs(View, { children: [data.map((item, index) => (_createElement(Item, Object.assign({}, item, { key: index })))), loading ? _jsx(Loading, {}) : null] }) })) })));
38
37
  }
39
38
  export const OrderListItem = memo(OrderListItemJsx);
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useComponent, antdMobile } from '@brushes/qj-simulate-component';
3
- import { CardJsx } from '../../../common/card';
4
3
  const { Button } = antdMobile;
5
4
  export function Item({ contractBillcode, dataBmoney, dataBnum, goodsList }) {
6
5
  const { View } = useComponent();
7
- return (_jsxs(View, Object.assign({ className: 'orderListItem' }, { children: [_jsxs(View, Object.assign({ className: 'topInfo' }, { children: [_jsxs(View, Object.assign({ className: 'orderNo' }, { children: ["\u8BA2\u5355\u53F7: ", contractBillcode, _jsx(Button, Object.assign({ className: 'copy', size: "mini", fill: 'outline' }, { children: "\u590D\u5236" }))] })), _jsx(View, Object.assign({ className: 'status' }, { children: "\u5F85\u652F\u4ED8" }))] })), _jsxs(View, Object.assign({ className: 'goodsItemWrap' }, { children: [goodsList.map((item) => (_jsx(CardJsx, Object.assign({}, item), item.contractGoodsId))), _jsxs(View, Object.assign({ className: 'allInfo' }, { children: [_jsxs(View, Object.assign({ className: 'totalNum' }, { children: ["\u5171", dataBnum, "\u4EF6\u5546\u54C1"] })), _jsxs(View, Object.assign({ className: 'totalPrice' }, { children: ["\u5408\u8BA1 \uFFE5", dataBmoney] }))] }))] })), _jsxs(View, Object.assign({ className: 'btnGroup' }, { children: [_jsx(Button, Object.assign({ shape: "rounded", className: 'btn white' }, { children: "\u67E5\u770B\u7269\u6D41" })), _jsx(Button, Object.assign({ shape: "rounded", className: 'btn black' }, { children: "\u786E\u8BA4\u6536\u8D27" }))] }))] })));
6
+ return (_jsxs(View, Object.assign({ className: 'orderListItem' }, { children: [_jsxs(View, Object.assign({ className: 'topInfo' }, { children: [_jsxs(View, Object.assign({ className: 'orderNo' }, { children: ["\u8BA2\u5355\u53F7: ", contractBillcode, _jsx(Button, Object.assign({ className: 'copy', size: "mini", fill: 'outline' }, { children: "\u590D\u5236" }))] })), _jsx(View, Object.assign({ className: 'status' }, { children: "\u5F85\u652F\u4ED8" }))] })), _jsx(View, Object.assign({ className: 'goodsItemWrap' }, { children: _jsxs(View, Object.assign({ className: 'allInfo' }, { children: [_jsxs(View, Object.assign({ className: 'totalNum' }, { children: ["\u5171", dataBnum, "\u4EF6\u5546\u54C1"] })), _jsxs(View, Object.assign({ className: 'totalPrice' }, { children: ["\u5408\u8BA1 \uFFE5", dataBmoney] }))] })) })), _jsxs(View, Object.assign({ className: 'btnGroup' }, { children: [_jsx(Button, Object.assign({ shape: "rounded", className: 'btn white' }, { children: "\u67E5\u770B\u7269\u6D41" })), _jsx(Button, Object.assign({ shape: "rounded", className: 'btn black' }, { children: "\u786E\u8BA4\u6536\u8D27" }))] }))] })));
8
7
  }
@@ -0,0 +1,6 @@
1
+ export declare const config: {
2
+ index: number;
3
+ label: string;
4
+ value: string;
5
+ icon: string;
6
+ }[];
@@ -0,0 +1,14 @@
1
+ export const config = [
2
+ {
3
+ index: 1,
4
+ label: '基本户',
5
+ value: 'account',
6
+ icon: 'zhanghu'
7
+ },
8
+ {
9
+ index: 2,
10
+ label: '微信小程序',
11
+ value: 'mini',
12
+ icon: 'xiaochengxu'
13
+ }
14
+ ];
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare function useOrderResult(code: string): {
3
+ paymentImpl: () => void;
4
+ channelList: never[];
5
+ handleRadio: (params: any) => void;
6
+ contract: import("react").MutableRefObject<{
7
+ dataBmoney: string;
8
+ contractBillcode: string;
9
+ }>;
10
+ loading: boolean;
11
+ };
@@ -0,0 +1,100 @@
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 { useEffect, useRef, useState } from 'react';
11
+ import { saveOrderToPay, syncContractState, paymentCommit } from '../../../utils/payment';
12
+ import { _ } from '@brushes/tools';
13
+ const { get } = _;
14
+ export function useOrderResult(code) {
15
+ const [loading, setLoading] = useState(false);
16
+ const channel = useRef('');
17
+ const [channelList, setChannelList] = useState([]);
18
+ const result = useRef({});
19
+ const contract = useRef({
20
+ dataBmoney: '',
21
+ contractBillcode: ''
22
+ });
23
+ useEffect(() => {
24
+ (() => __awaiter(this, void 0, void 0, function* () {
25
+ var _a;
26
+ try {
27
+ const data = yield syncContractState({
28
+ contractBillcode: code
29
+ });
30
+ contract.current = data.dataObj;
31
+ const res = yield saveOrderToPay({
32
+ contractBillcode: (_a = contract.current.contractBillcode) !== null && _a !== void 0 ? _a : ''
33
+ });
34
+ setChannelList(res.payChannelList);
35
+ result.current = res;
36
+ }
37
+ catch (err) {
38
+ console.log(err);
39
+ }
40
+ }))();
41
+ }, []);
42
+ const handleRadio = (params) => {
43
+ channel.current = params.detail.value;
44
+ };
45
+ const paymentImpl = () => {
46
+ switch (channel.current) {
47
+ case 'wechatmini':
48
+ wechatmini();
49
+ break;
50
+ }
51
+ };
52
+ const wechatmini = () => __awaiter(this, void 0, void 0, function* () {
53
+ setLoading(true);
54
+ const { ptradeSeqno, contractBlance, payChannelList } = result.current;
55
+ // 模拟微信支付场景
56
+ const pyJsons = [
57
+ {
58
+ faccountIdType: 'ACCOUNT',
59
+ fchannelCode: payChannelList[1].fchannelCode,
60
+ orderAmount: contract.current.dataBmoney,
61
+ faccountId: payChannelList[1].faccountOuterNo || ''
62
+ }
63
+ ];
64
+ try {
65
+ const res = yield paymentCommit({
66
+ ptradeSeqno,
67
+ payCommitStr: JSON.stringify(pyJsons),
68
+ contractBlance
69
+ });
70
+ let data = res.dataObj.requestData;
71
+ wx.requestPayment({
72
+ timeStamp: data.timeStamp,
73
+ nonceStr: data.nonceStr,
74
+ package: data.package,
75
+ signType: data.signType,
76
+ paySign: data.paySign,
77
+ success: function (res) {
78
+ console.log(64, res);
79
+ },
80
+ fail: function (res) {
81
+ console.log(res, '失败参数');
82
+ setLoading(false);
83
+ },
84
+ complete: function (res) {
85
+ setLoading(false);
86
+ }
87
+ });
88
+ }
89
+ catch (err) {
90
+ setLoading(false);
91
+ }
92
+ });
93
+ return {
94
+ paymentImpl,
95
+ channelList,
96
+ handleRadio,
97
+ contract,
98
+ loading
99
+ };
100
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const PaymentMode: import("react").MemoExoticComponent<({ code }: {
3
+ code: string;
4
+ }) => JSX.Element>;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useComponent, IconMobile, WrapLoading } from '@brushes/qj-simulate-component';
4
+ import { getEnv } from '@brushes/api';
5
+ // import {config} from "./config";
6
+ import { useOrderResult } from './hooks/useOrderResult';
7
+ const flag = getEnv();
8
+ const PaymentModeJsx = ({ code }) => {
9
+ const { View, Text } = useComponent();
10
+ const { paymentImpl, channelList, contract, handleRadio, loading } = useOrderResult(code);
11
+ return (_jsxs(View, Object.assign({ className: 'paymentModeWrap', style: {
12
+ height: flag ? 'inherit' : '667px'
13
+ } }, { children: [_jsxs(View, Object.assign({ className: 'paymentMode' }, { children: [_jsxs(View, Object.assign({ className: 'topInfo' }, { children: [_jsxs(Text, Object.assign({ className: 'title' }, { children: [_jsx(IconMobile, { value: 'roundcheck' }), "\u8BA2\u5355\u63D0\u4EA4\u6210\u529F"] })), _jsxs(View, Object.assign({ className: 'info' }, { children: ["\u8BA2\u5355\u53F7\uFF1A", contract.current.contractBillcode, " | \u603B\u91D1\u989D\uFF1A", contract.current.dataBmoney, "\u5143"] }))] })), _jsx(View, Object.assign({ className: 'paymentGroup' }, { children: _jsx("radio-group", Object.assign({ onChange: handleRadio }, { children: channelList.map((item) => {
14
+ return (_jsxs(View, Object.assign({ className: 'paymentItem' }, { children: [_jsx(IconMobile, { value: item.icon }), _jsxs(View, { children: [_jsxs(View, Object.assign({ className: 'base' }, { children: [_jsx(Text, { children: item.fchannelName }), flag ? _jsx("radio", { value: item.fchannelCode }) : _jsx("input", { type: "radio" })] })), item.value === 'account' ? (_jsxs(View, Object.assign({ className: 'info' }, { children: [_jsx(View, { children: "\u8D26\u6237\u4F59\u989D\uFF1A0\u5143" }), _jsx(View, { children: "\u672C\u5355\u62B5\u6263\uFF1A5.4\u5143" })] }))) : null] })] }), item.fchannelCode));
15
+ }) })) }))] })), _jsx(WrapLoading, Object.assign({ loading: loading }, { children: _jsx(View, Object.assign({ className: 'btnGroup', onClick: paymentImpl }, { children: _jsx(View, Object.assign({ className: 'payment' }, { children: "\u7ACB\u5373\u652F\u4ED8" })) })) }))] })));
16
+ };
17
+ export const PaymentMode = memo(PaymentModeJsx);
@@ -0,0 +1,12 @@
1
+ export interface AddressType {
2
+ provinceName: string;
3
+ cityName: string;
4
+ areaName: string;
5
+ addressDetail: string;
6
+ addressMember: string;
7
+ addressPhone: string;
8
+ addressDefault: string;
9
+ }
10
+ export declare const Address: ({ address }: {
11
+ address: AddressType;
12
+ }) => JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useComponent, IconMobile } from '@brushes/qj-simulate-component';
3
+ import { _ } from '@brushes/tools';
4
+ import { useMemo } from 'react';
5
+ const { isEmpty } = _;
6
+ export const Address = ({ address }) => {
7
+ return _jsx(_Fragment, { children: isEmpty(address) ? _jsx(NoAddress, {}) : _jsx(DefaultAddress, { address: address }) });
8
+ };
9
+ const DefaultAddress = ({ address }) => {
10
+ const { View, Text } = useComponent();
11
+ const addressInfo = useMemo(() => {
12
+ const { provinceName, addressDefault, cityName, areaName, addressDetail, addressMember = '', addressPhone = '' } = address;
13
+ return {
14
+ addressDefault: addressDefault === '1',
15
+ addressMember,
16
+ addressPhone,
17
+ address: provinceName + cityName + areaName + addressDetail
18
+ };
19
+ }, [address]);
20
+ return (_jsxs(View, Object.assign({ className: "address-info" }, { children: [_jsx(IconMobile, { style: {
21
+ fontWeight: 900,
22
+ color: '#444',
23
+ lineHeight: 3.2
24
+ }, value: 'shouhuodizhi' }), _jsxs(View, Object.assign({ className: "left" }, { children: [_jsxs(View, Object.assign({ className: "left-title" }, { children: [_jsx(Text, { children: addressInfo.addressMember }), _jsx(Text, Object.assign({ className: 'left-padding' }, { children: addressInfo.addressPhone })), _jsx(Text, Object.assign({ className: 'left-padding left-title-default' }, { children: addressInfo.addressDefault ? '默认' : '' }))] })), _jsx(View, Object.assign({ className: "left-detail" }, { children: addressInfo.address }))] })), _jsx(IconMobile, { value: 'xiangyou1', style: {
25
+ color: '#444',
26
+ lineHeight: 3,
27
+ textAlign: 'right'
28
+ } })] })));
29
+ };
30
+ const NoAddress = () => {
31
+ const { View, Text } = useComponent();
32
+ return (_jsxs(_Fragment, { children: [_jsxs(View, Object.assign({ className: 'group' }, { children: [_jsx(Text, { className: 'local' }), _jsx(Text, Object.assign({ className: 'address' }, { children: "\u9009\u62E9\u6536\u8D27\u5730\u5740" }))] })), _jsx(Text, { className: 'arrow' })] }));
33
+ };
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ interface OrderPriceType {
3
+ payState: {
4
+ shoppingCountPrice: string | number;
5
+ freight: string | number;
6
+ accountsSumPrice: string | number;
7
+ comDisMoney: string | number;
8
+ };
9
+ savePayPrice: () => void;
10
+ }
11
+ declare const OrderPrice: React.FC<OrderPriceType>;
12
+ export default OrderPrice;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useComponent } from '@brushes/qj-simulate-component';
3
+ const OrderPrice = ({ payState, savePayPrice }) => {
4
+ const { View, Text } = useComponent();
5
+ const { shoppingCountPrice, freight, accountsSumPrice, comDisMoney } = payState;
6
+ return (_jsxs(_Fragment, { children: [_jsxs(View, Object.assign({ className: 'price blcWrap' }, { children: [_jsx(View, Object.assign({ className: 'title' }, { children: "\u4EF7\u683C\u660E\u7EC6" })), _jsxs(View, Object.assign({ className: 'express blcItem' }, { children: [_jsx(View, Object.assign({ className: 'label' }, { children: "\u5546\u54C1\u603B\u91D1\u989D" })), _jsxs(View, Object.assign({ className: 'value' }, { children: ["\uFFE5 ", shoppingCountPrice] }))] })), _jsxs(View, Object.assign({ className: 'coupon blcItem' }, { children: [_jsx(View, Object.assign({ className: 'label' }, { children: "\u4F18\u60E0\u91D1\u989D" })), _jsxs(View, Object.assign({ className: 'value' }, { children: ["\uFFE5 ", comDisMoney] }))] })), _jsxs(View, Object.assign({ className: 'express blcItem' }, { children: [_jsx(View, Object.assign({ className: 'label' }, { children: "\u8FD0\u8D39" })), _jsxs(View, Object.assign({ className: 'value' }, { children: ["\uFFE5 ", freight] }))] })), _jsxs(View, Object.assign({ className: 'all blcItem' }, { children: [_jsx(View, Object.assign({ className: 'label' }, { children: "\u603B\u8BA1" })), _jsxs(View, Object.assign({ className: 'value', style: { color: '#000' } }, { children: ["\uFFE5 ", accountsSumPrice] }))] }))] })), _jsxs(View, Object.assign({ className: 'placeOrderFooter' }, { children: [_jsxs(Text, Object.assign({ className: 'price' }, { children: ["\u5408\u8BA1: ", accountsSumPrice] })), _jsx(View, Object.assign({ className: 'btn', onClick: savePayPrice }, { children: "\u751F\u6210\u8BA2\u5355" }))] }))] }));
7
+ };
8
+ export default OrderPrice;
@@ -0,0 +1,4 @@
1
+ declare const ShopJsx: ({ goodsList }: {
2
+ goodsList: Array<any>;
3
+ }) => JSX.Element;
4
+ export default ShopJsx;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useComponent } from '@brushes/qj-simulate-component';
3
+ import { CardJsx } from '../../../common/card';
4
+ const ShopJsx = ({ goodsList }) => {
5
+ console.log(6, goodsList);
6
+ const { View } = useComponent();
7
+ return (_jsx(View, Object.assign({ className: 'place-order-goods' }, { children: goodsList.map((item, ind) => (_jsx(CardJsx, Object.assign({}, item), ind))) })));
8
+ };
9
+ export default ShopJsx;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { PaymentOrderType } from '../index';
3
+ export declare function usePlaceOrder({ skuId, goodsNum, shoppingGoodsId }: PaymentOrderType): {
4
+ savePayPrice: () => void;
5
+ address: any;
6
+ list: import("react").MutableRefObject<any[]>;
7
+ payState: import("react").MutableRefObject<{
8
+ contractSettlOpno: number;
9
+ promotionCodes: null;
10
+ shoppingCountPrice: number;
11
+ totalDiscountPrice: number;
12
+ accountsSumPrice: number;
13
+ discount: number;
14
+ freight: number;
15
+ comDisMoney: number;
16
+ copyComDisMoney: number;
17
+ }>;
18
+ };