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>
);
}