feat: v3.4.18 门店体验与登录态优化

- mini-user 门店座机电话中间四位脱敏(保留区号与前后位)
- mini-user 套餐详情图增加 1/N 计数与自动轮播
- h5-partner 账号暂停(DISABLED)禁止登录并提示客服
- h5-shop 提现/筛选栏左右留白与页面一致
- h5-shop 休息中核销改为弹「是否开启营业」并支持开张后继续

Co-Authored-By: WorkBuddy <workbuddy@tencent.com>
This commit is contained in:
2026-08-17 21:34:40 +08:00
parent c0ce494732
commit cc750dc1d6
10 changed files with 351 additions and 31 deletions
+63 -11
View File
@@ -20,6 +20,8 @@ export default function PhoneRedeemPage() {
const [msg, setMsg] = useState('');
const [loading, setLoading] = useState(false);
const [confirmCooldown, setConfirmCooldown] = useState(0);
const [showOpenModal, setShowOpenModal] = useState(false);
const [opening, setOpening] = useState(false);
useEffect(() => {
request<Record<string, unknown>>('SHOP_H5', '/shop/store')
@@ -36,15 +38,7 @@ export default function PhoneRedeemPage() {
return () => window.clearTimeout(timer);
}, [confirmCooldown]);
async function sendConfirmSms() {
if (!/^1\d{10}$/.test(phone.trim())) {
setMsg('请输入正确的手机号');
return;
}
if (storeClosed) {
setMsg('门店未营业,无法核销');
return;
}
async function prepareDirectRedeem() {
const value = Number(amount);
if (!Number.isFinite(value) || value <= 0) {
setMsg('请输入有效核销金额');
@@ -69,6 +63,37 @@ export default function PhoneRedeemPage() {
}
}
async function sendConfirmSms() {
if (!/^1\d{10}$/.test(phone.trim())) {
setMsg('请输入正确的手机号');
return;
}
if (storeClosed) {
setShowOpenModal(true);
return;
}
await prepareDirectRedeem();
}
async function openStoreAndContinue() {
if (opening) return;
setOpening(true);
try {
await request('SHOP_H5', '/shop/store/status', {
method: 'PUT',
body: JSON.stringify({ status: 'OPEN' }),
});
setStoreClosed(false);
setShowOpenModal(false);
await prepareDirectRedeem();
} catch (e) {
setShowOpenModal(false);
setMsg(e instanceof Error ? e.message : '开启营业失败');
} finally {
setOpening(false);
}
}
async function confirmRedeem() {
if (!prepared) {
setMsg('请先发送核销验证码');
@@ -114,7 +139,7 @@ export default function PhoneRedeemPage() {
<main className="shop-redeem-main">
{storeClosed && (
<p className="shop-redeem-error" style={{ marginBottom: 12 }}></p>
<p className="shop-redeem-error" style={{ marginBottom: 12 }}></p>
)}
<section className="shop-redeem-card">
@@ -181,7 +206,7 @@ export default function PhoneRedeemPage() {
<button
type="button"
className="shop-phone-code-btn"
disabled={loading || confirmCooldown > 0 || storeClosed || !canSendCode}
disabled={loading || confirmCooldown > 0 || !canSendCode}
onClick={() => void sendConfirmSms()}
>
{confirmCooldown > 0 ? `${confirmCooldown}s` : '发送验证码'}
@@ -205,6 +230,33 @@ export default function PhoneRedeemPage() {
</div>
</section>
</main>
{showOpenModal && (
<div className="shop-redeem-modal" role="dialog" aria-modal="true">
<div className="shop-redeem-modal-card">
<h4 className="shop-redeem-modal-title"></h4>
<p className="shop-redeem-modal-desc"></p>
<div className="shop-redeem-modal-actions">
<button
type="button"
className="shop-redeem-modal-cancel"
disabled={opening}
onClick={() => setShowOpenModal(false)}
>
</button>
<button
type="button"
className="shop-redeem-modal-confirm"
disabled={opening}
onClick={() => void openStoreAndContinue()}
>
{opening ? '开启中…' : '确认开启'}
</button>
</div>
</div>
</div>
)}
</div>
);
}
+59 -7
View File
@@ -29,6 +29,8 @@ export default function RedeemConfirmPage() {
const [storeClosed, setStoreClosed] = useState(false);
const [failCount, setFailCount] = useState(0);
const [showWeakNet, setShowWeakNet] = useState(false);
const [showOpenModal, setShowOpenModal] = useState(false);
const [opening, setOpening] = useState(false);
useEffect(() => {
request<Record<string, unknown>>('SHOP_H5', '/shop/store')
@@ -71,11 +73,7 @@ export default function RedeemConfirmPage() {
});
}, [token]);
async function confirm() {
if (storeClosed) {
setMsg('门店未营业,无法核销');
return;
}
async function doConfirm() {
if (!token.trim()) {
setMsg('请先扫码获取核销码');
return;
@@ -103,6 +101,33 @@ export default function RedeemConfirmPage() {
}
}
async function confirm() {
if (storeClosed) {
setShowOpenModal(true);
return;
}
await doConfirm();
}
async function openStoreAndContinue() {
if (opening) return;
setOpening(true);
try {
await request('SHOP_H5', '/shop/store/status', {
method: 'PUT',
body: JSON.stringify({ status: 'OPEN' }),
});
setStoreClosed(false);
setShowOpenModal(false);
await doConfirm();
} catch (e) {
setShowOpenModal(false);
setMsg(e instanceof Error ? e.message : '开启营业失败');
} finally {
setOpening(false);
}
}
const previewAmount = preview?.amount ?? 0;
const userLabel = preview?.user?.nickname || preview?.user?.phone || '—';
@@ -117,7 +142,7 @@ export default function RedeemConfirmPage() {
<main className="shop-redeem-main">
{storeClosed && (
<p className="shop-redeem-error" style={{ marginBottom: 12 }}></p>
<p className="shop-redeem-error" style={{ marginBottom: 12 }}></p>
)}
<section className="shop-redeem-card">
<div className="shop-redeem-banner">
@@ -189,7 +214,7 @@ export default function RedeemConfirmPage() {
<button
type="button"
className={`shop-redeem-confirm-btn${loading ? ' success' : ''}`}
disabled={loading || storeClosed || !preview}
disabled={loading || !preview}
onClick={() => void confirm()}
>
<span className="material-symbols-outlined shop-fill-icon">
@@ -213,6 +238,33 @@ export default function RedeemConfirmPage() {
</span>
</div>
</main>
{showOpenModal && (
<div className="shop-redeem-modal" role="dialog" aria-modal="true">
<div className="shop-redeem-modal-card">
<h4 className="shop-redeem-modal-title"></h4>
<p className="shop-redeem-modal-desc"></p>
<div className="shop-redeem-modal-actions">
<button
type="button"
className="shop-redeem-modal-cancel"
disabled={opening}
onClick={() => setShowOpenModal(false)}
>
</button>
<button
type="button"
className="shop-redeem-modal-confirm"
disabled={opening}
onClick={() => void openStoreAndContinue()}
>
{opening ? '开启中…' : '确认开启'}
</button>
</div>
</div>
</div>
)}
</div>
);
}
+72 -2
View File
@@ -1519,6 +1519,7 @@
z-index: 40;
background: var(--color-surface);
border-bottom: 1px solid var(--color-surface-container-highest);
padding: 0 var(--space-page);
}
.shop-records-range-tabs {
@@ -1897,8 +1898,8 @@
}
.shop-withdraw-btn {
width: 100%;
margin-top: 12px;
width: calc(100% - 2 * var(--space-page));
margin: 12px var(--space-page) 0;
height: 44px;
border: none;
border-radius: 12px;
@@ -1916,11 +1917,80 @@
.shop-withdraw-msg {
margin-top: 10px;
padding: 0 var(--space-page);
font-size: 13px;
color: var(--color-aged-amber);
text-align: center;
}
/* ─── 休息中核销·开张确认弹窗 ─── */
.shop-redeem-modal {
position: fixed;
inset: 0;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(0, 0, 0, 0.45);
}
.shop-redeem-modal-card {
width: 100%;
max-width: 320px;
background: var(--color-surface);
border-radius: var(--radius-lg, 16px);
padding: 24px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.shop-redeem-modal-title {
margin: 0 0 8px;
font-family: var(--font-headline);
font-size: 17px;
font-weight: 600;
color: var(--color-on-surface);
}
.shop-redeem-modal-desc {
margin: 0 0 20px;
font-size: 14px;
line-height: 1.5;
color: var(--color-on-surface-variant);
}
.shop-redeem-modal-actions {
display: flex;
gap: 12px;
}
.shop-redeem-modal-cancel,
.shop-redeem-modal-confirm {
flex: 1;
padding: 11px 0;
border: none;
border-radius: 999px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
}
.shop-redeem-modal-cancel {
background: var(--color-surface-container, #ececec);
color: var(--color-on-surface-variant);
}
.shop-redeem-modal-confirm {
background: var(--color-primary, #8b1a1a);
color: #fff;
}
.shop-redeem-modal-cancel:disabled,
.shop-redeem-modal-confirm:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* ─── 门店套餐 ─── */
.shop-packages-page .shop-records-main {
padding-bottom: 24px;