周立森 5 years ago
parent
commit
3b69963b05
6 changed files with 40 additions and 66 deletions
  1. 12
    1
      src/App.vue
  2. 1
    1
      src/main.js
  3. 8
    4
      src/router.js
  4. 4
    15
      src/views/Case.vue
  5. 12
    22
      src/views/Details.vue
  6. 3
    23
      src/views/Dynamic.vue

+ 12
- 1
src/App.vue View File

@@ -135,6 +135,12 @@ export default {
135 135
   color: #e03723;
136 136
   border: 1px solid #e03723;
137 137
 }
138
+@media (max-width: 992px) {
139
+  .top{
140
+  width:100%;
141
+   height:47.8px
142
+}
143
+}
138 144
 </style>
139 145
 
140 146
 
@@ -162,6 +168,8 @@ p {
162 168
     sans-serif;
163 169
 }
164 170
 
171
+
172
+
165 173
 .coll {
166 174
   display: none;
167 175
 }
@@ -222,7 +230,10 @@ a:focus, a:hover {
222 230
 
223 231
 <style lang="less" scoped>
224 232
 @media (max-width: 992px) {
225
-  
233
+  .top{
234
+  width:100%;
235
+   height:47.8px
236
+}
226 237
  
227 238
  
228 239
   .main {

+ 1
- 1
src/main.js View File

@@ -19,7 +19,7 @@ new Vue({
19 19
   //     return {x:0,y:0}
20 20
   //   }
21 21
   // },
22
-  
22
+ 
23 23
 
24 24
   render: h => h(App)
25 25
 }).$mount('#app')

+ 8
- 4
src/router.js View File

@@ -1,6 +1,6 @@
1 1
 import Vue from 'vue'
2 2
 import Router from 'vue-router'
3
-import Home from './views/Home.vue'
3
+// import Home from './views/Home.vue'
4 4
 
5 5
 Vue.use(Router)
6 6
 
@@ -10,7 +10,7 @@ export default new Router({
10 10
     {
11 11
       path: '/',
12 12
       name: 'home',
13
-      component: Home
13
+      component: () => import(/* webpackChunkName: "home" */ './views/Home.vue')
14 14
     },
15 15
     {
16 16
       path: '/about',
@@ -34,7 +34,7 @@ export default new Router({
34 34
       // route level code-splitting
35 35
       // this generates a separate chunk (about.[hash].js) for this route
36 36
       // which is lazy-loaded when the route is visited.
37
-      component: () => import(/* webpackChunkName: "Dynamic" */ './views/Dynamic.vue')
37
+      component: () => import(/* webpackChunkName: "dynamic" */ './views/Dynamic.vue')
38 38
     },
39 39
     {
40 40
       path: '/contact',
@@ -50,7 +50,7 @@ export default new Router({
50 50
       // route level code-splitting
51 51
       // this generates a separate chunk (about.[hash].js) for this route
52 52
       // which is lazy-loaded when the route is visited.
53
-      component: () => import(/* webpackChunkName: "Details" */ './views/Details.vue')
53
+      component: () => import(/* webpackChunkName: "details" */ './views/Details.vue')
54 54
     },
55 55
     {
56 56
       path: '/business',
@@ -86,6 +86,10 @@ export default new Router({
86 86
     //   component: () => import(/* webpackChunkName: "wheelplantings" */ './components/wheelplantings.vue')
87 87
     // },
88 88
   ],
89
+  // scrollBehavior (to, from, savedPosition) {
90
+  //   return { x: 0, y: 0 }
91
+  // }
92
+  
89 93
   scrollBehavior (to, from, saveTop) {
90 94
     // return 期望滚动到哪个的位置
91 95
     if(saveTop){

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

@@ -1,6 +1,7 @@
1 1
 <template>
2 2
   <div class="case">
3 3
     <Navbars></Navbars>
4
+    <div class="top"></div>
4 5
     <div>
5 6
       <img :src="cover.coverImg" width="100%" />
6 7
       <!-- width="100%" height="300"> -->
@@ -181,15 +182,6 @@ export default {
181 182
   min-height: 90vh;
182 183
 }
183 184
 
184
-/* .casecard {
185
-  width: 100%;
186
-
187
-  padding-bottom: 100%;
188
-  background-size: 100% 100% !important; */
189
-/* position: relative; */
190
-
191
-/* margin: 0;
192
-} */
193 185
 
194 186
 .border-bottom {
195 187
   /* display: none; */
@@ -231,12 +223,9 @@ export default {
231 223
 }
232 224
 
233 225
 @media (max-width: 992px) {
234
-  .case {
235
-    margin-top: 47.8px;
236
-    margin-bottom: -47.8px;
237
-    padding-bottom: 47.8px;
238
-    background-color: #fafafa;
239
-  }
226
+ .case{
227
+   background-color: #fafafa;
228
+ }
240 229
   .comtype {
241 230
     display: none;
242 231
     border-bottom: 1px solid #bfbfbf;

+ 12
- 22
src/views/Details.vue View File

@@ -1,5 +1,6 @@
1
-<template>
1
+<template id="detail">
2 2
   <div class="details">
3
+    <div class="top"></div>
3 4
     <Navbars></Navbars>
4 5
     <div class="head">
5 6
       <img :src="current.caseDetailCoverImg" width="100%" />
@@ -99,32 +100,15 @@ export default {
99 100
       activeColor: '#000',
100 101
       isMobilePhone,
101 102
       date: moment().format('YYYY年MM月DD日 h:mm')
102
-      // config: {T00:00:00.000
103
-      //   // url: '', // 网址,默认使用 window.location.href
104
-      //   // source: '', // 来源(QQ空间会用到), 默认读取head标签:<meta name="site" content="http://overtrue" />
105
-      //   // title: '', // 标题,默认读取 document.title 或者 <meta name="title" content="share.js" />
106
-      //   // description: '', // 描述, 默认读取head标签:<meta name="description" content="PHP弱类型的实现原理分析" />
107
-      //   image: '', // 图片, 默认取网页中第一个img标签
108
-      //   sites: ['weibo', 'wechat'], // 启用的站点
109
-      //   // disabled: ['google', 'facebook', 'twitter'], // 禁用的站点
110
-      //   wechatQrcodeTitle: '微信扫一扫:分享', // 微信二维码提示文字
111
-      //   wechatQrcodeHelper: '<p>微信里点“发现”,扫一下</p><p>二维码便可将本文分享至朋友圈。</p>'
112
-      // }
113 103
     }
114
-
115 104
   },
116 105
   components: {
117 106
     shares: () => import('../components/Shares'),
118
-
119 107
     Navbars: () => import('../components/Navbars'),
120
-
121 108
   },
122 109
   computed: {
123
-
124
-
125 110
     shareConfig () {
126 111
       return {
127
-
128 112
         url: window.location.href,
129 113
         title: this.current.caseTitle,
130 114
         image: this.current.caseDetailCoverImg, // 图片, 默认取网页中第一个img标签
@@ -184,6 +168,8 @@ export default {
184 168
         this.type = this.detail.current.type == 'case' ? '案例' : '分享'
185 169
         // console.log(this.detail.current, '1234')
186 170
         //  console.log(this.detail, '1234')
171
+        this.url=window.location.href
172
+        this.activeColor = '#000'
187 173
       })
188 174
     },
189 175
 
@@ -202,6 +188,7 @@ export default {
202 188
           }
203 189
         }
204 190
         this.activeColor = '#e03723'
191
+      
205 192
         // this.$message({
206 193
         //   message: res == this.current.likeNum ? '已赞' : '赞 +1',
207 194
         //   type: res == this.current.likeNum ? 'warning' : 'success'
@@ -344,9 +331,12 @@ export default {
344 331
 }
345 332
 
346 333
 @media (max-width: 992px) {
347
-  .details {
348
-    margin-top: 47.8px;
349
-  }
334
+  // .details {
335
+   
336
+  //   // margin-top: 47.8px;
337
+  //   // margin-bottom: -47.8px;
338
+  //   // padding-bottom: 47.8px;
339
+  // }
350 340
   .btn1 {
351 341
     line-height: 25px;
352 342
     font-size: 1.2rem !important;
@@ -398,7 +388,7 @@ export default {
398 388
     }
399 389
     .border-top {
400 390
       padding-top: 20px;
401
-
391
+margin-top: 2px;
402 392
       border-top: 1px solid #aaa;
403 393
     }
404 394
     .zan-share {

+ 3
- 23
src/views/Dynamic.vue View File

@@ -1,5 +1,6 @@
1 1
 <template>
2 2
   <div class="dynamic">
3
+    <div class="top"></div>
3 4
     <Navbars></Navbars>
4 5
     <div>
5 6
       <img :src="cover.coverImg" width="100%" />
@@ -71,7 +72,6 @@ export default {
71 72
       cover: {},
72 73
       casetype: [],
73 74
       caselist: [],
74
-
75 75
       conditions: {
76 76
         pageNum: 0,
77 77
         pageSize: 8,
@@ -100,35 +100,22 @@ export default {
100 100
     }).then(data => {
101 101
       this.cover = data[0];
102 102
     })
103
-
104
-
105
-    // axios.get('http://localhost:8080/pc/dynamic/cover')
106
-
107
-    // 分类
108
-    // axios.get('http://localhost:8080/pc/dynamicType/list')
109 103
     request({
110 104
       ...apis.caseType.list,
111 105
     })
112 106
       .then(res => {
113
-
114 107
         this.casetype = (res.records || []).filter(x => x.type === 'movement');
115
-
116 108
       })
117
-
118 109
     this.getCaseList()
119 110
   },
120
-
121 111
   computed: {
122
-
123 112
   },
124
-
125 113
   methods: {
126 114
     getCaseList (filters = {}) {
127 115
       const params = {
128 116
         ...this.conditions,
129 117
         ...filters
130 118
       }
131
-
132 119
       return new Promise((resolve, reject) => {
133 120
         request({
134 121
           ...apis.case.list,
@@ -140,7 +127,6 @@ export default {
140 127
           } else {
141 128
             this.caselist = con.records;
142 129
           }
143
-
144 130
           this.conditions.pageNum = con.current
145 131
           this.allLoaded = con.current >= con.pages
146 132
           resolve(con)
@@ -150,24 +136,18 @@ export default {
150 136
         })
151 137
       })
152 138
     },
153
-
154 139
     more () {
155 140
       if (!this.allLoaded) {
156 141
         this.getCaseList({ pageNum: this.conditions.pageNum + 1 })
157 142
       }
158 143
     },
159
-
160 144
     filterCase (caseType) {
161 145
       this.currentTypeName = caseType ? caseType.typeName : '全部动态'
162
-
163
-
164 146
       this.getCaseList({ pageNum: 1, caseType: caseType ? caseType.id : '' });
165 147
       this.drawer = false;
166 148
       this.thisbtn = caseType ? caseType.typeName : ''
167 149
     },
168 150
   }
169
-
170
-
171 151
 }
172 152
 </script>
173 153
 
@@ -228,9 +208,9 @@ export default {
228 208
 
229 209
 @media (max-width: 992px) {
230 210
   .dynamic {
231
-    margin-top: 47.8px;
211
+    /* margin-top: 47.8px;
232 212
     margin-bottom: -47.8px;
233
-    padding-bottom: 47.8px;
213
+    padding-bottom: 47.8px; */
234 214
     background-color: #fafafa;
235 215
   }
236 216
   .comtype {