Pārlūkot izejas kodu

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

吃个甘蔗嚼一年 3 gadus atpakaļ
vecāks
revīzija
ff59ae9a80

+ 11
- 9
src/components/CompoentsOrder/OrderCard/index.jsx Parādīt failu

@@ -61,23 +61,25 @@ export default (props) => {
61 61
     });
62 62
   };
63 63
   const PayAction =
64
-    kkp == '1' ? null :
65
-      sh == '1' ? <Action.Icon icon={Refund} text='售后/退款' onClick={() => handleRefund(item)} /> :
66
-        item.status === 0 ? <Action.Icon icon={Pay} text='支付' onClick={handleDetail} /> :
67
-          item.status === 1 && item.isVerified == false ? <Action.Icon icon={QRcode} text='扫码核销' onClick={() => onWriteOff(item)} /> :
68
-            item.status === 2 && item.isVerified == false ? <Action.Image image={refund} /> :
69
-              item.status === 7 && item.isVerified == false ? <Action.Image image={Cancel} /> :
70
-                item.status === 9 ? <Action.Image image={Null} /> :
71
-                  item.isVerified == true && item.isEvaluated > 0 ? <Action.Image image={Evaluated} /> :
72
-                    item.isVerified == true ? <Action.Icon icon={Evaluation} text='评价' onClick={() => evaluation(item)} /> : null
64
+    kkp == '1' ? null ://空卡片用于售后详情页面
65
+      sh == '1' ? <Action.Icon icon={Refund} text='售后/退款' onClick={() => handleRefund(item)} /> ://售后页面卡片
66
+        item.status === 0 ? <Action.Icon icon={Pay} text='支付' onClick={handleDetail} /> ://待支付
67
+          item.status === 1 && item.isVerified == false ? <Action.Icon icon={QRcode} text='扫码核销' onClick={() => onWriteOff(item)} /> ://待核销
68
+            item.status === 2 && item.isVerified == false ? <Action.Image image={refund} /> ://已退费
69
+              item.status === 7 && item.isVerified == false ? <Action.Image image={Cancel} /> ://已取消
70
+                item.status === 9 ? <Action.Image image={Null} /> ://已过期
71
+                  item.isVerified == true && item.isEvaluated > 0 ? <Action.Image image={Evaluated} /> ://已评价
72
+                    item.isVerified == true ? <Action.Icon icon={Evaluation} text='评价' onClick={() => evaluation(item)} /> : null//待评价
73 73
 
74 74
 
75 75
   return (
76 76
     <>
77 77
       {
78
+        //售后和售后详情页面不显示订单编号
78 79
         sh != '1' || kkp != '1' ? <view className='OrderNumber'>订单编号:{item.orderId}</view> : null
79 80
       }
80 81
       {
82
+        //待支付可以左滑删除
81 83
         item.status === 0 ? <SlideView del onDelete={() => handeDelete(item)} >
82 84
           <CouponCard onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })}} action={PayAction}>
83 85
             <CouponMedia>

+ 7
- 15
src/components/CompoentsOrder/complete/index.jsx Parādīt failu

@@ -19,7 +19,6 @@ const dict = {
19 19
 export default (props) => {
20 20
   const { type } = props;
21 21
   const [list, setList] = useState([]);
22
-  const [IsPull, setPull] = useState(false);
23 22
   const [pageNum, setNumber] = useState({ pageNum: 1 });
24 23
   const [HasNextPage, setHasNextPage] = useState(true);
25 24
   const [loading, setLoading] = useState(false)
@@ -40,14 +39,12 @@ export default (props) => {
40 39
     getOrderSub({
41 40
       ...pageNum,
42 41
       pageSize: 10,
43
-      isVerified: '',
44 42
       ...(type !== undefined ? dict[type] : null),
45 43
     }).then((res) => {
46 44
       setList(
47 45
         pageNum === 1 ? res.records || [] : list.concat(res.records || [])
48 46
       );
49 47
       setHasNextPage(res.current < res.pages);
50
-      setPull(false);
51 48
       setLoading(false)
52 49
 
53 50
     }).catch(e => {
@@ -68,17 +65,6 @@ export default (props) => {
68 65
   const onClose = () => {
69 66
     setShowCutover(false)
70 67
   }
71
-
72
-  useEffect(() => {
73
-    // 下拉刷新触发
74
-    if (IsPull) {
75
-      if (pageNum.pageNum === 1) {
76
-        getList();
77
-      } else {
78
-        setNumber(1);
79
-      }
80
-    }
81
-  }, [IsPull]);
82 68
   const [ite, setItem] = useState({})
83 69
   const show = (val) => {
84 70
     setItem(val)
@@ -89,7 +75,13 @@ export default (props) => {
89 75
         title: '删除订单成功',
90 76
         icon: 'none',
91 77
       })
92
-      getList();
78
+      getOrderSub({
79
+        ...pageNum,
80
+        pageSize: 10,
81
+        ...(type !== undefined ? dict[type] : null),
82
+      }).then((res) => {
83
+        setList(res.records || [])
84
+      })
93 85
     })
94 86
   }
95 87