From 7e5ee9d4e0f054c1eae9ddf1c788a3c1e05a236f Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Wed, 13 May 2026 17:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=B0=8F=E5=8C=BA=E3=80=81?= =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=8A=A5=E4=BF=AE=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wuye-manager-uniapp/api/api.js | 27 + wuye-manager-uniapp/api/request.js | 89 +- .../fault-reporting/fault-reporting.vue | 76 +- .../fault-reporting/repairSelect.vue | 48 +- .../notice-list/select-community.vue | 827 ++++++------------ .../pageSubPack/oneClickOpen/oneClickOpen.vue | 3 +- wuye-manager-uniapp/pages/guide/guide.vue | 6 +- wuye-manager-uniapp/pages/index/index.vue | 40 +- wuye-manager-uniapp/pages/my/my.vue | 8 +- wuye-manager-uniapp/static/imgs/adress.png | Bin 1080 -> 0 bytes wuye-manager-uniapp/static/imgs/banner1.png | Bin 116711 -> 0 bytes wuye-manager-uniapp/static/imgs/check.png | Bin 763 -> 0 bytes wuye-manager-uniapp/static/imgs/community.png | Bin 827 -> 0 bytes wuye-manager-uniapp/static/imgs/complaint.png | Bin 4964 -> 0 bytes wuye-manager-uniapp/static/imgs/delete.png | Bin 608 -> 0 bytes .../static/imgs/fault-report.png | Bin 4919 -> 0 bytes wuye-manager-uniapp/static/imgs/guide1.png | Bin 68227 -> 0 bytes wuye-manager-uniapp/static/imgs/guide2.png | Bin 65096 -> 0 bytes wuye-manager-uniapp/static/imgs/guide3.png | Bin 46812 -> 0 bytes wuye-manager-uniapp/static/imgs/my-work.png | Bin 4648 -> 0 bytes wuye-manager-uniapp/static/imgs/notice.png | Bin 2438 -> 0 bytes wuye-manager-uniapp/static/imgs/open.png | Bin 5162 -> 0 bytes wuye-manager-uniapp/static/imgs/shangbao.png | Bin 2353 -> 0 bytes wuye-manager-uniapp/static/imgs/touxiang.png | Bin 31992 -> 0 bytes .../static/imgs/work-order.png | Bin 5320 -> 0 bytes .../static/imgs/xuancheng-bg.png | Bin 80573 -> 0 bytes wuye-manager-uniapp/static/imgs/xunjian.png | Bin 2672 -> 0 bytes wuye-manager-uniapp/static/imgs/三角形.png | Bin 240 -> 0 bytes 28 files changed, 495 insertions(+), 629 deletions(-) delete mode 100644 wuye-manager-uniapp/static/imgs/adress.png delete mode 100644 wuye-manager-uniapp/static/imgs/banner1.png delete mode 100644 wuye-manager-uniapp/static/imgs/check.png delete mode 100644 wuye-manager-uniapp/static/imgs/community.png delete mode 100644 wuye-manager-uniapp/static/imgs/complaint.png delete mode 100644 wuye-manager-uniapp/static/imgs/delete.png delete mode 100644 wuye-manager-uniapp/static/imgs/fault-report.png delete mode 100644 wuye-manager-uniapp/static/imgs/guide1.png delete mode 100644 wuye-manager-uniapp/static/imgs/guide2.png delete mode 100644 wuye-manager-uniapp/static/imgs/guide3.png delete mode 100644 wuye-manager-uniapp/static/imgs/my-work.png delete mode 100644 wuye-manager-uniapp/static/imgs/notice.png delete mode 100644 wuye-manager-uniapp/static/imgs/open.png delete mode 100644 wuye-manager-uniapp/static/imgs/shangbao.png delete mode 100644 wuye-manager-uniapp/static/imgs/touxiang.png delete mode 100644 wuye-manager-uniapp/static/imgs/work-order.png delete mode 100644 wuye-manager-uniapp/static/imgs/xuancheng-bg.png delete mode 100644 wuye-manager-uniapp/static/imgs/xunjian.png delete mode 100644 wuye-manager-uniapp/static/imgs/三角形.png diff --git a/wuye-manager-uniapp/api/api.js b/wuye-manager-uniapp/api/api.js index d484f14..e976ac3 100644 --- a/wuye-manager-uniapp/api/api.js +++ b/wuye-manager-uniapp/api/api.js @@ -17,4 +17,31 @@ export const getLoginBySms = (data) =>{ export const getResetPassword = (data) =>{ return post('/api/butler/auth/forgetPassword',data) } +// ======首页===== // 获取小区列表 +export const getVillageList = (data) =>{ + return get('/api/inspection/today/villageList',data) +} +// 切换小区 +export const switchVillage = (data) =>{ + return post('/api/inspection/today/switchVillage',data) +} +// ======故障上报===== +// 获取报修项目 +export const getRepairOrder = () =>{ + return get('/manage/repair/order/list') +} +// 提交维修信息 +export const addRepairList = (data) =>{ + return post('/manage/repair/order',data) +} +// 上传图片 +export const uploadFile = (filePath) => { + return upload(filePath,' /resource/oss/upload'); +} + + +// 一键开门 +export const openDoor = (data) =>{ + return post('/manage/remote/open',data) +} diff --git a/wuye-manager-uniapp/api/request.js b/wuye-manager-uniapp/api/request.js index d4443af..949128f 100644 --- a/wuye-manager-uniapp/api/request.js +++ b/wuye-manager-uniapp/api/request.js @@ -1,81 +1,92 @@ - let baseUrl = ''; if (process.env.NODE_ENV === 'development') { baseUrl = 'http://192.168.0.239:8080'; // 开发环境 } else { - baseUrl = 'http://192.168.1.224:8080'; // 生产环境 + baseUrl = 'http://192.168.0.224:8080'; // 生产环境 } export default function request(url, data = {}, method = "GET") { return new Promise((resolve, reject) => { - // 加载中提示(提升用户体验) - uni.showLoading({ title: '请求中...', mask: true }); + uni.showLoading({ + title: '请求中...', + mask: true + }); uni.request({ url: baseUrl + url, data: data, method: method, header: { - "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), - "clientid": "resident", - 'content-type': 'application/json' - }, - // header: { - // "token": uni.getStorageSync("token") || '', - // 'content-type': 'application/json' - // }, + "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), + "clientid": "butler", + 'content-type': 'application/json' + }, success: (res) => { - uni.hideLoading(); // 关闭加载提示 + uni.hideLoading(); - // 处理HTTP状态码(网络层面) + // HTTP 失败 if (res.statusCode !== 200) { - const errMsg = `请求失败(${res.statusCode})`; - uni.showToast({ title: errMsg, icon: "none", duration: 2000 }); - reject(errMsg); + reject({ msg: `请求异常 ${res.statusCode}`, code: res.statusCode }); return; } - // 处理业务状态码(后端返回的data里) - const resData = res.data || {}; // 兼容后端返回空的情况 + const resData = res.data || {}; - // 优先处理token过期(401) + // token 过期 if (resData.code === 401) { - uni.showToast({ title: '登录过期,请重新登录', icon: 'none', duration: 2000 }); + uni.showToast({ title: '登录过期,请重新登录', icon: 'none' }); uni.clearStorageSync('token'); setTimeout(() => { uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' }); }, 1500); - reject('token 过期'); + reject({ msg: '登录过期', code: 401 }); return; } - // 业务成功(code=200) + // 成功 if (resData.code === 200) { - resolve(resData); // 只返回核心数据,简化页面调用 - } - // 业务失败(code=500) - else if (resData.code === 500) { - const errMsg = resData.msg || '请求失败'; - uni.showToast({ title: errMsg, icon: "none", duration: 2000 }); - // resolve(null) - reject(errMsg); + resolve(resData); } + // 业务失败 else { - const errMsg = resData.msg || '业务异常'; - uni.showToast({ title: errMsg, icon: "none", duration: 2000 }); - reject(errMsg); + reject({ msg: resData.msg || '请求失败', code: resData.code, data: resData }); } }, fail: (err) => { - uni.hideLoading(); // 关闭加载提示 - const errMsg = err.msg || '网络请求失败'; - uni.showToast({ title: errMsg, icon: "none", duration: 2000 }); - reject(err); + uni.hideLoading(); + reject({ msg: '网络异常', code: -1, raw: err }); } }); }); } + export const get = (url, data) => request(url, data, 'GET'); export const post = (url, data) => request(url, data, 'POST'); +// export const deleteMethod = (url, data) => request(url, data, 'DELETE'); +// export const putMethod = (url, data) => request(url, data, 'PUT'); - +// 上传 +export const upload = (filePath, url) => { + return new Promise((resolve, reject) => { + uni.uploadFile({ + url: baseUrl + url, + filePath: filePath, + name: 'file', + header: { + "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), + "clientid": "resident" + }, + success: (res) => { + try { + const data = JSON.parse(res.data); + resolve(data.data || ''); // 直接返回图片地址 + } catch (e) { + resolve(''); + } + }, + fail: (err) => { + reject(err); + } + }); + }); +}; diff --git a/wuye-manager-uniapp/pageSubPack/fault-reporting/fault-reporting.vue b/wuye-manager-uniapp/pageSubPack/fault-reporting/fault-reporting.vue index 54ee6dc..98b0b92 100644 --- a/wuye-manager-uniapp/pageSubPack/fault-reporting/fault-reporting.vue +++ b/wuye-manager-uniapp/pageSubPack/fault-reporting/fault-reporting.vue @@ -53,7 +53,7 @@ @@ -75,10 +75,12 @@ diff --git a/wuye-manager-uniapp/pageSubPack/fault-reporting/repairSelect.vue b/wuye-manager-uniapp/pageSubPack/fault-reporting/repairSelect.vue index 2e3e86c..fd6eb6e 100644 --- a/wuye-manager-uniapp/pageSubPack/fault-reporting/repairSelect.vue +++ b/wuye-manager-uniapp/pageSubPack/fault-reporting/repairSelect.vue @@ -17,7 +17,7 @@ v-for="item in categoryList" :key="item.id" > - {{ item.name }} + {{ item.projectName }} @@ -29,7 +29,7 @@ v-for="item in currentProjectList" :key="item.id" > - {{ item.name }} + {{ item.projectName }} @@ -38,20 +38,21 @@ diff --git a/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue b/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue index 938b09a..464d391 100644 --- a/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue +++ b/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue @@ -1,562 +1,299 @@ - - - // 监听搜索文本变化 - watch(searchText, (newVal) => { - if (!newVal.trim()) { - clearSearch() - } - }) - - // 初始化 - onMounted(() => { - // 初始化数据 - totalCommunities.value = [...allCommunities.value] - loadPageData(1) - - // 默认选中第一项 - if (displayedCommunities.value.length > 0) { - selectedItem.value = displayedCommunities.value[0] - } - }) - - - + + .search-container { + padding: 20rpx 30rpx; + background-color: #ffffff; + display: flex; + align-items: center; + z-index: 10; + position: sticky; + top: 0; + } + + .search-input-wrapper { + flex: 1; + background-color: #f3f3f3; + border-radius: 10rpx; + padding: 8rpx 20rpx; + display: flex; + align-items: center; + height: 80rpx; + } + + .search-icon { + margin-right: 15rpx; + } + + .search-input { + flex: 1; + height: 100%; + font-size: 28rpx; + color: #333; + } + + .placeholder { + color: #999; + font-size: 28rpx; + text-align: center; + } + + .clear-icon { + padding: 10rpx; + display: flex; + align-items: center; + justify-content: center; + } + + .community-list { + flex: 1; + margin-top: 20rpx; + margin-bottom: 180rpx; + } + + .community-item { + background-color: #fff; + padding: 30rpx; + margin-bottom: 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + } + + .community-item.active { + background-color: #F5FAFF; + border: 1px solid #2F77FD; + transform: translateY(2rpx); + } + + .community-item-left { + display: flex; + align-items: center; + flex: 1; + } + + .community-info { + display: flex; + flex-direction: column; + flex: 1; + } + + .community-name { + font-size: 32rpx; + color: #222; + font-weight: 500; + margin-bottom: 8rpx; + } + + .selected-icon { + margin-left: 20rpx; + } + + .empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 0; + } + + .empty-text { + font-size: 32rpx; + color: #999; + margin-top: 20rpx; + } + + .confirm-area { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx 30rpx 40rpx; + background-color: #fff; + box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, 0.05); + } + + .confirm-btn { + background-color: #4D5DFA; + color: #fff; + height: 80rpx; + line-height: 80rpx; + border-radius: 8rpx; + font-size: 28rpx; + width: 100%; + margin: 0; + } + + .disabled-btn { + background-color: #ccc; + color: #fff; + } + + @media (min-width: 768px) { + .container { + max-width: 500px; + margin: 0 auto; + } + } + diff --git a/wuye-manager-uniapp/pageSubPack/oneClickOpen/oneClickOpen.vue b/wuye-manager-uniapp/pageSubPack/oneClickOpen/oneClickOpen.vue index 701021c..a687b8d 100644 --- a/wuye-manager-uniapp/pageSubPack/oneClickOpen/oneClickOpen.vue +++ b/wuye-manager-uniapp/pageSubPack/oneClickOpen/oneClickOpen.vue @@ -7,7 +7,7 @@ - + @@ -49,6 +49,7 @@