reghao 2 years ago
parent
commit
b33e54a902

+ 1 - 1
src/components/card/StatusCard.vue

@@ -15,7 +15,7 @@
           </router-link>
         </el-row>
         <el-row>
-          <router-link target="_blank" :to="`/status/` + status.user.userId + '/' + status.statusId">
+          <router-link target="_blank" :to="`/status/` + status.statusId">
             <span>{{ status.createdAt }} 来自 微博网页版</span>
           </router-link>
         </el-row>

+ 1 - 1
src/components/layout/NavBar.vue

@@ -9,7 +9,7 @@
         </a>
       </el-col>
       <el-col :md="1" class="right">
-        <a href="/status/11011" class="tit">
+        <a href="/status" class="tit">
           <span>状态</span>
         </a>
       </el-col>

+ 2 - 2
src/router/index.js

@@ -84,12 +84,12 @@ const routes = [
     component: Home
   },
   {
-    path: '/status/:id',
+    path: '/status',
     name: 'TimelineIndex',
     component: TimelineIndex
   },
   {
-    path: '/status/:userId/:statusId',
+    path: '/status/:statusId',
     name: 'StatusPage',
     component: StatusPage
   },

+ 14 - 1
src/views/home/Article.vue

@@ -13,6 +13,12 @@
         </el-card>
       </el-col>
     </el-row>
+    <el-row v-if="showEmpty" class="not-result">
+      <el-col :span="12" :offset="6">
+        <img src="@/assets/img/icon/not-result.png">
+        <div>没有文章数据</div>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -30,7 +36,8 @@ export default {
       screenWidth: document.body.clientWidth,
       currentPage: 1,
       videoList: [],
-      video: null
+      video: null,
+      showEmpty: true
     }
   },
   created() {
@@ -76,6 +83,12 @@ export default {
   padding-right: 6%;
 }
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 .pagination {
   text-align: center;
   padding: 10px;

+ 14 - 1
src/views/home/Audio.vue

@@ -26,6 +26,12 @@
         </el-col>
       </el-col>
     </el-row>
+    <el-row v-if="showEmpty" class="not-result">
+      <el-col :span="12" :offset="6">
+        <img src="@/assets/img/icon/not-result.png">
+        <div>没有音频数据</div>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -40,7 +46,8 @@ export default {
       // 屏幕宽度, 为了控制分页条的大小
       screenWidth: document.body.clientWidth,
       currentPage: 1,
-      videoList: []
+      videoList: [],
+      showEmpty: true
     }
   },
   created() {
@@ -67,6 +74,12 @@ export default {
   padding-right: 6%;
 }
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 .pagination {
   text-align: center;
   padding: 10px;

+ 14 - 1
src/views/home/Image.vue

@@ -27,6 +27,12 @@
         </el-col>
       </el-col>
     </el-row>
+    <el-row v-if="showEmpty" class="not-result">
+      <el-col :span="12" :offset="6">
+        <img src="@/assets/img/icon/not-result.png">
+        <div>没有图片数据</div>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -42,7 +48,8 @@ export default {
       // 屏幕宽度, 为了控制分页条的大小
       screenWidth: document.body.clientWidth,
       currentPage: 1,
-      videoList: []
+      videoList: [],
+      showEmpty: true
     }
   },
   created() {
@@ -87,6 +94,12 @@ export default {
   padding-right: 6%;
 }
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 .pagination {
   text-align: center;
   padding: 10px;

+ 8 - 5
src/views/home/Timeline.vue

@@ -46,6 +46,7 @@ import HotVideo from '@/components/card/HotVideo'
 import HotSearch from '@/components/card/HotSearch'
 import { getUserInfo } from '@/utils/auth'
 import { statusTimeline, videoTimeline } from '@/api/timeline'
+import {getMyInfo} from "@/api/user";
 
 export default {
   name: 'Timeline',
@@ -55,6 +56,7 @@ export default {
       // 屏幕宽度, 为了控制分页条的大小
       screenWidth: document.body.clientWidth,
       nextId: 0,
+      userInfo: null,
       videoInfo: null,
       statusList: [],
       videoList: [],
@@ -62,11 +64,12 @@ export default {
     }
   },
   created() {
-    const userInfo = getUserInfo()
-    if (userInfo != null) {
-      document.title = userInfo.screenName + '的时间线'
-    }
-
+    getMyInfo().then(res => {
+      if (res.code === 0) {
+        this.userInfo = res.data
+        document.title = this.userInfo.screenName + '的时间线'
+      }
+    })
     this.videoTimelineWrapper(this.nextId)
   },
   mounted() {

+ 14 - 1
src/views/home/Video.vue

@@ -69,6 +69,12 @@
         <hot-list />
       </el-col>
     </el-row>
+    <el-row v-if="showEmpty" class="not-result">
+      <el-col :span="12" :offset="6">
+        <img src="@/assets/img/icon/not-result.png">
+        <div>没有视频数据</div>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
@@ -103,7 +109,8 @@ export default {
         Remove: function(key) { delete this[key] }
       },
       category: [],
-      childCategory: []
+      childCategory: [],
+      showEmpty: true
     }
   },
   created() {
@@ -199,6 +206,12 @@ export default {
   padding-right: 6%;
 }
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 .pagination {
   text-align: center;
   padding: 10px;