李志伟 3 年前
父节点
当前提交
5b891a2fdd
共有 1 个文件被更改,包括 7 次插入17 次删除
  1. 7
    17
      src/components/CompoentsOrder/complete/index.jsx

+ 7
- 17
src/components/CompoentsOrder/complete/index.jsx 查看文件

@@ -28,7 +28,7 @@ export default (props) => {
28 28
   })
29 29
 
30 30
   useEffect(() => {
31
-    if (pageNum) {
31
+    if (pageNum.pageNum) {
32 32
       getList();
33 33
     }
34 34
   }, [pageNum]);
@@ -39,16 +39,12 @@ export default (props) => {
39 39
     getOrderSub({
40 40
       ...pageNum,
41 41
       pageSize: 10,
42
-      ...(type !== undefined ? dict[type] : null),
42
+      isVerified: '',
43
+      ...(type !== undefined ? dict[type] : {}),
43 44
     }).then((res) => {
44
-      if (pageNum === 1) {
45
-        setList(res.records || [])
46
-      } else {
47
-        setList(res.records || [])
48
-      }
49
-      // setList(
50
-      //   pageNum === 1 ? res.records || [] : list.concat(res.records || [])
51
-      // );
45
+      setList(
46
+        pageNum.pageNum === 1 ? res.records || [] : list.concat(res.records || [])
47
+      );
52 48
       setHasNextPage(res.current < res.pages);
53 49
       setLoading(false)
54 50
 
@@ -80,13 +76,7 @@ export default (props) => {
80 76
         title: '删除订单成功',
81 77
         icon: 'none',
82 78
       })
83
-      getOrderSub({
84
-        ...pageNum,
85
-        pageSize: 10,
86
-        ...(type !== undefined ? dict[type] : null),
87
-      }).then((res) => {
88
-        setList(res.records || [])
89
-      })
79
+      setNumber({ pageNum: 1 })
90 80
     })
91 81
   }
92 82