临时闭店UI修改
This commit is contained in:
@@ -86,13 +86,17 @@ export default function StatusPage() {
|
||||
{open ? '营业中' : '临时闭店'}
|
||||
</h2>
|
||||
|
||||
<label className="shop-status-switch">
|
||||
<label className={`shop-status-switch${open ? ' open' : ' closed'}`}>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={open}
|
||||
onChange={(e) => requestToggle(e.target.checked)}
|
||||
aria-label={open ? '切换为临时闭店' : '切换为营业中'}
|
||||
/>
|
||||
<span className="shop-status-switch-track" />
|
||||
<span className="shop-status-switch-caption">
|
||||
{open ? '点击可临时闭店' : '点击恢复营业'}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<p className="shop-status-hours-label">营业时间</p>
|
||||
|
||||
@@ -1745,9 +1745,24 @@
|
||||
.shop-status-switch {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.shop-status-switch-caption {
|
||||
font-family: var(--font-label);
|
||||
font-size: 12px;
|
||||
color: var(--color-subtle-gray);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.shop-status-switch.closed .shop-status-switch-caption {
|
||||
color: var(--color-on-surface-variant);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.shop-status-switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
@@ -1758,11 +1773,13 @@
|
||||
.shop-status-switch-track {
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
background: var(--color-surface-variant);
|
||||
background: var(--color-surface-container-highest);
|
||||
border: 1px solid rgba(0, 0, 0, 0.14);
|
||||
border-radius: var(--radius-full);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: background 0.2s;
|
||||
transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
|
||||
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.shop-status-switch-track::after {
|
||||
@@ -1772,18 +1789,31 @@
|
||||
left: 4px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: var(--color-card);
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
transition: transform 0.2s;
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.shop-status-switch input:not(:checked) + .shop-status-switch-track {
|
||||
background: #b5b5b5;
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.shop-status-switch input:not(:checked) + .shop-status-switch-track::after {
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
|
||||
}
|
||||
|
||||
.shop-status-switch input:checked + .shop-status-switch-track {
|
||||
background: var(--color-success-green);
|
||||
border-color: var(--color-success-green);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.shop-status-switch input:checked + .shop-status-switch-track::after {
|
||||
transform: translateX(40px);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.shop-status-hours-label {
|
||||
@@ -1825,7 +1855,7 @@
|
||||
|
||||
.shop-status-hint.closed {
|
||||
background: var(--color-surface-container);
|
||||
border: 1px solid var(--color-surface-variant);
|
||||
border: 1px solid var(--color-surface-container-highest);
|
||||
color: var(--color-on-surface);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user