feat(quality-owner): 增加开通协议与强制阅读
This commit is contained in:
@@ -19,6 +19,9 @@ const form = reactive({
|
||||
depositYuan: 200,
|
||||
insurancePercent: 8,
|
||||
premiumInsurancePercent: 4,
|
||||
agreementTitle: '',
|
||||
agreementContent: '',
|
||||
agreementReadSeconds: 15,
|
||||
description: '',
|
||||
saving: false,
|
||||
})
|
||||
@@ -32,10 +35,18 @@ watch(
|
||||
form.depositYuan = Number(parsed.deposit_amount_cent || 20000) / 100
|
||||
form.insurancePercent = Number(parsed.insurance_fee_bps || 800) / 100
|
||||
form.premiumInsurancePercent = Number(parsed.premium_insurance_fee_bps || 400) / 100
|
||||
form.agreementTitle =
|
||||
typeof parsed.agreement_title === 'string' ? parsed.agreement_title : '优质号主服务协议'
|
||||
form.agreementContent =
|
||||
typeof parsed.agreement_content === 'string' ? parsed.agreement_content : ''
|
||||
form.agreementReadSeconds = Math.max(15, Number(parsed.agreement_read_seconds || 15))
|
||||
} catch {
|
||||
form.depositYuan = 200
|
||||
form.insurancePercent = 8
|
||||
form.premiumInsurancePercent = 4
|
||||
form.agreementTitle = '优质号主服务协议'
|
||||
form.agreementContent = ''
|
||||
form.agreementReadSeconds = 15
|
||||
}
|
||||
form.description = props.config.description || ''
|
||||
},
|
||||
@@ -55,6 +66,14 @@ async function save() {
|
||||
ElMessage.warning('极品专区费率不能高于普通保险费率')
|
||||
return
|
||||
}
|
||||
if (!form.agreementTitle.trim() || !form.agreementContent.trim()) {
|
||||
ElMessage.warning('请填写优质号主协议标题和正文')
|
||||
return
|
||||
}
|
||||
if (form.agreementReadSeconds < 15 || form.agreementReadSeconds > 300) {
|
||||
ElMessage.warning('强制阅读时长必须在 15-300 秒之间')
|
||||
return
|
||||
}
|
||||
form.saving = true
|
||||
try {
|
||||
await updateSystemConfig(props.config.key, {
|
||||
@@ -62,6 +81,9 @@ async function save() {
|
||||
deposit_amount_cent: Math.round(form.depositYuan * 100),
|
||||
insurance_fee_bps: Math.round(form.insurancePercent * 100),
|
||||
premium_insurance_fee_bps: Math.round(form.premiumInsurancePercent * 100),
|
||||
agreement_title: form.agreementTitle.trim(),
|
||||
agreement_content: form.agreementContent.trim(),
|
||||
agreement_read_seconds: Math.round(form.agreementReadSeconds),
|
||||
}),
|
||||
description: form.description,
|
||||
})
|
||||
@@ -80,7 +102,8 @@ async function save() {
|
||||
<el-dialog
|
||||
:model-value="modelValue"
|
||||
title="优质号主与无忧租号保险"
|
||||
width="560px"
|
||||
width="900px"
|
||||
class="quality-owner-config-dialog"
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<el-form label-position="top">
|
||||
@@ -105,6 +128,27 @@ async function save() {
|
||||
:step="0.5"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开通协议标题">
|
||||
<el-input v-model="form.agreementTitle" placeholder="优质号主服务协议" />
|
||||
</el-form-item>
|
||||
<el-form-item label="强制阅读时长(秒)">
|
||||
<el-input-number
|
||||
v-model="form.agreementReadSeconds"
|
||||
:min="15"
|
||||
:max="300"
|
||||
:step="1"
|
||||
:precision="0"
|
||||
/>
|
||||
<span class="agreement-config-hint">最低 15 秒,用户阅读完成并勾选同意后才能继续。</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="开通协议正文">
|
||||
<el-input
|
||||
v-model="form.agreementContent"
|
||||
type="textarea"
|
||||
:rows="20"
|
||||
placeholder="支持 Markdown 标题、列表和表格"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配置说明">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" />
|
||||
</el-form-item>
|
||||
@@ -112,7 +156,7 @@ async function save() {
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
title="费率按号主实际到手租金计算,并在订单结算时扣减;历史订单保留下单时费率快照。"
|
||||
title="费率按号主实际到手租金计算,并在订单结算时扣减;历史订单保留下单时费率快照。协议正文支持 Markdown 表格。"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
||||
@@ -120,3 +164,17 @@ async function save() {
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
:global(.quality-owner-config-dialog .el-dialog__body) {
|
||||
max-height: 72vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 18px;
|
||||
}
|
||||
|
||||
.agreement-config-hint {
|
||||
margin-left: 10px;
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -660,12 +660,11 @@ function formatConfigValue(row: SystemConfig) {
|
||||
<p class="eyebrow">Premium Owner</p>
|
||||
<h2>优质号主与无忧租号保险</h2>
|
||||
<span>
|
||||
配置优质号主保证金,以及普通发布和「优质号主 + 极品专区」的无忧租号保险服务费率。
|
||||
配置优质号主保证金、开通协议,以及普通发布和「优质号主 +
|
||||
极品专区」的无忧租号保险服务费率。
|
||||
</span>
|
||||
</div>
|
||||
<el-button type="primary" @click="openEdit(qualityOwnerConfig)">
|
||||
编辑保证金与费率
|
||||
</el-button>
|
||||
<el-button type="primary" @click="openEdit(qualityOwnerConfig)"> 编辑配置 </el-button>
|
||||
</div>
|
||||
<div class="publish-stat-grid home-stat-grid">
|
||||
<div class="publish-stat">
|
||||
|
||||
Reference in New Issue
Block a user