提交 7ff278b3 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 5543cb07
......@@ -60,6 +60,7 @@ function handleSubmit() {
<section class="discuss-item">
<div class="discuss-item__left">
<div class="discuss-item__landlord" v-if="data.sso_id === landlordId"><span>楼主</span></div>
<div class="discuss-item__index"><slot name="index"></slot></div>
<div class="discuss-item__avatar">
<img :src="data.sso_user.avatar || 'https://webapp-pub.ezijing.com/website/base/images/default.jpg'" />
</div>
......@@ -147,6 +148,15 @@ function handleSubmit() {
transform: rotate(-45deg);
}
}
.discuss-item__index {
position: absolute;
right: 0;
top: 0;
font-size: 14px;
line-height: 28px;
color: #9b9b9b;
padding: 5px 10px;
}
.discuss-item__avatar {
width: 100px;
height: 100px;
......
......@@ -62,6 +62,7 @@ function handleReply(data: DiscussCommentItem) {
}
activeComment = data
formVisible = true
form.content = ''
nextTick(() => {
inputRef?.focus()
})
......@@ -87,7 +88,6 @@ function handleSubmit() {
content: form.content
}).then(() => {
formVisible = false
form.content = ''
refresh()
ElMessage({ message: '回复成功', type: 'success' })
})
......
......@@ -14,11 +14,11 @@ interface Props {
}
const props = defineProps<Props>()
const router = useRouter()
const route = useRoute()
let detail = $ref<Post>()
const appList = $ref<InstanceType<typeof AppList> | null>(null)
const params = reactive({ page: 1, limit: 10 })
// 列表配置
const listOptions = computed(() => {
return {
......@@ -26,6 +26,10 @@ const listOptions = computed(() => {
remote: {
httpRequest: getPostAndDiscussList,
params: { id: props.id },
beforeRequest(requestParams: any) {
Object.assign(params, requestParams)
return requestParams
},
callback(res: { total: number; data: any; info: any }) {
detail = res.info
return { total: res.total, list: res.data }
......@@ -76,7 +80,9 @@ function handleBack() {
</div>
<AppList v-bind="listOptions" ref="appList">
<template #body="{ data }">
<DiscussItem :landlordId="detail.sso_id" :data="item" v-for="item in data" :key="item.id"></DiscussItem>
<DiscussItem :landlordId="detail.sso_id" :data="item" v-for="(item, index) in data" :key="item.id">
<template #index>{{ (params.page - 1) * params.limit + (index + 1) }}</template>
</DiscussItem>
</template>
</AppList>
</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论