lisenzhou před 2 roky
rodič
revize
3e0778d8f2

+ 5
- 5
config/dev.js Zobrazit soubor

@@ -1,12 +1,12 @@
1 1
 module.exports = {
2 2
   env: {
3
-    NODE_ENV: '"development"'
3
+    NODE_ENV: '"development"',
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"http://127.0.0.1:9087"',
7
-    // HOST: '"http://192.168.1.2:9087"',
6
+    // HOST: '"http://127.0.0.1:9087"',
7
+    HOST: '"http://192.168.89.147:9087"',
8 8
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9 9
   },
10 10
   mini: {},
11
-  h5: {}
12
-}
11
+  h5: {},
12
+};

+ 38
- 40
src/app.config.js Zobrazit soubor

@@ -1,56 +1,54 @@
1 1
 // eslint-disable-next-line no-undef
2 2
 export default defineAppConfig({
3 3
   pages: [
4
-    'pages/home/index',
5
-    'pages/login/index',
6
-    'pages/issue/list/index',
7
-    'pages/issue/list2/index',
8
-    'pages/issue/edit/index',
9
-    'pages/org/issue/list/index',
10
-    'pages/org/issue/detail/index',
11
-    'pages/apply/list/index',
4
+    "pages/home/index",
5
+    "pages/login/index",
6
+    "pages/issue/list/index",
7
+    "pages/issue/list2/index",
8
+    "pages/issue/edit/index",
9
+    "pages/org/issue/list/index",
10
+    "pages/org/issue/detail/index",
11
+    "pages/apply/list/index",
12 12
     // 'pages/apply/apply/index',
13
-    'pages/apply/verify/index',
14
-    'pages/apply/detail/index',
15
-    'pages/message/list/index',
16
-    'pages/checkStand/index',
17
-    'pages/reporting/index',
18
-    'pages/reporting/detail/index',
19
-    'pages/reset-password/index',
20
-    'pages/check/list/index',
21
-    'pages/check/loc/list/index',
22
-    'pages/check/edit/index',
23
-    'pages/notice/index',
24
-    'pages/notice/detail/index',
25
-    'pages/my/index',
26
-    'pages/my/edit/index',
27
-    'pages/feedback/issue/index',
28
-    'pages/feedback/issuelist/index'
13
+    "pages/apply/verify/index",
14
+    "pages/apply/detail/index",
15
+    "pages/message/list/index",
16
+    // 'pages/checkStand/index',
17
+    "pages/checkStand/list/index",
18
+    "pages/checkStand/detail/index",
19
+    "pages/reporting/index",
20
+    "pages/reporting/detail/index",
21
+    "pages/reset-password/index",
22
+    "pages/check/list/index",
23
+    "pages/check/loc/list/index",
24
+    "pages/check/edit/index",
25
+    "pages/notice/index",
26
+    "pages/notice/detail/index",
27
+    "pages/my/index",
28
+    "pages/my/edit/index",
29
+    "pages/feedback/issue/index",
30
+    "pages/feedback/issuelist/index",
29 31
   ],
30 32
   subpackages: [
31 33
     {
32
-      root: 'subpkg1',
33
-      pages: [
34
-        'pages/statistics/index',
35
-      ]
36
-    }
34
+      root: "subpkg1",
35
+      pages: ["pages/statistics/index"],
36
+    },
37 37
   ],
38 38
   window: {
39 39
     // backgroundColor: '#1A7565',
40
-    backgroundTextStyle: 'light',
41
-    navigationBarBackgroundColor: '#1A7565',
42
-    navigationBarTitleText: '文明创城',
43
-    navigationBarTextStyle: 'white'
40
+    backgroundTextStyle: "light",
41
+    navigationBarBackgroundColor: "#1A7565",
42
+    navigationBarTitleText: "文明创城",
43
+    navigationBarTextStyle: "white",
44 44
   },
45 45
   permission: {
46 46
     "scope.userLocation": {
47
-      desc: "你的位置信息将用于定位点位" // 高速公路行驶持续后台定位
48
-    }
47
+      desc: "你的位置信息将用于定位点位", // 高速公路行驶持续后台定位
48
+    },
49 49
   },
50
-  requiredPrivateInfos: [
51
-    'getLocation'
52
-  ],
50
+  requiredPrivateInfos: ["getLocation"],
53 51
   setting: {
54 52
     urlCheck: false,
55
-  }
56
-})
53
+  },
54
+});

+ 77
- 98
src/layouts/TabBar.jsx Zobrazit soubor

@@ -1,68 +1,68 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View, Image } from '@tarojs/components';
4
-import { Tabbar, TabbarItem } from '@antmjs/vantui';
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View, Image } from "@tarojs/components";
4
+import { Tabbar, TabbarItem } from "@antmjs/vantui";
5 5
 import {
6 6
   ROLE_INSPECTOR,
7 7
   ROLE_MANAGER,
8 8
   ROLE_ORG_USER,
9 9
   ROLE_ORG_MANAGER,
10 10
   ROLE_QUERY_PERSON,
11
-  ROLE_CITIZEN
12
-} from '@/utils/user';
13
-import homeIcon from '@/assets/tabbar/page.png';
14
-import homeActiveIcon from '@/assets/tabbar/page click.png';
15
-import noticeIcon from '@/assets/tabbar/notice.png';
16
-import noticeActiveIcon from '@/assets/tabbar/notice click.png';
17
-import issueIcon from '@/assets/tabbar/release.png';
18
-import issueActiveIcon from '@/assets/tabbar/release click.png';
19
-import checkIcon from '@/assets/tabbar/evaluation.png';
20
-import checkActiveIcon from '@/assets/tabbar/evaluation click.png';
21
-import mineIcon from '@/assets/tabbar/my.png';
22
-import mineActiveIcon from '@/assets/tabbar/my click.png';
11
+  ROLE_CITIZEN,
12
+} from "@/utils/user";
13
+import homeIcon from "@/assets/tabbar/page.png";
14
+import homeActiveIcon from "@/assets/tabbar/page click.png";
15
+import noticeIcon from "@/assets/tabbar/notice.png";
16
+import noticeActiveIcon from "@/assets/tabbar/notice click.png";
17
+import issueIcon from "@/assets/tabbar/release.png";
18
+import issueActiveIcon from "@/assets/tabbar/release click.png";
19
+import checkIcon from "@/assets/tabbar/evaluation.png";
20
+import checkActiveIcon from "@/assets/tabbar/evaluation click.png";
21
+import mineIcon from "@/assets/tabbar/my.png";
22
+import mineActiveIcon from "@/assets/tabbar/my click.png";
23 23
 
24 24
 const home = {
25
-  name: 'home',
26
-  label: '首页',
25
+  name: "home",
26
+  label: "首页",
27 27
   icon: homeIcon,
28 28
   activeIcon: homeActiveIcon,
29
-  page: '/pages/home/index'
30
-}
29
+  page: "/pages/home/index",
30
+};
31 31
 const notice = {
32
-  name: 'notice',
33
-  label: '公告',
32
+  name: "notice",
33
+  label: "公告",
34 34
   icon: noticeIcon,
35 35
   activeIcon: noticeActiveIcon,
36
-  page: '/pages/notice/index'
37
-}
36
+  page: "/pages/notice/index",
37
+};
38 38
 const issue = {
39
-  name: 'issue',
40
-  label: '发布',
39
+  name: "issue",
40
+  label: "发布",
41 41
   icon: issueIcon,
42 42
   activeIcon: issueActiveIcon,
43
-  page: '/pages/issue/edit/index'
44
-}
43
+  page: "/pages/issue/edit/index",
44
+};
45 45
 const feedback = {
46
-  name: 'feedback',
47
-  label: '随手拍',
46
+  name: "feedback",
47
+  label: "随手拍",
48 48
   icon: issueIcon,
49 49
   activeIcon: issueActiveIcon,
50
-  page: '/pages/feedback/issue/index'
51
-}
50
+  page: "/pages/feedback/issue/index",
51
+};
52 52
 const check = {
53
-  name: 'check',
54
-  label: '测评标准',
53
+  name: "check",
54
+  label: "测评标准",
55 55
   icon: checkIcon,
56 56
   activeIcon: checkActiveIcon,
57
-  page: '/pages/checkStand/index'
58
-}
57
+  page: "/pages/checkStand/list/index",
58
+};
59 59
 const mine = {
60
-  name: 'mine',
61
-  label: '我的',
60
+  name: "mine",
61
+  label: "我的",
62 62
   icon: mineIcon,
63 63
   activeIcon: mineActiveIcon,
64
-  page: '/pages/my/index'
65
-}
64
+  page: "/pages/my/index",
65
+};
66 66
 
67 67
 export default (props) => {
68 68
   const { active = -1, className, duty } = props;
@@ -70,51 +70,34 @@ export default (props) => {
70 70
   const tabItems = React.useMemo(() => {
71 71
     if (!duty) return [];
72 72
 
73
-    if (duty == ROLE_INSPECTOR // 督察员
74
-      || duty == ROLE_MANAGER // 管理员
73
+    if (
74
+      duty == ROLE_INSPECTOR || // 督察员
75
+      duty == ROLE_MANAGER // 管理员
75 76
     ) {
76
-      return [
77
-        home,
78
-        notice,
79
-        issue,
80
-        check,
81
-        mine
82
-      ]
77
+      return [home, notice, issue, check, mine];
83 78
     }
84
-    
85
-    if (duty == ROLE_QUERY_PERSON) { // 查询员
86
-      return [
87
-        home,
88
-        notice,
89
-        check,
90
-        mine
91
-      ]
79
+
80
+    if (duty == ROLE_QUERY_PERSON) {
81
+      // 查询员
82
+      return [home, notice, check, mine];
92 83
     }
93 84
 
94 85
     // 责任单位用户
95 86
     if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
96
-      return [
97
-        home,
98
-        notice,
99
-        mine,
100
-      ]
87
+      return [home, notice, mine];
101 88
     }
102 89
 
103 90
     if (duty == ROLE_CITIZEN) {
104
-      return [
105
-        home,
106
-        feedback,
107
-        mine,
108
-      ]
91
+      return [home, feedback, mine];
109 92
     }
110 93
 
111 94
     return [];
112 95
   }, [duty]);
113 96
 
114 97
   const onChange = (e) => {
115
-    const url = tabItems.filter(x => x.name === e.detail)[0].page;
116
-    Taro.reLaunch({ url })
117
-  }
98
+    const url = tabItems.filter((x) => x.name === e.detail)[0].page;
99
+    Taro.reLaunch({ url });
100
+  };
118 101
 
119 102
   return (
120 103
     <Tabbar
@@ -123,32 +106,28 @@ export default (props) => {
123 106
       active={active}
124 107
       onChange={onChange}
125 108
     >
126
-      {
127
-        tabItems.map(item => (
128
-          <TabbarItem
129
-            key={item.name}
130
-            name={item.name}
131
-            renderIcon={
132
-              <Image
133
-                src={item.icon}
134
-                mode="aspectFit"
135
-                style="width: 30px; height: 20px;"
136
-              ></Image>
137
-            }
138
-            renderIconActive={
139
-              <Image
140
-                src={item.activeIcon}
141
-                mode="aspectFit"
142
-                style="width: 30px; height: 20px;"
143
-              ></Image>
144
-            }
145
-          >
146
-            <View style={{fontSize: '14px'}}>
147
-              {item.label}
148
-            </View>
149
-          </TabbarItem>
150
-        ))
151
-      }
109
+      {tabItems.map((item) => (
110
+        <TabbarItem
111
+          key={item.name}
112
+          name={item.name}
113
+          renderIcon={
114
+            <Image
115
+              src={item.icon}
116
+              mode="aspectFit"
117
+              style="width: 30px; height: 20px;"
118
+            ></Image>
119
+          }
120
+          renderIconActive={
121
+            <Image
122
+              src={item.activeIcon}
123
+              mode="aspectFit"
124
+              style="width: 30px; height: 20px;"
125
+            ></Image>
126
+          }
127
+        >
128
+          <View style={{ fontSize: "14px" }}>{item.label}</View>
129
+        </TabbarItem>
130
+      ))}
152 131
     </Tabbar>
153
-  )
154
-}
132
+  );
133
+};

+ 3
- 0
src/pages/checkStand/detail/index.config.js Zobrazit soubor

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '测评标准'
3
+})

+ 34
- 0
src/pages/checkStand/detail/index.jsx Zobrazit soubor

@@ -0,0 +1,34 @@
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import Page from "@/layouts/index";
4
+import { View, RichText } from "@tarojs/components";
5
+import { getTaCheckStandById } from "@/services/tacheckstand";
6
+
7
+export default (props) => {
8
+  const router = Taro.useRouter();
9
+  const { id } = router.params;
10
+  const [loading, setLoading] = React.useState(false);
11
+  const [detail, setDetail] = React.useState();
12
+
13
+  React.useEffect(() => {
14
+    setLoading(true);
15
+
16
+    // ID 固定是 1
17
+    getTaCheckStandById(id)
18
+      .then((res) => {
19
+        setDetail(res);
20
+        setLoading(false);
21
+      })
22
+      .catch(() => {
23
+        setLoading(false);
24
+      });
25
+  }, []);
26
+
27
+  return (
28
+    <Page loading={loading}>
29
+      <View style={{ padding: "var(--main-space)" }}>
30
+        <RichText style={{ lineHeight: "2em" }} nodes={detail?.content} />
31
+      </View>
32
+    </Page>
33
+  );
34
+};

+ 0
- 0
src/pages/checkStand/detail/index.less Zobrazit soubor


+ 18
- 17
src/pages/checkStand/index.jsx Zobrazit soubor

@@ -1,11 +1,10 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import Page from '@/layouts/index';
4
-import { View, RichText } from '@tarojs/components';
5
-import { getTaCheckStandById } from '@/services/tacheckstand';
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import Page from "@/layouts/index";
4
+import { View, RichText } from "@tarojs/components";
5
+import { getTaCheckStandById } from "@/services/tacheckstand";
6 6
 
7 7
 export default (props) => {
8
-
9 8
   const [loading, setLoading] = React.useState(false);
10 9
   const [detail, setDetail] = React.useState();
11 10
 
@@ -13,19 +12,21 @@ export default (props) => {
13 12
     setLoading(true);
14 13
 
15 14
     // ID 固定是 1
16
-    getTaCheckStandById(1).then((res) => {
17
-      setDetail(res);
18
-      setLoading(false);
19
-    }).catch(() => {
20
-      setLoading(false);
21
-    });
15
+    getTaCheckStandById(1)
16
+      .then((res) => {
17
+        setDetail(res);
18
+        setLoading(false);
19
+      })
20
+      .catch(() => {
21
+        setLoading(false);
22
+      });
22 23
   }, []);
23
-  
24
+
24 25
   return (
25 26
     <Page tabBar="check" loading={loading}>
26
-      <View style={{ padding: 'var(--main-space)' }}>
27
-        <RichText style={{ lineHeight: '2em' }} nodes={detail?.content} />
27
+      <View style={{ padding: "var(--main-space)" }}>
28
+        <RichText style={{ lineHeight: "2em" }} nodes={detail?.content} />
28 29
       </View>
29 30
     </Page>
30
-  )
31
-}
31
+  );
32
+};

+ 3
- 0
src/pages/checkStand/list/index.config.js Zobrazit soubor

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '测评标准'
3
+})

+ 59
- 0
src/pages/checkStand/list/index.jsx Zobrazit soubor

@@ -0,0 +1,59 @@
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import { Cell, Tag, Notify } from "@antmjs/vantui";
5
+import Page from "@/layouts/index";
6
+import PowerList from "@/components/PowerList";
7
+import { getTaCheckStand } from "@/services/tacheckstand";
8
+import { ROLE_INSPECTOR } from "@/utils/user";
9
+
10
+export default (props) => {
11
+  const router = Taro.useRouter();
12
+  const { checkId } = router.params;
13
+
14
+  const [loading, setLoading] = React.useState(false);
15
+
16
+  const params = React.useMemo(
17
+    () => ({
18
+      checkId,
19
+      itemType: "loc",
20
+      pageSize: 500,
21
+      mustValid: true,
22
+    }),
23
+    [checkId]
24
+  );
25
+
26
+  const onClick = (item) => {
27
+    // if (item.answerNum >= item.num) {
28
+    //   Notify.show({
29
+    //     message: "当前测评问卷已收齐",
30
+    //     type: "warning",
31
+    //   });
32
+    //   return;
33
+    // }
34
+
35
+    Taro.navigateTo({
36
+      url: `/pages/checkStand/detail/index?id=${item.statndId}`,
37
+    });
38
+  };
39
+
40
+  return (
41
+    <Page tabBar="check" loading={loading} roles={[ROLE_INSPECTOR]}>
42
+      <PowerList
43
+        request={getTaCheckStand}
44
+        params={params}
45
+        renderItem={(item) => {
46
+          return (
47
+            <Cell
48
+              isLink
49
+              key={item.statndId}
50
+              title={item.locName}
51
+              onClick={() => onClick(item)}
52
+            ></Cell>
53
+          );
54
+        }}
55
+        onLoadingChange={setLoading}
56
+      />
57
+    </Page>
58
+  );
59
+};