Explorar o código

添加用户 follow 页面

reghao %!s(int64=2) %!d(string=hai) anos
pai
achega
ebf17f1b6c
Modificáronse 2 ficheiros con 75 adicións e 0 borrados
  1. 6 0
      src/router/index.js
  2. 69 0
      src/views/user/follow.vue

+ 6 - 0
src/router/index.js

@@ -12,6 +12,7 @@ const ArticleIndex = () => import('views/home/Article')
 const Search = () => import('views/home/Search')
 const VideoPage = () => import('views/home/VideoPage')
 const HomeIndex = () => import('views/user/Home')
+const FollowIndex = () => import('views/user/follow')
 const ProfileIndex = () => import('views/user/Profile')
 const CollectionIndex = () => import('views/user/Collection')
 const HistoryIndex = () => import('views/user/History')
@@ -72,6 +73,11 @@ const routes = [
     name: 'HomeIndex',
     component: HomeIndex
   },
+  {
+    path: '/user/:id/follow',
+    name: 'FollowIndex',
+    component: FollowIndex
+  },
   {
     path: '/u/profile',
     name: 'ProfileIndex',

+ 69 - 0
src/views/user/follow.vue

@@ -0,0 +1,69 @@
+<template>
+  <div>
+    <el-row>
+      <span>账户主页</span>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { getUserInfo } from '@/utils/auth'
+// import { getUserInfo } from "@/api/user";
+
+export default {
+  name: 'Profile',
+  data() {
+    return {
+      // 屏幕宽度, 为了控制分页条的大小
+      screenWidth: document.body.clientWidth,
+      user: null,
+      userId: null,
+    }
+  },
+  created() {
+    const userInfo = getUserInfo()
+    if (userInfo != null) {
+      document.title = userInfo.username + '的帐号主页'
+    }
+    /*getUserInfo(10001).then(res => {
+      if (res.code === 0) {
+        this.user = res.data
+        document.title = this.user.screenName + '的帐号主页'
+      }
+    })*/
+  },
+  mounted() {
+    // 当窗口宽度改变时获取屏幕宽度
+    window.onresize = () => {
+      return () => {
+        window.screenWidth = document.body.clientWidth
+        this.screenWidth = window.screenWidth
+      }
+    }
+  },
+  methods: {
+  }
+}
+</script>
+
+<style scoped>
+.movie-list {
+  padding-top: 15px;
+  padding-left: 6%;
+  padding-right: 6%;
+}
+
+.pagination {
+  text-align: center;
+  padding: 10px;
+}
+
+/*处于手机屏幕时*/
+@media screen and (max-width: 768px){
+  .movie-list {
+    padding-top: 8px;
+    padding-left: 0.5%;
+    padding-right: 0.5%;
+  }
+}
+</style>