diff --git a/property-uniapp-project/pageSubPack/api/api.js b/property-uniapp-project/pageSubPack/api/api.js
index f8274bf..6bbee38 100644
--- a/property-uniapp-project/pageSubPack/api/api.js
+++ b/property-uniapp-project/pageSubPack/api/api.js
@@ -132,10 +132,10 @@ export const addVisitorData = (data) =>{
}
// 通用文件上传
-export const uploadImage = () => {
- return upload('');
+export const uploadImage = (data) => {
+ return upload('/api/resident/file/uploadImage',data);
}
// 上传单张图片
export const uploadFile = (filePath) => {
- return upload(filePath, '');
+ return upload(filePath,'/api/resident/file/uploadImage');
}
\ No newline at end of file
diff --git a/property-uniapp-project/pageSubPack/api/apiSub.js b/property-uniapp-project/pageSubPack/api/apiSub.js
index 7cf240c..24395e4 100644
--- a/property-uniapp-project/pageSubPack/api/apiSub.js
+++ b/property-uniapp-project/pageSubPack/api/apiSub.js
@@ -87,4 +87,39 @@ export const upDateMyHouse = (data) => {
// 修改身份证照片
export const uploadFileUploadImage = (data) => {
return post(`/api/resident/file/uploadImage`, data)
+}
+
+// =========问卷调查=========
+// 问卷列表
+export const getQuestionnaireList = (data) => {
+ return get('/api/resident/questionnaire/list',data)
+}
+// 问卷详情
+export const getQuestionnaireDetail = (data) => {
+ return get('/api/resident/questionnaire/myAnswers',data)
+}
+// 提交问卷
+export const submitQuestionnair = (id,data) => {
+ return post(`/api/resident/questionnaire/${id}/submit`, data)
+}
+// =====投诉意见=======
+// 获取投诉类型
+export const getComplainType = () => {
+ return get('/complain/getComplainType')
+}
+// 获取投诉列表
+export const getComplainList = (data) => {
+ return get('/complain/getComplainList',data)
+}
+// 提交投诉建议
+export const addComplain = (data) => {
+ return post('/complain/add',data)
+}
+// 投诉详情
+export const getComplainDetail = (data) => {
+ return get('/complain/detail',data)
+}
+// 联系物业
+export const getManagePhoneData = (data) => {
+ return get('/banner/getManagePhone',data)
}
\ No newline at end of file
diff --git a/property-uniapp-project/pageSubPack/api/request.js b/property-uniapp-project/pageSubPack/api/request.js
index fc22abb..b760238 100644
--- a/property-uniapp-project/pageSubPack/api/request.js
+++ b/property-uniapp-project/pageSubPack/api/request.js
@@ -1,7 +1,5 @@
let baseUrl = '';
if (process.env.NODE_ENV === 'development') {
- // http://192.168.1.215
- // http://192.168.0.224
baseUrl = 'http://192.168.0.239:8080'; // 开发环境
} else {
baseUrl = 'http://192.168.0.224:8080'; // 生产环境
@@ -9,7 +7,6 @@ if (process.env.NODE_ENV === 'development') {
export default function request(url, data = {}, method = "GET") {
return new Promise((resolve, reject) => {
- // 加载中提示(提升用户体验)
uni.showLoading({
title: '请求中...',
mask: true
@@ -24,87 +21,51 @@ export default function request(url, data = {}, method = "GET") {
"clientid": "resident",
'content-type': 'application/json'
},
- // header: {
- // "token": uni.getStorageSync("token") || '',
- // '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(`请求异常 ${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'
- });
+ uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' });
}, 1500);
- reject('token 过期');
+ reject('登录过期');
return;
}
- // 业务成功(code=200)
+ // 成功
if (resData.code === 200) {
- resolve(resData); // 只返回核心数据,简化页面调用
+ 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);
- } else {
- const errMsg = resData.msg || '业务异常';
- uni.showToast({
- title: errMsg,
- icon: "none",
- duration: 2000
- });
- reject(errMsg);
+ // 业务失败:只 reject,不弹窗!
+ else {
+ reject(resData); // 把完整错误返回给页面!
}
},
fail: (err) => {
- uni.hideLoading(); // 关闭加载提示
- const errMsg = err.msg || '网络请求失败';
- uni.showToast({
- title: errMsg,
- icon: "none",
- duration: 2000
- });
+ uni.hideLoading();
reject(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({
@@ -116,16 +77,12 @@ export const upload = (filePath, url) => {
"clientid": "resident"
},
success: (res) => {
- if (res.statusCode === 200) {
- const data = JSON.parse(res.data);
- if (data.code === 200) {
- resolve(data);
- } else {
- reject(data.msg || '上传失败');
+ try {
+ const data = JSON.parse(res.data);
+ resolve(data.data || ''); // 直接返回图片地址
+ } catch (e) {
+ resolve('');
}
- } else {
- reject('上传失败');
- }
},
fail: (err) => {
reject(err);
diff --git a/property-uniapp-project/pageSubPack/loginSub/change-pwd.vue b/property-uniapp-project/pageSubPack/loginSub/change-pwd.vue
index 1cc644d..e5daac1 100644
--- a/property-uniapp-project/pageSubPack/loginSub/change-pwd.vue
+++ b/property-uniapp-project/pageSubPack/loginSub/change-pwd.vue
@@ -100,7 +100,7 @@ const handleConfirm = () => {
}
}).catch(err =>{
uni.showToast({
- title: err.msg,
+ title: err.msg || '网络异常',
icon: 'error'
});
})
diff --git a/property-uniapp-project/pageSubPack/loginSub/forget-pwd.vue b/property-uniapp-project/pageSubPack/loginSub/forget-pwd.vue
index 78cfe3f..02881a7 100644
--- a/property-uniapp-project/pageSubPack/loginSub/forget-pwd.vue
+++ b/property-uniapp-project/pageSubPack/loginSub/forget-pwd.vue
@@ -92,7 +92,7 @@ const getVerifyCode = () => {
}
}).catch(err =>{
uni.showToast({
- title: err.msg,
+ title: err.msg || '网络异常',
icon: 'error'
});
})
diff --git a/property-uniapp-project/pageSubPack/loginSub/login.vue b/property-uniapp-project/pageSubPack/loginSub/login.vue
index 479db17..bcabd8b 100644
--- a/property-uniapp-project/pageSubPack/loginSub/login.vue
+++ b/property-uniapp-project/pageSubPack/loginSub/login.vue
@@ -199,7 +199,7 @@ const handleLogin = () => {
}).catch(err => {
uni.showToast({
- title: '网络异常,请重试',
+ title: err.msg || '网络异常,请重试',
icon: 'error'
});
})
diff --git a/property-uniapp-project/pageSubPack/loginSub/pwd-login.vue b/property-uniapp-project/pageSubPack/loginSub/pwd-login.vue
index ebf68d3..c5b5183 100644
--- a/property-uniapp-project/pageSubPack/loginSub/pwd-login.vue
+++ b/property-uniapp-project/pageSubPack/loginSub/pwd-login.vue
@@ -155,7 +155,7 @@ const handleLogin = () => {
}).catch(err => {
uni.showToast({
- title: err.msg,
+ title: err.msg || '网络异常',
icon: 'error'
});
})
diff --git a/property-uniapp-project/pageSubPack/loginSub/register-new-user.vue b/property-uniapp-project/pageSubPack/loginSub/register-new-user.vue
index 5d891a3..93084cb 100644
--- a/property-uniapp-project/pageSubPack/loginSub/register-new-user.vue
+++ b/property-uniapp-project/pageSubPack/loginSub/register-new-user.vue
@@ -181,7 +181,7 @@
}
}).catch(err => {
uni.showToast({
- title: err.msg,
+ title: err.msg || '网络异常',
icon: 'error'
});
})
@@ -223,7 +223,7 @@
}
}).catch((err) => {
uni.showToast({
- title: err.msg,
+ title: err.msg || '网络异常',
icon: 'error'
});
})
diff --git a/property-uniapp-project/pageSubPack/notice-list/noticeList.vue b/property-uniapp-project/pageSubPack/notice-list/noticeList.vue
index 48f5d8b..4787a65 100644
--- a/property-uniapp-project/pageSubPack/notice-list/noticeList.vue
+++ b/property-uniapp-project/pageSubPack/notice-list/noticeList.vue
@@ -9,7 +9,7 @@
@clickLeft="narBack"
/>
-
+
{
displayedCommunities.value = []
hasMoreData.value = false
uni.showToast({
- title: "网络异常",
+ title: err.msg || "网络异常",
icon: 'error'
})
} finally {
@@ -267,7 +267,7 @@ const handleConfirm = async () => {
} catch (err) {
uni.hideLoading()
uni.showToast({
- title: '网络异常,请重试',
+ title: err.msg || '网络异常,请重试',
icon: 'error',
duration: 2000
})
diff --git a/property-uniapp-project/pageSubPack/online-repair/personalRepair.vue b/property-uniapp-project/pageSubPack/online-repair/personalRepair.vue
index 594758e..39b1326 100644
--- a/property-uniapp-project/pageSubPack/online-repair/personalRepair.vue
+++ b/property-uniapp-project/pageSubPack/online-repair/personalRepair.vue
@@ -55,11 +55,11 @@
-
-
+
+
-
+
上传照片
@@ -298,17 +298,28 @@ const goToSelectProject = () => {
uni.navigateTo({ url: '/pageSubPack/online-repair/personalSelectPoject' })
}
-// 图片
+// 选择图片
const chooseImage = () => {
+ // 计算还能选几张
+ const remainCount = 3 - form.value.images.length;
+ if (remainCount <= 0) {
+ uni.showToast({
+ title: '最多只能上传3张图片',
+ icon: 'none'
+ })
+ return;
+ }
uni.chooseImage({
- count: 3,
+ count: remainCount, // 动态限制可选数量
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
- form.value.images = [...form.value.images, ...res.tempFilePaths]
+ const tempFilePaths = res.tempFilePaths
+ form.value.images = [...form.value.images, ...tempFilePaths]
}
})
}
+// 预览图片
const previewImage = (url) => {
uni.previewImage({ urls: form.value.images, current: url })
}
@@ -326,7 +337,7 @@ const uploadImages = async () => {
}
try {
const res = await uploadFile(path)
- urls.push(res.data || res.msg || '')
+ urls.push(res.url || '')
} catch (e) {
console.error('上传失败', e)
}
@@ -469,24 +480,25 @@ textarea {
width: 80px;
height: 80px;
}
-.upload-item image {
+.upload-item .upload-img{
width: 100%;
height: 100%;
border-radius: 4px;
}
-.upload-item uni-icons {
+.upload-item .upload-delete{
position: absolute;
top: -5px;
right: -5px;
- background: #ff3b30;
- color: #fff;
- border-radius: 50%;
+ width: 32rpx;
+ height: 32rpx;
+ border-radius: 3rpx;
padding: 2px;
}
.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;
diff --git a/property-uniapp-project/pageSubPack/online-repair/publicRepair.vue b/property-uniapp-project/pageSubPack/online-repair/publicRepair.vue
index 596dd54..467916f 100644
--- a/property-uniapp-project/pageSubPack/online-repair/publicRepair.vue
+++ b/property-uniapp-project/pageSubPack/online-repair/publicRepair.vue
@@ -38,11 +38,12 @@
-
-
+
+
+
-
+
上传照片
@@ -93,15 +94,22 @@ const goBackSelect = () => {
// 选择图片
const chooseImage = () => {
+ // 计算还能选几张
+ const remainCount = 3 - form.value.images.length;
+ if (remainCount <= 0) {
+ uni.showToast({
+ title: '最多只能上传3张图片',
+ icon: 'none'
+ })
+ return;
+ }
uni.chooseImage({
- count: 3, // 最多选3张
+ count: remainCount, // 动态限制可选数量
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
- // 临时文件路径
const tempFilePaths = res.tempFilePaths
form.value.images = [...form.value.images, ...tempFilePaths]
-
}
})
}
@@ -111,7 +119,7 @@ const deleteImage = (index) => {
form.value.images.splice(index, 1)
}
-// 上传图片到服务器
+// 上传图片
const uploadImages = async () => {
const uploadedUrls = []
for (const path of form.value.images) {
@@ -122,9 +130,12 @@ const uploadImages = async () => {
try {
const res = await uploadFile(path)
// 根据后端实际返回结构调整字段名
- uploadedUrls.push(res.data || res.msg || '')
- } catch (e) {
- console.error('图片上传失败', e)
+ uploadedUrls.push(res.url || '')
+ } catch (err) {
+ uni.showToast({
+ title:e.msg || '图片上传失败',
+ icon:'error'
+ })
}
}
return uploadedUrls
@@ -250,24 +261,25 @@ const submitForm = async () => {
width: 80px;
height: 80px;
}
-.upload-item image {
+.upload-item .upload-img{
width: 100%;
height: 100%;
border-radius: 4px;
}
-.upload-item uni-icons {
+.upload-item .upload-delete{
position: absolute;
top: -5px;
right: -5px;
- background: #ff3b30;
- color: #fff;
- border-radius: 50%;
+ width: 32rpx;
+ height: 32rpx;
+ border-radius: 3rpx;
padding: 2px;
}
.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;
diff --git a/property-uniapp-project/pageSubPack/service-list/addComplaints.vue b/property-uniapp-project/pageSubPack/service-list/addComplaints.vue
index bd6f859..2a634d7 100644
--- a/property-uniapp-project/pageSubPack/service-list/addComplaints.vue
+++ b/property-uniapp-project/pageSubPack/service-list/addComplaints.vue
@@ -1,13 +1,11 @@
-
+
-
-
-
+
请填写反馈信息
@@ -19,9 +17,10 @@
投诉类型
- {{ selectedType || '请选择投诉类型' }}
- >
+
+ {{ selectedType || '请选择投诉类型' }}
+
+
@@ -32,9 +31,11 @@
投诉物业
- {{ selectedProperty || '请选择' }}
- >
+
+ {{ selectedProperty || '请选择' }}
+
+
+
@@ -45,8 +46,7 @@
问题描述
-
+
@@ -93,15 +93,13 @@
-
+
-
-
@@ -113,195 +111,188 @@
选择投诉类型
✕
-
-
-
- {{ item }}
+
+ {{ item.name }}
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue b/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue
index a3dd798..91a6618 100644
--- a/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue
+++ b/property-uniapp-project/pageSubPack/service-list/complaintsSuggestionsIndex.vue
@@ -1,228 +1,151 @@
-
+
-
+
+
-
-
+
+
+
-
- {{ '暂无数据'}}
-
+ 暂无数据
-
-
-
+
+
+
-
-
- {{item.desc}}
-
+ {{ item.desc }}
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
\ No newline at end of file
+.option-label {
+ font-size: 32rpx;
+}
+
+.status-bar {
+ width: 100vw;
+ height: 46px;
+}
+
diff --git a/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue b/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
index 8ca8bf2..34f9599 100644
--- a/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
+++ b/property-uniapp-project/pageSubPack/service-list/questionnaireFillout.vue
@@ -1,498 +1,402 @@
-
+
-
-
-
-
+
- 关于用户体验反馈的调查
+ {{ detailItem.title || '' }}
-
- 为了给您提供更好的服务,希望您能抽出几分钟时间,将进的感受和建议告诉我们,我们非常重视每位用户的宝贵意见,期待您的参与!
+ {{ detailItem.description || '' }}
+
+
+
+ 问卷内容加载中,请稍后...
-
-
+
+
- *1.您社区的大门数量
+ *
+ {{ idx + 1 }}.{{ q.title || '未命名问题' }}
-
-
-
- ✓
+
+
+
+
+
+ ✓
- {{ item }}
+ {{ opt.label }}
-
-
-
-
- *2.您所在的社区,关于消防演练,下列符合几项
-
-
-
-
- ✓
+
+
+
+
+ ✓
- {{ item }}
+ {{ opt.label }}
-
-
-
-
- *3.您所在的社区是否有健康医疗服务
-
-
-
-
- {{ q3Selected }}
-
-
- 请选择是否有该项服务
-
- ▼
+
+
+
-
-
-
-
- {{ item }}
-
+
+
+
-
-
-
-
- *4.您对所在社区的综合评分
-
-
-
- ★
-
-
-
-
-
-
-
- *5.您还有哪些建议
-
-
-
-
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/property-uniapp-project/pageSubPack/service-list/questionnaireSurveyIndex.vue b/property-uniapp-project/pageSubPack/service-list/questionnaireSurveyIndex.vue
index e7bdc9b..8218ef1 100644
--- a/property-uniapp-project/pageSubPack/service-list/questionnaireSurveyIndex.vue
+++ b/property-uniapp-project/pageSubPack/service-list/questionnaireSurveyIndex.vue
@@ -1,240 +1,152 @@
-
+
-
-
-
+
-
+
+
-
+
-
- {{ '暂无数据'}}
-
+ 暂无数据
-
+
+
+
{{ item.title }}
- {{ item.time }}
-
+ {{ item.createTime }}
+
-
- {{ item.status }}
+
+ {{ item.statusName}}
-
-
-
-
+
-
-
-
-
+