|
|
@@ -93,6 +93,7 @@ import { ref, computed } from 'vue'
|
|
|
import { onShow } from '@dcloudio/uni-app'
|
|
|
import CustomNav from '@/components/custom-nav.vue'
|
|
|
import TabBar from '@/components/tab-bar.vue'
|
|
|
+import { handleQrScanResult } from '@/utils/qr'
|
|
|
import { fetchUserInfo as fetchUserInfoApi, downloadAvatar as downloadAvatarApi } from '@/api/user'
|
|
|
|
|
|
const user = ref<{ avatar?: string; nickname?: string; age?: number }>({})
|
|
|
@@ -205,13 +206,7 @@ onShow(() => {
|
|
|
})
|
|
|
|
|
|
function handleScan(res: any) {
|
|
|
- console.log('[index] scan result', res)
|
|
|
- const resultText = res?.result || ''
|
|
|
- if (resultText) {
|
|
|
- uni.showToast({ title: String(resultText), icon: 'none', duration: 2000 })
|
|
|
- } else {
|
|
|
- uni.showToast({ title: '未识别到有效内容', icon: 'none' })
|
|
|
- }
|
|
|
+ return handleQrScanResult(res)
|
|
|
}
|
|
|
|
|
|
function onItemClick(type: string) {
|