[baozhangchao] vor 3 Jahren
Ursprung
Commit
8aa8ecf9fd
4 geänderte Dateien mit 95 neuen und 21 gelöschten Zeilen
  1. 10
    5
      src/pages/dogLicenseList/index.jsx
  2. 9
    5
      src/pages/dogList/index.jsx
  3. 16
    11
      src/pages/noticeList/index.jsx
  4. 60
    0
      src/store/app.js

+ 10
- 5
src/pages/dogLicenseList/index.jsx Datei anzeigen

@@ -47,11 +47,16 @@ export default (props) => {
47 47
   return (
48 48
     <>
49 49
       {
50
-        dogCardList.map((item, index) => {
51
-          return (
52
-            widgetView(item)
53
-          )
54
-        })
50
+        !dogCardList.length <= 0 ?
51
+          dogCardList.map((item, index) => {
52
+            return (
53
+              widgetView(item)
54
+            )
55
+          })
56
+          :
57
+          <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
58
+            暂无证件信息
59
+          </View>
55 60
       }
56 61
     </>
57 62
   )

+ 9
- 5
src/pages/dogList/index.jsx Datei anzeigen

@@ -54,11 +54,15 @@ export default (props) => {
54 54
   return (
55 55
     <>
56 56
       {
57
-        dogs.map((item, index) => {
58
-          return (
59
-            widgetView(item)
60
-          )
61
-        })
57
+        !dogs.length <= 0 ?
58
+          dogs.map((item, index) => {
59
+            return (
60
+              widgetView(item)
61
+            )
62
+          })
63
+          : <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
64
+            暂无狗狗信息
65
+          </View>
62 66
       }
63 67
       <Button title='+ 添加狗狗' width='50' onClick={() => goLicenseInfo()} />
64 68
     </>

+ 16
- 11
src/pages/noticeList/index.jsx Datei anzeigen

@@ -29,18 +29,23 @@ export default (props) => {
29 29
     <>
30 30
       <View className='noticeList'>
31 31
         {
32
-          noticeList.map((item, index) => {
33
-            return (
34
-              <View key={index} className='notice-item-row' onClick={() => { goDetail(item.noticeId) }}>
35
-                <Image className='notice' src={noticeIcon} mode='aspectFit' />
36
-                <View className='notice-item-body'>
37
-                  <View className='notice-item-title'>{item.title}</View>
38
-                  <View className='notice-item-time'>{item.createDate}</View>
32
+          !noticeList.length <= 0 ?
33
+            noticeList.map((item, index) => {
34
+              return (
35
+                <View key={index} className='notice-item-row' onClick={() => { goDetail(item.noticeId) }}>
36
+                  <Image className='notice' src={noticeIcon} mode='aspectFit' />
37
+                  <View className='notice-item-body'>
38
+                    <View className='notice-item-title'>{item.title}</View>
39
+                    <View className='notice-item-time'>{item.createDate}</View>
40
+                  </View>
41
+                  <Image className='action' src={more} mode='aspectFit' />
39 42
                 </View>
40
-                <Image className='action' src={more} mode='aspectFit' />
41
-              </View>
42
-            )
43
-          })
43
+              )
44
+            })
45
+            :
46
+            <View style={{ textAlign: 'center', margin: '6vw 0 3vw 0', color: '#858585', fontSize: '12px' }}>
47
+              暂无通知信息
48
+            </View>
44 49
         }
45 50
 
46 51
 

+ 60
- 0
src/store/app.js Datei anzeigen

@@ -0,0 +1,60 @@
1
+import { Component } from 'react'
2
+import Taro from '@tarojs/taro';
3
+//at.alicdn.com/t/font_3429358_khwsvk6pgxm.css
4
+import store, { StoreRoot, useModel } from './store'
5
+
6
+import './app.less'
7
+import { View } from '@tarojs/components';
8
+
9
+class App extends Component {
10
+
11
+  componentDidMount () {
12
+
13
+  }
14
+
15
+  componentDidShow () { }
16
+
17
+  componentDidHide () { }
18
+
19
+  componentDidCatchError () { }
20
+  onLaunch (options) {
21
+
22
+    const { logins, setUserLocation } = store.getModel('userData').getState()
23
+
24
+
25
+    // 登录获取人员信息
26
+    Taro.login({
27
+      success: (res) => {
28
+        const { code } = res;
29
+        logins({ code })
30
+      }
31
+    })
32
+    Taro.loadFontFace({
33
+      family: 'iconfont',
34
+      source: 'url("//at.alicdn.com/t/font_3429358_8dmcqsujg73.ttf?t=1653555641856")',
35
+      success () {
36
+        console.log('字体加载完成👍');
37
+
38
+      },
39
+      fail (e) {
40
+        console.log(e, '👈字体加载失败');
41
+      }
42
+    })
43
+
44
+
45
+
46
+  }
47
+
48
+  // this.props.children 是将要会渲染的页面
49
+  render () {
50
+    return <StoreRoot>
51
+      <View className='pages-index'>
52
+        {this.props.children}
53
+      </View>
54
+
55
+    </StoreRoot>
56
+    // return this.props.children
57
+  }
58
+}
59
+
60
+export default App