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

chore: update

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