周立森 5 years ago
parent
commit
4c8a06ee69
5 changed files with 77 additions and 68 deletions
  1. 8
    3
      src/components/CaseCard.vue
  2. 16
    4
      src/views/Case.vue
  3. 10
    16
      src/views/Details.vue
  4. 36
    38
      src/views/Dynamic.vue
  5. 7
    7
      src/views/Home.vue

+ 8
- 3
src/components/CaseCard.vue View File

1
 <template>
1
 <template>
2
-  <el-card class="case-card" shadow="hover" :body-style="{ padding: '0px' }">
3
-    <img :src="thumb" class="image">
2
+  <el-card class="case-card" shadow="hover" :body-style="{ padding: '0px' }" style=" padding: 0px">
3
+    <img :style="{background: `url(${thumb})`}" class="image">  
4
     <div class="body">
4
     <div class="body">
5
       <h3>{{title}}</h3>
5
       <h3>{{title}}</h3>
6
       <div class="bottom clearfix caption">
6
       <div class="bottom clearfix caption">
27
   padding: 0;
27
   padding: 0;
28
 
28
 
29
   .image {
29
   .image {
30
-    width: 100%;
30
+      bottom: 0;
31
+  width: 100%;
32
+
33
+  height: 0;
34
+  padding-bottom: 48.5%;
35
+  background-size: 100% 100% !important;
31
   }
36
   }
32
 
37
 
33
   .body {
38
   .body {

+ 16
- 4
src/views/Case.vue View File

41
     <div class="contanier center-block dyn-main">
41
     <div class="contanier center-block dyn-main">
42
       <div class="row">
42
       <div class="row">
43
         <div class="col-md-6 col-xs-6" v-for="(item,index) in caselist" :key="index" :class="{ marginTP: index > 1 }">
43
         <div class="col-md-6 col-xs-6" v-for="(item,index) in caselist" :key="index" :class="{ marginTP: index > 1 }">
44
-          <a href="/details">
45
-            <case-card :thumb="item.caseCoverImg" :title="item.caseTitle" :caption="item.caseSummary"></case-card>
46
-          </a>
44
+          <router-link :to="{ name: 'details', query: { id: item.id }}">
45
+            <case-card :thumb="item.caseCoverImg" :title="item.caseTitle" :caption="item.caseSummary" class="casecard"></case-card>
46
+          </router-link>
47
         </div>
47
         </div>
48
       </div>
48
       </div>
49
     </div>
49
     </div>
50
-
50
+<!--  -->
51
     <div style="margin-top:40px">
51
     <div style="margin-top:40px">
52
       <button type="button" v-if="!allLoaded" class="btn btn-default" @click="more">加载更多</button>
52
       <button type="button" v-if="!allLoaded" class="btn btn-default" @click="more">加载更多</button>
53
       <p v-else>已经到底了~更多案例尽请期待~</p>
53
       <p v-else>已经到底了~更多案例尽请期待~</p>
160
 
160
 
161
 <style scoped>
161
 <style scoped>
162
 
162
 
163
+.casecard{
164
+ 
165
+  width: 100%;
166
+
167
+  padding-bottom: 100%;
168
+  background-size: 100% 100% !important;
169
+  /* position: relative; */
170
+
171
+  margin: 0;
172
+
173
+}
174
+
163
 .border-bottom {
175
 .border-bottom {
164
   /* display: none; */
176
   /* display: none; */
165
   border-bottom: 1px solid #bfbfbf;
177
   border-bottom: 1px solid #bfbfbf;

+ 10
- 16
src/views/Details.vue View File

67
   </div>
67
   </div>
68
 </template>
68
 </template>
69
 
69
 
70
-<script>
71
 
70
 
72
 
71
 
73
-export default {
74
-
75
-}
76
-</script>
77
-
78
 
72
 
79
 <script scoped>
73
 <script scoped>
80
 // @ is an alias to /src
74
 // @ is an alias to /src
100
     getDetail () {
94
     getDetail () {
101
       const id = this.$route.query.id;
95
       const id = this.$route.query.id;
102
       const type = this.$route.query.type;
96
       const type = this.$route.query.type;
103
-      const taCaseTypeId = this.$route.query.taCaseTypeId;
97
+      // const taCaseTypeId = this.$route.query.taCaseTypeId;
104
       request({
98
       request({
105
         ...apis.case.list,
99
         ...apis.case.list,
106
         urlData: { type: type },
100
         urlData: { type: type },
107
         params: { pageNum: 1, pageSize: 1, id: id },
101
         params: { pageNum: 1, pageSize: 1, id: id },
108
         query: {}
102
         query: {}
109
       }).then(con => {
103
       }).then(con => {
110
-        console.log(con, "124")
104
+        // console.log(con, "124")
111
         this.datas = con.records[0];
105
         this.datas = con.records[0];
112
         // window.console.log(this.caselist, "543");
106
         // window.console.log(this.caselist, "543");
113
       })
107
       })
114
 
108
 
115
-      request({
116
-        ...apis.case.list,
117
-        urlData: { type: type },
118
-        params: { pageNum: 1, pageSize: 4, }
119
-      }).then(con => {
120
-        console.log(con, "456")
121
-        console.log(taCaseTypeId, "456")
109
+      // request({
110
+      //   ...apis.case.list,
111
+      //   urlData: { type: type },
112
+      //   params: { pageNum: 1, pageSize: 4, }
113
+      // }).then(con => {
114
+        // console.log(con, "456")
115
+        // console.log(taCaseTypeId, "456")
122
         // this.morecase = con.records[0];
116
         // this.morecase = con.records[0];
123
         // window.console.log(this.caselist, "543");
117
         // window.console.log(this.caselist, "543");
124
-      })
118
+      // })
125
     }
119
     }
126
 
120
 
127
   },
121
   },

+ 36
- 38
src/views/Dynamic.vue View File

14
     </div>
14
     </div>
15
 
15
 
16
     <div class="row mobtype border-bottom">
16
     <div class="row mobtype border-bottom">
17
-   
18
-        <div class="col-xs-6">
19
-          <div> <p style="line-height:40px">选择想看的动态类型:</p></div>
17
+      <div class="col-xs-6">
18
+        <div>
19
+          <p style="line-height:40px">选择想看的动态类型:</p>
20
         </div>
20
         </div>
21
-        <div class="col-xs-6">
22
-          <el-button class="btn-link mobbtn" @click="drawer = true" type="button" style="margin-left: 16px;">全部动态</el-button>
23
-        </div>
24
-  
21
+      </div>
22
+      <div class="col-xs-6">
23
+        <el-button class="btn-link mobbtn" @click="drawer = true" type="button" style="margin-left: 16px;">全部动态</el-button>
24
+      </div>
25
     </div>
25
     </div>
26
     <el-drawer :visible.sync="drawer" :direction="direction" :before-close="handleClose" :show-close="true" size="80%">
26
     <el-drawer :visible.sync="drawer" :direction="direction" :before-close="handleClose" :show-close="true" size="80%">
27
       <div>
27
       <div>
42
     <div class="contanier center-block dyn-main">
42
     <div class="contanier center-block dyn-main">
43
       <div class="row">
43
       <div class="row">
44
         <div class="col-md-6 col-xs-6" v-for="(item,index) in caselist" :key="index" :class="{ marginTP: index > 1 }">
44
         <div class="col-md-6 col-xs-6" v-for="(item,index) in caselist" :key="index" :class="{ marginTP: index > 1 }">
45
-          <case-card :thumb="item.caseCoverImg" :title="item.caseTitle" :caption="item.caseSummary"></case-card>
45
+          <router-link :to="{ name: 'details', query: { id: item.id }}">
46
+            <case-card :thumb="item.caseCoverImg" :title="item.caseTitle" :caption="item.caseSummary"></case-card>
47
+          </router-link>
46
         </div>
48
         </div>
47
       </div>
49
       </div>
48
     </div>
50
     </div>
49
 
51
 
50
-    <div style="margin-top:40px" >
52
+    <div style="margin-top:40px">
51
       <button type="button" class="btn btn-default" @click="more" v-if="!allLoaded">加载更多</button>
53
       <button type="button" class="btn btn-default" @click="more" v-if="!allLoaded">加载更多</button>
52
       <p v-else>已经到底了~更多案例尽请期待~</p>
54
       <p v-else>已经到底了~更多案例尽请期待~</p>
53
     </div>
55
     </div>
158
 </script>
160
 </script>
159
 
161
 
160
 <style scoped>
162
 <style scoped>
161
-
162
 .border-bottom {
163
 .border-bottom {
163
   /* display: none; */
164
   /* display: none; */
164
   border-bottom: 1px solid #bfbfbf;
165
   border-bottom: 1px solid #bfbfbf;
165
-      margin-top: 10px !important;
166
+  margin-top: 10px !important;
167
+}
168
+.btn1 {
169
+  font-size: 24px !important;
170
+  color: black !important;
171
+  border: none !important;
172
+}
173
+.btn1:hover {
174
+  color: red !important;
175
+  text-decoration: none;
166
 }
176
 }
167
- .btn1 {
168
-    font-size: 24px !important;
169
-    color: black !important;
170
-    border: none !important;
171
-  }
172
-  .btn1:hover {
173
-    color: red !important;
174
-    text-decoration: none;
175
-  }
176
 .text-left {
177
 .text-left {
177
   color: #000;
178
   color: #000;
178
 }
179
 }
187
 }
188
 }
188
 
189
 
189
 @media (max-width: 992px) {
190
 @media (max-width: 992px) {
190
-  .dynamic{
191
+  .dynamic {
191
     margin-top: 58px;
192
     margin-top: 58px;
192
   }
193
   }
193
   .comtype {
194
   .comtype {
199
   }
200
   }
200
 }
201
 }
201
 .row {
202
 .row {
202
-    margin: 0;
203
-  }
203
+  margin: 0;
204
+}
204
 .marginTP {
205
 .marginTP {
205
   margin-top: 3rem;
206
   margin-top: 3rem;
206
 }
207
 }
215
     justify-content: center;
216
     justify-content: center;
216
   }
217
   }
217
   .dynamic {
218
   .dynamic {
218
-  margin-top: 116px;
219
-  margin-bottom: -116px;
220
-  padding-bottom: 116px; 
221
-  background-color: #fafafa;
222
-}
223
-  
219
+    margin-top: 116px;
220
+    margin-bottom: -116px;
221
+    padding-bottom: 116px;
222
+    background-color: #fafafa;
223
+  }
224
+
224
   .mobtype {
225
   .mobtype {
225
     display: none;
226
     display: none;
226
   }
227
   }
227
 
228
 
228
-  
229
   .btn {
229
   .btn {
230
     font-size: 24px;
230
     font-size: 24px;
231
     margin-top: 88px;
231
     margin-top: 88px;
253
   }
253
   }
254
 }
254
 }
255
 
255
 
256
+.mobbtn {
257
+  color: #e03723;
256
 
258
 
257
-.mobbtn{
258
-color: #e03723;
259
-   
260
-  padding:12px 40px;
259
+  padding: 12px 40px;
261
 
260
 
262
-    border-radius: 0px;
261
+  border-radius: 0px;
263
 
262
 
264
-    background-color: rgb(252, 151, 252);
265
-    border: 2px solid #bfbfbf;
266
-  
263
+  background-color: rgb(252, 151, 252);
264
+  border: 2px solid #bfbfbf;
267
 }
265
 }
268
 </style>
266
 </style>

+ 7
- 7
src/views/Home.vue View File

9
             <span class="icon-bar"></span>
9
             <span class="icon-bar"></span>
10
             <span class="icon-bar"></span>
10
             <span class="icon-bar"></span>
11
           </button>
11
           </button>
12
-          <a class="navbar-brand" href="#">
12
+          <a class="navbar-brand" href="/">
13
             <div alt="Brand" class="logo"></div>
13
             <div alt="Brand" class="logo"></div>
14
           </a>
14
           </a>
15
         </div>
15
         </div>
134
       </div>
134
       </div>
135
     </div>
135
     </div>
136
 
136
 
137
-    <a class="btn btn-default btn-lg" href="/case" role="button">更多案例</a>
137
+    <router-link class="btn btn-default btn-lg" :to="{ name: 'case' }">更多案例</router-link>
138
 
138
 
139
     <div></div>
139
     <div></div>
140
 
140
 
161
         <div class="contanier st top-news">
161
         <div class="contanier st top-news">
162
           <div class="row">
162
           <div class="row">
163
             <div class="col-xs-6 col-md-6 home-news-hover home-news" v-for="(item,index) in dynamiclist" :key="index">
163
             <div class="col-xs-6 col-md-6 home-news-hover home-news" v-for="(item,index) in dynamiclist" :key="index">
164
-              <a href="/details">
164
+              <router-link :to="{ name: 'details', query: { id: item.id }}">
165
                 <div :style="{background: `url(${item.caseCoverImg})`}" class="home-dynamic"></div>
165
                 <div :style="{background: `url(${item.caseCoverImg})`}" class="home-dynamic"></div>
166
                 <h3 class="text-left" style>{{item.caseTitle}}</h3>
166
                 <h3 class="text-left" style>{{item.caseTitle}}</h3>
167
-              </a>
167
+              </router-link>
168
             </div>
168
             </div>
169
             <!-- item.caseCoverImg -->
169
             <!-- item.caseCoverImg -->
170
           </div>
170
           </div>
171
         </div>
171
         </div>
172
       </div>
172
       </div>
173
     </div>
173
     </div>
174
-    <a class="btn btn-default btn-lg dynbtn" href="/dynamic" role="button">更多动态</a>
174
+    <router-link class="btn btn-default btn-lg" role="button" :to="{ name: 'dynamic' }">更多案例</router-link>
175
   </div>
175
   </div>
176
 </template>
176
 </template>
177
 
177
 
282
     margin-top: 20px;
282
     margin-top: 20px;
283
     font-size: 20px;
283
     font-size: 20px;
284
     font-weight: bold;
284
     font-weight: bold;
285
-    letter-spacing:1px;
285
+    letter-spacing: 1px;
286
   }
286
   }
287
   h3 {
287
   h3 {
288
     font-size: 2.4rem;
288
     font-size: 2.4rem;
386
   }
386
   }
387
   .btn:hover {
387
   .btn:hover {
388
     color: #e03723;
388
     color: #e03723;
389
-    border: 1px solid #e03723;
389
+    border: 2px solid #e03723;
390
   }
390
   }
391
 
391
 
392
   p {
392
   p {