对接首页消息通知、巡检点 切换小区获取最新数据
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user