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:
@@ -71,16 +71,24 @@ function formatPartnerError(e: unknown): string {
|
||||
if (text.includes('合伙人账号不存在') || text.includes('未找到合伙人账号')) {
|
||||
return '未找到合伙人账号';
|
||||
}
|
||||
if (text.includes('合伙人账号已停用') || text.includes('账号已停用')) {
|
||||
return '合伙人账号已暂停,无法登录';
|
||||
if (
|
||||
text.includes('合伙人账号已停用') ||
|
||||
text.includes('账号已停用') ||
|
||||
text.includes('暂停使用')
|
||||
) {
|
||||
return '该账号已暂停使用,请联系客服人员';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
function formatWechatError(e: unknown): string {
|
||||
const text = e instanceof Error ? e.message : '微信登录失败';
|
||||
if (text.includes('合伙人账号已停用') || text.includes('账号已停用')) {
|
||||
return '合伙人账号已暂停,无法登录';
|
||||
if (
|
||||
text.includes('合伙人账号已停用') ||
|
||||
text.includes('账号已停用') ||
|
||||
text.includes('暂停使用')
|
||||
) {
|
||||
return '该账号已暂停使用,请联系客服人员';
|
||||
}
|
||||
if (text.includes('首次登录') || text.includes('手机验证码')) {
|
||||
return '该微信尚未绑定合伙人账号,请先使用手机验证码登录,登录后将自动关联微信';
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -38,6 +38,7 @@ export default function ProductCarousel({
|
||||
<Swiper
|
||||
className={prefix}
|
||||
circular={slides.length > 1}
|
||||
{...(variant === 'detail' && slides.length > 1 ? { autoplay: true, interval: 3500 } : {})}
|
||||
onChange={(e) => setActiveIndex(e.detail.current)}
|
||||
>
|
||||
{slides.map((src, index) => (
|
||||
@@ -66,6 +67,9 @@ export default function ProductCarousel({
|
||||
))}
|
||||
</View>
|
||||
) : null}
|
||||
{variant === 'detail' && slides.length > 1 ? (
|
||||
<View className={`${prefix}-counter`}>{activeIndex + 1}/{slides.length}</View>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function normalizeContactPhone(raw: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* 脱敏展示:手机 138****8000;座机保留区号,如 0379-****888。
|
||||
* 脱敏展示:手机 138****8000;座机隐藏本地号中间四位,如 0379-12****78。
|
||||
* 门店详情电话展示用(拨号仍走 toDialablePhone 明文)。
|
||||
*/
|
||||
export function maskPhone(phone: string) {
|
||||
@@ -45,9 +45,16 @@ export function maskPhone(phone: string) {
|
||||
const areaLen = digits.startsWith('01') || digits.startsWith('02') ? 3 : 4;
|
||||
const area = digits.slice(0, areaLen);
|
||||
const local = digits.slice(areaLen);
|
||||
const keepTail = Math.min(4, Math.max(2, local.length - 4));
|
||||
const maskedLocal =
|
||||
local.length <= 4 ? '*'.repeat(local.length) : `${'*'.repeat(local.length - keepTail)}${local.slice(-keepTail)}`;
|
||||
// 隐藏本地号中间四位(保留区号,本号前后各留若干位):0379-12345678 → 0379-12****78
|
||||
let maskedLocal: string;
|
||||
if (local.length <= 4) {
|
||||
maskedLocal = '*'.repeat(local.length);
|
||||
} else {
|
||||
const keep = local.length - 4;
|
||||
const head = Math.max(1, Math.floor(keep / 2));
|
||||
const tail = keep - head;
|
||||
maskedLocal = `${local.slice(0, head)}${'*'.repeat(4)}${local.slice(local.length - tail)}`;
|
||||
}
|
||||
const joiner = main.includes('-') ? '-' : '';
|
||||
return ext ? `${area}${joiner}${maskedLocal}-${ext}` : `${area}${joiner}${maskedLocal}`;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,20 @@
|
||||
background: var(--color-heritage-red);
|
||||
}
|
||||
|
||||
.detail-carousel-counter {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
z-index: 2;
|
||||
padding: 2px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 999px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.product-detail-info {
|
||||
padding: var(--space-md) var(--space-page) var(--space-lg);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,21 @@
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* 套餐详情图右下角 1/N 计数(detail 变体复用 .detail-carousel-counter) */
|
||||
.detail-carousel-counter {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
z-index: 2;
|
||||
padding: 2px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 999px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.store-detail-info-card {
|
||||
margin: 0 var(--space-page) 16px;
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user