feat: 添加租后须知功能并优化发布默认设置

新增功能:
- 添加租后须知查看功能(PC端+移动端)
- 管理后台支持配置租后须知内容
- 默认提供完整的租后须知模板

功能实现:
- 后端:新增 PostRentalNotice API 接口和配置管理
- PC端:在用户下拉菜单添加租后须知入口,独立页面展示
- 移动端:在个人中心实名认证下方添加入口,弹窗展示
- 管理端:新增租后须知配置弹窗,支持编辑和恢复默认

优化改进:
- 修复发布页面默认选中"参考比例"而非"自定比例"
- 移除错误的迁移测试脚本(与 MySQL 8.0 不兼容)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
yml
2026-06-05 09:55:11 +08:00
co-authored by Claude Opus 4.7
parent 0b9b0b5ea7
commit 5d5bd5af77
15 changed files with 563 additions and 201 deletions
@@ -27,6 +27,7 @@ import SalePriceDialog from '../components/SalePriceDialog.vue'
import HomeAnnouncementsDialog from '../components/HomeAnnouncementsDialog.vue'
import HomeBannersDialog from '../components/HomeBannersDialog.vue'
import OrderAgreementsDialog from '../components/OrderAgreementsDialog.vue'
import PostRentalNoticeDialog from '../components/PostRentalNoticeDialog.vue'
import GeneralConfigDialog from '../components/GeneralConfigDialog.vue'
import AutoWelcomeConfig from '../components/AutoWelcomeConfig.vue'
@@ -51,6 +52,7 @@ const salePriceVisible = ref(false)
const announcementsVisible = ref(false)
const bannersVisible = ref(false)
const agreementsVisible = ref(false)
const postRentalNoticeVisible = ref(false)
const generalVisible = ref(false)
const publishConfig = computed(() => configs.value.find((item) => item.key === 'listing.publish_options') || null)
@@ -58,6 +60,7 @@ const salePriceConfig = computed(() => configs.value.find((item) => item.key ===
const homeAnnouncementsConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_announcements') || null)
const homeBannersConfig = computed(() => configs.value.find((item) => item.key === 'mobile.home_banners') || null)
const orderAgreementsConfig = computed(() => configs.value.find((item) => item.key === 'order.agreements') || null)
const postRentalNoticeConfig = computed(() => configs.value.find((item) => item.key === 'profile.post_rental_notice') || null)
const regularConfigs = computed(() =>
configs.value.filter(
@@ -66,7 +69,8 @@ const regularConfigs = computed(() =>
item.key !== 'listing.sale_price_config' &&
item.key !== 'mobile.home_announcements' &&
item.key !== 'mobile.home_banners' &&
item.key !== 'order.agreements',
item.key !== 'order.agreements' &&
item.key !== 'profile.post_rental_notice',
),
)
@@ -136,6 +140,8 @@ function openEdit(row: SystemConfig) {
bannersVisible.value = true
} else if (row.key === 'order.agreements') {
agreementsVisible.value = true
} else if (row.key === 'profile.post_rental_notice') {
postRentalNoticeVisible.value = true
} else {
generalVisible.value = true
}
@@ -356,6 +362,39 @@ function formatConfigValue(row: SystemConfig) {
</div>
</section>
<section v-if="postRentalNoticeConfig" class="publish-config-panel">
<div class="publish-config-main">
<div>
<p class="eyebrow">Post Rental Notice</p>
<h2>租后须知配置</h2>
<span>管理移动端个人中心展示的租后须知内容用户在实名认证下方可查看</span>
</div>
<el-button type="primary" @click="openEdit(postRentalNoticeConfig)">编辑租后须知</el-button>
</div>
<div class="publish-stat-grid home-stat-grid">
<div class="publish-stat">
<strong>1</strong>
<span>须知文档</span>
</div>
<div class="publish-stat">
<strong>移动端</strong>
<span>个人中心展示</span>
</div>
<div class="publish-stat">
<strong>实名认证</strong>
<span>下方位置</span>
</div>
<div class="publish-stat">
<strong>接口</strong>
<span>/api/post-rental-notice</span>
</div>
<div class="publish-stat">
<strong>更新</strong>
<span>{{ formatHomeConfigStatus(postRentalNoticeConfig, '未初始化') }}</span>
</div>
</div>
</section>
<AutoWelcomeConfig />
<el-table v-loading="loading" class="table-panel" :data="regularConfigs">
@@ -414,6 +453,13 @@ function formatConfigValue(row: SystemConfig) {
@saved="loadConfigs"
/>
<PostRentalNoticeDialog
v-if="postRentalNoticeConfig"
v-model="postRentalNoticeVisible"
:config="postRentalNoticeConfig"
@saved="loadConfigs"
/>
<GeneralConfigDialog
v-if="currentEditingConfig"
v-model="generalVisible"