fangmingyue 2 年之前
父節點
當前提交
9a8092d552

+ 5
- 5
config/dev.js 查看文件

1
 module.exports = {
1
 module.exports = {
2
   env: {
2
   env: {
3
-    NODE_ENV: '"development"'
3
+    NODE_ENV: '"development"',
4
   },
4
   },
5
   defineConstants: {
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
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
8
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9
   },
9
   },
10
   mini: {},
10
   mini: {},
11
-  h5: {}
12
-}
11
+  h5: {},
12
+};

+ 38
- 40
src/app.config.js 查看文件

1
 // eslint-disable-next-line no-undef
1
 // eslint-disable-next-line no-undef
2
 export default defineAppConfig({
2
 export default defineAppConfig({
3
   pages: [
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
     // 'pages/apply/apply/index',
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
   subpackages: [
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
   window: {
38
   window: {
39
     // backgroundColor: '#1A7565',
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
   permission: {
45
   permission: {
46
     "scope.userLocation": {
46
     "scope.userLocation": {
47
-      desc: "你的位置信息将用于定位点位" // 高速公路行驶持续后台定位
48
-    }
47
+      desc: "你的位置信息将用于定位点位", // 高速公路行驶持续后台定位
48
+    },
49
   },
49
   },
50
-  requiredPrivateInfos: [
51
-    'getLocation'
52
-  ],
50
+  requiredPrivateInfos: ["getLocation"],
53
   setting: {
51
   setting: {
54
     urlCheck: false,
52
     urlCheck: false,
55
-  }
56
-})
53
+  },
54
+});

+ 73
- 95
src/layouts/TabBar.jsx 查看文件

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
 import {
5
 import {
6
   ROLE_INSPECTOR,
6
   ROLE_INSPECTOR,
7
   ROLE_MANAGER,
7
   ROLE_MANAGER,
8
   ROLE_ORG_USER,
8
   ROLE_ORG_USER,
9
   ROLE_ORG_MANAGER,
9
   ROLE_ORG_MANAGER,
10
   ROLE_QUERY_PERSON,
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
 const home = {
24
 const home = {
25
-  name: 'home',
26
-  label: '首页',
25
+  name: "home",
26
+  label: "首页",
27
   icon: homeIcon,
27
   icon: homeIcon,
28
   activeIcon: homeActiveIcon,
28
   activeIcon: homeActiveIcon,
29
-  page: '/pages/home/index'
30
-}
29
+  page: "/pages/home/index",
30
+};
31
 const notice = {
31
 const notice = {
32
-  name: 'notice',
33
-  label: '公告',
32
+  name: "notice",
33
+  label: "公告",
34
   icon: noticeIcon,
34
   icon: noticeIcon,
35
   activeIcon: noticeActiveIcon,
35
   activeIcon: noticeActiveIcon,
36
-  page: '/pages/notice/index'
37
-}
36
+  page: "/pages/notice/index",
37
+};
38
 const issue = {
38
 const issue = {
39
-  name: 'issue',
40
-  label: '发布',
39
+  name: "issue",
40
+  label: "发布",
41
   icon: issueIcon,
41
   icon: issueIcon,
42
   activeIcon: issueActiveIcon,
42
   activeIcon: issueActiveIcon,
43
-  page: '/pages/issue/edit/index'
44
-}
43
+  page: "/pages/issue/edit/index",
44
+};
45
 const feedback = {
45
 const feedback = {
46
-  name: 'feedback',
47
-  label: '随手拍',
46
+  name: "feedback",
47
+  label: "随手拍",
48
   icon: issueIcon,
48
   icon: issueIcon,
49
   activeIcon: issueActiveIcon,
49
   activeIcon: issueActiveIcon,
50
-  page: '/pages/feedback/issue/index'
51
-}
50
+  page: "/pages/feedback/issue/index",
51
+};
52
 const check = {
52
 const check = {
53
-  name: 'check',
54
-  label: '测评标准',
53
+  name: "check",
54
+  label: "测评标准",
55
   icon: checkIcon,
55
   icon: checkIcon,
56
   activeIcon: checkActiveIcon,
56
   activeIcon: checkActiveIcon,
57
-  page: '/pages/checkStand/index'
58
-}
57
+  page: "/pages/checkStand/list/index",
58
+};
59
 const mine = {
59
 const mine = {
60
-  name: 'mine',
61
-  label: '我的',
60
+  name: "mine",
61
+  label: "我的",
62
   icon: mineIcon,
62
   icon: mineIcon,
63
   activeIcon: mineActiveIcon,
63
   activeIcon: mineActiveIcon,
64
-  page: '/pages/my/index'
65
-}
64
+  page: "/pages/my/index",
65
+};
66
 
66
 
67
 export default (props) => {
67
 export default (props) => {
68
   const { active = -1, className, duty } = props;
68
   const { active = -1, className, duty } = props;
73
     if (duty == ROLE_INSPECTOR // 督查员
73
     if (duty == ROLE_INSPECTOR // 督查员
74
       || duty == ROLE_MANAGER // 管理员
74
       || duty == ROLE_MANAGER // 管理员
75
     ) {
75
     ) {
76
-      return [
77
-        home,
78
-        notice,
79
-        issue,
80
-        check,
81
-        mine
82
-      ]
76
+      return [home, notice, issue, check, mine];
83
     }
77
     }
84
 
78
 
85
-    if (duty == ROLE_QUERY_PERSON) { // 查询员
86
-      return [
87
-        home,
88
-        notice,
89
-        check,
90
-        mine
91
-      ]
79
+    if (duty == ROLE_QUERY_PERSON) {
80
+      // 查询员
81
+      return [home, notice, check, mine];
92
     }
82
     }
93
 
83
 
94
     // 责任单位用户
84
     // 责任单位用户
95
     if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
85
     if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
96
-      return [
97
-        home,
98
-        notice,
99
-        mine,
100
-      ]
86
+      return [home, notice, mine];
101
     }
87
     }
102
 
88
 
103
     if (duty == ROLE_CITIZEN) {
89
     if (duty == ROLE_CITIZEN) {
104
-      return [
105
-        home,
106
-        feedback,
107
-        mine,
108
-      ]
90
+      return [home, feedback, mine];
109
     }
91
     }
110
 
92
 
111
     return [];
93
     return [];
112
   }, [duty]);
94
   }, [duty]);
113
 
95
 
114
   const onChange = (e) => {
96
   const onChange = (e) => {
115
-    const url = tabItems.filter(x => x.name === e.detail)[0].page;
116
-    Taro.reLaunch({ url })
117
-  }
97
+    const url = tabItems.filter((x) => x.name === e.detail)[0].page;
98
+    Taro.reLaunch({ url });
99
+  };
118
 
100
 
119
   return (
101
   return (
120
     <Tabbar
102
     <Tabbar
123
       active={active}
105
       active={active}
124
       onChange={onChange}
106
       onChange={onChange}
125
     >
107
     >
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
-      }
108
+      {tabItems.map((item) => (
109
+        <TabbarItem
110
+          key={item.name}
111
+          name={item.name}
112
+          renderIcon={
113
+            <Image
114
+              src={item.icon}
115
+              mode="aspectFit"
116
+              style="width: 30px; height: 20px;"
117
+            ></Image>
118
+          }
119
+          renderIconActive={
120
+            <Image
121
+              src={item.activeIcon}
122
+              mode="aspectFit"
123
+              style="width: 30px; height: 20px;"
124
+            ></Image>
125
+          }
126
+        >
127
+          <View style={{ fontSize: "14px" }}>{item.label}</View>
128
+        </TabbarItem>
129
+      ))}
152
     </Tabbar>
130
     </Tabbar>
153
-  )
154
-}
131
+  );
132
+};

+ 3
- 0
src/pages/checkStand/detail/index.config.js 查看文件

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

+ 34
- 0
src/pages/checkStand/detail/index.jsx 查看文件

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 查看文件


+ 18
- 17
src/pages/checkStand/index.jsx 查看文件

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
 export default (props) => {
7
 export default (props) => {
8
-
9
   const [loading, setLoading] = React.useState(false);
8
   const [loading, setLoading] = React.useState(false);
10
   const [detail, setDetail] = React.useState();
9
   const [detail, setDetail] = React.useState();
11
 
10
 
13
     setLoading(true);
12
     setLoading(true);
14
 
13
 
15
     // ID 固定是 1
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
   return (
25
   return (
25
     <Page tabBar="check" loading={loading}>
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
       </View>
29
       </View>
29
     </Page>
30
     </Page>
30
-  )
31
-}
31
+  );
32
+};

+ 3
- 0
src/pages/checkStand/list/index.config.js 查看文件

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

+ 59
- 0
src/pages/checkStand/list/index.jsx 查看文件

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}>
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
+};