feat(listing): 增加押金说明配置与悬浮提示

This commit is contained in:
yml2213
2026-11-05 11:44:49 +08:00
parent 6355ca21b0
commit 15030237c4
11 changed files with 195 additions and 7 deletions
@@ -837,6 +837,22 @@
min-width: 0;
}
.deposit-heading .deposit-heading-title {
gap: 4px;
}
.deposit-guide-trigger {
display: inline-grid;
width: 22px;
height: 22px;
padding: 0;
place-items: center;
border: 0;
background: transparent;
color: #f97316;
font-size: 17px;
}
.deposit-heading b {
color: #f04452;
font-size: 13px;
@@ -129,6 +129,16 @@ function openPublishAgreement(agreement: AgreementContent) {
agreementPopupVisible.value = true
}
function showDepositGuide() {
if (!priceConfig.value.deposit_tooltip) return
void showDialog({
title: '押金说明',
message: priceConfig.value.deposit_tooltip,
messageAlign: 'left',
confirmButtonText: '我知道了',
})
}
function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
setter(value)
}
@@ -689,7 +699,18 @@ const screenshotGuides: Record<string, string> = {
<h2 class="section-title">押金与价格</h2>
<div class="deposit-card">
<label class="deposit-heading">
<span>押金<b>*</b></span>
<span class="deposit-heading-title">
押金<b>*</b>
<button
v-if="priceConfig.deposit_tooltip"
type="button"
class="deposit-guide-trigger"
aria-label="查看押金说明"
@click.prevent.stop="showDepositGuide"
>
<van-icon name="info-o" />
</button>
</span>
<em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em>
</label>
<div class="deposit-input-wrap">
@@ -164,6 +164,44 @@
align-items: center;
}
.deposit-label-title {
display: inline-flex;
align-items: center;
gap: 3px;
}
.deposit-guide-trigger {
display: inline-grid;
width: 18px;
height: 18px;
padding: 0;
place-items: center;
border: 0;
background: transparent;
color: var(--color-orange-primary);
cursor: help;
}
.deposit-guide-trigger:hover,
.deposit-guide-trigger:focus-visible {
color: var(--color-orange-dark);
outline: none;
}
.deposit-guide-content {
max-height: min(62vh, 560px);
overflow-y: auto;
color: #3f4753;
font-size: 13px;
line-height: 1.75;
white-space: pre-wrap;
}
:global(.deposit-guide-popper.el-popover) {
max-width: min(560px, calc(100vw - 32px));
padding: 14px 16px;
}
.deposit-label em {
display: inline-flex;
align-items: center;
@@ -3,6 +3,7 @@ import {
ArrowRight,
Delete,
DocumentChecked,
InfoFilled,
Picture,
RefreshRight,
UploadFilled,
@@ -544,10 +545,26 @@ function selectDailyLoss(value: string | number) {
<PublishSection title="押金与价格" description="系统按资料自动计算售价">
<div class="compact-grid two">
<label class="input-block">
<span class="deposit-label"
>押金<b>*</b
><em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em></span
>
<span class="deposit-label">
<span class="deposit-label-title">
押金<b>*</b>
<el-popover
v-if="priceConfig.deposit_tooltip"
placement="top-start"
:width="560"
trigger="hover"
popper-class="deposit-guide-popper"
>
<template #reference>
<button type="button" class="deposit-guide-trigger" aria-label="查看押金说明">
<el-icon><InfoFilled /></el-icon>
</button>
</template>
<div class="deposit-guide-content">{{ priceConfig.deposit_tooltip }}</div>
</el-popover>
</span>
<em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em>
</span>
<div class="deposit-control">
<el-input-number
v-model="form.depositAmountYuan"