a1300399510@qq.com 提交于 2023/04/06 -19:00:02

This commit is contained in:
XiaoMo 2023-04-06 19:00:11 +08:00
parent 5c8dc0dfd1
commit 44a5ab5d81
2 changed files with 51 additions and 38 deletions

View File

@ -134,18 +134,22 @@
<template v-if="postList.list.length != 0"> <template v-if="postList.list.length != 0">
<div class="card-item shadow" v-for="(item, index) in postList.list" :key="index"> <div class="card-item shadow" v-for="(item, index) in postList.list" :key="index">
<div class="card-head flexacenter"> <div class="card-head flexacenter">
<img class="card-head-icon" <img class="card-head-icon" :src="item.avatar" />
src="https://axure-file.lanhuapp.com/md516b251fb-9cfa-46fc-a9b6-2a41a7b4dc37__3ad73406ff4bc8b138dafc6dcbf1a635.svg" />
<div class="card-head-content flex1 flexflex"> <div class="card-head-content flex1 flexflex">
<div class="card-head-name flexflex">闫旭Mike <div class="landlord flexcenter" v-if="index == 0"> <div class="card-head-name flexflex">{{ item.author }} <div class="landlord flexcenter"
v-if="index == 0">
楼主 楼主
</div> </div>
</div> </div>
<div class="card-head-time">2022-7-6 14:56</div> <div class="card-head-time">{{ $formattedDate(item.dateline) }}</div>
</div> </div>
<div class="card-head-fool">{{ index == 0 ? '楼主' : `${index}` }}</div> <div class="card-head-fool">{{ index == 0 ? '楼主' : `${index}` }}</div>
</div> </div>
<div class="card-content flex1" v-html="item.message"></div>
<template v-if="false">
<div class="card-content flex1"> <div class="card-content flex1">
<!-- 回复引用 --> <!-- 回复引用 -->
<div class="quotation flexflex" v-if="index == 1"> <div class="quotation flexflex" v-if="index == 1">
@ -188,6 +192,9 @@
之前申请永久居民参考了不少寄托的帖子和经验现在回馈给大家积攒RP 之前申请永久居民参考了不少寄托的帖子和经验现在回馈给大家积攒RP
之前申请永久居民参考了不少寄托的帖子和经验现在回馈给大家积攒RP 之前申请永久居民参考了不少寄托的帖子和经验现在回馈给大家积攒RP
</div> </div>
</template>
</div> </div>
</template> </template>
@ -254,8 +261,9 @@
</div> </div>
<!-- 分页 --> <!-- 分页 -->
<div class="paging flexcenter" v-if="postList.list.length != 0"> <div class="paging flexcenter" v-if="postList.count.length > postList.limit">
<el-pagination small background layout="prev, pager, next" :total="1000"> <el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="postList.page" :page-size="postList.limit" :total="postList.count">
</el-pagination> </el-pagination>
</div> </div>
@ -601,17 +609,18 @@ export default {
let data = res.data let data = res.data
console.log(data); console.log(data);
this.postList.list = data.list this.postList.list = data.data
this.postList.page = data.page this.postList.page = data.page
this.postList.limit = data.limit this.postList.limit = data.limit
this.postList.count = data.count this.postList.count = data.count
console.log(this.postList);
}) })
}, },
// //
postComment(message) { postComment(message) {
this.$http.post("/api/operation/reply", { this.$http.post("/api/operation/reply", {
@ -622,6 +631,10 @@ export default {
}) })
}, },
//
currentChange() {
this.getPostList()
},
// //
tapLike() { tapLike() {

View File

@ -53,7 +53,7 @@
<img class="result-empty-icon" src="@/assets/img/icon/empty.png"> <img class="result-empty-icon" src="@/assets/img/icon/empty.png">
</div> </div>
<div v-if="list.length > limit" class="paging flexcenter"> <div v-if="count > limit" class="paging flexcenter">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange" <el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="page" :page-size="limit" :total="count"> :current-page.sync="page" :page-size="limit" :total="count">
</el-pagination> </el-pagination>