张延森 3 anni fa
parent
commit
59b9928756

BIN
src/assets/images/screen/header-bg.png Vedi File


BIN
src/assets/images/screen/header-title.png Vedi File


+ 0
- 21
src/components/ScreenBox/ScreenHeader/Attchment.jsx Vedi File

@@ -1,21 +0,0 @@
1
-import React, { useMemo } from 'react';
2
-import classNames from 'classnames';
3
-import Styles from './style.less';
4
-
5
-export default (props) => {
6
-  const classList = useMemo(() => {
7
-    return classNames(
8
-      Styles.attchment,
9
-      Styles['bt-border'],
10
-      Styles['bt-pointer'],
11
-      Styles['bt-slash'],
12
-      {
13
-        [Styles['rht-pointer']]: props.direct === 'left',
14
-        [Styles['attchment-right']]: props.direct === 'right',
15
-        [Styles['rht-slash']]: props.direct === 'right',
16
-      },
17
-    );
18
-  }, [props.direct]);
19
-
20
-  return <div className={classList}>{props.title}</div>;
21
-};

+ 7
- 5
src/components/ScreenBox/ScreenHeader/index.jsx Vedi File

@@ -1,17 +1,19 @@
1
-import Attchment from './Attchment';
1
+import titleImg from '@/assets/images/screen/header-title.png';
2 2
 import Styles from './style.less';
3 3
 
4
-export default () => {
4
+export default (props) => {
5 5
   return (
6 6
     <div className={Styles['screen-header-box']}>
7 7
       <div className={Styles['screen-header-left']}>
8
-        <Attchment direct="left" title="数据概览" />
8
+        <div>数据概览</div>
9 9
       </div>
10 10
       <div className={Styles['screen-header-left']}>{/* 只负责占位 */}</div>
11
-      <div className={Styles['screen-header-content']}></div>
11
+      <div className={Styles['screen-header-content']}>
12
+        <img src={titleImg} alt="" />
13
+      </div>
12 14
       <div className={Styles['screen-header-right']}>{/* 只负责占位 */}</div>
13 15
       <div className={Styles['screen-header-right']}>
14
-        <Attchment direct="right" title="多云21-28°C" />
16
+        <div>{props.weather}</div>
15 17
       </div>
16 18
     </div>
17 19
   );

+ 30
- 56
src/components/ScreenBox/ScreenHeader/style.less Vedi File

@@ -1,15 +1,43 @@
1 1
 .screen-header-box {
2 2
   display: flex;
3
-  align-items: center;
4
-  justify-content: center;
3
+  align-items: stretch;
4
+  height: 5%;
5
+  min-height: 60px;
6
+
7
+  padding-right: 1.5em;
8
+  padding-left: 1.5em;
9
+  color: #fff;
10
+  font-size: 12px;
11
+  background-image: url('~@/assets/images/screen/header-bg.png');
12
+  background-repeat: no-repeat;
13
+  background-size: 100% 100%;
5 14
 
6 15
   .screen-header-left,
7 16
   .screen-header-right {
17
+    display: grid;
8 18
     flex: 1;
19
+    letter-spacing: 2px;
20
+    text-align: left;
21
+    place-items: center;
22
+
23
+    & > div {
24
+      width: 100%;
25
+    }
26
+  }
27
+
28
+  .screen-header-right {
29
+    text-align: right;
9 30
   }
10 31
 
11 32
   .screen-header-content {
33
+    display: flex;
12 34
     flex: 6;
35
+    align-items: center;
36
+    justify-content: center;
37
+
38
+    & > img {
39
+      height: 50%;
40
+    }
13 41
   }
14 42
 
15 43
   .attchment {
@@ -21,58 +49,4 @@
21 49
       text-align: right;
22 50
     }
23 51
   }
24
-
25
-  .bt-border {
26
-    margin-bottom: 10px;
27
-    padding-right: 1em;
28
-    padding-left: 1em;
29
-    border-bottom: 2px solid #3d81f0;
30
-  }
31
-
32
-  .bt-slash {
33
-    position: relative;
34
-    &::before {
35
-      position: absolute;
36
-      bottom: -3px;
37
-      left: 0;
38
-      z-index: 10;
39
-      width: 10px;
40
-      height: 10px;
41
-      border-bottom: 2px solid #3d81f0;
42
-      transform: rotate(60deg);
43
-      transform-origin: top center;
44
-      content: ' ';
45
-    }
46
-  }
47
-
48
-  .rht-slash {
49
-    &::before {
50
-      right: 0;
51
-      left: auto;
52
-      transform: rotate(120deg);
53
-      transform-origin: right center;
54
-    }
55
-  }
56
-
57
-  .bt-pointer {
58
-    position: relative;
59
-    &::after {
60
-      position: absolute;
61
-      bottom: -3px;
62
-      left: 0;
63
-      z-index: 10;
64
-      width: 6px;
65
-      height: 4px;
66
-      background: #fffa00;
67
-      border-radius: 50%;
68
-      content: ' ';
69
-    }
70
-  }
71
-
72
-  .rht-pointer {
73
-    &::after {
74
-      right: 0;
75
-      left: auto;
76
-    }
77
-  }
78 52
 }