点赞/评论/个人主页功能完善
This commit is contained in:
@@ -43,10 +43,33 @@
|
||||
<el-card class="box-card" style="border: none;margin-top: 20px">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="评论" name="first">
|
||||
<el-empty description="暂无评论" :image-size="115"></el-empty>
|
||||
<el-card style="border: none;display: flex;flex-direction: row;justify-content: flex-start;align-items: flex-start">
|
||||
<span style="font-size: 16px;font-weight: bold">总共评论: {{commentList.length}} 条</span>
|
||||
</el-card>
|
||||
<el-empty v-show="commentList.length===0" description="暂无评论" :image-size="115"></el-empty>
|
||||
<div v-show="commentList.length!==0" v-for="(item,index) in commentList" :key="index">
|
||||
<UserComments :comments="item" :index="index"></UserComments>
|
||||
</div>
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目" name="third">
|
||||
<el-empty description="暂无项目" :image-size="115"></el-empty>
|
||||
<el-tab-pane label="项目" name="second">
|
||||
<el-card style="border: none;display: flex;flex-direction: row;justify-content: flex-start;align-items: flex-start">
|
||||
<span style="font-size: 16px;font-weight: bold">总共提交: {{projectList.length}} 个</span>
|
||||
</el-card>
|
||||
<el-empty v-show="projectList.length===0" description="暂无项目" :image-size="115"></el-empty>
|
||||
<div v-show="projectList.length!==0" v-for="(item,index) in projectList" :key="index">
|
||||
<UserProjects :project="item"></UserProjects>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="点赞" name="third">
|
||||
<el-card style="border: none;display: flex;flex-direction: row;justify-content: flex-start;align-items: flex-start">
|
||||
<span style="font-size: 16px;font-weight: bold">总共点赞: {{like.length}} 个</span>
|
||||
</el-card>
|
||||
<el-empty v-show="like.length===0" description="暂无点赞" :image-size="115"></el-empty>
|
||||
<div v-show="like.length!==0" v-for="(item,index) in like" :key="index">
|
||||
<UserProjects :project="item"></UserProjects>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
@@ -59,10 +82,12 @@
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import RightTools from "@/components/Home/RightTools.vue";
|
||||
import UserProjects from "@/components/User/UserProjects.vue";
|
||||
import UserComments from "@/components/User/UserComments.vue";
|
||||
|
||||
export default {
|
||||
name: "UserInfoPage",
|
||||
components: {RightTools},
|
||||
components: {UserComments, UserProjects, RightTools},
|
||||
data(){
|
||||
return{
|
||||
activeName:'first',
|
||||
@@ -71,8 +96,9 @@ export default {
|
||||
creatTime:null,
|
||||
projectNum:0,
|
||||
userId:null,
|
||||
projectList:null,
|
||||
commentList:{},
|
||||
projectList:[],
|
||||
commentList:[],
|
||||
like:[],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -123,6 +149,7 @@ export default {
|
||||
}).then(function (res) {
|
||||
that.projectList=JSON.parse(res.data.project);
|
||||
that.commentList=JSON.parse(res.data.comment);
|
||||
that.like=JSON.parse(res.data.like)
|
||||
});
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user