fangmingyue před 1 rokem
rodič
revize
723b9e2787

+ 2
- 2
config/prod.js Zobrazit soubor

@@ -3,11 +3,11 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"http://192.168.89.147:9087"',
6
+    // HOST: '"http://192.168.89.25:9087"',
7 7
     HOST: '"https://wmcj.huoshannews.com"',
8 8
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9 9
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
10
-    VERSION: '"1.1.24-20230516"',
10
+    VERSION: '"1.1.26-20230609"',
11 11
   },
12 12
   mini: {},
13 13
   h5: {

+ 2
- 1
project.private.config.json Zobrazit soubor

@@ -17,5 +17,6 @@
17 17
                 }
18 18
             ]
19 19
         }
20
-    }
20
+    },
21
+    "libVersion": "2.32.0"
21 22
 }

+ 0
- 1
src/app.config.js Zobrazit soubor

@@ -28,7 +28,6 @@ export default defineAppConfig({
28 28
     "pages/feedback/issuelist/index",
29 29
     "pages/user/list/index",
30 30
     "pages/user/add/index",
31
-    // "pages/reportList/index",
32 31
   ],
33 32
   subpackages: [
34 33
     {

+ 1
- 0
src/app.js Zobrazit soubor

@@ -7,6 +7,7 @@ const App = (props) => {
7 7
   Taro.useLaunch(() => {
8 8
     Taro.login({
9 9
       success: (res) => {
10
+        console.log(res)
10 11
         store.getState('user').login(res.code);
11 12
       }
12 13
     });

+ 1
- 1
src/layouts/TabBar.jsx Zobrazit soubor

@@ -83,7 +83,7 @@ export default (props) => {
83 83
 
84 84
     // 责任单位用户
85 85
     if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
86
-      return [home, notice, mine];
86
+      return [home, notice,feedback, mine];
87 87
     }
88 88
 
89 89
     if (duty == ROLE_CITIZEN) {

+ 89
- 50
src/pages/feedback/issue/index.jsx Zobrazit soubor

@@ -1,18 +1,22 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import Page from '@/layouts/index';
5
-import { Button, Notify, Field, Cell, CellGroup } from '@antmjs/vantui';
6
-import Map from '@/components/map';
7
-import Uploader from '@/components/Uploader/index';
8
-import mapIcon from '@/assets/icons/marker.png';
9
-import { warn } from '@/utils/message';
10
-import { postTaFeedback } from '@/services/tafeedback';
11
-import { geocoder } from '@/utils/map';
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import Page from "@/layouts/index";
5
+import { Button, Notify, Field, Cell, CellGroup } from "@antmjs/vantui";
6
+import Map from "@/components/map";
7
+import Uploader from "@/components/Uploader/index";
8
+import mapIcon from "@/assets/icons/marker.png";
9
+import { warn } from "@/utils/message";
10
+import { postTaFeedback } from "@/services/tafeedback";
11
+import { geocoder } from "@/utils/map";
12
+// import { authPhone } from "@/services/wxma";
13
+// import { useModel } from "@/store";
12 14
 
13 15
 export default (props) => {
16
+  // const { setPerson, person } = useModel("user");
17
+  // console.log(person);
14 18
   const readOnly = false;
15
-
19
+  // const [phone, setPhone] = React.useState();
16 20
   const [loading, setLoading] = React.useState(false);
17 21
   const fmRef = React.useRef({
18 22
     typeId: undefined,
@@ -34,47 +38,64 @@ export default (props) => {
34 38
 
35 39
     fmRef.current = data;
36 40
     setFormData(data);
37
-  }
41
+  };
38 42
 
39 43
   const onSubmit = () => {
40
-    console.log(formData)
41 44
     try {
42
-      warn(!formData.addr, '请填写地址')
43
-      warn(!formData.content, '请填写问题描述')
44
-      warn(!formData.attachList || formData.attachList.length < 1, '请上传照片')
45
+      warn(!formData.addr, "请填写地址");
46
+      warn(!formData.content, "请填写问题描述");
47
+      warn(
48
+        !formData.attachList || formData.attachList.length < 1,
49
+        "请上传照片"
50
+      );
45 51
     } catch (e) {
46 52
       return;
47 53
     }
48 54
 
49
-    setLoading(true)
50
-    postTaFeedback(formData).then(() => {
51
-      setLoading(false);
52
-      Taro.navigateBack({
53
-        delta: 1,
54
-        fail: () => {
55
-          Taro.reLaunch({
56
-            url: '/pages/home/index'
57
-          })
58
-        } 
55
+    setLoading(true);
56
+    postTaFeedback(formData)
57
+      .then(() => {
58
+        setLoading(false);
59
+        Taro.navigateBack({
60
+          delta: 1,
61
+          fail: () => {
62
+            Taro.reLaunch({
63
+              url: "/pages/home/index",
64
+            });
65
+          },
66
+        });
67
+      })
68
+      .catch(() => {
69
+        setLoading(false);
59 70
       });
60
-    }).catch(() => {
61
-      setLoading(false);
62
-    })
71
+  };
63 72
 
64
-  }
65
-    
66 73
   const onLocationChange = (loc) => {
67
-    setFieldChange('location', loc);
74
+    setFieldChange("location", loc);
68 75
 
69 76
     if (loc) {
70 77
       // 交换经纬度位置
71
-      const [x, y] = loc.split(',');
72
-      const location = [y, x].join(',');
73
-      geocoder(location).then(e => setFieldChange('addr', e?.address_component?.street_number || e?.address)).catch(console.error)
78
+      const [x, y] = loc.split(",");
79
+      const location = [y, x].join(",");
80
+      geocoder(location)
81
+        .then((e) =>
82
+          setFieldChange(
83
+            "addr",
84
+            e?.address_component?.street_number || e?.address
85
+          )
86
+        )
87
+        .catch(console.error);
74 88
     }
75
-  }
76
-
77
-
89
+  };
90
+
91
+  const onGetPhoneNumber = (e) => {
92
+    // const code = e?.detail?.code;
93
+    // authPhone(code).then((res) => {
94
+    //   setPerson(res.person)
95
+    //   // Taro.setStorage({ key: "phone", data: res.person.phone });
96
+    // });
97
+    // onSubmit();
98
+  };
78 99
   return (
79 100
     <Page tabBar="feedback">
80 101
       <Map
@@ -89,25 +110,24 @@ export default (props) => {
89 110
           value={formData.addr}
90 111
           leftIcon={mapIcon}
91 112
           readonly={readOnly}
92
-          onChange={e => setFieldChange('addr', e.detail)}
113
+          onChange={(e) => setFieldChange("addr", e.detail)}
93 114
         />
94 115
       </CellGroup>
95 116
 
96
-      <CellGroup style={{ marginTop: '20px' }}>
97
-
117
+      <CellGroup style={{ marginTop: "20px" }}>
98 118
         <Cell title="问题描述" size="large" border={false} />
99 119
 
100 120
         <Field
101 121
           type="textarea"
102 122
           placeholder="请输入问题描述"
103 123
           readonly={readOnly}
104
-          autosize={{ minHeight: '120px' }}
124
+          autosize={{ minHeight: "120px" }}
105 125
           value={formData.content}
106
-          onChange={e => setFieldChange('content', e.detail)}
126
+          onChange={(e) => setFieldChange("content", e.detail)}
107 127
         />
108 128
       </CellGroup>
109 129
 
110
-      <CellGroup style={{ marginTop: '20px' }}>
130
+      <CellGroup style={{ marginTop: "20px" }}>
111 131
         <Cell title="拍照" size="large" border={false} />
112 132
 
113 133
         <Cell
@@ -115,15 +135,34 @@ export default (props) => {
115 135
             <Uploader
116 136
               value={formData.attachList}
117 137
               disabled={readOnly}
118
-              onChange={e => setFieldChange('attachList', e)}
138
+              onChange={(e) => setFieldChange("attachList", e)}
119 139
             />
120 140
           }
121 141
         />
122 142
       </CellGroup>
123 143
 
124
-      <View style={{ padding: 'var(--main-space)', background: '#fff' }}>
125
-        <Button block type="primary" onClick={onSubmit}>提交</Button>
144
+      <View style={{ padding: "var(--main-space)", background: "#fff" }}>
145
+        {
146
+      //   person?.phone ?
147
+        
148
+      //  : (
149
+      //     <Button
150
+      //       block
151
+      //       type="primary"
152
+      //       openType="getPhoneNumber"
153
+      //       onGetPhoneNumber={onGetPhoneNumber}
154
+      //       // onClick={onSubmit}
155
+      //     >
156
+      //       提交
157
+      //     </Button>
158
+      //   )
159
+        (
160
+          <Button block type="primary" onClick={onSubmit}>
161
+            提交
162
+          </Button>
163
+        )
164
+        }
126 165
       </View>
127 166
     </Page>
128
-  )
129
-}
167
+  );
168
+};

+ 1
- 0
src/pages/feedback/issuelist/index.jsx Zobrazit soubor

@@ -27,6 +27,7 @@ export default (props) => {
27 27
   }, [title]);
28 28
 
29 29
   const onClick = (item) => {
30
+    console.log(item)
30 31
     Taro.navigateTo({
31 32
       url: `/pages/issue/edit/index?id=${item.issueId}`
32 33
     })

+ 1
- 0
src/pages/home/components/Head.jsx Zobrazit soubor

@@ -32,6 +32,7 @@ export default (props) => {
32 32
   }
33 33
 
34 34
   const onSelect = (e) => {
35
+    console.log(e)
35 36
     updateDuty(e.detail.value)
36 37
   }
37 38
 

+ 4
- 3
src/pages/home/index.jsx Zobrazit soubor

@@ -4,7 +4,7 @@ import Page from '@/layouts/index';
4 4
 import { useModel } from '@/store';
5 5
 import MenuIcon from '@/components/MenuIcon';
6 6
 import { ROLE_CITIZEN, ROLE_INSPECTOR, ROLE_MANAGER, ROLE_ORG_MANAGER, ROLE_ORG_USER, ROLE_QUERY_PERSON } from '@/utils/user';
7
-import { PROCESS_APPLY_DELAY, PROCESS_APPLY_END, PROCESS_APPLY_REJECT, PROCESS_APPLY_VERIFY, PROCESS_ASSIGNED, PROCESS_END, PROCESS_START } from '@/utils/biz';
7
+import { PROCESS_APPLY_DELAY, PROCESS_APPLY_END, PROCESS_APPLY_REJECT, PROCESS_APPLY_VERIFY, PROCESS_ASSIGNED, PROCESS_END, PROCESS_START ,APPLY_REJECT} from '@/utils/biz';
8 8
 import { getApplyNum } from '@/services/taissueapply';
9 9
 import Head from './components/Head';
10 10
 import Banner from './components/Banner';
@@ -44,7 +44,8 @@ const menus = {
44 44
     { icon: 'icon3', text: '已 办 结', link: `/pages/org/issue/list/index?title=已办结&bizStatus=${PROCESS_END}` },
45 45
     { icon: 'icon5', text: '已 逾 期', link: '/pages/org/issue/list/index?title=已逾期&bizStatus=expired' },
46 46
     { icon: 'icon11', text: '消息通知', link: '/pages/message/list/index'},
47
-    // { icon: 'icon10', text: '我的上报', link: '/pages/reportList/index?title=我的上报'},
47
+    { icon: 'icon10', text: '我的上报', link: `/pages/feedback/issuelist/index?title=我的上报&bizStatus=`},
48
+
48 49
   ],
49 50
 
50 51
   // 责任交办单位管理员
@@ -70,7 +71,7 @@ const menus = {
70 71
   [ROLE_CITIZEN]: [
71 72
     { icon: 'icon1', text: '未处理', link: `/pages/feedback/issuelist/index?title=未处理&bizStatus=${PROCESS_START}` },
72 73
     { icon: 'icon2', text: '已处理', link: `/pages/feedback/issuelist/index?title=已处理&bizStatus=${PROCESS_ASSIGNED}` },
73
-    { icon: 'icon12', text: '已打回', link: `/pages/feedback/issuelist/index?title=已打回&bizStatus=reject` },
74
+    { icon: 'icon12', text: '已打回', link: `/pages/feedback/issuelist/index?title=已打回&bizStatus=${APPLY_REJECT}` },
74 75
   ],
75 76
 }
76 77
 

+ 5
- 3
src/pages/issue/components/Issue/index.jsx Zobrazit soubor

@@ -13,7 +13,9 @@ import mapIcon from '@/assets/icons/marker.png';
13 13
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
14 14
 import { PROCESS_END } from '@/utils/biz';
15 15
 import { geocoder } from '@/utils/map';
16
-
16
+import {
17
+  ROLE_ORG_USER,
18
+} from "@/utils/user";
17 19
 import IssueStatus from './IssueStatus';
18 20
 
19 21
 const today = new Date();
@@ -241,7 +243,7 @@ export default (props) => {
241 243
       </CellGroup>
242 244
 
243 245
       {
244
-        (showOrg || showExpireDate) && (
246
+        (showOrg ) && (
245 247
           <CellGroup style={{ marginTop: '20px' }}>
246 248
             {
247 249
               showOrg && (
@@ -254,7 +256,7 @@ export default (props) => {
254 256
               )
255 257
             }
256 258
             {
257
-              showExpireDate && (
259
+              (showExpireDate)  && (
258 260
                 <Cell
259 261
                   title="办结时间"
260 262
                   isLink={!readOnly}

+ 52
- 31
src/pages/issue/edit/components/Save.jsx Zobrazit soubor

@@ -1,45 +1,66 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { Button } from '@antmjs/vantui';
5
-import { postTaIssue } from '@/services/taissue';
6
-import { warn } from '@/utils/message';
7
-
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import { Button } from "@antmjs/vantui";
5
+import { postTaIssue, postIssueAssigned } from "@/services/taissue";
6
+import { warn } from "@/utils/message";
7
+import { useModel } from "@/store";
8
+import { ROLE_INSPECTOR } from "@/utils/user";
8 9
 export default (props) => {
9
-
10 10
   const { formData } = props;
11
-
11
+  const { duty } = useModel("user");
12 12
   const [loading, setLoading] = React.useState(false);
13 13
 
14
+  function jump() {
15
+    return Taro.navigateBack({
16
+      delta: 1,
17
+      fail: () => {
18
+        Taro.reLaunch({
19
+          url: "/pages/home/index",
20
+        });
21
+      },
22
+    });
23
+  }
24
+
14 25
   // 新增问题单
15 26
   const onSubmit = () => {
27
+    console.log(formData);
16 28
     try {
17
-      warn(!formData.addr, '请填写地址')
18
-      warn(!formData.locId, '请选择点位')
19
-      warn(!formData.content, '请填写问题描述')
20
-      warn(!formData.typeId, '请选择问题分类')
21
-      warn(!formData.attachList || formData.attachList.length < 1, '请上传照片')
29
+      warn(!formData.addr, "请填写地址");
30
+      warn(!formData.locId, "请选择点位");
31
+      warn(!formData.content, "请填写问题描述");
32
+      warn(!formData.typeId, "请选择问题分类");
33
+      warn(
34
+        !formData.attachList || formData.attachList.length < 1,
35
+        "请上传照片"
36
+      );
22 37
     } catch (e) {
23 38
       return;
24 39
     }
25 40
 
26
-    setLoading(true)
27
-    postTaIssue(formData).then(() => {
28
-      setLoading(false);
29
-      Taro.navigateBack({
30
-        delta: 1,
31
-        fail: () => {
32
-          Taro.reLaunch({
33
-            url: '/pages/home/index'
34
-          });
35
-        }
41
+    setLoading(true);
42
+    postTaIssue(formData)
43
+      .then((res) => {
44
+        const data = { ...res, ...formData };
45
+        formData.orgId
46
+          ? postIssueAssigned({ ...data, nextOrg: formData.orgId })
47
+              .then(() => {
48
+                setLoading(false);
49
+                jump(); //跳转
50
+              })
51
+              .catch((e) => {
52
+                setLoading(false);
53
+              })
54
+          : jump();
55
+      })
56
+      .catch(() => {
57
+        setLoading(false);
36 58
       });
37
-    }).catch(() => {
38
-      setLoading(false);
39
-    })
40
-  }
59
+  };
41 60
 
42 61
   return (
43
-    <Button block type="primary" loading={loading} onClick={onSubmit}>提交</Button>
44
-  )
45
-}
62
+    <Button block type="primary" loading={loading} onClick={onSubmit}>
63
+      提交
64
+    </Button>
65
+  );
66
+};

+ 95
- 88
src/pages/issue/edit/index.jsx Zobrazit soubor

@@ -1,26 +1,31 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { CellGroup, Cell } from '@antmjs/vantui';
5
-import Page from '@/layouts/index';
6
-import { useModel } from '@/store';
7
-import { ROLE_INSPECTOR, ROLE_MANAGER, ROLE_CITIZEN, ROLE_QUERY_PERSON } from '@/utils/user';
8
-import { getTaIssueById } from '@/services/taissue';
9
-import { getSysOrgById } from '@/services/sysorg';
10
-import IssueForm from '../components/Issue';
11
-import Save from './components/Save';
12
-import Edit from './components/Edit';
13
-import Assigned from './components/Assigned';
14
-import Cancel from './components/Cancel';
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import { CellGroup, Cell } from "@antmjs/vantui";
5
+import Page from "@/layouts/index";
6
+import { useModel } from "@/store";
7
+import {
8
+  ROLE_INSPECTOR,
9
+  ROLE_MANAGER,
10
+  ROLE_CITIZEN,
11
+  ROLE_QUERY_PERSON,
12
+  ROLE_ORG_USER,
13
+} from "@/utils/user";
14
+import { getTaIssueById } from "@/services/taissue";
15
+import { getSysOrgById } from "@/services/sysorg";
16
+import IssueForm from "../components/Issue";
17
+import Save from "./components/Save";
18
+import Edit from "./components/Edit";
19
+import Assigned from "./components/Assigned";
20
+import Cancel from "./components/Cancel";
15 21
 // eslint-disable-next-line import/first
16
-import { PROCESS_END, PROCESS_START } from '@/utils/biz';
22
+import { PROCESS_END, PROCESS_START } from "@/utils/biz";
17 23
 
18 24
 export default (props) => {
19
-
20 25
   const router = Taro.useRouter();
21 26
   const { id } = router.params;
22 27
 
23
-  const { user, duty } = useModel('user');
28
+  const { user, duty } = useModel("user");
24 29
 
25 30
   const [loading, setLoading] = React.useState(false);
26 31
   const [issue, setIssue] = React.useState();
@@ -28,65 +33,54 @@ export default (props) => {
28 33
   React.useMemo(() => {
29 34
     if (id) {
30 35
       Taro.setNavigationBarTitle({
31
-        title: '问题单详情'
32
-      })
36
+        title: "问题单详情",
37
+      });
33 38
     } else {
34 39
       Taro.setNavigationBarTitle({
35
-        title: '我要上报'
36
-      })
40
+        title: "我要上报",
41
+      });
37 42
     }
38 43
   }, [id]);
39 44
 
40 45
   // 各按钮状态
41
-  const [
42
-    readOnly,
43
-    showOrg,
44
-    canEdit,
45
-    canAssigned,
46
-    canCancel,
47
-  ] = React.useMemo(() => {
48
-    // 如果是督查员
49
-    if (duty == ROLE_INSPECTOR) {
50
-      return [
51
-        issue && issue.processNode != PROCESS_START,
52
-        issue?.processNode && issue?.processNode != PROCESS_START, // true,
53
-        issue && issue.processNode == PROCESS_START,
54
-        false,
55
-        false,
56
-      ]
57
-    }
46
+  const [readOnly, showOrg, canEdit, canAssigned, canCancel] =
47
+    React.useMemo(() => {
48
+      // 如果是督查员
49
+      if (duty == ROLE_INSPECTOR) {
50
+        return [
51
+          issue && issue.processNode != PROCESS_START,
52
+          true,
53
+          // issue?.processNode && issue?.processNode != PROCESS_START, // true,
54
+          issue && issue.processNode == PROCESS_START,
55
+          false,
56
+          false,
57
+        ];
58
+      }
58 59
 
59
-    // 如果是管理员
60
-    if (duty == ROLE_MANAGER) {
61
-      return [
62
-        issue && issue.processNode != PROCESS_START,
63
-        true,
64
-        false,
65
-        issue && issue.processNode == PROCESS_START,
66
-        issue && issue.processNode == PROCESS_START,
67
-      ]
68
-    }
60
+      // 如果是管理员
61
+      if (duty == ROLE_MANAGER) {
62
+        return [
63
+          issue && issue.processNode != PROCESS_START,
64
+          true,
65
+          false,
66
+          issue && issue.processNode == PROCESS_START,
67
+          issue && issue.processNode == PROCESS_START,
68
+        ];
69
+      }
69 70
 
70
-    // 如果是查询员
71
-    if (duty == ROLE_QUERY_PERSON) {
72
-      return [
73
-        true,
74
-        true,
75
-        false,
76
-        false,
77
-        false,
78
-      ]
79
-    }
71
+      // 如果是查询员
72
+      if (duty == ROLE_QUERY_PERSON) {
73
+        return [true, true, false, false, false];
74
+      }
80 75
 
81
-    // 其他人员
82
-    return [
83
-      true,
84
-      false,
85
-      false,
86
-      false,
87
-      false,
88
-    ]
89
-  }, [issue, duty]);
76
+      // 如果是交办单位人员
77
+      if (duty == ROLE_ORG_USER) {
78
+        return [true, true, false, false, false];
79
+      }
80
+
81
+      // 其他人员
82
+      return [true, false, false, false, false];
83
+    }, [issue, duty]);
90 84
 
91 85
   // const onIssueChange = (val = {}) => {
92 86
   //   setIssue({
@@ -97,29 +91,42 @@ export default (props) => {
97 91
 
98 92
   React.useEffect(() => {
99 93
     if (id) {
100
-      setLoading(true)
101
-      getTaIssueById(id).then(res => {
102
-        setLoading(false);
103
-        if (res.orgId) {
104
-          getSysOrgById(res.orgId).then(r => {
105
-            setIssue({
106
-              ...res,
107
-              orgName: r?.name
108
-            });
109
-          }).catch(() => {
94
+      setLoading(true);
95
+      getTaIssueById(id)
96
+        .then((res) => {
97
+          setLoading(false);
98
+          if (res.orgId) {
99
+            getSysOrgById(res.orgId)
100
+              .then((r) => {
101
+                setIssue({
102
+                  ...res,
103
+                  orgName: r?.name,
104
+                });
105
+              })
106
+              .catch(() => {
107
+                setIssue(res);
108
+              });
109
+          } else {
110 110
             setIssue(res);
111
-          })
112
-        } else {
113
-          setIssue(res);
114
-        }
115
-      }).catch(() => {
116
-        setLoading(false);
117
-      });
111
+          }
112
+        })
113
+        .catch(() => {
114
+          setLoading(false);
115
+        });
118 116
     }
119 117
   }, [id]);
120 118
 
121 119
   return (
122
-    <Page roles={[ROLE_INSPECTOR, ROLE_MANAGER, ROLE_CITIZEN, ROLE_QUERY_PERSON]} loading={loading}>
120
+    <Page
121
+      roles={[
122
+        ROLE_INSPECTOR,
123
+        ROLE_MANAGER,
124
+        ROLE_CITIZEN,
125
+        ROLE_ORG_USER,
126
+        ROLE_QUERY_PERSON,
127
+      ]}
128
+      loading={loading}
129
+    >
123 130
       <IssueForm
124 131
         issueId={id}
125 132
         issue={issue}
@@ -127,7 +134,7 @@ export default (props) => {
127 134
         showOrg={showOrg}
128 135
         showExpireDate={showOrg}
129 136
         renderAction={(formData) => (
130
-          <View style={{ padding: 'var(--main-space)', background: '#fff' }}>
137
+          <View style={{ padding: "var(--main-space)", background: "#fff" }}>
131 138
             {!id && <Save formData={formData} />}
132 139
             {canEdit && <Edit issue={issue} formData={formData} />}
133 140
             {canAssigned && <Assigned issue={issue} formData={formData} />}
@@ -136,5 +143,5 @@ export default (props) => {
136 143
         )}
137 144
       />
138 145
     </Page>
139
-  )
140
-}
146
+  );
147
+};

+ 1
- 0
src/pages/login/components/Bottom.jsx Zobrazit soubor

@@ -9,6 +9,7 @@ export default (props) => {
9 9
   const { signinByPhone } = useModel('user');
10 10
 
11 11
   const onGetPhoneNumber = (e) => {
12
+    console.log(e)
12 13
     const code = e.detail.code;
13 14
     signinByPhone(code).then(props.onSuccess);
14 15
   }

+ 0
- 12
src/pages/reportList/index.jsx Zobrazit soubor

@@ -1,12 +0,0 @@
1
-// import React from "react";
2
-// import Taro from "@tarojs/taro";
3
-// import Page from "@/layouts/index";
4
-// import PowerList from "@/components/PowerList";
5
-
6
-// export default (props) => {
7
-//   return (
8
-//     <Page>
9
-//       <PowerList request={}/>
10
-//     </Page>
11
-//   )
12
-// };

+ 42
- 32
src/store/user.js Zobrazit soubor

@@ -1,9 +1,15 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import md5 from 'md5';
4
-import { login, signin, currentUser, authPhone, authUser } from '@/services/wxma';
5
-import { changePassword } from '@/services/sysuser';
6
-import { ROLE_CITIZEN } from '@/utils/user';
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import md5 from "md5";
4
+import {
5
+  login,
6
+  signin,
7
+  currentUser,
8
+  authPhone,
9
+  authUser,
10
+} from "@/services/wxma";
11
+import { changePassword } from "@/services/sysuser";
12
+import { ROLE_CITIZEN } from "@/utils/user";
7 13
 
8 14
 export default function useUser() {
9 15
   const [person, setPerson] = React.useState();
@@ -11,20 +17,23 @@ export default function useUser() {
11 17
   const [duty, setDuty] = React.useState();
12 18
 
13 19
   const maLogin = (code) => {
14
-    login(code).then(res => {
20
+    console.log(code);
21
+    login(code).then((res) => {
15 22
       setPerson(res.person);
16
-      Taro.setStorage({ key: 'personId', data: res.person.personId })
17
-      Taro.setStorage({ key: 'sessionKey', data: res.sessionKey })
23
+      Taro.setStorage({ key: "personId", data: res.person.personId });
24
+      Taro.setStorage({ key: "sessionKey", data: res.sessionKey });
18 25
     });
19
-  }
26
+  };
20 27
 
21 28
   const updateDuty = (d = ROLE_CITIZEN) => {
22 29
     setDuty(d);
23
-    Taro.setStorageSync('duty', d);
24
-  }
30
+    Taro.setStorageSync("duty", d);
31
+  };
25 32
 
26 33
   const initDuty = (u) => {
27
-    const d = Taro.getStorageSync('duty');
34
+    console.log(u)
35
+    const d = Taro.getStorageSync("duty");
36
+    console.log(d)
28 37
     const dutyList = u?.dutyList || [];
29 38
     if (d) {
30 39
       if (dutyList.indexOf(d) < 0) {
@@ -35,55 +44,55 @@ export default function useUser() {
35 44
     } else {
36 45
       updateDuty(dutyList[0]);
37 46
     }
38
-  }
47
+  };
39 48
 
40 49
   const maSignIn = (params) => {
41 50
     const data = {
42 51
       ...params,
43
-      password: md5(params.password)
52
+      password: md5(params.password),
44 53
     };
45 54
 
46
-    return signin(data).then(res => {
55
+    return signin(data).then((res) => {
47 56
       setUser(res.user);
48 57
       initDuty(res.user);
49
-    })
50
-  }
58
+    });
59
+  };
51 60
 
52 61
   const current = () => {
53
-    currentUser().then(res => {
62
+    currentUser().then((res) => {
54 63
       setUser(res.user);
55 64
       initDuty(res.user);
56
-    })
57
-  }
65
+    });
66
+  };
58 67
 
59 68
   const signinByPhone = (code) => {
60
-    return authPhone(code).then(res => {
69
+    return authPhone(code).then((res) => {
61 70
       setUser(res.user);
62 71
       initDuty(res.user);
63 72
       setPerson(res.person);
64
-    })
65
-  }
73
+    });
74
+  };
66 75
 
67 76
   const authProfile = (data) => {
68
-    const sessionKey = Taro.getStorageSync('sessionKey');
69
-    authUser({ ...data, sessionKey }).then(res => {
77
+    const sessionKey = Taro.getStorageSync("sessionKey");
78
+    authUser({ ...data, sessionKey }).then((res) => {
70 79
       setPerson(res);
71
-    })
72
-  }
80
+    });
81
+  };
73 82
 
74 83
   const signOut = () => {
75 84
     setUser(null);
76 85
     initDuty([]);
77
-  }
86
+  };
78 87
 
79 88
   const changePwd = (params) => {
80 89
     const data = {
81 90
       originPassword: md5(params.originPassword),
82 91
       newPassword: md5(params.newPassword),
83
-    }
92
+    };
84 93
 
85 94
     changePassword(data);
86
-  }
95
+  };
87 96
 
88 97
   return {
89 98
     user,
@@ -97,5 +106,6 @@ export default function useUser() {
97 106
     authProfile,
98 107
     signOut,
99 108
     changePwd,
100
-  }
109
+    // setPerson,
110
+  };
101 111
 }