Browse Source

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

吃个甘蔗嚼一年 3 years ago
parent
commit
ff59ae9a80

+ 11
- 9
src/components/CompoentsOrder/OrderCard/index.jsx View File

61
     });
61
     });
62
   };
62
   };
63
   const PayAction =
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
   return (
75
   return (
76
     <>
76
     <>
77
       {
77
       {
78
+        //售后和售后详情页面不显示订单编号
78
         sh != '1' || kkp != '1' ? <view className='OrderNumber'>订单编号:{item.orderId}</view> : null
79
         sh != '1' || kkp != '1' ? <view className='OrderNumber'>订单编号:{item.orderId}</view> : null
79
       }
80
       }
80
       {
81
       {
82
+        //待支付可以左滑删除
81
         item.status === 0 ? <SlideView del onDelete={() => handeDelete(item)} >
83
         item.status === 0 ? <SlideView del onDelete={() => handeDelete(item)} >
82
           <CouponCard onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })}} action={PayAction}>
84
           <CouponCard onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })}} action={PayAction}>
83
             <CouponMedia>
85
             <CouponMedia>

+ 7
- 15
src/components/CompoentsOrder/complete/index.jsx View File

19
 export default (props) => {
19
 export default (props) => {
20
   const { type } = props;
20
   const { type } = props;
21
   const [list, setList] = useState([]);
21
   const [list, setList] = useState([]);
22
-  const [IsPull, setPull] = useState(false);
23
   const [pageNum, setNumber] = useState({ pageNum: 1 });
22
   const [pageNum, setNumber] = useState({ pageNum: 1 });
24
   const [HasNextPage, setHasNextPage] = useState(true);
23
   const [HasNextPage, setHasNextPage] = useState(true);
25
   const [loading, setLoading] = useState(false)
24
   const [loading, setLoading] = useState(false)
40
     getOrderSub({
39
     getOrderSub({
41
       ...pageNum,
40
       ...pageNum,
42
       pageSize: 10,
41
       pageSize: 10,
43
-      isVerified: '',
44
       ...(type !== undefined ? dict[type] : null),
42
       ...(type !== undefined ? dict[type] : null),
45
     }).then((res) => {
43
     }).then((res) => {
46
       setList(
44
       setList(
47
         pageNum === 1 ? res.records || [] : list.concat(res.records || [])
45
         pageNum === 1 ? res.records || [] : list.concat(res.records || [])
48
       );
46
       );
49
       setHasNextPage(res.current < res.pages);
47
       setHasNextPage(res.current < res.pages);
50
-      setPull(false);
51
       setLoading(false)
48
       setLoading(false)
52
 
49
 
53
     }).catch(e => {
50
     }).catch(e => {
68
   const onClose = () => {
65
   const onClose = () => {
69
     setShowCutover(false)
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
   const [ite, setItem] = useState({})
68
   const [ite, setItem] = useState({})
83
   const show = (val) => {
69
   const show = (val) => {
84
     setItem(val)
70
     setItem(val)
89
         title: '删除订单成功',
75
         title: '删除订单成功',
90
         icon: 'none',
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