Yansen пре 2 година
родитељ
комит
b76dd645b0

BIN
src/assets/icons/exit.png Прегледај датотеку


+ 2
- 1
src/layouts/TabBar.jsx Прегледај датотеку

@@ -91,7 +91,8 @@ export default (props) => {
91 91
       ]
92 92
     }
93 93
 
94
-    if (duty == ROLE_ORG_USER) {
94
+    // 责任单位用户
95
+    if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
95 96
       return [
96 97
         home,
97 98
         notice,

+ 1
- 0
src/pages/home/index.jsx Прегледај датотеку

@@ -40,6 +40,7 @@ const menus = {
40 40
     { icon: 'icon11', text: '消息通知', link: '/pages/message/list/index' },
41 41
   ],
42 42
 
43
+  // 责任单位管理员
43 44
   [ROLE_ORG_MANAGER]: [
44 45
     { icon: 'icon2', text: '处 理 中', link: `/pages/org/issue/list/index?title=处理中&bizStatus=${PROCESS_ASSIGNED}` },
45 46
     { icon: 'icon3', text: '已 办 结', link: `/pages/org/issue/list/index?title=已办结&bizStatus=${PROCESS_END}` },

+ 22
- 10
src/pages/message/list/components/Card.jsx Прегледај датотеку

@@ -3,28 +3,40 @@ import Taro from '@tarojs/taro';
3 3
 import { View } from '@tarojs/components';
4 4
 import { Cell } from '@antmjs/vantui';
5 5
 import { getDtStr } from '@/utils/date';
6
+import { ROLE_ORG_MANAGER, ROLE_ORG_USER } from '@/utils/user';
7
+import { getTaIssueApplyById } from '@/services/taissueapply';
6 8
 import style from './card.module.less';
7 9
 
8 10
 export default (props) => {
9
-  const { item } = props;
11
+  const { item, duty } = props;
10 12
 
11
-  const url = React.useMemo(() => {
12
-    if (item.targetType == 'issue') {
13
-      Taro.navigateTo({
14
-        url: `/pages/issue/edit/index`
15
-      })
16
-    } else if (item.targetType == 'apply') {
13
+  console.log(item)
17 14
 
15
+  const onClick = () => {
16
+    if (item.targetType == 'apply') {
17
+      getTaIssueApplyById(item.targetId).then(res => naviTo(res.issueId));
18
+    } else if (item.targetType == 'issue') {
19
+      naviTo(item.targetId);
18 20
     }
21
+  };
19 22
 
20
-    return '';
21
-  }, [item])
23
+  const naviTo = (issueId) => {
24
+    if (duty == ROLE_ORG_USER || duty == ROLE_ORG_MANAGER) {
25
+      Taro.navigateTo({
26
+        url: `/pages/org/issue/detail/index?id=${issueId}`
27
+      })
28
+    } else {
29
+      Taro.navigateTo({
30
+        url: `/pages/issue/edit/index?id=${issueId}`
31
+      })
32
+    }
33
+  }
22 34
   
23 35
   return (
24 36
     <View className={style['msg-card-wrapper']}>
25 37
       <Cell
26 38
         isLink
27
-        url={url}
39
+        onClick={onClick}
28 40
         renderTitle={(
29 41
           <View style={{ display: 'flex', justifyContent: 'space-between' }}>
30 42
             <View>

+ 3
- 2
src/pages/message/list/index.jsx Прегледај датотеку

@@ -4,17 +4,18 @@ import { View } from '@tarojs/components';
4 4
 import Page from '@/layouts/index';
5 5
 import PowerList from '@/components/PowerList';
6 6
 import { getTaMessage } from '@/services/tamessage';
7
+import { useModel } from '@/store';
7 8
 import Card from './components/Card';
8 9
 
9 10
 export default (props) => {
10
-
11
+  const { duty } = useModel('user');
11 12
   
12 13
   return (
13 14
     <Page>
14 15
       <PowerList
15 16
         request={getTaMessage}
16 17
         renderItem={(item) => (
17
-          <Card key={item.msgId} item={item} />
18
+          <Card key={item.msgId} item={item} duty={duty} />
18 19
         )}
19 20
       />
20 21
     </Page>

+ 60
- 42
src/pages/my/index.jsx Прегледај датотеку

@@ -1,32 +1,61 @@
1 1
 import React from 'react';
2 2
 import Taro from '@tarojs/taro';
3 3
 import Page from '@/layouts/index';
4
-import { View } from '@tarojs/components';
5
-import { Empty } from '@antmjs/vantui'
4
+import { View, Image } from '@tarojs/components';
6 5
 import logo from '@/assets/image/logo.png';
6
+import peopleicon from '@/assets/icons/peopleicon.png';
7
+import icon11 from '@/assets/icons/icon11.png';
8
+import iconExit from '@/assets/icons/exit.png';
7 9
 import { useModel } from '@/store';
10
+import { getSysOrgById } from '@/services/sysorg';
11
+import { ROLE_CITIZEN, ROLE_QUERY_PERSON } from '@/utils/user';
8 12
 import Head from './components/Head';
9
-import './index.less';
13
+import styles from './style.module.less';
10 14
 
11 15
 export default (props) => {
12 16
 
13
-  const { user, person, duty } = useModel('user');
17
+  const { user, person, duty, signOut } = useModel('user');
18
+  const [org, setOrg] = React.useState();
14 19
 
15
-  // const [
16
-  //   show1,
17
-  //   show2,
18
-  // ] = React.useMemo(() => {
19
-  //   return [
20
-  //     false,
21
-  //     false,
22
-  //   ]
23
-  // }, [duty]);
20
+  const [
21
+    show1,
22
+    show2,
23
+  ] = React.useMemo(() => {
24
+    if (duty == ROLE_CITIZEN) {
25
+      return [
26
+        false, 
27
+        false,
28
+      ]
29
+    }
24 30
 
25
-  // const onClick = () => {
26
-  //   Taro.navigateTo({
27
-  //     url: `/pages/my/edit/index`
28
-  //   })
29
-  // }
31
+    if (duty == ROLE_QUERY_PERSON) {
32
+      return [
33
+        true,
34
+        false,
35
+      ]
36
+    }
37
+
38
+    return [
39
+      true,
40
+      true,
41
+    ]
42
+  }, [duty]);
43
+
44
+  const onExit = () => {
45
+    signOut();
46
+  }
47
+
48
+  const onClick = () => {
49
+    Taro.navigateTo({
50
+      url: `/pages/message/list/index`
51
+    })
52
+  }
53
+
54
+  React.useEffect(() => {
55
+    if (user) {
56
+      getSysOrgById(user.orgId).then(setOrg);
57
+    }
58
+  }, [user]);
30 59
 
31 60
   return (
32 61
     <Page tabBar="mine">
@@ -34,40 +63,29 @@ export default (props) => {
34 63
         avatar={user?.avatar || person?.avatar || logo}
35 64
         name={user?.name || person?.name || '市民先生'}
36 65
       />
37
-      <View>
38
-        <Empty description="我们在正在努力开发中..." />
39
-      </View>
40
-      {/* <View className="wrapper-header">
41
-        <View className="wrapper-header-circle">
42
-          <View className="wrapper-header-circle2" />
43
-        </View>
44
-        <View className="wrapper-header-box">
45
-          <Image className="wrapper-header-img" src={user?.avatar || person?.avatar || logo} />
46
-        </View>
47
-        <View className="wrapper-header-box2">
48
-          <View className="wrapper-header-text">{user?.name || person?.name || '市民先生'}</View>
49
-        </View>
50
-      </View>
51
-
52
-      <View className="wrapper-middle">
66
+      <View className={styles['bg-menu-box']}>
53 67
         {
54 68
           show1 && (
55
-            <View className="wrapper-middle-box">
56
-              <Image className="wrapper-middle-img" src={peopleicon} />
57
-              <View className="wrapper-middle-text">所在部门</View>
58
-              <View className="wrapper-middle-text2">县文明办</View>
69
+            <View className={styles['bg-menu-item']}>
70
+              <Image src={peopleicon} />
71
+              <View className={styles['bg-menu-title']}>所在部门</View>
72
+              <View className={styles['bg-menu-subtitle']}>{org?.name || '暂无'}</View>
59 73
             </View>
60 74
           )
61 75
         }
62 76
         {
63 77
           show2 && (
64
-            <View className="wrapper-middle-box" onClick={onClick}>
65
-              <Image className="wrapper-middle-img" src={smallbell} />
66
-              <View className="wrapper-middle-text3">消息通知</View>
78
+            <View className={styles['bg-menu-item']} onClick={onClick}>
79
+              <Image src={icon11} />
80
+              <View className={styles['bg-menu-title']}>消息通知</View>
67 81
             </View>
68 82
           )
69 83
         }
70
-      </View> */}
84
+      </View>
85
+      <View className={styles.exit} onClick={onExit}>
86
+        退出
87
+        <Image src={iconExit} />
88
+      </View>
71 89
     </Page>
72 90
   )
73 91
 }

+ 0
- 82
src/pages/my/index.less Прегледај датотеку

@@ -1,82 +0,0 @@
1
-// .wrapper-header {
2
-//   background: var(--main-bg-color);
3
-//   border-radius: 0px 0px 120px 120px;
4
-//   height: 50vw;
5
-//   align-items: center;
6
-//   display: flex;
7
-//   justify-content: center;
8
-
9
-//   .wrapper-header-circle {
10
-//     position: relative;
11
-//     opacity: 0.02;
12
-//     border-radius: 50%;
13
-//     background: #ffffff;
14
-//     width: 298px;
15
-//     height: 298px;
16
-//     .wrapper-header-circle2 {
17
-//       position: absolute;
18
-//       left: 0;
19
-//       right: 0;
20
-//       top: 0;
21
-//       bottom: 0;
22
-//       margin: auto;
23
-//       width: 198px;
24
-//       height: 198px;
25
-//       background: #ffffff;
26
-//       border-radius: 50%;
27
-//     }
28
-//   }
29
-//   .wrapper-header-box {
30
-//     position: relative;
31
-//     .wrapper-header-img {
32
-//       position: absolute;
33
-//       top: -49px;
34
-//       right: 88px;
35
-//       width: 115px;
36
-//       height: 109px;
37
-//       border-radius: 50%;
38
-//     }
39
-//   }
40
-//   .wrapper-header-box2 {
41
-//     position: relative;
42
-//     .wrapper-header-text {
43
-//       position: absolute;
44
-//       width: 249px;
45
-//       right: 17px;
46
-//       top: 79px;
47
-//       font-size: 32px;
48
-//       color: #fff;
49
-//     }
50
-//   }
51
-// }
52
-
53
-// .wrapper-middle {
54
-//   padding: var(--main-space);
55
-//   display: grid;
56
-//   grid-template-columns: repeat(2, 335px);
57
-//   grid-auto-rows: 335px;
58
-//   grid-gap: var(--main-space);
59
-//   .wrapper-middle-box {
60
-//     box-shadow: 0px 18px 22px 0px rgba(0, 0, 0, 0.06);
61
-//     border-radius: 8px;
62
-//     display: grid;
63
-//     place-items: center;
64
-//     margin-bottom: 20px;
65
-//   }
66
-//   .wrapper-middle-img {
67
-//     width: 120px;
68
-//     height: 120px;
69
-//   }
70
-//   .wrapper-middle-text {
71
-//     font-size: 32px;
72
-//     margin-bottom: -38px;
73
-//   }
74
-//   .wrapper-middle-text2 {
75
-//     font-size: 28px;
76
-//     color: #757575;
77
-//   }
78
-//   .wrapper-middle-text3 {
79
-//     font-size: 32px;
80
-//     margin-bottom: 50px;
81
-//   }
82
-// }

+ 62
- 0
src/pages/my/style.module.less Прегледај датотеку

@@ -0,0 +1,62 @@
1
+
2
+.exit {
3
+  position: absolute;
4
+  top: var(--main-space);
5
+  right: var(--main-space);
6
+  z-index: 2;
7
+  color: #fff;
8
+  font-size: 28px;
9
+  line-height: 36px;
10
+
11
+  image {
12
+    width: 36px;
13
+    height: 36px;
14
+    display: inline-block;
15
+    margin-left: 2vw;
16
+    vertical-align: middle;
17
+  }
18
+}
19
+
20
+.bg-menu-box {
21
+  display: flex;
22
+  justify-content: center;
23
+  align-items: center;
24
+  margin-top: var(--main-space);
25
+
26
+  .bg-menu-item {
27
+    flex: none;
28
+    width: 45vw;
29
+    height: 45vw;
30
+    background: #FFFFFF;
31
+    box-shadow: 0px 18px 22px 0px rgba(0,0,0,0.06);
32
+    border-radius: 8px;
33
+
34
+    & + .bg-menu-item {
35
+      margin-left: var(--main-space);
36
+    }
37
+
38
+    image {
39
+      display: block;
40
+      width: 120px;
41
+      height: 120px;
42
+      margin: auto;
43
+      margin-top: 10vw;
44
+    }
45
+
46
+    .bg-menu-title {
47
+      font-size: 32px;
48
+      font-weight: bold;
49
+      color: #202020;
50
+      margin-top: 20px;
51
+      text-align: center;
52
+    }
53
+
54
+    .bg-menu-subtitle {
55
+      font-size: 28px;
56
+      font-weight: 500;
57
+      color: #757575;
58
+      margin-top: 14px;
59
+      text-align: center;
60
+    }
61
+  }
62
+}

+ 6
- 3
src/pages/notice/components/Card/index.jsx Прегледај датотеку

@@ -21,14 +21,17 @@ export default (props) => {
21 21
     <View className={style['notice-card-wrapper']}>
22 22
       <CellGroup>
23 23
         <Cell
24
-          title={dataset?.title}
25
-          isLink size="large"
24
+          isLink
25
+          size="large"
26 26
           style={{ color: 'var(--main-bg-color)' }}
27 27
           onClick={() => onClick()}
28
+          renderTitle={(
29
+            <View className={style['notice-card-title']}>{dataset?.title}</View>
30
+          )}
28 31
         />
29 32
         <Cell
30 33
           renderTitle={(<>
31
-            <View className={style['notice-card-title']}>日期: </View>
34
+            <View className={style['notice-card-title2']}>日期: </View>
32 35
             <View className={style['notice-card-title2']}>{dateStr}</View>
33 36
           </>
34 37
           )}

+ 1
- 0
src/pages/notice/components/Card/style.module.less Прегледај датотеку

@@ -8,6 +8,7 @@
8 8
   .notice-card-title {
9 9
     font-weight: bold;
10 10
     display: inline-block;
11
+    letter-spacing: 4px;
11 12
   }
12 13
   .notice-card-title2 {
13 14
     display: inline-block;

+ 6
- 0
src/store/user.js Прегледај датотеку

@@ -70,6 +70,11 @@ export default function useUser() {
70 70
     })
71 71
   }
72 72
 
73
+  const signOut = () => {
74
+    setUser(null);
75
+    initDuty([]);
76
+  }
77
+
73 78
   return {
74 79
     user,
75 80
     person,
@@ -80,5 +85,6 @@ export default function useUser() {
80 85
     updateDuty,
81 86
     signinByPhone,
82 87
     authProfile,
88
+    signOut,
83 89
   }
84 90
 }