refactor: 优化跨标签会话同步、引入强类型安全JSON解析工具及Seller样式重构

This commit is contained in:
yml
2026-05-25 02:31:14 +08:00
parent 65dae78532
commit bc04b43db6
8 changed files with 387 additions and 371 deletions
+7
View File
@@ -21,4 +21,11 @@ window.addEventListener("auth-storage-changed", () => {
useAdminSessionStore(pinia).syncFromStorage(); useAdminSessionStore(pinia).syncFromStorage();
}); });
window.addEventListener("storage", (event) => {
if (event.storageArea === localStorage) {
useSessionStore(pinia).syncFromStorage();
useAdminSessionStore(pinia).syncFromStorage();
}
});
router.isReady().then(() => app.mount("#app")); router.isReady().then(() => app.mount("#app"));
+8
View File
@@ -0,0 +1,8 @@
export function safeParseJSON<T>(raw: string, fallback: T): T {
if (!raw || !raw.trim()) return fallback
try {
return JSON.parse(raw) as T
} catch {
return fallback
}
}
@@ -17,6 +17,7 @@ import {
} from '@/api/homeConfig' } from '@/api/homeConfig'
import { fetchSystemConfigs, type SystemConfig } from '@/api/systemConfigs' import { fetchSystemConfigs, type SystemConfig } from '@/api/systemConfigs'
import { formatDateTime } from '@/utils/time' import { formatDateTime } from '@/utils/time'
import { safeParseJSON } from '@/utils/json'
// 导入重构后的 Dialog 子组件 // 导入重构后的 Dialog 子组件
import PublishOptionsDialog from './components/PublishOptionsDialog.vue' import PublishOptionsDialog from './components/PublishOptionsDialog.vue'
@@ -76,8 +77,8 @@ const salePriceStats = computed(() => {
}) })
const homeStats = computed(() => { const homeStats = computed(() => {
const announcements = parseHomeAnnouncements(homeAnnouncementsConfig.value?.value || '', false) const announcements = parseHomeAnnouncements(homeAnnouncementsConfig.value?.value || '')
const banners = parseHomeBanners(homeBannersConfig.value?.value || '', false) const banners = parseHomeBanners(homeBannersConfig.value?.value || '')
return { return {
announcementCount: announcements.length, announcementCount: announcements.length,
bannerCount: banners.length, bannerCount: banners.length,
@@ -111,39 +112,23 @@ function openEdit(row: SystemConfig) {
} }
function safeParsePublishOptions(raw: string) { function safeParsePublishOptions(raw: string) {
try { const parsed = safeParseJSON(raw, emptyListingPublishOptions)
const parsed = raw.trim() ? JSON.parse(raw) : emptyListingPublishOptions return cloneOptions(mergeListingPublishOptions(parsed))
return cloneOptions(mergeListingPublishOptions(parsed))
} catch {
return cloneOptions(emptyListingPublishOptions)
}
} }
function safeParseSalePriceConfig(raw: string) { function safeParseSalePriceConfig(raw: string) {
try { const parsed = safeParseJSON(raw, emptyListingSalePriceConfig)
const parsed = raw.trim() ? JSON.parse(raw) : emptyListingSalePriceConfig return cloneSalePriceConfig(mergeListingSalePriceConfig(parsed))
return cloneSalePriceConfig(mergeListingSalePriceConfig(parsed))
} catch {
return cloneSalePriceConfig(emptyListingSalePriceConfig)
}
} }
function parseHomeAnnouncements(raw: string, showWarning = false) { function parseHomeAnnouncements(raw: string) {
try { const parsed = safeParseJSON(raw, defaultHomeAnnouncements)
const parsed = raw.trim() ? JSON.parse(raw) : defaultHomeAnnouncements return mergeHomeConfig({ announcements: Array.isArray(parsed) ? parsed : [] }).announcements
return mergeHomeConfig({ announcements: Array.isArray(parsed) ? parsed : [] }).announcements
} catch {
return [...defaultHomeAnnouncements]
}
} }
function parseHomeBanners(raw: string, showWarning = false) { function parseHomeBanners(raw: string) {
try { const parsed = safeParseJSON(raw, defaultHomeBanners)
const parsed = raw.trim() ? JSON.parse(raw) : defaultHomeBanners return cloneHomeBanners(mergeHomeConfig({ banners: Array.isArray(parsed) ? parsed : [] }).banners)
return cloneHomeBanners(mergeHomeConfig({ banners: Array.isArray(parsed) ? parsed : [] }).banners)
} catch {
return cloneHomeBanners(defaultHomeBanners)
}
} }
function cloneOptions(options: ListingPublishOptions) { function cloneOptions(options: ListingPublishOptions) {
@@ -4,6 +4,7 @@ import { ref, watch } from 'vue'
import { defaultHomeAnnouncements, mergeHomeConfig } from '@/api/homeConfig' import { defaultHomeAnnouncements, mergeHomeConfig } from '@/api/homeConfig'
import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs' import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs'
import { safeParseJSON } from '@/utils/json'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@@ -31,12 +32,8 @@ watch(
) )
function parseHomeAnnouncements(raw: string) { function parseHomeAnnouncements(raw: string) {
try { const parsed = safeParseJSON(raw, defaultHomeAnnouncements)
const parsed = raw.trim() ? JSON.parse(raw) : defaultHomeAnnouncements return mergeHomeConfig({ announcements: Array.isArray(parsed) ? parsed : [] }).announcements
return mergeHomeConfig({ announcements: Array.isArray(parsed) ? parsed : [] }).announcements
} catch {
return [...defaultHomeAnnouncements]
}
} }
function linesToItems(value: string) { function linesToItems(value: string) {
@@ -5,6 +5,7 @@ import { ref, watch } from 'vue'
import { uploadAdminFile } from '@/api/files' import { uploadAdminFile } from '@/api/files'
import { defaultHomeBanners, mergeHomeConfig, type HomeBannerSlide } from '@/api/homeConfig' import { defaultHomeBanners, mergeHomeConfig, type HomeBannerSlide } from '@/api/homeConfig'
import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs' import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs'
import { safeParseJSON } from '@/utils/json'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@@ -33,12 +34,8 @@ watch(
) )
function parseHomeBanners(raw: string) { function parseHomeBanners(raw: string) {
try { const parsed = safeParseJSON(raw, defaultHomeBanners)
const parsed = raw.trim() ? JSON.parse(raw) : defaultHomeBanners return cloneHomeBanners(mergeHomeConfig({ banners: Array.isArray(parsed) ? parsed : [] }).banners)
return cloneHomeBanners(mergeHomeConfig({ banners: Array.isArray(parsed) ? parsed : [] }).banners)
} catch {
return cloneHomeBanners(defaultHomeBanners)
}
} }
function cloneHomeBanners(banners: HomeBannerSlide[]) { function cloneHomeBanners(banners: HomeBannerSlide[]) {
@@ -8,6 +8,7 @@ import {
type ListingPublishOptions, type ListingPublishOptions,
} from '@/api/listingOptions' } from '@/api/listingOptions'
import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs' import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs'
import { safeParseJSON } from '@/utils/json'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@@ -35,13 +36,8 @@ watch(
) )
function parsePublishOptions(raw: string) { function parsePublishOptions(raw: string) {
try { const parsed = safeParseJSON(raw, emptyListingPublishOptions)
const parsed = raw.trim() ? JSON.parse(raw) : emptyListingPublishOptions return cloneOptions(mergeListingPublishOptions(parsed))
return cloneOptions(mergeListingPublishOptions(parsed))
} catch {
ElMessage.warning('发布选项 JSON 解析失败,已清空草稿')
return cloneOptions(emptyListingPublishOptions)
}
} }
function cloneOptions(options: ListingPublishOptions) { function cloneOptions(options: ListingPublishOptions) {
@@ -8,6 +8,7 @@ import {
type PublishSalePriceConfig, type PublishSalePriceConfig,
} from '@/api/listingOptions' } from '@/api/listingOptions'
import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs' import { updateSystemConfig, type SystemConfig } from '@/api/systemConfigs'
import { safeParseJSON } from '@/utils/json'
const props = defineProps<{ const props = defineProps<{
modelValue: boolean modelValue: boolean
@@ -35,13 +36,8 @@ watch(
) )
function parseSalePriceConfig(raw: string) { function parseSalePriceConfig(raw: string) {
try { const parsed = safeParseJSON(raw, emptyListingSalePriceConfig)
const parsed = raw.trim() ? JSON.parse(raw) : emptyListingSalePriceConfig return cloneSalePriceConfig(mergeListingSalePriceConfig(parsed))
return cloneSalePriceConfig(mergeListingSalePriceConfig(parsed))
} catch {
ElMessage.warning('出售定价规则 JSON 解析失败,已清空草稿')
return cloneSalePriceConfig(emptyListingSalePriceConfig)
}
} }
function cloneSalePriceConfig(config: PublishSalePriceConfig) { function cloneSalePriceConfig(config: PublishSalePriceConfig) {
@@ -1,6 +1,18 @@
/* 设计系统变量定义 */
.publish-page { .publish-page {
--color-bg-gray: #f7f9fc;
--color-bg-orange: #fff7f0;
--color-orange-primary: #ff6a00;
--color-orange-dark: #e65f00;
--color-text-main: #303743;
--color-text-sub: #7f8895;
--color-text-dark: #20242a;
--color-border: #dfe5ee;
--color-danger: #f04438;
--radius-8: 8px;
min-width: 0; min-width: 0;
color: #20242a; color: var(--color-text-dark);
} }
.publish-layout { .publish-layout {
@@ -10,6 +22,11 @@
gap: 18px; gap: 18px;
max-width: 1238px; max-width: 1238px;
margin: 0 auto; margin: 0 auto;
@media (max-width: 1180px) {
grid-template-columns: 1fr;
max-width: 920px;
}
} }
.form-column { .form-column {
@@ -18,9 +35,29 @@
gap: 18px; gap: 18px;
} }
/* 统合的灰色圆角面板基础类 */
.panel-field-row,
.panel-input-grid,
.level-row,
.login-method-row,
.quantity-item,
.skin-group,
.region-panel,
.ratio-panel,
.time-preset-row,
.price-cell {
padding: 12px;
border-radius: var(--radius-8);
background: var(--color-bg-gray);
}
.panel-input-grid {
align-items: end;
}
.summary-panel { .summary-panel {
border: 1px solid #e6ebf2; border: 1px solid #e6ebf2;
border-radius: 8px; border-radius: var(--radius-8);
background: #fff; background: #fff;
box-shadow: 0 12px 34px rgba(20, 34, 56, 0.05); box-shadow: 0 12px 34px rgba(20, 34, 56, 0.05);
} }
@@ -31,34 +68,24 @@
gap: 14px; gap: 14px;
align-items: center; align-items: center;
margin-top: 12px; margin-top: 12px;
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
& > label {
color: var(--color-text-main);
font-size: 13px;
font-weight: 800;
line-height: 22px;
}
& label span {
color: var(--color-danger);
}
} }
.panel-field-row, /* 按钮共用样式 */
.panel-input-grid {
padding: 12px;
border-radius: 8px;
background: #f7f9fc;
}
.panel-input-grid {
align-items: end;
}
.field-row > label,
.input-block > span {
color: #303743;
font-size: 13px;
font-weight: 800;
line-height: 22px;
}
.field-row label span,
.input-block b,
.level-row strong span,
.upload-copy strong span {
color: #f04438;
}
.level-btn, .level-btn,
.region-btn, .region-btn,
.mode-toggle button, .mode-toggle button,
@@ -68,14 +95,28 @@
color: #596474; color: #596474;
font-weight: 800; font-weight: 800;
cursor: pointer; cursor: pointer;
transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease; transition: all 0.16s ease;
} }
.level-btn.active, .level-btn,
.region-btn.active { .region-btn {
border-color: #1477ff; &.active {
background: #1477ff; border-color: #1477ff;
color: #fff; background: #1477ff;
color: #fff;
}
}
.level-btn {
height: 30px;
min-width: 0;
border-radius: 15px;
}
.region-btn {
height: 32px;
min-width: 0;
border-radius: 16px;
} }
.compact-grid { .compact-grid {
@@ -83,28 +124,43 @@
grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px; gap: 16px;
margin-top: 16px; margin-top: 16px;
}
.compact-grid.two { &.two {
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
} }
.input-block { .input-block {
display: grid; display: grid;
min-width: 0; min-width: 0;
gap: 8px; gap: 8px;
}
.input-block :deep(.el-input-number), & > span {
.input-block :deep(.el-input), color: var(--color-text-main);
.input-block :deep(.el-date-editor) { font-size: 13px;
width: 100%; font-weight: 800;
} line-height: 22px;
}
.input-block :deep(.el-input__wrapper), & b {
.input-block :deep(.el-textarea__inner) { color: var(--color-danger);
border-radius: 8px; }
box-shadow: 0 0 0 1px #dfe5ee inset;
:deep(.el-input-number),
:deep(.el-input),
:deep(.el-date-editor) {
width: 100%;
}
:deep(.el-input__wrapper),
:deep(.el-textarea__inner) {
border-radius: var(--radius-8);
box-shadow: 0 0 0 1px var(--color-border) inset;
}
} }
.level-panel { .level-panel {
@@ -114,17 +170,18 @@
} }
.level-row { .level-row {
display: grid;
grid-template-columns: 72px minmax(0, 1fr); grid-template-columns: 72px minmax(0, 1fr);
gap: 12px; gap: 12px;
align-items: center; align-items: center;
padding: 10px 12px; padding: 10px 12px;
border-radius: 8px;
background: #f7f9fc;
}
.level-row strong { & strong {
font-size: 13px; font-size: 13px;
& span {
color: var(--color-danger);
}
}
} }
.level-options { .level-options {
@@ -133,28 +190,22 @@
gap: 9px; gap: 9px;
} }
.level-btn {
height: 30px;
min-width: 0;
border-radius: 15px;
}
.field-hint { .field-hint {
grid-column: 2; grid-column: 2;
margin: 0; margin: 0;
color: #7f8895; color: var(--color-text-sub);
font-size: 12px; font-size: 12px;
line-height: 1.55; line-height: 1.55;
@media (max-width: 860px) {
grid-column: auto;
}
} }
.login-method-row { .login-method-row {
padding: 12px; & .field-hint {
border-radius: 8px; margin-top: -2px;
background: #f7f9fc; }
}
.login-method-row .field-hint {
margin-top: -2px;
} }
.quantity-table { .quantity-table {
@@ -168,6 +219,10 @@
grid-template-columns: minmax(160px, 1fr) 90px 112px 112px 92px; grid-template-columns: minmax(160px, 1fr) 90px 112px 112px 92px;
gap: 12px; gap: 12px;
align-items: center; align-items: center;
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
} }
.quantity-header { .quantity-header {
@@ -176,50 +231,50 @@
color: #7b8492; color: #7b8492;
font-size: 12px; font-size: 12px;
font-weight: 800; font-weight: 800;
@media (max-width: 860px) {
display: none;
}
} }
.quantity-item { .quantity-item {
min-height: 58px; min-height: 58px;
padding: 12px;
border-radius: 8px; &.disabled {
background: #f7f9fc; opacity: 0.62;
}
:deep(.el-input-number) {
width: 100%;
min-width: 0;
}
} }
.quantity-meta { .quantity-meta {
display: grid; display: grid;
min-width: 0; min-width: 0;
gap: 4px; gap: 4px;
}
.quantity-meta strong { & strong {
overflow: hidden; overflow: hidden;
font-size: 13px; font-size: 13px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.quantity-meta small, & small {
.quantity-price, color: var(--color-text-sub);
.quantity-status, font-size: 12px;
.upload-copy small, font-weight: 700;
.region-title span { }
color: #7f8895;
font-size: 12px;
font-weight: 700;
} }
.quantity-price, .quantity-price,
.quantity-status { .quantity-status {
white-space: nowrap; white-space: nowrap;
} color: var(--color-text-sub);
font-size: 12px;
.quantity-item.disabled { font-weight: 700;
opacity: 0.62;
}
.quantity-item :deep(.el-input-number) {
width: 100%;
min-width: 0;
} }
.mode-toggle { .mode-toggle {
@@ -227,24 +282,24 @@
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 6px; gap: 6px;
min-width: 0; min-width: 0;
}
.mode-toggle button { & button {
height: 30px; height: 30px;
min-width: 0; min-width: 0;
border-radius: 8px; border-radius: var(--radius-8);
font-size: 12px; font-size: 12px;
white-space: nowrap; white-space: nowrap;
}
.mode-toggle button:disabled { &:disabled {
cursor: not-allowed; cursor: not-allowed;
} }
.mode-toggle button.active { &.active {
border-color: #ff6a00; border-color: var(--color-orange-primary);
background: #fff3ea; background: #fff3ea;
color: #e65f00; color: var(--color-orange-dark);
}
}
} }
.recommend-button { .recommend-button {
@@ -252,9 +307,9 @@
height: 32px; height: 32px;
padding: 0 12px; padding: 0 12px;
border: 1px solid #ffba86; border: 1px solid #ffba86;
border-radius: 8px; border-radius: var(--radius-8);
background: #fff7f0; background: var(--color-bg-orange);
color: #e65f00; color: var(--color-orange-dark);
font-size: 12px; font-size: 12px;
font-weight: 800; font-weight: 800;
cursor: pointer; cursor: pointer;
@@ -265,22 +320,26 @@
grid-template-columns: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr) auto;
gap: 8px; gap: 8px;
align-items: center; align-items: center;
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
} }
.deposit-breakdown { .deposit-breakdown {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 6px; gap: 6px;
}
.deposit-breakdown span { & span {
min-height: 24px; min-height: 24px;
padding: 4px 8px; padding: 4px 8px;
border-radius: 12px; border-radius: 12px;
background: #fff7f0; background: var(--color-bg-orange);
color: #e65f00; color: var(--color-orange-dark);
font-size: 12px; font-size: 12px;
font-weight: 800; font-weight: 800;
}
} }
.skin-groups { .skin-groups {
@@ -288,14 +347,8 @@
gap: 10px; gap: 10px;
} }
.skin-group, .skin-group {
.region-panel, border: none;
.ratio-panel {
display: grid;
gap: 10px;
padding: 12px;
border-radius: 8px;
background: #f7f9fc;
} }
.skin-title, .skin-title,
@@ -305,10 +358,12 @@
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: 12px;
font-size: 13px; font-size: 13px;
}
.skin-group { & span {
border: none; color: var(--color-text-sub);
font-size: 12px;
font-weight: 700;
}
} }
.skin-title { .skin-title {
@@ -327,16 +382,17 @@
grid-template-columns: 88px minmax(0, 1fr); grid-template-columns: 88px minmax(0, 1fr);
gap: 12px; gap: 12px;
align-items: start; align-items: start;
padding: 12px;
border-radius: 8px;
background: #f7f9fc;
}
.time-preset-row strong { @media (max-width: 860px) {
color: #303743; grid-template-columns: 1fr;
font-size: 13px; }
font-weight: 800;
line-height: 32px; & strong {
color: var(--color-text-main);
font-size: 13px;
font-weight: 800;
line-height: 32px;
}
} }
.time-preset-content { .time-preset-content {
@@ -347,11 +403,15 @@
.time-input { .time-input {
width: 118px; width: 118px;
}
.time-input :deep(.el-input__wrapper) { @media (max-width: 860px) {
border-radius: 8px; width: 140px;
box-shadow: 0 0 0 1px #dfe5ee inset; }
& :deep(.el-input__wrapper) {
border-radius: var(--radius-8);
box-shadow: 0 0 0 1px var(--color-border) inset;
}
} }
.login-region-panel { .login-region-panel {
@@ -362,18 +422,20 @@
display: grid; display: grid;
grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-columns: repeat(8, minmax(0, 1fr));
gap: 8px; gap: 8px;
}
.region-btn { @media (max-width: 860px) {
height: 32px; grid-template-columns: repeat(4, minmax(0, 1fr));
min-width: 0; }
border-radius: 16px;
} }
.upload-grid { .upload-grid {
display: grid; display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px; gap: 12px;
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
} }
.upload-item { .upload-item {
@@ -382,32 +444,44 @@
gap: 12px; gap: 12px;
align-items: center; align-items: center;
min-height: 112px; min-height: 112px;
padding: 12px; border: 1px solid var(--color-border-light);
border: 1px solid #e6ebf2;
border-radius: 8px; @media (max-width: 860px) {
background: #f8fafc; grid-template-columns: 1fr;
}
} }
.upload-copy { .upload-copy {
display: grid; display: grid;
min-width: 0; min-width: 0;
gap: 6px; gap: 6px;
}
.upload-copy strong { & strong {
color: #232a35; color: #232a35;
font-size: 14px; font-size: 14px;
}
.upload-copy small { & span {
line-height: 1.45; color: var(--color-danger);
}
}
& small {
color: var(--color-text-sub);
font-size: 12px;
font-weight: 700;
line-height: 1.45;
}
} }
.upload-add, .upload-add,
.upload-preview { .upload-preview {
width: 96px; width: 96px;
height: 88px; height: 88px;
border-radius: 8px; border-radius: var(--radius-8);
@media (max-width: 860px) {
width: 100%;
}
} }
.upload-add { .upload-add {
@@ -419,38 +493,38 @@
font-size: 12px; font-size: 12px;
font-weight: 800; font-weight: 800;
cursor: pointer; cursor: pointer;
}
.upload-add:disabled { &:disabled {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.58; opacity: 0.58;
}
} }
.upload-preview { .upload-preview {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background: #e8edf4; background: #e8edf4;
}
.upload-preview img { & img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
.upload-preview button { & button {
position: absolute; position: absolute;
right: 6px; right: 6px;
bottom: 6px; bottom: 6px;
display: grid; display: grid;
width: 28px; width: 28px;
height: 28px; height: 28px;
place-items: center; place-items: center;
border: none; border: none;
border-radius: 8px; border-radius: var(--radius-8);
background: rgba(17, 24, 39, 0.72); background: rgba(17, 24, 39, 0.72);
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
}
} }
.hidden-file { .hidden-file {
@@ -459,6 +533,13 @@
.ratio-panel { .ratio-panel {
margin-top: 14px; margin-top: 14px;
& p {
margin: 0;
color: var(--color-text-sub);
font-size: 12px;
line-height: 1.5;
}
} }
.ratio-reference { .ratio-reference {
@@ -467,32 +548,20 @@
justify-content: space-between; justify-content: space-between;
min-height: 52px; min-height: 52px;
padding: 12px; padding: 12px;
border-radius: 8px; border-radius: var(--radius-8);
background: #fff; background: #fff;
}
.ratio-reference span { & span {
color: #303743; color: var(--color-text-main);
font-size: 13px; font-size: 13px;
font-weight: 800; font-weight: 800;
} }
.ratio-reference strong, & strong {
.price-cell strong, color: var(--color-orange-primary);
.summary-main strong { font-weight: 900;
color: #ff6a00; font-size: 22px;
font-weight: 900; }
}
.ratio-reference strong {
font-size: 22px;
}
.ratio-panel p {
margin: 0;
color: #7f8895;
font-size: 12px;
line-height: 1.5;
} }
.ratio-mode-grid, .ratio-mode-grid,
@@ -500,6 +569,10 @@
display: grid; display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px; gap: 10px;
@media (max-width: 860px) {
grid-template-columns: 1fr;
}
} }
.ratio-mode-btn { .ratio-mode-btn {
@@ -507,24 +580,23 @@
gap: 6px; gap: 6px;
min-height: 72px; min-height: 72px;
padding: 12px; padding: 12px;
border-radius: 8px;
text-align: left; text-align: left;
}
.ratio-mode-btn span { & span {
color: #7f8895; color: var(--color-text-sub);
font-size: 12px; font-size: 12px;
} }
.ratio-mode-btn.active { &.active {
border-color: #ff6a00; border-color: var(--color-orange-primary);
background: #fff7f0; background: var(--color-bg-orange);
color: #ff6a00; color: var(--color-orange-primary);
} }
.ratio-mode-btn:disabled { &:disabled {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.58; opacity: 0.58;
}
} }
.price-grid { .price-grid {
@@ -537,23 +609,23 @@
gap: 6px; gap: 6px;
min-height: 82px; min-height: 82px;
padding: 14px; padding: 14px;
border-radius: 8px;
background: #f7f9fc;
}
.price-cell span { & span {
color: #6f7a89; color: #6f7a89;
font-size: 12px; font-size: 12px;
font-weight: 800; font-weight: 800;
} }
.price-cell strong { & strong {
overflow-wrap: anywhere; overflow-wrap: anywhere;
font-size: 21px; color: var(--color-orange-primary);
} font-weight: 900;
font-size: 21px;
}
.price-cell.accent { &.accent {
background: #fff7f0; background: var(--color-bg-orange);
}
} }
.remark { .remark {
@@ -566,6 +638,10 @@
top: 76px; top: 76px;
align-self: start; align-self: start;
height: fit-content; height: fit-content;
@media (max-width: 1180px) {
display: none;
}
} }
.summary-panel { .summary-panel {
@@ -576,102 +652,56 @@
display: grid; display: grid;
gap: 8px; gap: 8px;
padding: 16px; padding: 16px;
border-radius: 8px; border-radius: var(--radius-8);
background: #fff7f0; background: var(--color-bg-orange);
}
.summary-main span, & span {
.summary-list span { color: #6f7a89;
color: #6f7a89; font-size: 12px;
font-size: 12px; font-weight: 800;
font-weight: 800; }
}
.summary-main strong { & strong {
font-size: 34px; color: var(--color-orange-primary);
line-height: 1; font-weight: 900;
font-size: 34px;
line-height: 1;
}
} }
.summary-list { .summary-list {
display: grid; display: grid;
gap: 10px; gap: 10px;
margin: 14px 0; margin: 14px 0;
}
.summary-list div { & span {
display: flex; color: #6f7a89;
justify-content: space-between; font-size: 12px;
gap: 12px; font-weight: 800;
padding-bottom: 10px; }
border-bottom: 1px solid #eef2f6;
}
.summary-list strong { & div {
color: #20242a; display: flex;
font-size: 13px; justify-content: space-between;
text-align: right; gap: 12px;
overflow-wrap: anywhere; padding-bottom: 10px;
border-bottom: 1px solid #eef2f6;
}
& strong {
color: var(--color-text-dark);
font-size: 13px;
text-align: right;
overflow-wrap: anywhere;
}
} }
.summary-actions { .summary-actions {
display: grid; display: grid;
gap: 10px; gap: 10px;
}
.summary-actions :deep(.el-button) { & :deep(.el-button) {
width: 100%;
margin-left: 0;
}
@media (max-width: 1180px) {
.publish-layout {
grid-template-columns: 1fr;
max-width: 920px;
}
.summary-column {
display: none;
}
}
@media (max-width: 860px) {
.field-row,
.compact-grid,
.compact-grid.two,
.upload-grid,
.price-grid {
grid-template-columns: 1fr;
}
.quantity-header {
display: none;
}
.field-hint {
grid-column: auto;
}
.quantity-item,
.upload-item {
grid-template-columns: 1fr;
}
.deposit-control,
.ratio-mode-grid,
.time-preset-row {
grid-template-columns: 1fr;
}
.time-input {
width: 140px;
}
.upload-add,
.upload-preview {
width: 100%; width: 100%;
} margin-left: 0;
.region-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
} }
} }