diff --git a/src/pages-core/auth/components/wechat-login-panel.vue b/src/pages-core/auth/components/wechat-login-panel.vue
index 37b9f2c..0f5fbfe 100644
--- a/src/pages-core/auth/components/wechat-login-panel.vue
+++ b/src/pages-core/auth/components/wechat-login-panel.vue
@@ -43,6 +43,10 @@ const props = defineProps<{
validateTenant: () => boolean
}>()
+const emit = defineEmits<{
+ (e: 'phone-refused'): void
+}>()
+
const toast = useToast()
const loading = ref(false)
const needPhoneAuth = ref(false)
@@ -79,7 +83,8 @@ async function handleWechatLogin() {
/** 第二步:手机号授权后完成登录 */
async function handleGetPhoneNumber(e: any) {
if (e.detail.errMsg !== 'getPhoneNumber:ok') {
- toast.warning('未获取到手机号授权,无法继续登录')
+ toast.warning('为方便工作,建议授权手机号')
+ emit('phone-refused')
return
}
diff --git a/src/pages-core/auth/login.vue b/src/pages-core/auth/login.vue
index f61f0aa..588296e 100644
--- a/src/pages-core/auth/login.vue
+++ b/src/pages-core/auth/login.vue
@@ -22,6 +22,7 @@
:agreed="agreed"
:redirect-url="redirectUrl"
:validate-tenant="validateTenant"
+ @phone-refused="activeTab = 'username'"
/>
diff --git a/src/pages/index/components/menu-section.vue b/src/pages/index/components/menu-section.vue
index 634ba70..1dd8363 100644
--- a/src/pages/index/components/menu-section.vue
+++ b/src/pages/index/components/menu-section.vue
@@ -97,6 +97,7 @@ const quickApps = [
{ key: 'inspection', name: '巡检记录', icon: 'i-carbon-list-checked', color: '#8B5CF6', bgLight: '#F5F3FF', url: '/pages/scan/inspection/list' },
{ key: 'workOrderStats', name: '工单统计', icon: 'i-carbon-chart-bar', color: '#3B82F6', bgLight: '#EFF6FF', url: '/pages/scan/work-order/stats' },
{ key: 'trafficStats', name: '客流统计', icon: 'i-carbon-pedestrian', color: '#10B981', bgLight: '#ECFDF5', url: '/pages/scan/traffic/index' },
+ { key: 'bluetoothDebug', name: '蓝牙调试', icon: 'i-carbon-bluetooth', color: '#0EA5E9', bgLight: '#F0F9FF', url: '/pages/scan/bluetooth-debug/index' },
]
function handleQuickApp(app: any) {
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 15118f4..ddf10e0 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -4,10 +4,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tabbar/index.vue b/src/tabbar/index.vue
index 9cbc10c..f0efe29 100644
--- a/src/tabbar/index.vue
+++ b/src/tabbar/index.vue
@@ -2,6 +2,7 @@
/* eslint-disable brace-style */ // 原因:unibest 官方维护的代码,尽量不要大概,避免难以合并
// i-carbon-code
import type { CustomTabBarItem } from './types'
+import { parseQrCode } from '@/utils/qrcode'
import { customTabbarEnable, needHideNativeTabbar, tabbarCacheEnable } from './config'
import { tabbarList, tabbarStore } from './store'
@@ -25,12 +26,18 @@ function handleClickBulge() {
uni.navigateTo({ url: fallbackUrl })
return
}
- uni.navigateTo({
- url: `/pages/scan/inspection/index?code=${encodeURIComponent(res.result)}`,
- })
+ const parsed = parseQrCode(res.result)
+ if (parsed) {
+ uni.navigateTo({
+ url: `/pages/scan/inspection/index?areaId=${parsed.areaId}&areaName=${encodeURIComponent(parsed.areaName)}`,
+ })
+ }
+ else {
+ uni.showToast({ title: '无法识别该二维码', icon: 'none' })
+ }
},
fail: () => {
- uni.navigateTo({ url: fallbackUrl })
+ // 用户取消扫码,不跳转(避免进入 scan/index 又自动触发一次扫码)
},
})
}