Selaa lähdekoodia

flex add icon

[baozhangchao] 3 vuotta sitten
vanhempi
commit
90bd950eb6
4 muutettua tiedostoa jossa 60 lisäystä ja 8 poistoa
  1. 1
    1
      src/app.js
  2. 9
    1
      src/components/ViewIcon/style.less
  3. 19
    6
      src/pages/main/index.jsx
  4. 31
    0
      src/pages/main/style.less

+ 1
- 1
src/app.js Näytä tiedosto

@@ -31,7 +31,7 @@ class App extends Component {
31 31
     })
32 32
     Taro.loadFontFace({
33 33
       family: 'iconfont',
34
-      source: 'url("//at.alicdn.com/t/font_3429358_r17zty6kva.ttf?t=1653534540687")',
34
+      source: 'url("//at.alicdn.com/t/font_3429358_afs07k49tq.ttf?t=1653537640226")',
35 35
       success () {
36 36
         console.log('eeeeeeeeee');
37 37
 

+ 9
- 1
src/components/ViewIcon/style.less Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 @font-face {
2 2
   font-family: "iconfont"; /* Project id 3429358 */
3
-  src: url("//at.alicdn.com/t/font_3429358_r17zty6kva.ttf?t=1653534540687")
3
+  src: url("//at.alicdn.com/t/font_3429358_afs07k49tq.ttf?t=1653537640226")
4 4
     format("truetype");
5 5
 }
6 6
 
@@ -12,6 +12,14 @@
12 12
   -moz-osx-font-smoothing: grayscale;
13 13
 }
14 14
 
15
+.icon-bianji:before {
16
+  content: "\e8ac";
17
+}
18
+
19
+.icon-morentouxiang:before {
20
+  content: "\e65d";
21
+}
22
+
15 23
 .icon-tongzhigonggao:before {
16 24
   content: "\e634";
17 25
 }

+ 19
- 6
src/pages/main/index.jsx Näytä tiedosto

@@ -11,25 +11,38 @@ export default (props) => {
11 11
   const goDogList = () => {
12 12
     console.log('e',);
13 13
   }
14
+  const goSetUser = (e) => {
15
+    Taro.navigateTo({
16
+      url: '/pages/setUser/index'
17
+    })
18
+  }
14 19
   return (
15 20
     <View className='user-box'>
16 21
 
17 22
       <View className='user-box-Card'>
18
-        <Image />
23
+        <View className='user-box-Card-useImage'>
24
+          <ViewIcon icon='morentouxiang' size={50} color='#FBD804' />
25
+        </View>
26
+
27
+        <View className='user-box-Card-NameCard'>
28
+          <View>姓名:王王王</View>
29
+          <View>文明养狗,遵纪守法</View>
30
+        </View>
31
+        <View className='user-box-Card-right' onClick={goSetUser}>
32
+          <ViewIcon icon='bianji' size={19} color='#2f2f2f' />
33
+
34
+          修改信息
35
+        </View>
19 36
       </View>
20 37
 
21 38
       <mp-cells ext-class='my-cells' >
22 39
         <mp-cell link hover>
23 40
           <View className='iconCell'>
24
-            <ViewIcon icon='dingdan' size={25} />
41
+            <ViewIcon icon='dingdan' size={22} />
25 42
             {/* <Image slot='icon' src={listImage} style='margin-right: 16px;vertical-align: middle;width:28px; height: 30px;' /> */}
26
-
27 43
             <View onClick={goDogList} style='padding-left:5px;width:80%'>申请列表</View>
28
-
29 44
           </View>
30
-
31 45
         </mp-cell>
32
-
33 46
       </mp-cells>
34 47
     </View >
35 48
   )

+ 31
- 0
src/pages/main/style.less Näytä tiedosto

@@ -1,4 +1,35 @@
1 1
 .user-box {
2
+  width: 100vw;
3
+  &-Card {
4
+    width: 100%;
5
+    background-color: #fff;
6
+    display: flex;
7
+    align-items: center;
8
+    padding: 5px 15px;
9
+    &-NameCard {
10
+      margin-left: 20px;
11
+      > View:nth-child(1) {
12
+        font-size: 30px;
13
+        font-weight: 600;
14
+      }
15
+      > View:nth-child(2) {
16
+        color: rgb(175, 175, 175);
17
+        font-size: 25px;
18
+      }
19
+    }
20
+    &-right {
21
+      display: flex;
22
+      align-items: center;
23
+      text-align: center;
24
+      font-size: 28px;
25
+      position: relative;
26
+      left: 30vw;
27
+    }
28
+  }
29
+  .weui-cell {
30
+    height: 25px;
31
+    font-size: 30px;
32
+  }
2 33
   .iconCell {
3 34
     display: flex;
4 35
     align-items: center;