merge: 合并 origin/main(排行榜/手机号校验)并保留本地体验会员与UI改动

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-08 00:17:07 +08:00
3 changed files with 284 additions and 112 deletions

View File

@@ -1,6 +1,5 @@
/** 三端固定normal | dashou | shangjia认证后不可回退 */
import { isStaffMode } from './staff-api.js';
import { ensurePhoneAuth } from './phone-auth.js';
const VALID = ['normal', 'dashou', 'shangjia'];
@@ -56,9 +55,6 @@ export function getPrimaryRole(app) {
if (isRoleStatusActive(wx.getStorageSync('shangjiastatus'))) {
return 'shangjia';
}
if (isStaffMode()) {
return 'shangjia';
}
return 'normal';
}
@@ -89,7 +85,7 @@ export function clearPrimaryRole(app) {
export const PRIMARY_DEFAULT_PAGES = {
normal: '/pages/mine/mine',
dashou: '/pages/accept-order/accept-order',
shangjia: '/pages/merchant-home/merchant-home',
shangjia: '/pages/merchant-orders/merchant-orders',
};
/** 锁定主端并跳转到该端默认首页,同时建立 IM 长连接 */
@@ -111,8 +107,8 @@ function finishEnterLockedRole(role, app) {
export function enterLockedRole(role, app) {
if (!VALID.includes(role) || role === 'normal') return false;
if (role === 'dashou' || role === 'shangjia') {
ensurePhoneAuth({ redirect: true, role }).then((ok) => {
if (role === 'dashou') {
ensurePhoneAuth({ redirect: true, role: 'dashou' }).then((ok) => {
if (ok) finishEnterLockedRole(role, app);
});
return true;