ソースを参照

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

[baozhangchao] 3 年 前
コミット
c1858b832b

+ 2
- 1
src/app.config.js ファイルの表示

@@ -2,7 +2,8 @@ export default {
2 2
   pages: [
3 3
     'pages/index/index',
4 4
     'pages/main/index',
5
-    'pages/NoticeInfo/index',
5
+    'pages/noticeList/index',
6
+    'pages/noticeInfo/index',
6 7
     'pages/setUser/index',
7 8
     'pages/setDogLicense/index',
8 9
     'pages/dogLicenseList/index',

+ 15
- 5
src/pages/NoticeInfo/index.jsx ファイルの表示

@@ -1,15 +1,25 @@
1
-import { View, Text, Image } from '@tarojs/components'
2
-import Taro from '@tarojs/taro';
1
+import { View, RichText, ScrollView } from '@tarojs/components'
3 2
 
4 3
 import './style.less'
5 4
 
6 5
 export default (props) => {
7 6
 
8
-
7
+  let htmlSnip=`<p style="text-align: center;"><strong>通知2士大夫敢死队</strong></p>
8
+  <p style="text-indent: 2em;" data-spm-anchor-id="C73544894212.P59511941341.0.i0">在今天举行的上海市新冠肺炎疫情防控新闻发布会上,相关部门介绍,全市高三、高二年级学生从6月6日,初三年级学生从6月13日起返校复学;中小学其他各年级学生继续居家在线学习至学期结束,学校可在学期结束前安排一次学生返校活动。有关部门将按照规范完成校园消杀,确保校园安全干净,为学校配备专门的核酸采样和检测力量,实施校园网格化管理等措施。</p>
9
+  <p style="text-indent: 2em;">上海复工复产加快推动,上海四家整车厂、中国船舶集团旗下的三大船企都实现复工复产。上海还将根据疫情防控形势,在6月推动工业、服务业和外资外贸企业等应复尽复。</p>
10
+  <p style="text-indent: 2em; text-align: right;">2022年5月26日</p>
11
+  <p style="text-indent: 2em; text-align: right;">南京防疫办公室</p>`
12
+  
13
+  htmlSnip = htmlSnip.replace(/<\/p>/g, '</p><p style="height: 1em">&nbsp;</p>')
14
+  
9 15
   return (
10
-    <View className='index-UserQRcode'>
11
-      我是公告嗷嗷嗷嗷嗷
16
+    <ScrollView scrollY style={{height:'100vh'}}>
17
+    <View className='noticeInfo'>
18
+      <View className='title'>我是标题</View>
19
+      <View className='date'>2022-6-9 13:33</View>
20
+      <RichText nodes={htmlSnip}></RichText>
12 21
     </View>
22
+    </ScrollView>
13 23
   )
14 24
 }
15 25
 

+ 11
- 0
src/pages/NoticeInfo/style.less ファイルの表示

@@ -0,0 +1,11 @@
1
+.noticeInfo{
2
+  padding: 32px;
3
+  .title{
4
+    font-size: 40px;
5
+    font-weight: bold;
6
+  }
7
+  .date{
8
+    color: gray;
9
+    margin-bottom: 32px;
10
+  }
11
+}

+ 8
- 4
src/pages/index/index.jsx ファイルの表示

@@ -38,14 +38,18 @@ export default (props) => {
38 38
       url: '/pages/main/index'
39 39
     })
40 40
   }
41
-
41
+  goMain
42
+  const goNoticeList=()=>{
43
+    Taro.navigateTo({url:'/pages/noticeList/index'})
44
+  }
45
+  const goDetail=()=>{
46
+    Taro.navigateTo({url:'/pages/noticeInfo/index'})
47
+  }
42 48
   const goDogLicenseList = (e) => {
43 49
     Taro.navigateTo({
44 50
       url: '/pages/dogLicenseList/index'
45 51
     })
46 52
   }
47
-
48
-
49 53
   return (
50 54
     <ScrollView scrollY style={{
51 55
       height: '100vh'
@@ -83,7 +87,7 @@ export default (props) => {
83 87
         </View>
84 88
 
85 89
         <View className='message-box'>
86
-          <Notice />
90
+          <Notice onMoreClick={goNoticeList} onClick={goDetail} />
87 91
         </View>
88 92
       </View>
89 93
     </ScrollView>

+ 8
- 0
src/pages/noticeList/index.config.js ファイルの表示

@@ -0,0 +1,8 @@
1
+export default {
2
+  navigationBarTitleText: "公告列表",
3
+  disableScroll: true,
4
+  navigationBarBackgroundColor: "#FBD804",
5
+  navigationBarTextStyle: "black",
6
+  backgroundColor: "#FBD804",
7
+  usingComponents: {},
8
+};

+ 111
- 0
src/pages/noticeList/index.jsx ファイルの表示

@@ -0,0 +1,111 @@
1
+import { ScrollView, View } from '@tarojs/components'
2
+import Taro from '@tarojs/taro';
3
+import './style.less'
4
+
5
+export default (props) => {
6
+  const onClick = () => { 
7
+    Taro.navigateTo({url:'/pages/noticeInfo/index'})
8
+  }
9
+  return (
10
+    <ScrollView scrollY style={{ height: '100vh' }}>
11
+      <View className='noticeList'>
12
+        <View className='notice-item-row' onClick={onClick}>
13
+          <View className='iconfont icon-notice' />
14
+          <View className='notice-item-body'>
15
+            <View className='notice-item-title'>这是我第一个通知</View>
16
+            <View className='notice-item-time'>2022.05.26</View>
17
+          </View>
18
+          <View className='iconfont icon-action' />
19
+        </View>
20
+        <View className='notice-item-row' onClick={onClick}>
21
+          <View className='iconfont icon-notice' />
22
+          <View className='notice-item-body'>
23
+            <View className='notice-item-title'>这是我第一个通知江苏省南京市江宁区南京南站</View>
24
+            <View className='notice-item-time'>2022.05.26</View>
25
+          </View>
26
+          <View className='iconfont icon-action' />
27
+        </View>
28
+        <View className='notice-item-row' onClick={onClick}>
29
+          <View className='iconfont icon-notice' />
30
+          <View>
31
+            <View className='notice-item-title'>这是我第一个通知</View>
32
+            <View className='notice-item-time'>2022.05.26</View>
33
+          </View>
34
+          <View className='iconfont icon-action' />
35
+        </View>
36
+        <View className='notice-item-row' onClick={onClick}>
37
+          <View className='iconfont icon-notice' />
38
+          <View className='notice-item-body'>
39
+            <View className='notice-item-title'>这是我第一个通知</View>
40
+            <View className='notice-item-time'>2022.05.26</View>
41
+          </View>
42
+          <View className='iconfont icon-action' />
43
+        </View>
44
+        <View className='notice-item-row' onClick={onClick}>
45
+          <View className='iconfont icon-notice' />
46
+          <View className='notice-item-body'>
47
+            <View className='notice-item-title'>这是我第一个通知江苏省南京市江宁区南京南站</View>
48
+            <View className='notice-item-time'>2022.05.26</View>
49
+          </View>
50
+          <View className='iconfont icon-action' />
51
+        </View>
52
+        <View className='notice-item-row' onClick={onClick}>
53
+          <View className='iconfont icon-notice' />
54
+          <View>
55
+            <View className='notice-item-title'>这是我第一个通知</View>
56
+            <View className='notice-item-time'>2022.05.26</View>
57
+          </View>
58
+          <View className='iconfont icon-action' />
59
+        </View>
60
+        <View className='notice-item-row' onClick={onClick}>
61
+          <View className='iconfont icon-notice' />
62
+          <View className='notice-item-body'>
63
+            <View className='notice-item-title'>这是我第一个通知</View>
64
+            <View className='notice-item-time'>2022.05.26</View>
65
+          </View>
66
+          <View className='iconfont icon-action' />
67
+        </View>
68
+        <View className='notice-item-row' onClick={onClick}>
69
+          <View className='iconfont icon-notice' />
70
+          <View className='notice-item-body'>
71
+            <View className='notice-item-title'>这是我第一个通知江苏省南京市江宁区南京南站</View>
72
+            <View className='notice-item-time'>2022.05.26</View>
73
+          </View>
74
+          <View className='iconfont icon-action' />
75
+        </View>
76
+        <View className='notice-item-row' onClick={onClick}>
77
+          <View className='iconfont icon-notice' />
78
+          <View>
79
+            <View className='notice-item-title'>这是我第一个通知</View>
80
+            <View className='notice-item-time'>2022.05.26</View>
81
+          </View>
82
+          <View className='iconfont icon-action' />
83
+        </View>
84
+        <View className='notice-item-row' onClick={onClick}>
85
+          <View className='iconfont icon-notice' />
86
+          <View className='notice-item-body'>
87
+            <View className='notice-item-title'>这是我第一个通知</View>
88
+            <View className='notice-item-time'>2022.05.26</View>
89
+          </View>
90
+          <View className='iconfont icon-action' />
91
+        </View>
92
+        <View className='notice-item-row' onClick={onClick}>
93
+          <View className='iconfont icon-notice' />
94
+          <View className='notice-item-body'>
95
+            <View className='notice-item-title'>这是我第一个通知江苏省南京市江宁区南京南站</View>
96
+            <View className='notice-item-time'>2022.05.26</View>
97
+          </View>
98
+          <View className='iconfont icon-action' />
99
+        </View>
100
+        <View className='notice-item-row' onClick={onClick}>
101
+          <View className='iconfont icon-notice' />
102
+          <View>
103
+            <View className='notice-item-title'>这是我第一个通知</View>
104
+            <View className='notice-item-time'>2022.05.26</View>
105
+          </View>
106
+          <View className='iconfont icon-action' />
107
+        </View>
108
+      </View>
109
+    </ScrollView>
110
+  )
111
+}

+ 74
- 0
src/pages/noticeList/style.less ファイルの表示

@@ -0,0 +1,74 @@
1
+.noticeList{
2
+  padding: 32px;
3
+  @font-face {
4
+    font-family: 'iconfont';  /* Project id 2904679 */
5
+    src: url('//at.alicdn.com/t/font_2904679_ix6j11q9hir.woff2?t=1653563318275') format('woff2'),
6
+      url('//at.alicdn.com/t/font_2904679_ix6j11q9hir.woff?t=1653563318275') format('woff'),
7
+      url('//at.alicdn.com/t/font_2904679_ix6j11q9hir.ttf?t=1653563318275') format('truetype');  }
8
+  .iconfont {
9
+    font-family: "iconfont" !important;
10
+    font-size: 16px;
11
+    font-style: normal;
12
+    -webkit-font-smoothing: antialiased;
13
+    -moz-osx-font-smoothing: grayscale;
14
+  }
15
+  .icon-notice{
16
+    font-size: 80px;
17
+    width: 80px;
18
+    flex:none;
19
+    margin-right: 16px;
20
+    color: rgb(31 , 136, 217);
21
+  }
22
+  .icon-notice:before {
23
+    content: "\e60d";
24
+  }
25
+  .icon-action{
26
+    font-size: 40px;
27
+    width: 40px;
28
+    margin-left: 16px;
29
+    flex:none;
30
+  }
31
+  .icon-action:before {
32
+    content: "\e60e";
33
+  }
34
+  .notice-item-row {
35
+    align-items: center;
36
+    background-color: white;
37
+    display: flex;
38
+    border-radius: 16px;
39
+    padding: 32px;
40
+    & + .notice-item-row {
41
+      margin-top: 32px;
42
+    } 
43
+    .notice-item-title {
44
+      width: calc(100vw - 280px);
45
+      white-space: nowrap;
46
+      overflow: hidden;
47
+      text-overflow: ellipsis;
48
+      font-weight: bold;
49
+    } 
50
+    .notice-item-time{
51
+      font-size: 0.5em;
52
+      margin-top: 8px;
53
+    }
54
+    .icon-notice{
55
+      font-size: 80px;
56
+      width: 80px;
57
+      flex:none;
58
+      margin-right: 16px;
59
+      color: rgb(31 , 136, 217);
60
+    }
61
+    .icon-notice:before {
62
+      content: "\e60d";
63
+    }
64
+    .icon-action{
65
+      font-size: 40px;
66
+      width: 40px;
67
+      margin-left: 16px;
68
+      flex:none;
69
+    }
70
+    .icon-action:before {
71
+      content: "\e60e";
72
+    }  
73
+  } 
74
+}