This commit is contained in:
2026-06-16 19:26:48 +08:00
parent 77e3a85134
commit d7461853cf
20 changed files with 1229 additions and 223 deletions
+17 -10
View File
@@ -1,18 +1,20 @@
<template>
<view class="wrap home">
<u-navbar :is-back="false" title-color="#ffffff" :background="navbarBg" title="首页">
<view class="home-navbar">
<view class="slot-wrap">
<u-input style="color: #ffffff;" v-model="currentProjectName" :clearable="false" type="select"
placeholder="请选择项目" @click="handleShowProjectSelect" />
</view>
</u-navbar>
<view class="home-navbar-title">首页</view>
<view class="home-navbar-placeholder"></view>
</view>
<view class="home-icons">
<view class="home-icon" @click="handleScan">
<u-icon name="saoyisao" custom-prefix="nbd-icon" :size="68" color="#ffffff" />
<text>扫一扫</text>
</view>
<view class="home-icon">
<view class="home-icon" @click="handleSkipByPath('/pages/todo/list')">
<u-icon name="daiban" custom-prefix="nbd-icon" :size="68" color="#ffffff" />
<text>待办</text>
</view>
@@ -175,15 +177,17 @@
const {
pastelColors
} = menuStore
const navbarBg = reactive({
backgroundColor: "var(--u-type-primary)"
})
const projectNameKeyword = ref('')
const showProject = ref(false)
const showEditQuick = ref(false)
const currentProjectName = computed(() => currentProject.value?.ProjectName || '')
const handleSkipByPath = (path)=>{
uni.navigateTo({
url: path
})
}
const handleSkip = (item) => {
if (!currentProject.value.ProjectId) {
handleShowProjectSelect()
@@ -244,12 +248,15 @@
*/
const handleScan = () => {
uni.scanCode({
onlyFromCamera: true,
success(res) {
console.log('扫码结果:', res)
const result = res.result || ''
uni.navigateTo({
url:scanToSkipUrl(result)
})
const url = scanToSkipUrl(result)
if (url) {
uni.navigateTo({ url })
} else {
uni.showToast({ title: '无法识别的二维码/条形码', icon: 'none' })
}
},
fail(err) {
console.error('扫码失败:', err)