优化发布截图上传与押金提示

This commit is contained in:
yml2213
2026-06-07 21:40:36 +08:00
parent eebd2d3b04
commit a8b3d3813b
16 changed files with 308 additions and 53 deletions
@@ -23,7 +23,6 @@ const {
form,
quantityValues,
quantityModes,
screenshotFiles,
selectedSkins,
uploadedScreenshotCount,
requiredScreenshotCount,
@@ -63,7 +62,12 @@ const {
triggerUpload,
handleScreenshotUpload,
removeScreenshot,
getScreenshotURLs,
getScreenshotCount,
getScreenshotPreviewURL,
isMultiScreenshotSlot,
canAddScreenshot,
getScreenshotLimitHint,
handleFireLevelInput,
handleAcceleratedSaleRatioInput,
useRecommendedDeposit,
@@ -359,17 +363,24 @@ function selectOnlineEnd(value: string | number) {
</div>
</PublishSection>
<PublishSection title="截图材料" :description="`${uploadedScreenshotCount}/${screenshotSlots.length} 已上传`">
<PublishSection title="截图材料" :description="`${uploadedScreenshotCount}/${screenshotSlots.length} 已上传`">
<div class="upload-grid">
<div v-for="slot in screenshotSlots" :key="slot.key" class="upload-item">
<div class="upload-copy">
<strong>{{ slot.label }}<span v-if="isScreenshotRequired(slot)">*</span></strong>
<small>{{ slot.hint }}</small>
<em v-if="getScreenshotLimitHint(slot.key)">{{ getScreenshotLimitHint(slot.key) }}</em>
</div>
<div v-if="screenshotFiles[slot.key]" class="upload-preview">
<img :src="getScreenshotPreviewURL(slot.key)" :alt="slot.label" />
<button type="button" @click="removeScreenshot(slot.key)">
<el-icon><Delete /></el-icon>
<div v-if="getScreenshotCount(slot.key)" class="upload-preview-list">
<div v-for="(url, index) in getScreenshotURLs(slot.key)" :key="`${slot.key}-${url}`" class="upload-preview">
<img :src="getScreenshotPreviewURL(slot.key, index)" :alt="`${slot.label}${index + 1}`" />
<button type="button" @click="removeScreenshot(slot.key, index)">
<el-icon><Delete /></el-icon>
</button>
</div>
<button v-if="canAddScreenshot(slot.key)" type="button" class="upload-add" :disabled="uploading" @click="triggerUpload(slot.key)">
<el-icon><Picture /></el-icon>
<span>{{ uploading && activeUploadKey === slot.key ? '上传中' : '继续上传' }}</span>
</button>
</div>
<button v-else type="button" class="upload-add" :disabled="uploading" @click="triggerUpload(slot.key)">
@@ -382,6 +393,7 @@ function selectOnlineEnd(value: string | number) {
ref="fileInput"
type="file"
accept="image/jpeg,image/png,image/webp"
:multiple="isMultiScreenshotSlot(activeUploadKey)"
class="hidden-file"
@change="handleScreenshotUpload"
/>
@@ -390,7 +402,7 @@ function selectOnlineEnd(value: string | number) {
<PublishSection title="押金与价格" description="系统按资料自动计算售价">
<div class="compact-grid two">
<label class="input-block">
<span>押金<b>*</b></span>
<span class="deposit-label">押金<b>*</b><em v-if="priceConfig.deposit_hint">{{ priceConfig.deposit_hint }}</em></span>
<div class="deposit-control">
<el-input-number
v-model="form.deposit_amount"