张延森 hace 3 años
padre
commit
c8fde9276e
Se han modificado 2 ficheros con 57 adiciones y 27 borrados
  1. 13
    7
      src/components/foodCards/foodCards.jsx
  2. 44
    20
      src/components/foodCards/style.less

+ 13
- 7
src/components/foodCards/foodCards.jsx Ver fichero

@@ -30,14 +30,20 @@ export default (props) => {
30 30
   return (
31 31
     <view className='foodCard'>
32 32
       <view className='fCleft'>
33
-        <view className='backMoney'>
34
-          返现¥{(item.cashback / 100).toFixed(2)}
35
-        </view>
36
-        <view className='appraise'>
37
-          <Star star={st} />
38
-          <text className='storezf'>{st}</text>
33
+        <view className='fCleft_header'>
34
+          <view>
35
+            <view className='backMoney'>
36
+              返现¥{(item.cashback / 100).toFixed(2)}
37
+            </view>
38
+          </view>
39
+          <view>
40
+            <view className='appraise'>
41
+              <Star star={st} />
42
+              <text className='storezf'>{st}</text>
43
+            </view>
44
+          </view>
39 45
         </view>
40
-        <view>
46
+        <view className='fCleft_body'>
41 47
           <view className='contentImg' onClick={() => { goFood() }}>
42 48
             <image src={item.poster} className='img1'></image>
43 49
             <image src={msTip} className='mstip'></image>

+ 44
- 20
src/components/foodCards/style.less Ver fichero

@@ -1,32 +1,50 @@
1 1
 .foodCard{
2 2
   background: #FFF;
3
-  // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
4 3
   border-radius: 12px;
5 4
   position: relative;
6 5
   margin: 15px 15px;
7 6
   margin-bottom: 30px;
8 7
   overflow: hidden;
9
-  filter: drop-shadow(0px 6px 13px rgba(0, 0, 0, 0.12));
8
+  // filter: drop-shadow(0px 6px 13px rgba(0, 0, 0, 0.12));
9
+  // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
10 10
   background: radial-gradient(circle at 82% top,transparent 20px,#fff 0) top,
11 11
               radial-gradient(circle at 82% bottom,transparent 20px,#fff 0) bottom;
12 12
   background-repeat: no-repeat;
13
-  background-size: auto 50%;
13
+  background-size: 100% 50%;
14
+  box-sizing: border-box;
15
+  display: flex;
16
+
14 17
   .fCleft{
15
-    float: left;
16
-    width: 82%;
18
+    flex: auto;
19
+
20
+    &_header {
21
+      display: flex;
22
+      margin: 22px 0;
23
+
24
+      & > view {
25
+        flex: 1;
26
+      }
27
+    }
28
+
29
+    &_body {
30
+      display: flex;
31
+      padding: 0 20px 43px 20px;
32
+    }
33
+    
17 34
     .backMoney{
35
+      display: inline-block;
36
+
18 37
       font-size: 24px;
19 38
       font-weight: bold;
20
-      color: #FFF;
21
-      margin: 22px 40px 20px 0;        
22
-      padding: 12px 17px 9px 6px;
23
-      background:url('../../assets/icons/housemantj/fximg.png') no-repeat;    
24
-      display: inline-block;
39
+      color: #FFF;     
40
+      padding: 12px 30px 9px 1em;
41
+      background:url('../../assets/icons/housemantj/fximg.png') no-repeat;
25 42
       background-size: 100% 100%;
26 43
     }
27
-    .appraise{
44
+
45
+    .appraise {
28 46
       display: inline-block;
29
-      margin-left: 10px;
47
+
30 48
       image{
31 49
         width: 21px;
32 50
         height: 21px;
@@ -38,10 +56,12 @@
38 56
         color: #020200;
39 57
       }
40 58
     }
59
+
41 60
     .contentImg{
42
-      margin: 0 20px 43px 20px;
61
+      flex: none;
43 62
       position: relative;
44
-      display: inline-block;
63
+      width: 144px;
64
+      
45 65
       .img1{
46 66
         width: 144px;
47 67
         height: 144px;
@@ -55,8 +75,9 @@
55 75
       }
56 76
     }
57 77
     .neirong{
58
-      display: inline-block;
59
-      width: 57%;
78
+      flex: auto;
79
+      margin-left: 1em;
80
+
60 81
       .textword{
61 82
         font-size: 24px;           
62 83
         color: #333;
@@ -111,14 +132,15 @@
111 132
     }
112 133
   }
113 134
   .fCright{
114
-    float: right;
135
+    flex: none;
115 136
     width: 18%;
116 137
     line-height: 0;
117 138
     image{
139
+      display: block;
118 140
       width:35px;
119 141
       height:32px;
120
-      margin-top: 120%;
121
-      margin-left:calc(50% - 15px)
142
+      margin: 0 auto;
143
+      margin-top: 100%;
122 144
     }
123 145
     view{
124 146
       font-size: 24px;
@@ -130,11 +152,13 @@
130 152
     }
131 153
   }
132 154
   .columnLine{
155
+    flex: none;
156
+    width: 1px;
133 157
     height: 50%;
134 158
     border-right: 2px dashed #595959;
135 159
     opacity: 0.12;
136 160
     position: absolute;
137 161
     right: 18%;
138
-    bottom:15%;
162
+    bottom: 25%;
139 163
   }
140 164
 }