소스 검색

Merge branch 'master' of http://git.ycjcjy.com/civilized_city/miniapp

Yansen 2 년 전
부모
커밋
605b736e91

+ 4
- 1
src/app.config.js 파일 보기

@@ -15,13 +15,16 @@ export default defineAppConfig({
15 15
     'pages/message/list/index',
16 16
     'pages/index3/index',
17 17
     'pages/index4/index',
18
-    'pages/index5/index',
19 18
     'pages/reporting/index',
20 19
     'pages/reporting/detail/index',
21 20
     'pages/reset-password/index',
22 21
     'pages/check/list/index',
23 22
     'pages/check/loc/list/index',
24 23
     'pages/check/edit/index',
24
+    'pages/notice/index',
25
+    'pages/notice/edit/index',
26
+    'pages/my/index',
27
+    'pages/my/edit/index',
25 28
   ],
26 29
   window: {
27 30
     // backgroundColor: '#1A7565',

BIN
src/assets/icons/bell.png 파일 보기


BIN
src/assets/icons/headportrait.png 파일 보기


BIN
src/assets/icons/peopleicon.png 파일 보기


BIN
src/assets/icons/smallbell.png 파일 보기


+ 1
- 2
src/components/ScrollPage/style.module.less 파일 보기

@@ -1,11 +1,10 @@
1 1
 .box {
2 2
   display: flex;
3
+  height: calc(100%-100px);
3 4
   .page {
4 5
     flex: 1;
5
-    height: 100%;
6 6
   }
7 7
   .button {
8
-    flex: none;
9 8
     height: 100px;
10 9
   }
11 10
 }

+ 3
- 3
src/layouts/TabBar.jsx 파일 보기

@@ -33,7 +33,7 @@ const notice = {
33 33
   label: '公告',
34 34
   icon: noticeIcon,
35 35
   activeIcon: noticeActiveIcon,
36
-  page: '/pages/index3/index'
36
+  page: '/pages/notice/index'
37 37
 }
38 38
 const issue = {
39 39
   name: 'issue',
@@ -54,7 +54,7 @@ const mine = {
54 54
   label: '我的',
55 55
   icon: mineIcon,
56 56
   activeIcon: mineActiveIcon,
57
-  page: '/pages/index5/index'
57
+  page: '/pages/my/index'
58 58
 }
59 59
 
60 60
 export default (props) => {
@@ -62,7 +62,7 @@ export default (props) => {
62 62
 
63 63
   const tabItems = React.useMemo(() => {
64 64
     if (!user) return [];
65
-    
65
+
66 66
     if (user.dutyList.indexOf(ROLE_INSPECTOR) > -1 // 督察员
67 67
       || user.dutyList.indexOf(ROLE_MANAGER) > -1 // 管理员
68 68
     ) {

+ 2
- 2
src/layouts/index.jsx 파일 보기

@@ -13,7 +13,7 @@ export default (props) => {
13 13
 
14 14
   const { person, user } = useModel('user');
15 15
 
16
-  const conatinerClass = `${laySty['page-conatiner']} ${tabBar ? laySty['with-tabbar'] : ''} ${className}`;
16
+  const containerClass = `${laySty['page-conatiner']} ${tabBar ? laySty['with-tabbar'] : ''} ${className}`;
17 17
 
18 18
   React.useEffect(() => {
19 19
     if (person && !user) {
@@ -30,7 +30,7 @@ export default (props) => {
30 30
     <View className={laySty['page-wrapper']}>
31 31
       <Notify id="vanNotify" />
32 32
       <NavLoading loading={loading} />
33
-      <View className={conatinerClass} style={style}>
33
+      <View className={containerClass} style={style}>
34 34
         {
35 35
           !person && (
36 36
             <View className={laySty.loading}>

+ 53
- 53
src/pages/check/edit/index.jsx 파일 보기

@@ -63,17 +63,17 @@ export default (props) => {
63 63
   const onAnswerItemChange = (answerItem, quInfo) => {
64 64
     if (!answerItem) return;
65 65
 
66
-    const an = {...(answer || {})}
66
+    const an = { ...(answer || {}) }
67 67
     const answerItemList = an.answerItemList || []
68 68
 
69 69
     if ((answerItem.answerCode || answerItem.answer) &&
70 70
       answerItem.attachList?.length) {
71
-        // 说明这一题已经回答完毕
72
-        quInfo.finished = true
73
-      } else {
74
-        quInfo.finished = false
75
-      }
76
-    
71
+      // 说明这一题已经回答完毕
72
+      quInfo.finished = true
73
+    } else {
74
+      quInfo.finished = false
75
+    }
76
+
77 77
     // 更新问题列表中是否作答的标志位
78 78
     setQuList(quList.map(x => x.quId == quInfo.quId ? quInfo : x));
79 79
 
@@ -118,13 +118,13 @@ export default (props) => {
118 118
       setLoading(false);
119 119
       const t = setTimeout(() => {
120 120
         clearTimeout(t);
121
-        Taro.navigateBack({delta: 1});
122
-      }, 1000);      
121
+        Taro.navigateBack({ delta: 1 });
122
+      }, 1000);
123 123
     }).catch(() => {
124 124
       setLoading(false);
125 125
     });
126 126
   }
127
-  
127
+
128 128
   // 查询当前测评点位主记录
129 129
   React.useEffect(() => {
130 130
     if (id) {
@@ -137,7 +137,7 @@ export default (props) => {
137 137
       });
138 138
     }
139 139
   }, [id]);
140
-  
140
+
141 141
   // 查询当前测评调查问卷主记录
142 142
   React.useEffect(() => {
143 143
     if (checkId && typ == 'survey') {
@@ -156,7 +156,7 @@ export default (props) => {
156 156
     if (checkItemInfo?.itemId) {
157 157
       const { itemId } = checkItemInfo;
158 158
       setLoading(true);
159
-      
159
+
160 160
       preCheck(itemId, { noSuccesTip: true }).then((checkRes) => {
161 161
         if (checkRes.errorCode < 0) {
162 162
           setLoading(false);
@@ -164,11 +164,11 @@ export default (props) => {
164 164
             message: checkRes.message,
165 165
             type: 'warning',
166 166
           })
167
-  
168
-          Taro.navigateBack({delta: 1})
167
+
168
+          Taro.navigateBack({ delta: 1 })
169 169
           return;
170 170
         }
171
-  
171
+
172 172
         if (checkRes.errorCode > 0) {
173 173
           setReadonly(true);
174 174
           // Notify.show({
@@ -176,12 +176,12 @@ export default (props) => {
176 176
           //   type: 'warning',
177 177
           // })
178 178
         }
179
-        
179
+
180 180
         // 查询我的答案
181 181
         // getTaCheckItemAnswer(itemId).then(setAnswer);
182 182
     
183 183
         // 查询当前测评主记录的所有问题
184
-        getTaCheckItemQu({pageSize: 200, itemId}).then(res => {
184
+        getTaCheckItemQu({ pageSize: 200, itemId }).then(res => {
185 185
           setLoading(false);
186 186
           setQuList(res.records || []);
187 187
         }).catch(() => {
@@ -193,7 +193,7 @@ export default (props) => {
193 193
       });
194 194
     }
195 195
   }, [checkItemInfo]);
196
-  
196
+
197 197
   return (
198 198
     <Page loading={loading} roles={[ROLE_INSPECTOR]}>
199 199
       <VABC
@@ -207,42 +207,42 @@ export default (props) => {
207 207
           />
208 208
         )}
209 209
       >
210
-        <ScrollView scrollY style={{height: '100%'}}>
211
-        {
212
-          index == -1 && (
213
-            <LocForm
214
-              checkType={typ}
215
-              readonly={readonly}
216
-              checkItemInfo={checkItemInfo}
217
-              answer={answer}
218
-              onChange={setAnswer}
219
-              onLoadingChange={setLoading}
220
-            />
221
-          )
222
-        }
223
-        {
224
-          quList.map((x, inx) => {
225
-            const answerItem = answer?.answerItemList?.filter(y => y.quId == x.quId)[0];
226
-
227
-            return (
228
-              index == inx && (
229
-                <Question
230
-                  key={x.quId}
231
-                  cursor={inx}
232
-                  readonly={readonly}
233
-                  quInfo={x}
234
-                  answerItem={answerItem}
235
-                  total={quList?.length}
236
-                  onChange={e => onAnswerItemChange(e, x)}
237
-                  onPrev={() => onIndexChange(null, -1)}
238
-                  onNext={() => onIndexChange(null, 1)}
239
-                  onLoadingChange={setLoading}
240
-                />
241
-              )
210
+        <ScrollView scrollY style={{ height: '100%' }}>
211
+          {
212
+            index == -1 && (
213
+              <LocForm
214
+                checkType={typ}
215
+                readonly={readonly}
216
+                checkItemInfo={checkItemInfo}
217
+                answer={answer}
218
+                onChange={setAnswer}
219
+                onLoadingChange={setLoading}
220
+              />
242 221
             )
243
-          })
244
-        }
245
-          
222
+          }
223
+          {
224
+            quList.map((x, inx) => {
225
+              const answerItem = answer?.answerItemList?.filter(y => y.quId == x.quId)[0];
226
+
227
+              return (
228
+                index == inx && (
229
+                  <Question
230
+                    key={x.quId}
231
+                    cursor={inx}
232
+                    readonly={readonly}
233
+                    quInfo={x}
234
+                    answerItem={answerItem}
235
+                    total={quList?.length}
236
+                    onChange={e => onAnswerItemChange(e, x)}
237
+                    onPrev={() => onIndexChange(null, -1)}
238
+                    onNext={() => onIndexChange(null, 1)}
239
+                    onLoadingChange={setLoading}
240
+                  />
241
+                )
242
+              )
243
+            })
244
+          }
245
+
246 246
         </ScrollView>
247 247
       </VABC>
248 248
     </Page>

+ 0
- 24
src/pages/index5/index.jsx 파일 보기

@@ -1,24 +0,0 @@
1
-import { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
3
-import './index.less'
4
-
5
-export default class Index extends Component {
6
-
7
-  componentWillMount () { }
8
-
9
-  componentDidMount () { }
10
-
11
-  componentWillUnmount () { }
12
-
13
-  componentDidShow () { }
14
-
15
-  componentDidHide () { }
16
-
17
-  render () {
18
-    return (
19
-      <View className='index'>
20
-        <Text>Hello world!</Text>
21
-      </View>
22
-    )
23
-  }
24
-}

+ 0
- 0
src/pages/index5/index.less 파일 보기


+ 21
- 0
src/pages/my/components/Notice.jsx 파일 보기

@@ -0,0 +1,21 @@
1
+import React from 'react';
2
+import { View, Image } from '@tarojs/components';
3
+import smallbell from '@/assets/icons/smallbell.png';
4
+import Taro from '@tarojs/taro';
5
+import style from './notice.module.less';
6
+
7
+export default (props) => {
8
+
9
+  const onClick = () => {
10
+    Taro.navigateTo({
11
+      url: `/pages/my/edit/index`
12
+    })
13
+  }
14
+
15
+  return (
16
+    <View className="wrapper-middle-box" onClick={onClick}>
17
+      <Image className="wrapper-middle-img" src={smallbell} />
18
+      <View className="wrapper-middle-text3">消息通知</View>
19
+    </View>
20
+  )
21
+}

+ 15
- 0
src/pages/my/components/notice.module.less 파일 보기

@@ -0,0 +1,15 @@
1
+.wrapper-middle-box {
2
+  box-shadow: 0px 18px 22px 0px rgba(0, 0, 0, 0.06);
3
+  border-radius: 8px;
4
+  display: grid;
5
+  place-items: center;
6
+  margin-bottom: 20px;
7
+}
8
+.wrapper-middle-img {
9
+  width: 120px;
10
+  height: 120px;
11
+}
12
+.wrapper-middle-text3 {
13
+  font-size: 32px;
14
+  margin-bottom: 34px;
15
+}

+ 3
- 0
src/pages/my/edit/index.config.js 파일 보기

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '消息通知'
3
+})

+ 25
- 0
src/pages/my/edit/index.jsx 파일 보기

@@ -0,0 +1,25 @@
1
+import React from 'react';
2
+import Page from '@/layouts/index';
3
+import { Cell, CellGroup } from '@antmjs/vantui'
4
+import { View, Image } from '@tarojs/components';
5
+import bell from '@/assets/icons/bell.png';
6
+import './index.less';
7
+
8
+export default (props) => {
9
+  return (
10
+    <Page>
11
+      <View className="news-card-wrapper">
12
+        <CellGroup>
13
+          <Cell
14
+            title="您的xxxx项目已完成,点击查看详情!"
15
+            isLink size="large"
16
+            renderIcon={(<>
17
+              <Image className="img-wrapper" src={bell} />
18
+            </>
19
+            )}
20
+          />
21
+        </CellGroup>
22
+      </View>
23
+    </Page>
24
+  )
25
+}

+ 11
- 0
src/pages/my/edit/index.less 파일 보기

@@ -0,0 +1,11 @@
1
+.news-card-wrapper {
2
+  width: calc(100% - var(--main-space) * 2);
3
+  margin: var(--main-space);
4
+  box-shadow: 0px 9px 11px 0px rgba(0, 0, 0, 0.06);
5
+  border-radius: 8px;
6
+  .img-wrapper {
7
+    width: 32px;
8
+    height: 42px;
9
+    margin-right: 2vw;
10
+  }
11
+}

src/pages/index5/index.config.js → src/pages/my/index.config.js 파일 보기


+ 35
- 0
src/pages/my/index.jsx 파일 보기

@@ -0,0 +1,35 @@
1
+import React from 'react';
2
+import Page from '@/layouts/index';
3
+import { View, Image } from '@tarojs/components';
4
+import headportrait from '@/assets/icons/headportrait.png';
5
+import peopleicon from '@/assets/icons/peopleicon.png';
6
+import { Card } from '@antmjs/vantui';
7
+import Notice from './components/Notice';
8
+import './index.less';
9
+
10
+export default (props) => {
11
+  return (
12
+    <Page tabBar="mine">
13
+      <View className="wrapper-header">
14
+        <View className="wrapper-header-circle">
15
+          <View className="wrapper-header-circle2" />
16
+        </View>
17
+        <View className="wrapper-header-box">
18
+          <Image className="wrapper-header-img" src={headportrait} />
19
+        </View>
20
+        <View className="wrapper-header-box2">
21
+          <View className="wrapper-header-text">昵称:Tomorrow</View>
22
+        </View>
23
+      </View>
24
+
25
+      <View className="wrapper-middle">
26
+        <View className="wrapper-middle-box">
27
+          <Image className="wrapper-middle-img" src={peopleicon} />
28
+          <View className="wrapper-middle-text">所在部门</View>
29
+          <View className="wrapper-middle-text2">县文明办</View>
30
+        </View>
31
+        <Notice />
32
+      </View>
33
+    </Page>
34
+  )
35
+}

+ 77
- 0
src/pages/my/index.less 파일 보기

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

+ 33
- 0
src/pages/notice/components/Card/index.jsx 파일 보기

@@ -0,0 +1,33 @@
1
+import React from 'react';
2
+import { Cell, CellGroup } from '@antmjs/vantui';
3
+import { View } from '@tarojs/components';
4
+import Taro from '@tarojs/taro';
5
+import style from './style.module.less';
6
+
7
+export default (props) => {
8
+
9
+  const onClick = () => {
10
+    Taro.navigateTo({
11
+      url: `/pages/notice/edit/index`
12
+    })
13
+  }
14
+
15
+  return (
16
+    <View className={style['notice-card-wrapper']}>
17
+      <CellGroup>
18
+        <Cell
19
+          title="关于2022年模拟测评报告"
20
+          isLink size="large"
21
+          style={{ color: 'var(--main-bg-color)' }}
22
+          onClick={() => onClick()}
23
+        />
24
+        <Cell
25
+          renderTitle={(<>
26
+            <View className={style['notice-card-title']}>日期: </View><View className={style['notice-card-title2']}>2022-12-06 12:00</View>
27
+          </>
28
+          )}
29
+        />
30
+      </CellGroup>
31
+    </View>
32
+  )
33
+}

+ 15
- 0
src/pages/notice/components/Card/style.module.less 파일 보기

@@ -0,0 +1,15 @@
1
+.notice-card-wrapper {
2
+  width: calc(100% - var(--main-space) * 2);
3
+  margin: var(--main-space);
4
+  background: #ffffff;
5
+  box-shadow: 0px 18px 22px 1px rgba(0, 0, 0, 0.06);
6
+  border-radius: 8px;
7
+  overflow: hidden;
8
+  .notice-card-title {
9
+    font-weight: bold;
10
+    display: inline-block;
11
+  }
12
+  .notice-card-title2 {
13
+    display: inline-block;
14
+  }
15
+}

+ 20
- 0
src/pages/notice/components/Details/index.jsx 파일 보기

@@ -0,0 +1,20 @@
1
+import React from 'react';
2
+import { View } from '@tarojs/components';
3
+import style from './style.module.less';
4
+
5
+export default (props) => {
6
+  return (
7
+    <View className={style['notice-wrapper']} style={style}>
8
+      <View className={style['notice-hd']}>
9
+        【关于2022年模拟测评公告】
10
+        <View className={style['notice-hd2']}>2022-12-06 12:00</View>
11
+      </View>
12
+      <View className={style['notice-bd']}>
13
+
14
+      </View>
15
+      <View className={style['notice-ft']}>
16
+
17
+      </View>
18
+    </View>
19
+  )
20
+}

+ 25
- 0
src/pages/notice/components/Details/style.module.less 파일 보기

@@ -0,0 +1,25 @@
1
+.notice-wrapper {
2
+  height: 100%;
3
+  display: flex;
4
+  flex-direction: column;
5
+
6
+  .notice-hd {
7
+    flex: none;
8
+    margin: var(--main-space);
9
+    font-weight: bold;
10
+    .notice-hd2 {
11
+      font-weight: 400;
12
+      margin-left: var(--main-space);
13
+    }
14
+  }
15
+
16
+  .notice-bd {
17
+    flex: 1;
18
+    overflow: hidden;
19
+    margin: var(--main-space);
20
+  }
21
+
22
+  .notice-ft {
23
+    flex: none;
24
+  }
25
+}

+ 4
- 0
src/pages/notice/edit/index.config.js 파일 보기

@@ -0,0 +1,4 @@
1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '详情'
4
+})

+ 11
- 0
src/pages/notice/edit/index.jsx 파일 보기

@@ -0,0 +1,11 @@
1
+import React from 'react';
2
+import Page from '@/layouts/index';
3
+import Details from '../components/Details/index';
4
+
5
+export default (props) => {
6
+  return (
7
+    <Page>
8
+      <Details />
9
+    </Page>
10
+  )
11
+}

+ 4
- 0
src/pages/notice/index.config.js 파일 보기

@@ -0,0 +1,4 @@
1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '公告'
4
+})

+ 12
- 0
src/pages/notice/index.jsx 파일 보기

@@ -0,0 +1,12 @@
1
+import React from 'react';
2
+import Page from '@/layouts/index';
3
+import Card from './components/Card/index';
4
+
5
+export default (props) => {
6
+
7
+  return (
8
+    <Page tabBar="notice">
9
+      <Card />
10
+    </Page>
11
+  )
12
+}