修改bug

This commit is contained in:
zsh
2024-12-27 17:25:22 +08:00
parent a02c8656c6
commit 9026b27169
11 changed files with 103 additions and 55 deletions
+27 -18
View File
@@ -7,7 +7,7 @@
<!-- <img :src="comment.avatar" alt="用户昵称" class="avatar"> -->
<image-preview :src="comment.avatar" :width="25" :height="25" />
<div class="username">
<div style="margin-right: 5px;">
<div style="margin-right: 5px">
{{ comment.nickName }}
</div>
<!-- <div v-if="comment.parentId" class="reply-to"></div>
@@ -18,7 +18,7 @@
<div class="comment-content">{{ comment.content }}</div>
<div class="comment-info">
<span class="comment-time">{{ comment.createTime }}</span>
<span class="ip-address">IP: {{ comment.address?comment.address:'未知' }}</span>
<span class="ip-address">IP: {{ comment.address ? comment.address : '未知' }}</span>
</div>
</div>
<div v-if="comment.daList && comment.daList.length" class="replies">
@@ -32,10 +32,10 @@
<div class="reply-to"></div>
<span>{{ reply.replyNickName }}</span>
</div>
<div class="comment-content" style="margin-left: 10px;">{{ reply.content }}</div>
<div class="comment-info" style="margin-left: 10px;">
<div class="comment-content" style="margin-left: 10px">{{ reply.content }}</div>
<div class="comment-info" style="margin-left: 10px">
<span class="comment-time">{{ reply.createTime }}</span>
<span class="ip-address">IP: {{ reply.address?reply.address:'未知' }}</span>
<span class="ip-address">IP: {{ reply.address ? reply.address : '未知' }}</span>
</div>
</div>
</div>
@@ -43,27 +43,37 @@
</div>
</div>
</div>
<pagination v-show="total > 0" id="table_page" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getCommentList" />
<pagination
v-show="total > 0"
id="table_page"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getCommentList"
/>
</div>
</template>
<script setup lang="ts" name="commentList">
import { ref, reactive, onMounted, nextTick } from 'vue';
import {commentList } from '@/api/manage/scenic';
import { commentList } from '@/api/manage/scenic';
//导入父组件传递的值
const props = defineProps({
bizId:{
bizId: {
type: Number,
default: null,
default: null
},
type: {
type: Number,
default: null
}
});
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
bizId: null,
status: 0,
type: props.type
});
// 监听父组件传递的tagIds,当tagIds发生变化时,重新获取数据
watch(
@@ -80,7 +90,7 @@ watch(
},
{ immediate: true }
);
const total=ref(0)
const total = ref(0);
const loading = ref(false);
const commentListData = ref([]);
// 导入父组件定义的函数
@@ -90,11 +100,11 @@ const emit = defineEmits(['hideDialog']);
*/
const getCommentList = async () => {
loading.value = true;
let res=await commentList(queryParams).finally(() => (loading.value = false));
console.log('评论列表:',res);
total.value=res.total;
let res = await commentList(queryParams).finally(() => (loading.value = false));
console.log('评论列表:', res);
total.value = res.total;
commentListData.value = res.rows;
}
};
</script>
<style lang="scss" scoped>
.commentList {
@@ -147,7 +157,6 @@ const getCommentList = async () => {
}
}
.ip-address {
margin-left: 15px;
}
@@ -167,4 +176,4 @@ const getCommentList = async () => {
padding-bottom: 0px !important;
margin-bottom: 0px !important;
}
</style>
</style>