张涛 2 years ago
parent
commit
adadaf7399
3 changed files with 12 additions and 19 deletions
  1. 1
    1
      config/prod.js
  2. 10
    17
      src/components/PowerList/index.jsx
  3. 1
    1
      src/pages/issue/edit/index.jsx

+ 1
- 1
config/prod.js View File

6
     HOST: '"https://wmcj.huoshannews.com"',
6
     HOST: '"https://wmcj.huoshannews.com"',
7
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
7
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
8
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
8
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
9
-    VERSION: '"1.1.14-20230327"',
9
+    VERSION: '"1.1.15-20230328"',
10
   },
10
   },
11
   mini: {},
11
   mini: {},
12
   h5: {
12
   h5: {

+ 10
- 17
src/components/PowerList/index.jsx View File

9
 
9
 
10
   const pageSize = 5;
10
   const pageSize = 5;
11
   const pageNumRef = React.useRef(0);
11
   const pageNumRef = React.useRef(0);
12
-  const listRef = React.useRef([]);
13
   const [loading, setLoading] = React.useState(false);
12
   const [loading, setLoading] = React.useState(false);
14
   const [list, setList] = React.useState([]);
13
   const [list, setList] = React.useState([]);
15
   const [finished, setFinished] = React.useState(true);
14
   const [finished, setFinished] = React.useState(true);
15
+  const listRef = React.useRef([]);
16
+  const paramsRef = React.useRef();
16
   listRef.current = list;
17
   listRef.current = list;
18
+  paramsRef.current = params || {};
17
 
19
 
18
   const changeLoading = (val) => {
20
   const changeLoading = (val) => {
19
     setLoading(val);
21
     setLoading(val);
28
         changeLoading(true);
30
         changeLoading(true);
29
         request({
31
         request({
30
           pageSize,
32
           pageSize,
31
-          ...(params || {}),
33
+          ...paramsRef.current,
32
           ...options,
34
           ...options,
33
         })
35
         })
34
           .then((res) => {
36
           .then((res) => {
53
           });
55
           });
54
       });
56
       });
55
     },
57
     },
56
-    [request, params]
58
+    []
57
   );
59
   );
58
 
60
 
59
   const refresh = React.useCallback(() => {
61
   const refresh = React.useCallback(() => {
70
       pageNumRef.current += 1;
72
       pageNumRef.current += 1;
71
       queryData({ pageNum: pageNumRef.current });
73
       queryData({ pageNum: pageNumRef.current });
72
     },
74
     },
73
-    [queryData]
75
+    []
74
   );
76
   );
75
 
77
 
76
   useShow(() => {
78
   useShow(() => {
77
     refresh();
79
     refresh();
78
   });
80
   });
79
-  // 后加的
80
-  React.useEffect(() => {
81
-    onScrollToLower();
82
-  }, [onScrollToLower]);
83
 
81
 
82
+  
84
   React.useEffect(() => {
83
   React.useEffect(() => {
85
     refresh();
84
     refresh();
86
-  }, [refresh]);
85
+  }, [refresh, params]);
87
 
86
 
88
   React.useImperativeHandle(ref, () => ({
87
   React.useImperativeHandle(ref, () => ({
89
     refresh,
88
     refresh,
90
     updateData: (dt) => setList(dt),
89
     updateData: (dt) => setList(dt),
91
   }));
90
   }));
92
-  const onScrolls = (e) => {
93
-    console.log(e.target.scrollTop);
94
-  };
95
-  const onClicks = (e) => {
96
-    console.log(132);
97
-    console.log(e);
98
-  };
91
+ 
92
+
99
   return (
93
   return (
100
     <PowerScrollView
94
     <PowerScrollView
101
       scrollY
95
       scrollY
106
       finished={finished}
100
       finished={finished}
107
       onScrollToLower={onScrollToLower}
101
       onScrollToLower={onScrollToLower}
108
       style={{ height: "100%", overflowY: "auto" }}
102
       style={{ height: "100%", overflowY: "auto" }}
109
-      onScroll={onScrolls}
110
       renderLoading={loading ? <view>加载中...</view> : <view></view>}
103
       renderLoading={loading ? <view>加载中...</view> : <view></view>}
111
     >
104
     >
112
       {list.map(renderItem)}
105
       {list.map(renderItem)}

+ 1
- 1
src/pages/issue/edit/index.jsx View File

49
     if (duty == ROLE_INSPECTOR) {
49
     if (duty == ROLE_INSPECTOR) {
50
       return [
50
       return [
51
         issue && issue.processNode != PROCESS_START,
51
         issue && issue.processNode != PROCESS_START,
52
-        true,
52
+        issue?.processNode && issue?.processNode != PROCESS_START, // true,
53
         issue && issue.processNode == PROCESS_START,
53
         issue && issue.processNode == PROCESS_START,
54
         false,
54
         false,
55
         false,
55
         false,