对接一键开门 修改首页引导页自适应样式
This commit is contained in:
@@ -100,14 +100,14 @@ onLoad((options) => {
|
||||
repairId.value = options.projectId
|
||||
}
|
||||
|
||||
// ✅ 监听返回选择的项目
|
||||
// 监听返回选择的项目
|
||||
uni.$on('selectRepairProject', (data) => {
|
||||
repairProject.value = `${data.category}-${data.project}`
|
||||
repairId.value = data.projectId
|
||||
})
|
||||
})
|
||||
|
||||
// ✅ 页面卸载时移除监听(必须加)
|
||||
// 页面卸载时移除监听
|
||||
onUnload(() => {
|
||||
uni.$off('selectRepairProject')
|
||||
})
|
||||
@@ -155,8 +155,8 @@ const uploadImages = async () => {
|
||||
uploadedUrls.push(res.url || '')
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title:e.msg || '图片上传失败',
|
||||
icon:'error'
|
||||
title:err.msg || '图片上传失败',
|
||||
icon:'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,18 +42,10 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import {getRepairOrder} from '../../api/api.js'
|
||||
|
||||
// 分类列表
|
||||
const categoryList = ref([
|
||||
// { id: 1, name: '基础设施' },
|
||||
// { id: 2, name: '电子设施' }
|
||||
])
|
||||
const categoryList = ref([])
|
||||
|
||||
// 所有项目数据
|
||||
const projectList = ref([
|
||||
// { id: 101, categoryId: 1, name: '路灯' },
|
||||
// { id: 102, categoryId: 1, name: '楼层指示灯' },
|
||||
// { id: 103, categoryId: 2, name: '应急出口灯' },
|
||||
// { id: 104, categoryId: 1, name: '草坪灯' }
|
||||
])
|
||||
const projectList = ref([])
|
||||
|
||||
// 选中的分类
|
||||
const activeCategory = ref(1)
|
||||
@@ -91,7 +83,7 @@ const fetchProjectList = async () => {
|
||||
activeCategory.value = categoryList.value[0]?.id || 1
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '获取项目列表失败', icon: 'none' })
|
||||
uni.showToast({ title: e.msg ||'获取项目列表失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user