对接首页消息通知、巡检点 切换小区获取最新数据

This commit is contained in:
zhouyanli
2026-05-15 16:06:32 +08:00
parent 8324d096c0
commit 856f36455c
17 changed files with 425 additions and 770 deletions

View File

@@ -53,7 +53,7 @@
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
<image :src="img" mode="aspectFill" class="upload-img"></image>
<image
src="http://47.104.199.163:9090/images/imgs/delete.png"
src="https://wuyeadmin.bugtc.com/images/imgs/delete.png"
class="upload-delete"
@click="deleteImage(index)"
></image>
@@ -61,8 +61,8 @@
</view>
<!-- 上传按钮 -->
<view class="upload-btn" @click="chooseImage" v-if="form.images.length < 3">
<uni-icons type="plus" size="24"></uni-icons>
<text>上传照片</text>
<uni-icons type="plusempty" size="24"></uni-icons>
<!-- <text>上传照片</text> -->
</view>
</view>
</view>
@@ -74,7 +74,7 @@
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { onLoad,onShow ,onUnload} from '@dcloudio/uni-app'
import {addRepairList,uploadFile} from '../../api/api.js'
@@ -92,13 +92,24 @@ const form = ref({
// ==========方法========
// 页面加载时获取传参
onLoad(options => {
// 页面加载
onLoad((options) => {
// 第一次进入页面接收参数
if (options.category && options.project) {
repairProject.value = `${options.category}-${options.project}`
repairId.value = options.projectId
}
console.log('项目id',repairId.value)
// ✅ 监听返回选择的项目
uni.$on('selectRepairProject', (data) => {
repairProject.value = `${data.category}-${data.project}`
repairId.value = data.projectId
})
})
// ✅ 页面卸载时移除监听(必须加)
onUnload(() => {
uni.$off('selectRepairProject')
})
// 选择项目页
@@ -287,7 +298,8 @@ const submitForm = async () => {
.upload-btn {
width: 80px;
height: 80px;
border: 1px dashed #ccc;
/* border: 1px dashed #ccc; */
background-color: #f3f3f3;
border-radius: 4px;
display: flex;
flex-direction: column;