Merge branch 'main' of http://gitea.bugtc.com/zhouyanli/property-resident-side
# Conflicts: # property-uniapp-project/pageSubPack/api/apiSub.js
This commit is contained in:
7
property-uniapp-project/.claude/settings.local.json
Normal file
7
property-uniapp-project/.claude/settings.local.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"WebFetch(domain:app.apifox.com)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -176,7 +176,14 @@ const narBack = () => {
|
|||||||
*/
|
*/
|
||||||
const switchTab = (tab) => {
|
const switchTab = (tab) => {
|
||||||
activeTab.value = tab
|
activeTab.value = tab
|
||||||
|
if (tab === 'list') {
|
||||||
resetAndLoad()
|
resetAndLoad()
|
||||||
|
} else {
|
||||||
|
// 暂无审核功能,"我的活动"默认显示暂无数据
|
||||||
|
displayedActivities.value = []
|
||||||
|
hasMoreData.value = false
|
||||||
|
currentPage.value = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -185,7 +192,7 @@ const switchTab = (tab) => {
|
|||||||
*/
|
*/
|
||||||
const switchFilter = (filter) => {
|
const switchFilter = (filter) => {
|
||||||
myFilter.value = filter
|
myFilter.value = filter
|
||||||
resetAndLoad()
|
// resetAndLoad()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -287,7 +294,9 @@ const viewActivityDetail = (activity) => {
|
|||||||
* 页面显示时刷新数据
|
* 页面显示时刷新数据
|
||||||
*/
|
*/
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
if (activeTab.value === 'list') {
|
||||||
getActivityListData(1) // 强制刷新第一页
|
getActivityListData(1) // 强制刷新第一页
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -296,7 +305,7 @@ onShow(() => {
|
|||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
// 监听详情页报名/取消报名后的刷新通知
|
// 监听详情页报名/取消报名后的刷新通知
|
||||||
uni.$on('refreshActivityList', (data) => {
|
uni.$on('refreshActivityList', (data) => {
|
||||||
console.log('收到活动列表刷新通知:', data)
|
// console.log('收到活动列表刷新通知:', data)
|
||||||
getActivityListData(1)
|
getActivityListData(1)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -312,9 +321,7 @@ onUnload(() => {
|
|||||||
* 监听我的活动筛选条件变化
|
* 监听我的活动筛选条件变化
|
||||||
*/
|
*/
|
||||||
watch(() => myFilter.value, () => {
|
watch(() => myFilter.value, () => {
|
||||||
if (activeTab.value === 'my') {
|
// 暂无审核功能,筛选条件暂不触发加载
|
||||||
resetAndLoad()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
<view class="upload-area">
|
<view class="upload-area">
|
||||||
<!-- 已上传图片 -->
|
<!-- 已上传图片 -->
|
||||||
<view class="uploaded-img" v-for="(img, index) in imgList" :key="index">
|
<view class="uploaded-img" v-for="(img, index) in imgList" :key="index">
|
||||||
<image :src="img" mode="aspectFill"></image>
|
<image :src="img" mode="aspectFill" class="upload-img"></image>
|
||||||
<text class="del-img" @click="deleteImg(index)">×</text>
|
<image src="http://47.104.199.163:9090/images/imgs/delete.png" class="upload-delete" @click="deleteImage(index)"></image>
|
||||||
|
<!-- <text class="del-img" @click="deleteImg(index)">×</text> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 上传按钮(最多3张) -->
|
<!-- 上传按钮(最多3张) -->
|
||||||
<view class="upload-btn" @click="chooseImg" v-if="imgList.length < 3">
|
<view class="upload-btn" @click="chooseImg" v-if="imgList.length < 3">
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { addActivityLive, signinActivityLive, uploadImage } from '../api/api.js';
|
import { addActivityLive, signinActivityLive, uploadFile } from '../api/api.js';
|
||||||
|
|
||||||
// 活动ID
|
// 活动ID
|
||||||
const activityId = ref('');
|
const activityId = ref('');
|
||||||
@@ -98,7 +99,7 @@ const chooseImg = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 删除图片
|
// 删除图片
|
||||||
const deleteImg = (index) => {
|
const deleteImage = (index) => {
|
||||||
imgList.value.splice(index, 1);
|
imgList.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,9 +148,9 @@ const reLocate = () => {
|
|||||||
// 上传所有图片
|
// 上传所有图片
|
||||||
const uploadAllImages = async () => {
|
const uploadAllImages = async () => {
|
||||||
if (imgList.value.length === 0) return [];
|
if (imgList.value.length === 0) return [];
|
||||||
const uploadPromises = imgList.value.map(img => uploadImage(img));
|
const uploadPromises = imgList.value.map(img => uploadFile(img));
|
||||||
const results = await Promise.all(uploadPromises);
|
const results = await Promise.all(uploadPromises);
|
||||||
return results.map(res => res.data?.url || res.data);
|
return results.map(res => res.url);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交实况
|
// 提交实况
|
||||||
@@ -258,11 +259,20 @@ const submitStatus = async () => {
|
|||||||
height: 80px;
|
height: 80px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.uploaded-img image {
|
.uploaded-img .upload-img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
.uploaded-img .upload-delete{
|
||||||
|
position: absolute;
|
||||||
|
top: -5px;
|
||||||
|
right: -5px;
|
||||||
|
width: 32rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
border-radius: 3rpx;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
.del-img {
|
.del-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ export const getResetPassword = (data) =>{
|
|||||||
return post('/api/resident/auth/resetPassword',data)
|
return post('/api/resident/auth/resetPassword',data)
|
||||||
}
|
}
|
||||||
// =========首页=======
|
// =========首页=======
|
||||||
|
// 获取bannar图
|
||||||
|
export const getBannarList = (data) =>{
|
||||||
|
return get('/resident/banner',data)
|
||||||
|
}
|
||||||
// 首页最新公告
|
// 首页最新公告
|
||||||
export const getNoticeLatest = () =>{
|
export const getNoticeLatest = () =>{
|
||||||
return get('/api/resident/notice/latest')
|
return get('/api/resident/notice/latest')
|
||||||
@@ -131,11 +135,7 @@ export const addVisitorData = (data) =>{
|
|||||||
return post("/api/visitor", data)
|
return post("/api/visitor", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通用文件上传
|
|
||||||
export const uploadImage = () => {
|
|
||||||
return upload('');
|
|
||||||
}
|
|
||||||
// 上传单张图片
|
// 上传单张图片
|
||||||
export const uploadFile = (filePath) => {
|
export const uploadFile = (filePath) => {
|
||||||
return upload(filePath, '');
|
return upload(filePath,'/api/resident/file/uploadImage');
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,42 @@ export const authLogout = (data) => {
|
|||||||
// 编辑房屋
|
// 编辑房屋
|
||||||
export const upDateMyHouse = (data) => {
|
export const upDateMyHouse = (data) => {
|
||||||
return putMethod(`/api/resident/my/house/${data.id}`, data)
|
return putMethod(`/api/resident/my/house/${data.id}`, 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('/api/manage/banner/getManagePhone',data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改身份证照片
|
// 修改身份证照片
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// http://192.168.1.215
|
|
||||||
// http://192.168.0.224
|
|
||||||
baseUrl = 'http://192.168.0.239:8080'; // 开发环境
|
baseUrl = 'http://192.168.0.239:8080'; // 开发环境
|
||||||
} else {
|
} else {
|
||||||
baseUrl = 'http://192.168.0.224:8080'; // 生产环境
|
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") {
|
export default function request(url, data = {}, method = "GET") {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 加载中提示(提升用户体验)
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '请求中...',
|
title: '请求中...',
|
||||||
mask: true
|
mask: true
|
||||||
@@ -24,87 +21,51 @@ export default function request(url, data = {}, method = "GET") {
|
|||||||
"clientid": "resident",
|
"clientid": "resident",
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
// header: {
|
|
||||||
// "token": uni.getStorageSync("token") || '',
|
|
||||||
// 'content-type': 'application/json'
|
|
||||||
// },
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
uni.hideLoading(); // 关闭加载提示
|
uni.hideLoading();
|
||||||
|
|
||||||
// 处理HTTP状态码(网络层面)
|
// HTTP 失败
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
const errMsg = `请求失败(${res.statusCode})`;
|
reject({ msg: `请求异常 ${res.statusCode}`, code: res.statusCode });
|
||||||
uni.showToast({
|
|
||||||
title: errMsg,
|
|
||||||
icon: "none",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
reject(errMsg);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理业务状态码(后端返回的data里)
|
const resData = res.data || {};
|
||||||
const resData = res.data || {}; // 兼容后端返回空的情况
|
|
||||||
|
|
||||||
// 优先处理token过期(401)
|
// token 过期
|
||||||
if (resData.code === 401) {
|
if (resData.code === 401) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '登录过期,请重新登录', icon: 'none' });
|
||||||
title: '登录过期,请重新登录',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
uni.clearStorageSync('token');
|
uni.clearStorageSync('token');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' });
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
|
||||||
});
|
|
||||||
}, 1500);
|
}, 1500);
|
||||||
reject('token 过期');
|
reject({ msg: '登录过期', code: 401 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 业务成功(code=200)
|
// 成功
|
||||||
if (resData.code === 200) {
|
if (resData.code === 200) {
|
||||||
resolve(resData); // 只返回核心数据,简化页面调用
|
resolve(resData);
|
||||||
}
|
}
|
||||||
// 业务失败(code=500)
|
// 业务失败
|
||||||
else if (resData.code === 500) {
|
else {
|
||||||
const errMsg = resData.msg || '请求失败';
|
reject({ msg: resData.msg || '请求失败', code: resData.code, data: resData });
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.hideLoading(); // 关闭加载提示
|
uni.hideLoading();
|
||||||
const errMsg = err.msg || '网络请求失败';
|
reject({ msg: '网络异常', code: -1, raw: err });
|
||||||
uni.showToast({
|
|
||||||
title: errMsg,
|
|
||||||
icon: "none",
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
reject(err);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const get = (url, data) => request(url, data, 'GET');
|
export const get = (url, data) => request(url, data, 'GET');
|
||||||
export const post = (url, data) => request(url, data, 'POST');
|
export const post = (url, data) => request(url, data, 'POST');
|
||||||
export const deleteMethod = (url, data) => request(url, data, 'DELETE');
|
export const deleteMethod = (url, data) => request(url, data, 'DELETE');
|
||||||
export const putMethod = (url, data) => request(url, data, 'PUT');
|
export const putMethod = (url, data) => request(url, data, 'PUT');
|
||||||
// 通用文件上传
|
|
||||||
|
// 上传
|
||||||
export const upload = (filePath, url) => {
|
export const upload = (filePath, url) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
@@ -116,15 +77,11 @@ export const upload = (filePath, url) => {
|
|||||||
"clientid": "resident"
|
"clientid": "resident"
|
||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.statusCode === 200) {
|
try {
|
||||||
const data = JSON.parse(res.data);
|
const data = JSON.parse(res.data);
|
||||||
if (data.code === 200) {
|
resolve(data.data || ''); // 直接返回图片地址
|
||||||
resolve(data);
|
} catch (e) {
|
||||||
} else {
|
resolve('');
|
||||||
reject(data.msg || '上传失败');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reject('上传失败');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const handleConfirm = () => {
|
|||||||
}
|
}
|
||||||
}).catch(err =>{
|
}).catch(err =>{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const getVerifyCode = () => {
|
|||||||
}
|
}
|
||||||
}).catch(err =>{
|
}).catch(err =>{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -62,7 +62,6 @@
|
|||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<button
|
<button
|
||||||
class="login-btn"
|
class="login-btn"
|
||||||
:disabled="!canLogin"
|
|
||||||
@click="handleLogin"
|
@click="handleLogin"
|
||||||
>
|
>
|
||||||
登录
|
登录
|
||||||
@@ -166,7 +165,26 @@ const getVerifyCode = () => {
|
|||||||
|
|
||||||
// 登录处理
|
// 登录处理
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
if (!canLogin.value) return;
|
if (!phoneNumber.value) {
|
||||||
|
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) {
|
||||||
|
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!verifyCode.value) {
|
||||||
|
uni.showToast({ title: '请输入验证码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^\d{6}$/.test(verifyCode.value)) {
|
||||||
|
uni.showToast({ title: '验证码为 6 位数字', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!agreeAgreement.value) {
|
||||||
|
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.showLoading({ title: '登录中...', mask: true });
|
uni.showLoading({ title: '登录中...', mask: true });
|
||||||
let params = {
|
let params = {
|
||||||
phone:phoneNumber.value,
|
phone:phoneNumber.value,
|
||||||
@@ -199,7 +217,7 @@ const handleLogin = () => {
|
|||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '网络异常,请重试',
|
title: err.msg || '网络异常,请重试',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -55,7 +55,6 @@
|
|||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<button
|
<button
|
||||||
class="login-btn"
|
class="login-btn"
|
||||||
:disabled="!canLogin"
|
|
||||||
@click="handleLogin"
|
@click="handleLogin"
|
||||||
>
|
>
|
||||||
登录
|
登录
|
||||||
@@ -109,30 +108,37 @@ onLoad(() =>{
|
|||||||
|
|
||||||
// 登录逻辑
|
// 登录逻辑
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
// if (!canLogin.value) {
|
|
||||||
// uni.showToast({ title: '请输入账号和密码', icon: 'none' });
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!phoneNumber.value) {
|
if (!phoneNumber.value) {
|
||||||
uni.showToast({ title: '请输入账号', icon: 'none' });
|
uni.showToast({ title: '请输入账号', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (phoneNumber.value.length < 4 || phoneNumber.value.length > 16) {
|
||||||
|
uni.showToast({ title: '账号长度需为 4-16 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!password.value) {
|
if (!password.value) {
|
||||||
uni.showToast({ title: '请输入密码', icon: 'none' });
|
uni.showToast({ title: '请输入密码', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (password.value.length < 6) {
|
||||||
|
uni.showToast({ title: '密码至少输入 6 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (password.value.length > 16) {
|
||||||
|
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!agreeAgreement.value){
|
if(!agreeAgreement.value){
|
||||||
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// uni.showLoading({ title: '登录中...', mask: true });
|
uni.showLoading({ title: '登录中...', mask: true });
|
||||||
let params = {
|
let params = {
|
||||||
username:phoneNumber.value,
|
username:phoneNumber.value,
|
||||||
password:password.value
|
password:password.value
|
||||||
}
|
}
|
||||||
getLoginPassword(params).then(res =>{
|
getLoginPassword(params).then(res =>{
|
||||||
// console.log('33333',res)
|
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
uni.setStorageSync('token', res.data.token);
|
uni.setStorageSync('token', res.data.token);
|
||||||
// 存用户ID
|
// 存用户ID
|
||||||
@@ -155,21 +161,11 @@ const handleLogin = () => {
|
|||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
// 测试
|
|
||||||
// uni.showLoading({
|
|
||||||
// title: '登录中...',
|
|
||||||
// mask:true
|
|
||||||
// });
|
|
||||||
// setTimeout(() => {
|
|
||||||
// uni.switchTab({ url: '/pages/index/index' });
|
|
||||||
// }, 1500);
|
|
||||||
// uni.hideLoading()
|
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- 立即注册按钮 -->
|
<!-- 立即注册按钮 -->
|
||||||
<button class="register-btn" :disabled="!canRegister" @click="handleRegister">
|
<button class="register-btn" @click="handleRegister">
|
||||||
立即注册
|
立即注册
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -191,7 +191,46 @@
|
|||||||
|
|
||||||
// 处理注册逻辑
|
// 处理注册逻辑
|
||||||
const handleRegister = () => {
|
const handleRegister = () => {
|
||||||
if (!canRegister.value) return;
|
if (!phoneNumber.value) {
|
||||||
|
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) {
|
||||||
|
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!verifyCode.value) {
|
||||||
|
uni.showToast({ title: '请输入验证码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!/^\d{6}$/.test(verifyCode.value)) {
|
||||||
|
uni.showToast({ title: '验证码为 6 位数字', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!account.value) {
|
||||||
|
uni.showToast({ title: '请输入账号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (account.value.length < 4 || account.value.length > 20) {
|
||||||
|
uni.showToast({ title: '账号长度需为 4-20 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!password.value) {
|
||||||
|
uni.showToast({ title: '请输入密码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (password.value.length < 6) {
|
||||||
|
uni.showToast({ title: '密码至少输入 6 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (password.value.length > 16) {
|
||||||
|
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!agreeAgreement.value) {
|
||||||
|
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '注册中...',
|
title: '注册中...',
|
||||||
mask: true
|
mask: true
|
||||||
@@ -223,7 +262,7 @@
|
|||||||
}
|
}
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,254 +1,215 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="更改手机号码" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
|
<uni-nav-bar
|
||||||
|
title="更改手机号码"
|
||||||
|
left-icon="left"
|
||||||
|
@click-left="goBack"
|
||||||
|
background-color="transparent"
|
||||||
|
:border="false"
|
||||||
|
>
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
|
||||||
<scroll-view class="page" scroll-y>
|
<scroll-view class="page" scroll-y>
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<view class="form-container">
|
<view class="form-container">
|
||||||
<!-- 手机号输入框(带+86前缀) -->
|
<!-- 手机号输入框(带+86前缀) -->
|
||||||
<view class="input-group phone-input">
|
<view class="input-group phone-input">
|
||||||
<image class="iconStyle" src="http://47.104.199.163:9090/images/propertyImgs/phoneIcon.png"></image>
|
<image class="iconStyle" src="http://47.104.199.163:9090/images/propertyImgs/phoneIcon.png"></image>
|
||||||
<input class="input-item" type="number" v-model="phone" placeholder="请输入手机号码"
|
<input
|
||||||
placeholder-class="input-placeholder" maxlength="11" />
|
class="input-item"
|
||||||
|
type="number"
|
||||||
|
v-model="phone"
|
||||||
|
placeholder="请输入手机号码"
|
||||||
|
placeholder-class="input-placeholder"
|
||||||
|
maxlength="11"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 验证码输入框(带获取验证码按钮) -->
|
<!-- 验证码输入框(带获取验证码按钮) -->
|
||||||
<view class="input-group code-input" style="padding: 0 0 0 20rpx;">
|
<view class="input-group code-input" style="padding: 0 0 0 20rpx;">
|
||||||
<image class="iconStyle" src="http://47.104.199.163:9090/images/propertyImgs/codeIcon.png">️</image>
|
<image class="iconStyle" src="http://47.104.199.163:9090/images/propertyImgs/codeIcon.png"></image>
|
||||||
|
<input
|
||||||
<input class="input-item code-item" type="number" v-model="code" placeholder="请输入验证码"
|
class="input-item code-item"
|
||||||
placeholder-class="input-placeholder" maxlength="6" />
|
type="number"
|
||||||
<button class="code-btn" :disabled="countdown > 0" @click="getCode">
|
v-model="code"
|
||||||
|
placeholder="请输入验证码"
|
||||||
|
placeholder-class="input-placeholder"
|
||||||
|
maxlength="6"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
class="code-btn"
|
||||||
|
:disabled="countdown > 0"
|
||||||
|
@click="getCode"
|
||||||
|
>
|
||||||
{{ countdown > 0 ? `${countdown}s后重发` : '获取验证码' }}
|
{{ countdown > 0 ? `${countdown}s后重发` : '获取验证码' }}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<view class="bottom-btn">
|
<view class="bottom-btn">
|
||||||
<button class="submit-btn" @click="onSubmit">确定</button>
|
<button class="submit-btn" @click="onSubmit">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, onUnmounted } from 'vue'
|
||||||
onReady: function(e) {},
|
import { getAuthSendSmsCode, getUserChangePhone } from '../api/apiSub.js'
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
// 响应式数据
|
||||||
|
const statusBarHeight = ref(20)
|
||||||
|
const phone = ref('')
|
||||||
|
const code = ref('')
|
||||||
|
const countdown = ref(0)
|
||||||
|
let timer = null // 定时器无需响应式,用普通变量
|
||||||
|
|
||||||
computed: {
|
// 获取验证码
|
||||||
|
const getCode = () => {
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onUnload() {
|
|
||||||
// 页面卸载时清除定时器
|
|
||||||
if (this.timer) clearInterval(this.timer)
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
phone: '',
|
|
||||||
code: '',
|
|
||||||
countdown: 0,
|
|
||||||
timer: null,
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
// 获取验证码
|
|
||||||
getCode() {
|
|
||||||
// 1. 手机号校验
|
|
||||||
const phoneReg = /^1[3-9]\d{9}$/
|
const phoneReg = /^1[3-9]\d{9}$/
|
||||||
if (!this.phone) {
|
if (!phone.value) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入手机号', icon: 'none' })
|
||||||
title: '请输入手机号',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!phoneReg.test(this.phone)) {
|
if (!phoneReg.test(phone.value)) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '手机号格式不正确', icon: 'none' })
|
||||||
title: '手机号格式不正确',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 模拟发送验证码(替换为实际接口)
|
uni.showLoading({ title: '发送中...' })
|
||||||
uni.showLoading({
|
getAuthSendSmsCode({ phone: phone.value, scene: 'register' }).then(res => {
|
||||||
title: '发送中...'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
if (res.code === 200) {
|
||||||
title: '验证码已发送',
|
uni.showToast({ title: '验证码已发送', icon: 'none' })
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
|
|
||||||
// 3. 开启60秒倒计时
|
// 60秒倒计时
|
||||||
this.countdown = 60
|
countdown.value = 60
|
||||||
this.timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
if (this.countdown <= 1) {
|
if (countdown.value <= 1) {
|
||||||
clearInterval(this.timer)
|
clearInterval(timer)
|
||||||
this.countdown = 0
|
countdown.value = 0
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.countdown--
|
countdown.value--
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}, 800)
|
} else {
|
||||||
},
|
uni.showToast({ title: res.msg || '发送失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: '发送失败', icon: 'none' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 提交修改
|
// 提交修改
|
||||||
onSubmit() {
|
const onSubmit = () => {
|
||||||
// 1. 基础校验
|
|
||||||
const phoneReg = /^1[3-9]\d{9}$/
|
const phoneReg = /^1[3-9]\d{9}$/
|
||||||
if (!this.phone) {
|
if (!phone.value) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入手机号', icon: 'none' })
|
||||||
title: '请输入手机号',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!phoneReg.test(this.phone)) {
|
if (!phoneReg.test(phone.value)) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '手机号格式不正确', icon: 'none' })
|
||||||
title: '手机号格式不正确',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.code) {
|
if (!code.value) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入验证码', icon: 'none' })
|
||||||
title: '请输入验证码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.showLoading({
|
|
||||||
title: '更换中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '更换成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
// 提交成功后跳转列表页
|
|
||||||
uni.hideLoading();
|
|
||||||
this.goBack();
|
|
||||||
}, 2500);
|
|
||||||
|
|
||||||
|
uni.showLoading({ title: '更换中...', mask: true })
|
||||||
|
getUserChangePhone({ newPhone: phone.value, smsCode: code.value,scene:'change_phone' }).then(res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({ title: '更换成功', icon: 'success' })
|
||||||
|
setTimeout(() => goBack(), 1500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '更换失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: '更换失败', icon: 'none' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
const goBack = () => {
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/my/settingIndex',
|
url: '/pageSubPack/my/settingIndex'
|
||||||
success: res => {},
|
})
|
||||||
fail: () => {},
|
}
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
// 页面卸载清除定时器
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (timer) clearInterval(timer)
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.contentStyle {
|
.contentStyle {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* background-color: #fff; */
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* 底部按钮 */
|
/* 底部按钮 */
|
||||||
.bottom-btn {
|
.bottom-btn {
|
||||||
padding: 20rpx 30rpx 40rpx;
|
padding: 20rpx 30rpx 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 表单容器 */
|
/* 表单容器 */
|
||||||
.form-container {
|
.form-container {}
|
||||||
/* padding: 60rpx 30rpx; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 输入框组(手机号+验证码行) */
|
/* 输入框组(手机号+验证码行) */
|
||||||
.input-group {
|
.input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
/* border: 1rpx solid #dcdcdc; */
|
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconStyle {
|
.iconStyle {
|
||||||
width:50rpx;
|
width: 50rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phone-input .input-item {
|
.phone-input .input-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
border: none;
|
border: none;
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 验证码输入框 */
|
/* 验证码输入框 */
|
||||||
.code-input .code-item {
|
.code-input .code-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-btn {
|
.code-btn {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #2F77FD;
|
background: #2F77FD;
|
||||||
@@ -256,27 +217,27 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-btn[disabled] {
|
.code-btn[disabled] {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 通用输入框样式 */
|
/* 通用输入框样式 */
|
||||||
.input-item {
|
.input-item {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-placeholder {
|
.input-placeholder {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 确定按钮 */
|
/* 确定按钮 */
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
@@ -286,11 +247,10 @@
|
|||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
border: none;
|
border: none;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-bar {
|
||||||
.status-bar {
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -34,98 +34,57 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref } from 'vue'
|
||||||
onReady: function(e) {},
|
import { authChangePassword } from '../api/apiSub.js'
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
|
|
||||||
},
|
const statusBarHeight = ref(20);
|
||||||
created() {
|
const oldPwd = ref('');
|
||||||
|
const newPwd = ref('');
|
||||||
},
|
const confirmPwd = ref('')
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
oldPwd: '',
|
|
||||||
newPwd: '',
|
|
||||||
confirmPwd: '',
|
|
||||||
|
|
||||||
|
|
||||||
}
|
// 方法
|
||||||
},
|
const onSubmit = () => {
|
||||||
|
if (!oldPwd.value) {
|
||||||
|
uni.showToast({ title: '请输入原密码', icon: 'none' })
|
||||||
methods: {
|
|
||||||
|
|
||||||
// 提交修改
|
|
||||||
onSubmit() {
|
|
||||||
// 1. 基础校验
|
|
||||||
if (!this.oldPwd) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入原密码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.newPwd) {
|
if (!newPwd.value) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '请输入新密码', icon: 'none' })
|
||||||
title: '请输入新密码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.newPwd !== this.confirmPwd) {
|
if (newPwd.value !== confirmPwd.value) {
|
||||||
uni.showToast({
|
uni.showToast({ title: '两次密码不一致', icon: 'none' })
|
||||||
title: '两次密码不一致',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({ title: '修改中...', mask: true })
|
||||||
title: '修改中...',
|
authChangePassword({
|
||||||
mask: true
|
oldPassword: oldPwd.value,
|
||||||
});
|
newPassword: newPwd.value,
|
||||||
setTimeout(() => {
|
confirmPassword: confirmPwd.value
|
||||||
uni.showToast({
|
}).then(res => {
|
||||||
title: '修改成功',
|
uni.hideLoading()
|
||||||
icon: 'success'
|
if (res.code === 200) {
|
||||||
});
|
uni.showToast({ title: '修改成功', icon: 'success' })
|
||||||
}, 1000);
|
setTimeout(() => goBack(), 1500)
|
||||||
setTimeout(() => {
|
} else {
|
||||||
// 提交成功后跳转列表页
|
uni.showToast({ title: res.msg || '修改失败', icon: 'none' })
|
||||||
uni.hideLoading();
|
}
|
||||||
this.goBack();
|
}).catch((err) => {
|
||||||
}, 2500);
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: err.msg || '修改失败', icon: 'none' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const goBack = () =>{
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/my/settingIndex',
|
url: '/pageSubPack/my/settingIndex',
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
});
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
onPullDownRefresh
|
onPullDownRefresh
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
authLogout
|
authLogout, getUserProfile, getUserNotify, changeUserNotify
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -47,7 +47,8 @@
|
|||||||
const cacheSize = ref(0)
|
const cacheSize = ref(0)
|
||||||
const settingList = ref([{
|
const settingList = ref([{
|
||||||
title: '更改手机号码',
|
title: '更改手机号码',
|
||||||
type: 'arrow'
|
type: 'text',
|
||||||
|
value: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '修改密码',
|
title: '修改密码',
|
||||||
@@ -144,7 +145,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onSwitchChange = (item, e) => {
|
const onSwitchChange = (item, e) => {
|
||||||
item.checked = e.detail.value
|
const checked = e.detail.value
|
||||||
|
const notifyEnabled = checked ? '1' : '0'
|
||||||
|
changeUserNotify({ notifyEnabled }).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
item.checked = checked
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '更新失败', icon: 'none' })
|
||||||
|
item.checked = !checked
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
uni.showToast({ title: '更新失败', icon: 'none' })
|
||||||
|
item.checked = !checked
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
@@ -152,6 +165,20 @@
|
|||||||
url: '/pages/myIndex/myIndex'
|
url: '/pages/myIndex/myIndex'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getUserProfile().then(res => {
|
||||||
|
if (res.code === 200 && res.data) {
|
||||||
|
const phone = res.data.phone || ''
|
||||||
|
settingList.value[0].value = phone
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getUserNotify().then(res => {
|
||||||
|
if (res.code === 200 && res.data) {
|
||||||
|
settingList.value[2].checked = res.data.notifyEnabled === '1'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
@clickLeft="narBack"
|
@clickLeft="narBack"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 滚动区域(能正常滚动的核心) -->
|
<!-- 滚动区域 -->
|
||||||
<scroll-view
|
<scroll-view
|
||||||
scroll-y
|
scroll-y
|
||||||
class="scroll-box"
|
class="scroll-box"
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ const getCommunityList = async (pageNum = 1, keyword = '') => {
|
|||||||
displayedCommunities.value = []
|
displayedCommunities.value = []
|
||||||
hasMoreData.value = false
|
hasMoreData.value = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "网络异常",
|
title: err.msg || "网络异常",
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
@@ -267,7 +267,7 @@ const handleConfirm = async () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '网络异常,请重试',
|
title: err.msg || '网络异常,请重试',
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -55,11 +55,11 @@
|
|||||||
<view class="upload-wrap">
|
<view class="upload-wrap">
|
||||||
<!-- 已上传图片 -->
|
<!-- 已上传图片 -->
|
||||||
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
|
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
|
||||||
<image :src="img" mode="aspectFill" @click="previewImage(img)"></image>
|
<image :src="img" mode="aspectFill" class="upload-img" @click="previewImage(img)"></image>
|
||||||
<uni-icons type="close" size="16" @click="deleteImage(index)"></uni-icons>
|
<image src="http://47.104.199.163:9090/images/imgs/delete.png" class="upload-delete" @click="deleteImage(index)"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<view class="upload-btn" @click="chooseImage">
|
<view class="upload-btn" @click="chooseImage" v-if="form.images.length < 3">
|
||||||
<uni-icons type="plus" size="24"></uni-icons>
|
<uni-icons type="plus" size="24"></uni-icons>
|
||||||
<text>上传照片</text>
|
<text>上传照片</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -298,17 +298,28 @@ const goToSelectProject = () => {
|
|||||||
uni.navigateTo({ url: '/pageSubPack/online-repair/personalSelectPoject' })
|
uni.navigateTo({ url: '/pageSubPack/online-repair/personalSelectPoject' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片
|
// 选择图片
|
||||||
const chooseImage = () => {
|
const chooseImage = () => {
|
||||||
|
// 计算还能选几张
|
||||||
|
const remainCount = 3 - form.value.images.length;
|
||||||
|
if (remainCount <= 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '最多只能上传3张图片',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 3,
|
count: remainCount, // 动态限制可选数量
|
||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
form.value.images = [...form.value.images, ...res.tempFilePaths]
|
const tempFilePaths = res.tempFilePaths
|
||||||
|
form.value.images = [...form.value.images, ...tempFilePaths]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 预览图片
|
||||||
const previewImage = (url) => {
|
const previewImage = (url) => {
|
||||||
uni.previewImage({ urls: form.value.images, current: url })
|
uni.previewImage({ urls: form.value.images, current: url })
|
||||||
}
|
}
|
||||||
@@ -326,7 +337,7 @@ const uploadImages = async () => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await uploadFile(path)
|
const res = await uploadFile(path)
|
||||||
urls.push(res.data || res.msg || '')
|
urls.push(res.url || '')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('上传失败', e)
|
console.error('上传失败', e)
|
||||||
}
|
}
|
||||||
@@ -469,24 +480,25 @@ textarea {
|
|||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
}
|
}
|
||||||
.upload-item image {
|
.upload-item .upload-img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.upload-item uni-icons {
|
.upload-item .upload-delete{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
right: -5px;
|
right: -5px;
|
||||||
background: #ff3b30;
|
width: 32rpx;
|
||||||
color: #fff;
|
height: 32rpx;
|
||||||
border-radius: 50%;
|
border-radius: 3rpx;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
.upload-btn {
|
.upload-btn {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
border: 1px dashed #ccc;
|
/* border: 1px dashed #ccc; */
|
||||||
|
background-color: #f3f3f3;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -38,11 +38,12 @@
|
|||||||
<view class="upload-wrap">
|
<view class="upload-wrap">
|
||||||
<!-- 已上传图片 -->
|
<!-- 已上传图片 -->
|
||||||
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
|
<view class="upload-item" v-for="(img, index) in form.images" :key="index">
|
||||||
<image :src="img" mode="aspectFill"></image>
|
<image :src="img" mode="aspectFill" class="upload-img"></image>
|
||||||
<uni-icons type="close" size="16" @click="deleteImage(index)"></uni-icons>
|
<image src="http://47.104.199.163:9090/images/imgs/delete.png" class="upload-delete" @click="deleteImage(index)"></image>
|
||||||
|
<!-- <uni-icons type="close" size="16" @click="deleteImage(index)"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<view class="upload-btn" @click="chooseImage">
|
<view class="upload-btn" @click="chooseImage" v-if="form.images.length < 3">
|
||||||
<uni-icons type="plus" size="24"></uni-icons>
|
<uni-icons type="plus" size="24"></uni-icons>
|
||||||
<text>上传照片</text>
|
<text>上传照片</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -93,15 +94,22 @@ const goBackSelect = () => {
|
|||||||
|
|
||||||
// 选择图片
|
// 选择图片
|
||||||
const chooseImage = () => {
|
const chooseImage = () => {
|
||||||
|
// 计算还能选几张
|
||||||
|
const remainCount = 3 - form.value.images.length;
|
||||||
|
if (remainCount <= 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '最多只能上传3张图片',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 3, // 最多选3张
|
count: remainCount, // 动态限制可选数量
|
||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 临时文件路径
|
|
||||||
const tempFilePaths = res.tempFilePaths
|
const tempFilePaths = res.tempFilePaths
|
||||||
form.value.images = [...form.value.images, ...tempFilePaths]
|
form.value.images = [...form.value.images, ...tempFilePaths]
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -111,7 +119,7 @@ const deleteImage = (index) => {
|
|||||||
form.value.images.splice(index, 1)
|
form.value.images.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传图片到服务器
|
// 上传图片
|
||||||
const uploadImages = async () => {
|
const uploadImages = async () => {
|
||||||
const uploadedUrls = []
|
const uploadedUrls = []
|
||||||
for (const path of form.value.images) {
|
for (const path of form.value.images) {
|
||||||
@@ -122,9 +130,12 @@ const uploadImages = async () => {
|
|||||||
try {
|
try {
|
||||||
const res = await uploadFile(path)
|
const res = await uploadFile(path)
|
||||||
// 根据后端实际返回结构调整字段名
|
// 根据后端实际返回结构调整字段名
|
||||||
uploadedUrls.push(res.data || res.msg || '')
|
uploadedUrls.push(res.url || '')
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
console.error('图片上传失败', e)
|
uni.showToast({
|
||||||
|
title:e.msg || '图片上传失败',
|
||||||
|
icon:'error'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return uploadedUrls
|
return uploadedUrls
|
||||||
@@ -250,24 +261,25 @@ const submitForm = async () => {
|
|||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
}
|
}
|
||||||
.upload-item image {
|
.upload-item .upload-img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.upload-item uni-icons {
|
.upload-item .upload-delete{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
right: -5px;
|
right: -5px;
|
||||||
background: #ff3b30;
|
width: 32rpx;
|
||||||
color: #fff;
|
height: 32rpx;
|
||||||
border-radius: 50%;
|
border-radius: 3rpx;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
.upload-btn {
|
.upload-btn {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
border: 1px dashed #ccc;
|
/* border: 1px dashed #ccc; */
|
||||||
|
background-color: #f3f3f3;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -267,11 +267,12 @@ const previewImage = (url) => {
|
|||||||
.photo-item {
|
.photo-item {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
border: 1px dashed #ccc;
|
/* border: 1px solid #ccc; */
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-container {
|
.btn-container {
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="投诉建议" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="投诉建议" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y>
|
||||||
|
|
||||||
<!-- 表单主体 -->
|
<!-- 表单主体 -->
|
||||||
<view class="form-content">
|
<view class="form-content">
|
||||||
<text class="form-tip">请填写反馈信息</text>
|
<text class="form-tip">请填写反馈信息</text>
|
||||||
@@ -19,9 +17,10 @@
|
|||||||
<text class="label-text">投诉类型</text>
|
<text class="label-text">投诉类型</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row-right">
|
<view class="row-right">
|
||||||
<text class="value-text"
|
<text class="value-text" :class="{placeholderStyle:selectedType}">
|
||||||
:class="{placeholderStyle:selectedType}">{{ selectedType || '请选择投诉类型' }}</text>
|
{{ selectedType || '请选择投诉类型' }}
|
||||||
<text class="arrow-icon">></text>
|
</text>
|
||||||
|
<uni-icons type="arrowright" size="16"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -32,9 +31,11 @@
|
|||||||
<text class="label-text">投诉物业</text>
|
<text class="label-text">投诉物业</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row-right">
|
<view class="row-right">
|
||||||
<text class="value-text"
|
<text class="value-text" :class="{placeholderStyle:selectedProperty}">
|
||||||
:class="{placeholderStyle:selectedProperty}">{{ selectedProperty || '请选择' }}</text>
|
{{ selectedProperty || '请选择' }}
|
||||||
<text class="arrow-icon">></text>
|
</text>
|
||||||
|
<uni-icons type="arrowright" size="16"></uni-icons>
|
||||||
|
<!-- <text class="arrow-icon"> > </text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -45,8 +46,7 @@
|
|||||||
<text class="label-text">问题描述</text>
|
<text class="label-text">问题描述</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row-right desc-right">
|
<view class="row-right desc-right">
|
||||||
<textarea v-model="description" placeholder="请描述您的问题" class="desc-input" auto-height
|
<textarea v-model="description" placeholder="请描述您的问题" class="desc-input" auto-height maxlength="500"></textarea>
|
||||||
maxlength="500"></textarea>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -93,15 +93,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 底部下一步按钮 -->
|
<!-- 底部下一步按钮 -->
|
||||||
<view class="bottom-btn-wrap">
|
<view class="bottom-btn-wrap">
|
||||||
<button class="next-btn" @click="submitForm">提交</button>
|
<button class="next-btn" @click="submitForm">提交</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- ================== 自定义Popup弹窗(纯view实现) ================== -->
|
<!-- ================== 自定义Popup弹窗(纯view实现) ================== -->
|
||||||
<!-- 蒙层 -->
|
<!-- 蒙层 -->
|
||||||
<view class="mask" v-if="showTypePopup || showPropertyPopup" @click="closeAllPopup"></view>
|
<view class="mask" v-if="showTypePopup || showPropertyPopup" @click="closeAllPopup"></view>
|
||||||
@@ -113,195 +111,188 @@
|
|||||||
<text class="title">选择投诉类型</text>
|
<text class="title">选择投诉类型</text>
|
||||||
<text class="close" @click="showTypePopup = false">✕</text>
|
<text class="close" @click="showTypePopup = false">✕</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
|
<view :class="{ active: selectedType === item }" class="item" v-for="(item, index) in typeOptions" :key="index" @click="selectType(item)">
|
||||||
<view :class="{ active: selectedType === item }" class="item" v-for="(item, index) in typeOptions"
|
{{ item.name }}
|
||||||
:key="index" @click="selectType(item)">
|
|
||||||
{{ item }}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 投诉物业弹窗 -->
|
<!-- 投诉物业弹窗 -->
|
||||||
<view v-if="showPropertyPopup" class="mask" @click="showPropertyPopup=false"></view>
|
<view v-if="showPropertyPopup" class="mask" @click="showPropertyPopup=false"></view>
|
||||||
<view v-if="showPropertyPopup" class="popup">
|
<view v-if="showPropertyPopup" class="popup">
|
||||||
<view class="popup-header">
|
<view class="popup-header">
|
||||||
<text class="title">选择投诉类型</text>
|
<text class="title">选择投诉物业</text>
|
||||||
<text class="close" @click="showPropertyPopup = false">✕</text>
|
<text class="close" @click="showPropertyPopup = false">✕</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view :class="{ active: selectedProperty === item }" class="item"
|
<view :class="{ active: selectedProperty === item }" class="item" v-for="(item, index) in propertyOptions" :key="index" @click="selectProperty(item)">
|
||||||
v-for="(item, index) in propertyOptions" :key="index" @click="selectProperty(item)">
|
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref } from 'vue'
|
||||||
onReady: function(e) {},
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
components: {
|
import { getComplainType, addComplain } from '../api/apiSub.js'
|
||||||
|
import { uploadFile } from '../api/api.js'
|
||||||
|
|
||||||
},
|
// 弹窗控制
|
||||||
|
const showTypePopup = ref(false)
|
||||||
|
const showPropertyPopup = ref(false)
|
||||||
|
|
||||||
computed: {
|
// 下拉选项
|
||||||
|
const typeOptions = ref([])
|
||||||
|
const propertyOptions = ref(['XX物业A', 'XX物业B', 'XX物业C'])
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const selectedType = ref('')
|
||||||
|
const selectedTypeId = ref('')
|
||||||
|
const selectedProperty = ref('')
|
||||||
|
const description = ref('')
|
||||||
|
const name = ref('')
|
||||||
|
const phone = ref('')
|
||||||
|
const villageId = ref('')
|
||||||
|
|
||||||
|
// 多图上传
|
||||||
|
const tempFilePaths = ref([])
|
||||||
|
const maxCount = ref(9)
|
||||||
|
|
||||||
|
// 关闭所有弹窗
|
||||||
|
const closeAllPopup = () => {
|
||||||
|
showTypePopup.value = false
|
||||||
|
showPropertyPopup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
},
|
onLoad(() => {
|
||||||
created() {
|
getSelectType()
|
||||||
|
villageId.value = uni.getStorageSync('currentVillageId') || ''
|
||||||
},
|
})
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
// 弹窗控制
|
|
||||||
showTypePopup: false,
|
|
||||||
showPropertyPopup: false,
|
|
||||||
|
|
||||||
// 下拉选项
|
|
||||||
typeOptions: ['物业服务', '社区服务', '其他'],
|
|
||||||
propertyOptions: ['XX物业A', 'XX物业B', 'XX物业C'], // 替换为实际数据
|
|
||||||
|
|
||||||
// 表单数据
|
|
||||||
selectedType: '',
|
|
||||||
selectedProperty: '',
|
|
||||||
description: '',
|
|
||||||
name: '',
|
|
||||||
phone: '',
|
|
||||||
|
|
||||||
// 多图上传
|
|
||||||
tempFilePaths: [],
|
|
||||||
maxCount: 9 // 最大上传9张
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取投诉类型
|
||||||
|
const getSelectType = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getComplainType()
|
||||||
|
if (res.code === 200) {
|
||||||
|
typeOptions.value = res.data || []
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
},
|
} catch (err) {
|
||||||
|
uni.showToast({ title: '网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择投诉类型
|
||||||
methods: {
|
const selectType = (item) => {
|
||||||
// 返回上一页
|
selectedType.value = item.name
|
||||||
navigateBack() {
|
selectedTypeId.value = item.id || ''
|
||||||
uni.navigateBack();
|
showTypePopup.value = false
|
||||||
},
|
|
||||||
|
|
||||||
// 关闭所有弹窗
|
|
||||||
closeAllPopup() {
|
|
||||||
this.showTypePopup = false;
|
|
||||||
this.showPropertyPopup = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择投诉类型
|
|
||||||
selectType(item) {
|
|
||||||
this.selectedType = item;
|
|
||||||
this.showTypePopup = false;
|
|
||||||
// 切换类型时清空物业选择
|
// 切换类型时清空物业选择
|
||||||
if (item !== '物业服务') {
|
if (item.name !== '物业服务') {
|
||||||
this.selectedProperty = '';
|
selectedProperty.value = ''
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
// 选择物业
|
// 选择物业
|
||||||
selectProperty(item) {
|
const selectProperty = (item) => {
|
||||||
this.selectedProperty = item;
|
selectedProperty.value = item
|
||||||
this.showPropertyPopup = false;
|
showPropertyPopup.value = false
|
||||||
},
|
}
|
||||||
|
|
||||||
// 多图选择
|
// 多图选择
|
||||||
chooseImages() {
|
const chooseImages = () => {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: this.maxCount - this.tempFilePaths.length,
|
count: maxCount.value - tempFilePaths.value.length,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
sourceType: ['album', 'camera'],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.tempFilePaths = [...this.tempFilePaths, ...res.tempFilePaths];
|
tempFilePaths.value = [...tempFilePaths.value, ...res.tempFilePaths]
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
|
|
||||||
// 删除图片
|
// 上传单张图片
|
||||||
deletePhoto(index) {
|
const uploadImageData = async (filePath) => {
|
||||||
this.tempFilePaths.splice(index, 1);
|
try {
|
||||||
},
|
const res = await uploadFile(filePath)
|
||||||
|
return res.url || ''
|
||||||
|
} catch (err) {
|
||||||
|
console.error('单张图片上传失败', err)
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 表单提交
|
// 删除图片
|
||||||
submitForm() {
|
const deletePhoto = (index) => {
|
||||||
// 基础校验
|
tempFilePaths.value.splice(index, 1)
|
||||||
if (!this.selectedType) {
|
}
|
||||||
return uni.showToast({
|
|
||||||
title: '请选择投诉类型',
|
// 表单提交
|
||||||
icon: 'none'
|
const submitForm = async () => {
|
||||||
});
|
// 校验
|
||||||
|
if (!selectedTypeId.value) {
|
||||||
|
return uni.showToast({ title: '请选择投诉类型', icon: 'none' })
|
||||||
}
|
}
|
||||||
if (this.selectedType === '物业服务' && !this.selectedProperty) {
|
if (selectedType.value === '物业服务' && !selectedProperty.value) {
|
||||||
return uni.showToast({
|
return uni.showToast({ title: '请选择物业', icon: 'none' })
|
||||||
title: '请选择物业',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (!this.description.trim()) {
|
if (!description.value.trim()) {
|
||||||
return uni.showToast({
|
return uni.showToast({ title: '请输入问题描述', icon: 'none' })
|
||||||
title: '请输入问题描述',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({ title: '提交中...', mask: true })
|
||||||
title: '提交中...',
|
|
||||||
mask: true
|
try {
|
||||||
});
|
// 上传图片
|
||||||
|
let imageUrls = []
|
||||||
|
for (let path of tempFilePaths.value) {
|
||||||
|
let url = await uploadImageData(path)
|
||||||
|
if (url) imageUrls.push(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造提交参数
|
||||||
|
const params = {
|
||||||
|
typeId: selectedTypeId.value,
|
||||||
|
problemDes: description.value.trim(),
|
||||||
|
complaintName: name.value || '',
|
||||||
|
phone: phone.value || '',
|
||||||
|
villageId: villageId.value || '',
|
||||||
|
problemImageUrl: imageUrls.join(',')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用提交接口
|
||||||
|
const res = await addComplain(params)
|
||||||
|
|
||||||
|
uni.hideLoading()
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({ title: '提交成功', icon: 'success' })
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.showToast({
|
|
||||||
title: '提交成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
// 提交成功后跳转列表页
|
|
||||||
uni.hideLoading();
|
|
||||||
this.goBack();
|
|
||||||
}, 2500);
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/service-list/complaintsSuggestionsIndex',
|
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
||||||
success: res => {},
|
})
|
||||||
fail: () => {},
|
}, 1500)
|
||||||
complete: () => {}
|
} else {
|
||||||
});
|
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: err.msg || '提交失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
const goBack = () => {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
@@ -314,8 +305,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
/* background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
@@ -397,7 +386,6 @@
|
|||||||
/* 问题描述行 */
|
/* 问题描述行 */
|
||||||
.desc-row {
|
.desc-row {
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
padding-top: 32rpx;
|
padding-top: 32rpx;
|
||||||
padding-bottom: 32rpx;
|
padding-bottom: 32rpx;
|
||||||
}
|
}
|
||||||
@@ -486,7 +474,6 @@
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* 底部按钮 */
|
/* 底部按钮 */
|
||||||
.bottom-btn-wrap {
|
.bottom-btn-wrap {
|
||||||
padding: 20rpx 30rpx 40rpx;
|
padding: 20rpx 30rpx 40rpx;
|
||||||
@@ -532,7 +519,6 @@
|
|||||||
.popup-header {
|
.popup-header {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
/* border-bottom: 1rpx solid #f0f0f0; */
|
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="投诉详情" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="投诉详情" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<!-- 投诉状态 -->
|
<!-- 投诉状态 -->
|
||||||
<view class="status-section">
|
<view class="status-section">
|
||||||
@@ -14,10 +13,12 @@
|
|||||||
<text class="title-line"></text>
|
<text class="title-line"></text>
|
||||||
<text class="title-text">投诉状态</text>
|
<text class="title-text">投诉状态</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="status-value"
|
<text class="status-value" :class="statusClass">{{ statusText }}</text>
|
||||||
:class="status=='pending'?'pending':status=='processing'?'processing':status=='completed'?'completed':''">{{status=='pending'?'待处理':status=='processing'?'处理中':status=='completed'?'已完成':''}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="completedDesc" v-if="status=='completed'">已完成处理,已联系工作人员粘贴标语提醒,并派人定时巡视。</view>
|
<view class="completedDesc" v-if="detail.status === '2' && detail.handleContent">
|
||||||
|
{{ detail.handleContent }}
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 投诉详情 -->
|
<!-- 投诉详情 -->
|
||||||
<view class="detail-section">
|
<view class="detail-section">
|
||||||
<view class="section-title">
|
<view class="section-title">
|
||||||
@@ -25,122 +26,106 @@
|
|||||||
<text class="title-text">投诉详情</text>
|
<text class="title-text">投诉详情</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 投诉类型 -->
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="info-label">投诉类型</text>
|
<text class="info-label">投诉类型</text>
|
||||||
<text class="info-value">社区服务</text>
|
<text class="info-value">{{ detail.typeName}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题描述 -->
|
|
||||||
<view class="info-item desc-item">
|
<view class="info-item desc-item">
|
||||||
<text class="info-label">问题描述</text>
|
<text class="info-label">问题描述</text>
|
||||||
<text class="info-value desc-value">
|
<text class="info-value desc-value">{{ detail.problemDes }}</text>
|
||||||
投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容
|
|
||||||
</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 投诉人姓名 -->
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="info-label">投诉人姓名</text>
|
<text class="info-label">投诉人姓名</text>
|
||||||
<text class="info-value">匿名</text>
|
<text class="info-value">{{ detail.complaintName }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 手机号码 -->
|
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<text class="info-label">手机号码</text>
|
<text class="info-label">手机号码</text>
|
||||||
<text class="info-value">无</text>
|
<text class="info-value">{{ detail.phone}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题照片 -->
|
<view class="photo-section" v-if="photoList.length > 0">
|
||||||
<view class="photo-section">
|
|
||||||
<text class="photo-label">问题照片</text>
|
<text class="photo-label">问题照片</text>
|
||||||
<view class="photo-list">
|
<view class="photo-list">
|
||||||
<image v-for="(img, index) in photoList" :key="index" :src="img" mode="aspectFill"
|
<image v-for="(img, index) in photoList" :key="index" :src="img" mode="aspectFill"
|
||||||
class="photo-item"></image>
|
class="photo-item" @click="previewImage(index)"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, computed } from 'vue'
|
||||||
onReady: function(e) {},
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
components: {
|
import { getComplainDetail } from '../api/apiSub.js'
|
||||||
|
|
||||||
},
|
const id = ref('')
|
||||||
|
|
||||||
computed: {
|
const detail = ref({})
|
||||||
|
const photoList = ref([])
|
||||||
|
|
||||||
|
// 状态映射
|
||||||
|
const statusMap = {
|
||||||
|
'0': { text: '待处理', class: 'pending' },
|
||||||
|
'1': { text: '处理中', class: 'processing' },
|
||||||
|
'2': { text: '已完成', class: 'completed' }
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusText = computed(() => {
|
||||||
|
return statusMap[detail.value.status]?.text || '待处理'
|
||||||
|
})
|
||||||
|
|
||||||
|
const statusClass = computed(() => {
|
||||||
|
return statusMap[detail.value.status]?.class || 'pending'
|
||||||
|
})
|
||||||
|
|
||||||
},
|
onLoad((option) => {
|
||||||
created() {
|
id.value = option.id || ''
|
||||||
|
if (id.value) {
|
||||||
},
|
detailData()
|
||||||
onShow() {
|
}
|
||||||
|
})
|
||||||
},
|
// 获取详情
|
||||||
onLoad(option) {
|
const detailData = async () => {
|
||||||
this.id = option.id;
|
try {
|
||||||
this.status = option.status;
|
const res = await getComplainDetail({ id: id.value })
|
||||||
|
if (res.code === 200 && res.data) {
|
||||||
|
detail.value = res.data
|
||||||
},
|
// 图片URL逗号分隔转数组
|
||||||
mounted() {},
|
if (res.data.problemImageUrl) {
|
||||||
|
photoList.value = res.data.problemImageUrl.split(',').filter(url => url.trim())
|
||||||
onReady() {
|
} else {
|
||||||
this.$nextTick(() => {
|
photoList.value = []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
uni.showToast({ title: typeof err === 'string' ? err.msg : '网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览图片
|
||||||
|
const previewImage = (index) => {
|
||||||
|
uni.previewImage({
|
||||||
|
current: photoList.value[index],
|
||||||
|
urls: photoList.value
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
status: '',
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
// 问题照片列表,替换为你的实际图片路径
|
|
||||||
photoList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
// 返回
|
||||||
},
|
const goBack = () => {
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/service-list/complaintsSuggestionsIndex',
|
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
||||||
success: res => {},
|
})
|
||||||
fail: () => {},
|
}
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -152,8 +137,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
/* background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
@@ -161,12 +144,10 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* background-color: #fff; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-container {}
|
.page-container {}
|
||||||
|
|
||||||
/* 通用标题样式(带蓝色竖线) */
|
|
||||||
.section-title {
|
.section-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -187,7 +168,6 @@
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 投诉状态区域 */
|
|
||||||
.status-section {
|
.status-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -210,7 +190,6 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 详情信息项通用样式 */
|
|
||||||
.info-item {
|
.info-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
@@ -233,7 +212,6 @@
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 问题描述特殊样式(多行文本) */
|
|
||||||
.desc-item {
|
.desc-item {
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
@@ -243,7 +221,6 @@
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 问题照片区域 */
|
|
||||||
.photo-section {
|
.photo-section {
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
@@ -258,9 +235,7 @@
|
|||||||
.photo-list {
|
.photo-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
/* 自动换行 */
|
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
/* 图片之间的间距(可改) */
|
|
||||||
margin: 10rpx 0px 20rpx 0px;
|
margin: 10rpx 0px 20rpx 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +254,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.completed {
|
.completed {
|
||||||
|
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,228 +1,151 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="投诉建议" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="投诉建议" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
<!-- 1. 顶部分段控制器 -->
|
|
||||||
|
<!-- 顶部分段控制器 -->
|
||||||
<view style="width: 60vw;">
|
<view style="width: 60vw;">
|
||||||
<uni-segmented-control :current="currentTab" :values="tabs" @clickItem="onTabClick" style-type="text"
|
<uni-segmented-control :current="currentTab" :values="tabs" @clickItem="onTabClick" style-type="text"
|
||||||
active-color="#007AFF" inactive-color="#999" class="seg-control"></uni-segmented-control>
|
active-color="#007AFF" inactive-color="#999" class="seg-control"></uni-segmented-control>
|
||||||
</view>
|
</view>
|
||||||
<!-- 表单区域 -->
|
|
||||||
<scroll-view class="page" scroll-y="true">
|
<!-- 列表区域 -->
|
||||||
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<view v-if="dataList.length === 0" class="empty-state">
|
<view v-if="dataList.length === 0" class="empty-state">
|
||||||
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
||||||
<text class="empty-text">
|
<text class="empty-text">暂无数据</text>
|
||||||
{{ '暂无数据'}}
|
|
||||||
</text>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 2. 投诉卡片主体 -->
|
|
||||||
<view class="card-wrapper" v-for="item,index in dataList" :key="index">
|
<!-- 投诉卡片 -->
|
||||||
<!-- 卡片头部:标题 + 标签 -->
|
<view class="card-wrapper" v-for="(item, index) in dataList" :key="index">
|
||||||
<view class="card-header">
|
<view class="card-header">
|
||||||
<text class="card-title">{{item.title}}</text>
|
<text class="card-title">{{ item.title }}</text>
|
||||||
<text class="card-tag"
|
<text class="card-tag"
|
||||||
:class="item.status=='pending'?'pending':item.status=='processing'?'processing':item.status=='completed'?'completed':''">{{item.status=='pending'?'待处理':item.status=='processing'?'处理中':item.status=='completed'?'已完成':''}}</text>
|
:class="item.status === 'pending' ? 'pending' : item.status === 'processing' ? 'processing' : 'completed'">
|
||||||
|
{{ item.status === 'pending' ? '待处理' : item.status === 'processing' ? '处理中' : '已完成' }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 卡片内容:描述 + 横向图片 -->
|
|
||||||
<view class="card-body">
|
<view class="card-body">
|
||||||
<text class="card-desc">
|
<text class="card-desc">{{ item.desc }}</text>
|
||||||
{{item.desc}}
|
|
||||||
</text>
|
|
||||||
|
|
||||||
<!-- 横向图片滚动区 -->
|
|
||||||
<view class="img-scroll-container">
|
<view class="img-scroll-container">
|
||||||
<view v-for="(img, imgIndex) in item.imgList" :key="imgIndex" class="img-item">
|
<view v-for="(img, imgIndex) in item.imgList" :key="imgIndex" class="img-item">
|
||||||
<image :src="img" mode="widthFix" class="card-img"></image>
|
<image :src="img" mode="widthFix" class="card-img"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 时间 & 详情 -->
|
|
||||||
<view class="card-footer">
|
<view class="card-footer">
|
||||||
<text class="card-time">{{item.time}}</text>
|
<text class="card-time">{{ item.time }}</text>
|
||||||
<text class="card-detail" @click="turnToDetail(item)">投诉详情</text>
|
<text class="card-detail" @click="turnToDetail(item)">投诉详情</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
|
<!-- 底部按钮 -->
|
||||||
<view class="bottom-btn-wrap">
|
<view class="bottom-btn-wrap">
|
||||||
<button class="next-btn" @click="addComplaintsSuggestions">投诉建议</button>
|
<button class="next-btn" @click="addComplaintsSuggestions">投诉建议</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, onMounted } from 'vue'
|
||||||
onReady: function(e) {},
|
import {onLoad} from '@dcloudio/uni-app'
|
||||||
components: {
|
import {getComplainList} from '../api/apiSub.js'
|
||||||
|
|
||||||
},
|
// 分段器
|
||||||
|
const tabs = ref(["待处理", "处理中", "已完成"])
|
||||||
|
const currentTab = ref(0)
|
||||||
|
const dataList = ref([])
|
||||||
|
|
||||||
computed: {
|
// 模拟数据
|
||||||
|
const pendingList = ref([])
|
||||||
|
const processingList = ref([])
|
||||||
|
const completedList = ref([])
|
||||||
|
|
||||||
|
// 状态映射
|
||||||
|
const statusMap = {
|
||||||
|
"0":'pending',
|
||||||
},
|
'1':'processing',
|
||||||
created() {
|
'2':'completed'
|
||||||
|
}
|
||||||
},
|
// 接口数据映射为模板所需格式
|
||||||
onShow() {
|
const mapItem = (item) => {
|
||||||
|
// 图片:单 URL 转数组
|
||||||
},
|
let imgList = []
|
||||||
|
if (item.problemImageUrl) {
|
||||||
mounted() {
|
imgList = [item.problemImageUrl]
|
||||||
this.getDataList()
|
}
|
||||||
},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
return {
|
||||||
/* 设定状态栏默认高度 */
|
id: item.id,
|
||||||
statusBarHeight: 20,
|
title: item.typeName,
|
||||||
// 分段器数据
|
status: statusMap[item.status] || 'pending',
|
||||||
tabs: ["待处理", "处理中", "已完成"],
|
desc: item.problemDes || '',
|
||||||
currentTab: 0,
|
time: item.createTime || '',
|
||||||
dataList: [],
|
imgList
|
||||||
pendingList: [{
|
|
||||||
id: 1,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'pending',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'pending',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'pending',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'pending',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
|
|
||||||
processingList: [{
|
|
||||||
id: 2,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'processing',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: []
|
|
||||||
}],
|
|
||||||
completedList: [{
|
|
||||||
id: 3,
|
|
||||||
title: '社区服务',
|
|
||||||
status: 'completed',
|
|
||||||
desc: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
|
||||||
time: '2026-08-01 10:05:46',
|
|
||||||
imgList: [
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community1.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community2.png",
|
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/community3.png"
|
|
||||||
]
|
|
||||||
}],
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
|
// 切换tab
|
||||||
methods: {
|
const onTabClick = (e) => {
|
||||||
turnToDetail(item) {
|
currentTab.value = e.currentIndex
|
||||||
uni.redirectTo({
|
getComplainListData()
|
||||||
url: '/pageSubPack/service-list/complaintsDetail?id=' + item.id + '&status=' + item.status,
|
}
|
||||||
success: res => {},
|
// 获取列表数据
|
||||||
fail: () => {},
|
const getComplainListData = async () =>{
|
||||||
complete: () => {}
|
try{
|
||||||
});
|
let params ={
|
||||||
},
|
status:currentTab.value,
|
||||||
getDataList() {
|
villageId:uni.getStorageSync('currentVillageId')
|
||||||
if (this.currentTab == 0) {
|
|
||||||
this.dataList = this.pendingList
|
|
||||||
} else if (this.currentTab == 1) {
|
|
||||||
|
|
||||||
this.dataList = this.processingList
|
|
||||||
} else if (this.currentTab == 2) {
|
|
||||||
|
|
||||||
this.dataList = this.completedList
|
|
||||||
}
|
}
|
||||||
},
|
const res = await getComplainList(params)
|
||||||
addComplaintsSuggestions() {
|
if(res.code === 200){
|
||||||
uni.redirectTo({
|
dataList.value = res.data.map(mapItem)
|
||||||
url: '/pageSubPack/service-list/addComplaints',
|
}else{
|
||||||
success: res => {},
|
dataList.value = []
|
||||||
fail: () => {},
|
uni.showToast({title:res.msg || '获取失败',icon:'error'})
|
||||||
complete: () => {}
|
}
|
||||||
});
|
}catch(err){
|
||||||
|
// console.log('dess',err)
|
||||||
|
uni.showToast({title:err.msg || '网络异常',icon:'error'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onLoad(() =>{
|
||||||
|
getComplainListData()
|
||||||
|
})
|
||||||
|
|
||||||
},
|
// 跳转到详情
|
||||||
onTabClick(e) {
|
const turnToDetail = (item) => {
|
||||||
this.currentTab = e.currentIndex;
|
uni.navigateTo({
|
||||||
this.getDataList()
|
url: `/pageSubPack/service-list/complaintsDetail?id=${item.id}&status=${item.status}`
|
||||||
},
|
})
|
||||||
goBack() {
|
}
|
||||||
|
|
||||||
|
// 新增投诉
|
||||||
|
const addComplaintsSuggestions = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pageSubPack/service-list/addComplaints'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
const goBack = () => {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/serviceIndex/serviceIndex',
|
url: '/pages/serviceIndex/serviceIndex'
|
||||||
success: res => {},
|
})
|
||||||
fail: () => {},
|
}
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
// 页面挂载后加载数据
|
||||||
|
// onMounted(() => {
|
||||||
|
// getDataList()
|
||||||
}
|
// })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f2f1f6;
|
background: #f2f1f6;
|
||||||
@@ -234,7 +157,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,14 +165,12 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* background-color: #fff; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-container {
|
.page-container {
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 空状态 */
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -267,27 +187,18 @@
|
|||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- 分段控制器样式 --- */
|
|
||||||
.seg-control {
|
.seg-control {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardScroll {
|
|
||||||
padding: 0rpx 0rpx 0px 0rpx;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- 卡片主体样式 --- */
|
|
||||||
.card-wrapper {
|
.card-wrapper {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 卡片头部:标题 & 标签 */
|
|
||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -322,14 +233,11 @@
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 卡片内容区 */
|
|
||||||
.card-body {
|
.card-body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 描述文本 */
|
|
||||||
.card-desc {
|
.card-desc {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
@@ -337,31 +245,24 @@
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 图片容器 */
|
|
||||||
.img-scroll-container {
|
.img-scroll-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
/* 自动换行 */
|
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
/* 图片之间的间距(可改) */
|
|
||||||
margin: 10rpx 0px 20rpx 0px;
|
margin: 10rpx 0px 20rpx 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 单个图片项 */
|
|
||||||
.img-item {
|
.img-item {
|
||||||
width: calc(33.333% - 14rpx);
|
width: calc(33.333% - 14rpx);
|
||||||
height: 52px;
|
height: 52px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 图片样式 */
|
|
||||||
.card-img {
|
.card-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部栏:时间 & 详情 */
|
|
||||||
.card-footer {
|
.card-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -378,12 +279,10 @@
|
|||||||
color: #2F77FD;
|
color: #2F77FD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部按钮 */
|
|
||||||
.bottom-btn-wrap {
|
.bottom-btn-wrap {
|
||||||
padding: 20rpx 30rpx 40rpx;
|
padding: 20rpx 30rpx 40rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
/* background-color: #fff; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.next-btn {
|
.next-btn {
|
||||||
@@ -392,7 +291,7 @@
|
|||||||
line-height: 96rpx;
|
line-height: 96rpx;
|
||||||
background-color: #1677ff;
|
background-color: #1677ff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 36rpx;
|
font-size: 28rpx;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 值班电话 -->
|
<!-- 值班电话 -->
|
||||||
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex">
|
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex" @click="callPhone(phoneItems.phoneNum)">
|
||||||
<text class="phone-label">值班电话:</text>
|
<text class="phone-label">值班电话:</text>
|
||||||
<text class="phone-num">{{phoneItems.phoneNum}}</text>
|
<text class="phone-num">{{phoneItems.phoneNum}}</text>
|
||||||
<!-- <text class="phone-icon"></text> -->
|
<!-- <text class="phone-icon"></text> -->
|
||||||
@@ -43,74 +43,54 @@
|
|||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, onMounted } from 'vue';
|
||||||
onReady: function(e) {},
|
import { getManagePhoneData } from '../api/apiSub.js'
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
const statusBarHeight = ref(20)
|
||||||
|
const dataList = ref([])
|
||||||
|
|
||||||
computed: {
|
// ====方法=====
|
||||||
|
function callPhone(phone) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
dataList: [{
|
|
||||||
src: 'http://47.104.199.163:9090/images/propertyImgs/community1.png',
|
|
||||||
propertyName: '北境碧桂园小区物业中心',
|
|
||||||
propertyAddress: 'A栋3单元1801',
|
|
||||||
phoneList: [{
|
|
||||||
phoneNum: '080-12312312312',
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
phoneNum: '080-12312312312',
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// 电话点击拨号
|
|
||||||
callPhone(phone) {
|
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: phone.replace(/-/g, "")
|
phoneNumber: phone.replace(/-/g, ""),
|
||||||
|
fail: (err) => {
|
||||||
|
console.log('用户取消拨号', err)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
goBack() {
|
function goBack() {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/serviceIndex/serviceIndex',
|
url: '/pages/serviceIndex/serviceIndex',
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
});
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const villageId = uni.getStorageSync('currentVillageId')
|
||||||
|
if (!villageId) {
|
||||||
|
uni.showToast({ title: '请先选择小区', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.showLoading({ title: '加载中...' })
|
||||||
|
getManagePhoneData({ villageId }).then(res => {
|
||||||
|
uni.hideLoading()
|
||||||
|
if (res.code === 200 && res.data) {
|
||||||
|
const d = res.data
|
||||||
|
dataList.value = [{
|
||||||
|
src: d.villageImageUrl || 'http://47.104.199.163:9090/images/propertyImgs/community1.png',
|
||||||
|
propertyName: d.villageName || '',
|
||||||
|
propertyAddress: d.address || '',
|
||||||
|
phoneList: d.managePhone ? [{ phoneNum: d.managePhone }] : []
|
||||||
|
}]
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: '获取失败', icon: 'none' })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
|
|||||||
@@ -1,239 +1,221 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y="true">
|
||||||
<!-- 问卷标题 -->
|
<view class="survey-title">{{ detailItem.title || '' }}</view>
|
||||||
<view class="survey-title">关于用户体验反馈的调查</view>
|
<view class="survey-desc">{{ detailItem.description || '' }}</view>
|
||||||
|
|
||||||
<!-- 问卷说明 -->
|
<view v-if="questionList.length === 0" class="empty-tip">
|
||||||
<view class="survey-desc">
|
<text>暂无问卷内容</text>
|
||||||
为了给您提供更好的服务,希望您能抽出几分钟时间,将进的感受和建议告诉我们,我们非常重视每位用户的宝贵意见,期待您的参与!
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题1:社区大门数量 -->
|
<view v-for="(q, idx) in questionList" :key="q.cid" class="question-item">
|
||||||
<view class="question-item">
|
|
||||||
<view class="question-title">
|
<view class="question-title">
|
||||||
<text class="required">*</text>1.您社区的大门数量
|
<text v-if="q.required" class="required">*</text>
|
||||||
</view>
|
<text>{{ idx + 1 }}.{{ q.title || '未命名问题' }}</text>
|
||||||
<view class="answer-text">1</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题2:消防演练符合项 -->
|
<!-- radio / checkbox: 展示选项及选中状态 -->
|
||||||
<view class="question-item">
|
<view v-if="q.type === 'radio' || q.type === 'checkbox'" class="option-list">
|
||||||
<view class="question-title">
|
<view
|
||||||
<text class="required">*</text>2.您所在的社区,关于消防演练,下列符合几项
|
v-for="(opt, oIdx) in q.options"
|
||||||
</view>
|
:key="oIdx"
|
||||||
<view class="answer-text">一周2~3次</view>
|
class="option-item"
|
||||||
</view>
|
:class="{ active: isOptionSelected(q, opt.label) }"
|
||||||
|
>
|
||||||
<!-- 问题3:健康医疗服务 -->
|
<text class="option-icon">{{ q.type === 'radio' ? '●' : '■' }}</text>
|
||||||
<view class="question-item">
|
<text class="option-label">{{ opt.label }}</text>
|
||||||
<view class="question-title">
|
|
||||||
<text class="required">*</text>3.您所在的社区是否有健康医疗服务
|
|
||||||
</view>
|
|
||||||
<view class="answer-text">是</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 问题4:综合评分(星级) -->
|
|
||||||
<view class="question-item">
|
|
||||||
<view class="question-title">
|
|
||||||
<text class="required">*</text>4.您对所在社区的综合评分
|
|
||||||
</view>
|
|
||||||
<view class="star-container">
|
|
||||||
<view v-for="(item, index) in 5" :key="index" class="star-item" :class="{ active: index < score }">
|
|
||||||
<text class="star-icon">★</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题5:建议 -->
|
<!-- input / textarea: 展示文本答案 -->
|
||||||
<view class="question-item">
|
<view v-if="q.type === 'input' || q.type === 'textarea'" class="answer-text">
|
||||||
<view class="question-title">
|
{{ getAnswerText(q.cid) || '未填写' }}
|
||||||
<text class="required">*</text>5.您还有哪些建议
|
|
||||||
</view>
|
</view>
|
||||||
<view class="answer-text">没有其他建议</view>
|
|
||||||
<!-- 如需可编辑输入框,替换为下方textarea -->
|
|
||||||
<!-- <textarea class="suggest-input" placeholder="请输入您的建议" v-model="suggestion" /> -->
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, computed } from 'vue'
|
||||||
onReady: function(e) {},
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
components: {
|
import { getQuestionnaireDetail } from '../api/apiSub.js'
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
score: 3, // 默认3星,对应原图
|
|
||||||
suggestion: ''
|
|
||||||
|
|
||||||
|
|
||||||
|
const currentId = ref('')
|
||||||
|
const detailItem = ref({})
|
||||||
|
|
||||||
|
const questionList = computed(() => {
|
||||||
|
const content = detailItem.value?.content
|
||||||
|
if (!content) return []
|
||||||
|
try {
|
||||||
|
const list = JSON.parse(content)
|
||||||
|
return Array.isArray(list) ? list : []
|
||||||
|
} catch (e) {
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pageSubPack/service-list/questionnaireSurveyIndex',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
const answerMap = computed(() => {
|
||||||
|
const answerContent = detailItem.value?.answerContent
|
||||||
|
if (!answerContent) return {}
|
||||||
|
try {
|
||||||
|
const list = JSON.parse(answerContent)
|
||||||
|
if (!Array.isArray(list)) return {}
|
||||||
|
const map = {}
|
||||||
|
for (const item of list) {
|
||||||
|
map[item.cid] = item.value
|
||||||
}
|
}
|
||||||
|
return map
|
||||||
|
} catch (e) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const getDetailData = async () => {
|
||||||
|
try {
|
||||||
|
const params = { questionnairedId: currentId.value }
|
||||||
|
const res = await getQuestionnaireDetail(params)
|
||||||
|
if (res.code === 200) {
|
||||||
|
const data = Array.isArray(res.data) ? res.data[0] : res.data
|
||||||
|
detailItem.value = data || {}
|
||||||
|
} else {
|
||||||
|
detailItem.value = {}
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
uni.showToast({ title: err.msg || '网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad((option) => {
|
||||||
|
if (option.id) {
|
||||||
|
currentId.value = option.id
|
||||||
|
getDetailData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function isOptionSelected(question, label) {
|
||||||
|
const val = answerMap.value[question.cid]
|
||||||
|
if (val === undefined || val === null) return false
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
return val.includes(label)
|
||||||
|
}
|
||||||
|
return val === label
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAnswerText(cid) {
|
||||||
|
return answerMap.value[cid]
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.contentStyle {
|
.contentStyle {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
}
|
||||||
/* background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%); */
|
|
||||||
}
|
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* background-color: #fff; */
|
margin-bottom: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 滚动内容区 */
|
.survey-title {
|
||||||
.content-scroll {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 标题与描述 */
|
|
||||||
.survey-title {
|
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px 0 20rpx 0;
|
margin: 0px 0 20rpx 0;
|
||||||
;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.survey-desc {
|
.survey-desc {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #4A4A4A;
|
color: #4A4A4A;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-item {
|
.empty-tip {
|
||||||
|
text-align: center;
|
||||||
|
padding: 100rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question-item {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-title {
|
.question-title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.required {
|
.required {
|
||||||
color: #ff0000;
|
color: #ff0000;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.answer-text {
|
.answer-text {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
padding-left: 30rpx;
|
padding-left: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 星级评分样式 */
|
.option-list {
|
||||||
.star-container {
|
padding-left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
gap: 16rpx;
|
||||||
padding-left: 30rpx;
|
padding: 16rpx 0;
|
||||||
}
|
|
||||||
|
|
||||||
.star-item {
|
|
||||||
font-size: 48rpx;
|
|
||||||
color: #dcdcdc;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: color 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.star-item.active {
|
|
||||||
color: #409eff;
|
|
||||||
/* 蓝色,和原图一致 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.star-icon {
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 建议输入框样式(如需可编辑) */
|
|
||||||
.suggest-input {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 200rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
border: 1rpx solid #e5e5e5;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
background: #fff;
|
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
box-sizing: border-box;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.status-bar {
|
.option-item.active {
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-icon {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-item.active .option-icon {
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-label {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-bar {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,314 +1,254 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y>
|
||||||
|
|
||||||
|
|
||||||
<view class="content-wrap">
|
<view class="content-wrap">
|
||||||
<!-- 问卷标题 -->
|
<!-- 问卷标题 -->
|
||||||
<view class="survey-title">关于用户体验反馈的调查</view>
|
<view class="survey-title">{{ detailItem.title || '' }}</view>
|
||||||
|
|
||||||
<!-- 问卷说明 -->
|
<!-- 问卷说明 -->
|
||||||
<view class="survey-desc">
|
<view class="survey-desc">{{ detailItem.description || '' }}</view>
|
||||||
为了给您提供更好的服务,希望您能抽出几分钟时间,将进的感受和建议告诉我们,我们非常重视每位用户的宝贵意见,期待您的参与!
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<view v-if="questionList.length === 0" class="empty-tip">
|
||||||
|
<text>问卷内容加载中,请稍后...</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题1:单选 -->
|
<!-- 动态问题列表 -->
|
||||||
<view class="question-item">
|
<view v-for="(q, idx) in questionList" :key="q.cid" class="question-item">
|
||||||
<view class="question-title">
|
<view class="question-title">
|
||||||
<text class="required">*</text>1.您社区的大门数量
|
<text v-if="q.required" class="required">*</text>
|
||||||
|
<text>{{ idx + 1 }}.{{ q.title || '未命名问题' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="radio-group">
|
|
||||||
<view class="radio-item" v-for="(item, index) in q1Options" :key="index"
|
<!-- 单选 -->
|
||||||
@click="selectRadio(1, index)">
|
<view v-if="q.type === 'radio'" class="radio-group">
|
||||||
<view class="radio-circle" :class="{ checked: q1Selected === index }">
|
<view
|
||||||
<text v-if="q1Selected === index" class="check-icon">✓</text>
|
v-for="(opt, oIdx) in q.options"
|
||||||
</view>
|
:key="oIdx"
|
||||||
<text class="radio-label">{{ item }}</text>
|
class="radio-item"
|
||||||
|
:class="{ checked: answers[q.cid] === opt.label }"
|
||||||
|
@click="selectRadio(q.cid, opt.label)"
|
||||||
|
>
|
||||||
|
<view class="radio-circle" :class="{ active: answers[q.cid] === opt.label }">
|
||||||
|
<text v-if="answers[q.cid] === opt.label" class="check-icon">✓</text>
|
||||||
</view>
|
</view>
|
||||||
|
<text class="radio-label">{{ opt.label }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 问题2:单选 -->
|
<!-- 多选 -->
|
||||||
<view class="question-item">
|
<view v-if="q.type === 'checkbox'" class="checkbox-group">
|
||||||
<view class="question-title">
|
<view
|
||||||
<text class="required">*</text>2.您所在的社区,关于消防演练,下列符合几项
|
v-for="(opt, oIdx) in q.options"
|
||||||
|
:key="oIdx"
|
||||||
|
class="checkbox-item"
|
||||||
|
:class="{ checked: isChecked(q.cid, opt.label) }"
|
||||||
|
@click="toggleCheckbox(q.cid, opt.label)"
|
||||||
|
>
|
||||||
|
<view class="checkbox-box" :class="{ active: isChecked(q.cid, opt.label) }">
|
||||||
|
<text v-if="isChecked(q.cid, opt.label)" class="check-icon">✓</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="radio-group">
|
<text class="checkbox-label">{{ opt.label }}</text>
|
||||||
<view class="radio-item" v-for="(item, index) in q2Options" :key="index"
|
|
||||||
@click="selectRadio(2, index)">
|
|
||||||
<view class="radio-circle" :class="{ checked: q2Selected === index }">
|
|
||||||
<text v-if="q2Selected === index" class="check-icon">✓</text>
|
|
||||||
</view>
|
|
||||||
<text class="radio-label">{{ item }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 问题3:自定义 Select (核心部分,不使用 picker) -->
|
|
||||||
<view class="question-item">
|
|
||||||
<view class="question-title">
|
|
||||||
<text class="required">*</text>3.您所在的社区是否有健康医疗服务
|
|
||||||
</view>
|
|
||||||
<!-- 模拟输入框,点击展开下拉 -->
|
|
||||||
<view class="select-wrapper" @click="toggleDropdown">
|
|
||||||
<text class="select-text" v-if="q3Selected">
|
|
||||||
{{ q3Selected }}
|
|
||||||
</text>
|
|
||||||
<text class="select-placeholder" v-else>
|
|
||||||
请选择是否有该项服务
|
|
||||||
</text>
|
|
||||||
<text class="select-arrow">▼</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 下拉面板 (遮罩 + 列表) -->
|
|
||||||
<view class="dropdown-mask" v-if="showDropdown" @click="hideDropdown"></view>
|
|
||||||
<view class="dropdown-panel" v-if="showDropdown">
|
|
||||||
<view class="dropdown-item" v-for="(item, index) in q3Options" :key="index"
|
|
||||||
@click="selectQ3(index)" :class="{ active: index === q3Index }">
|
|
||||||
{{ item }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 问题4:星级评分 -->
|
|
||||||
<view class="question-item">
|
|
||||||
<view class="question-title">
|
|
||||||
<text class="required">*</text>4.您对所在社区的综合评分
|
|
||||||
</view>
|
|
||||||
<view class="star-group">
|
|
||||||
<view class="star-item" v-for="(item, index) in 5" :key="index" @click="selectStar(index + 1)">
|
|
||||||
<text class="star-icon" :class="{ active: index < q4Score }">★</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 问题5:文本输入 -->
|
|
||||||
<view class="question-item">
|
|
||||||
<view class="question-title">
|
|
||||||
<text class="required">*</text>5.您还有哪些建议
|
|
||||||
</view>
|
|
||||||
<textarea class="textarea-input" v-model="q5Content" placeholder="请输入您还有哪些建议" maxlength="500" />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 单行输入 -->
|
||||||
|
<view v-if="q.type === 'input'">
|
||||||
|
<input
|
||||||
|
class="text-input"
|
||||||
|
v-model="answers[q.cid]"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 多行输入 -->
|
||||||
|
<view v-if="q.type === 'textarea'">
|
||||||
|
<textarea
|
||||||
|
class="textarea-input"
|
||||||
|
v-model="answers[q.cid]"
|
||||||
|
placeholder="请输入"
|
||||||
|
maxlength="500"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 固定底部提交按钮 -->
|
<!-- 固定底部提交按钮 -->
|
||||||
<view class="submit-btn-wrap">
|
<view class="submit-btn-wrap">
|
||||||
<button class="submit-btn" @click="handleSubmit">提交</button>
|
<button class="submit-btn" @click="handleSubmit">提交</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, computed } from 'vue'
|
||||||
onReady: function(e) {},
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
components: {
|
import { getQuestionnaireDetail, submitQuestionnair } from '../api/apiSub.js'
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
// 问题1
|
|
||||||
q1Options: ['1', '2', '3', '4'],
|
|
||||||
q1Selected: -1,
|
|
||||||
// 问题2
|
|
||||||
q2Options: ['一周2~3次', '一月2~3次', '一年2~3次', '基本不买'],
|
|
||||||
q2Selected: -1,
|
|
||||||
// 问题3 (自定义Select)
|
|
||||||
q3Options: ['有', '无'], // 选项列表
|
|
||||||
q3Selected: '', // 绑定显示值
|
|
||||||
q3Index: -1, // 绑定索引
|
|
||||||
showDropdown: false, // 控制下拉面板显示
|
|
||||||
// 问题4
|
|
||||||
q4Score: -1,
|
|
||||||
// 问题5
|
|
||||||
q5Content: ''
|
|
||||||
|
|
||||||
|
|
||||||
|
const detailItem = ref({})
|
||||||
|
|
||||||
|
const questionList = computed(() => {
|
||||||
|
const content = detailItem.value?.content
|
||||||
|
if (!content) return []
|
||||||
|
try {
|
||||||
|
const list = JSON.parse(content)
|
||||||
|
return Array.isArray(list) ? list : []
|
||||||
|
} catch (e) {
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
|
|
||||||
|
const answers = ref({})
|
||||||
|
// 获取问卷调查
|
||||||
|
const getDetailData = async (id) => {
|
||||||
|
try {
|
||||||
|
const res = await getQuestionnaireDetail({ id })
|
||||||
|
// console.log('接口返回:', JSON.stringify(res))
|
||||||
|
if (res.code === 200) {
|
||||||
|
const data = Array.isArray(res.data) ? res.data[0] : res.data
|
||||||
|
detailItem.value = data || {}
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
uni.showToast({ title: err.msg || '网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
methods: {
|
onLoad((option) => {
|
||||||
selectRadio(type, index) {
|
if (option.id) {
|
||||||
if (type === 1) this.q1Selected = index
|
getDetailData(option.id)
|
||||||
else this.q2Selected = index
|
} else {
|
||||||
},
|
uni.showToast({ title: '缺少问卷ID', icon: 'none' })
|
||||||
// 问题3:切换下拉显示
|
}
|
||||||
toggleDropdown() {
|
})
|
||||||
this.showDropdown = !this.showDropdown
|
|
||||||
},
|
const selectRadio = (cid, label) => {
|
||||||
// 问题3:隐藏下拉
|
answers.value[cid] = label
|
||||||
hideDropdown() {
|
}
|
||||||
this.showDropdown = false
|
|
||||||
},
|
const isChecked = (cid, label) => {
|
||||||
// 问题3:选择选项
|
const arr = answers.value[cid]
|
||||||
selectQ3(index) {
|
if (!Array.isArray(arr)) return false
|
||||||
this.q3Index = index
|
return arr.includes(label)
|
||||||
this.q3Selected = this.q3Options[index]
|
}
|
||||||
this.hideDropdown() // 选择后自动关闭
|
|
||||||
},
|
const toggleCheckbox = (cid, label) => {
|
||||||
// 问题4
|
if (!Array.isArray(answers.value[cid])) {
|
||||||
selectStar(score) {
|
answers.value[cid] = []
|
||||||
this.q4Score = score
|
}
|
||||||
},
|
const arr = answers.value[cid]
|
||||||
// 提交
|
const pos = arr.indexOf(label)
|
||||||
handleSubmit() {
|
if (pos > -1) {
|
||||||
if (this.q1Selected === -1) {
|
arr.splice(pos, 1)
|
||||||
uni.showToast({
|
} else {
|
||||||
title: '请选择社区大门数量',
|
arr.push(label)
|
||||||
icon: 'none'
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
for (const q of questionList.value) {
|
||||||
|
if (q.required) {
|
||||||
|
const ans = answers.value[q.cid]
|
||||||
|
if (ans === undefined || ans === null || ans === '' || (Array.isArray(ans) && ans.length === 0)) {
|
||||||
|
uni.showToast({ title: `请填写第${questionList.value.indexOf(q) + 1}题`, icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.q2Selected === -1) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择社区消防演练频率',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if (this.q3Index === -1) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择社区是否有健康医疗服务',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if (this.q4Score === -1) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择对社区的综合评分',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.q5Content.trim()) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入建议',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.showLoading({
|
|
||||||
title: '提交中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '提交成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
// 提交成功后跳转列表页
|
|
||||||
uni.hideLoading();
|
|
||||||
this.goBack();
|
|
||||||
}, 2500);
|
|
||||||
},
|
|
||||||
goBack() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pageSubPack/service-list/questionnaireSurveyIndex',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
const answerList = []
|
||||||
|
for (const q of questionList.value) {
|
||||||
|
const val = answers.value[q.cid]
|
||||||
|
if (val !== undefined && val !== null && val !== '' && !(Array.isArray(val) && val.length === 0)) {
|
||||||
|
answerList.push({ cid: q.cid, value: val })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showLoading({ title: '提交中...', mask: true })
|
||||||
|
try {
|
||||||
|
const res = await submitQuestionnair(detailItem.value.questionnaireId, answerList)
|
||||||
|
uni.hideLoading()
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({ title: '提交成功', icon: 'success' })
|
||||||
|
setTimeout(() => { goBack() }, 1500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log('errrr',err)
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: err.msg || '网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const goBack = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f2f1f6;
|
background: #f2f1f6;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.contentStyle {
|
.contentStyle {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* background-color: #fff; */
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* 滚动内容区 */
|
.content-wrap {
|
||||||
.content-scroll {}
|
padding-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.content-wrap {
|
.survey-title {
|
||||||
// padding-bottom: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 标题与描述 */
|
|
||||||
.survey-title {
|
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px 0 20rpx 0;
|
margin: 0px 0 20rpx 0;
|
||||||
;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.survey-desc {
|
.survey-desc {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #4A4A4A;
|
color: #4A4A4A;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 问题项 */
|
.empty-tip {
|
||||||
.question-item {
|
text-align: center;
|
||||||
|
padding: 100rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question-item {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
.question-title {
|
.question-title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom:10rpx;
|
margin-bottom: 10rpx;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
|
|
||||||
.required {
|
.required {
|
||||||
@@ -317,20 +257,21 @@
|
|||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 单选按钮 */
|
/* 单选 */
|
||||||
.radio-group {
|
.radio-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 30rpx;
|
gap: 20rpx;
|
||||||
padding-left: 30rpx;
|
padding-left: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-item {
|
.radio-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
gap: 16rpx;
|
||||||
|
padding: 12rpx 0;
|
||||||
|
|
||||||
.radio-circle {
|
.radio-circle {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
@@ -341,114 +282,84 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
&.checked {
|
&.active {
|
||||||
background-color: #007aff;
|
background-color: #007aff;
|
||||||
border-color: #007aff;
|
border-color: #007aff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.check-icon {
|
.check-icon {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 24rpx;
|
font-size: 22rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.radio-label {
|
.radio-label {
|
||||||
font-size: 34rpx;
|
font-size: 32rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 核心:自定义 Select 样式 (模拟输入框) */
|
/* 多选 */
|
||||||
.select-wrapper {
|
.checkbox-group {
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
gap: 20rpx;
|
||||||
height: 80rpx;
|
padding-left: 10rpx;
|
||||||
padding: 0 20rpx;
|
}
|
||||||
border: 2rpx solid #e5e5e5;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.select-placeholder {
|
.checkbox-item {
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.select-arrow {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 下拉遮罩层 */
|
|
||||||
.dropdown-mask {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 下拉面板 */
|
|
||||||
.dropdown-panel {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
max-height: 400rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 2rpx solid #e5e5e5;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
z-index: 100;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item {
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
color: #007aff;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 星级评分 */
|
|
||||||
.star-group {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16rpx;
|
gap: 16rpx;
|
||||||
margin-left: 30rpx;
|
padding: 12rpx 0;
|
||||||
|
|
||||||
.star-icon {
|
.checkbox-box {
|
||||||
font-size: 56rpx;
|
width: 40rpx;
|
||||||
color: #e5e5e5;
|
height: 40rpx;
|
||||||
transition: all 0.2s ease;
|
border-radius: 8rpx;
|
||||||
|
border: 2rpx solid #ccc;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: #007aff;
|
background-color: #007aff;
|
||||||
}
|
border-color: #007aff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 文本输入框 */
|
.check-icon {
|
||||||
.textarea-input {
|
color: #fff;
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox-label {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文本输入 */
|
||||||
|
.text-input {
|
||||||
|
width: calc(100% - 30rpx);
|
||||||
|
height: 80rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
border: 2rpx solid #e5e5e5;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea-input {
|
||||||
width: calc(100% - 30rpx);
|
width: calc(100% - 30rpx);
|
||||||
min-height: 240rpx;
|
min-height: 240rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
@@ -459,18 +370,11 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部占位 & 提交按钮 */
|
/* 提交按钮 */
|
||||||
.bottom-placeholder {
|
.submit-btn-wrap {
|
||||||
height: 120rpx; // 高度要大于等于按钮高度
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-btn-wrap {
|
|
||||||
padding: 20rpx 30rpx 40rpx;
|
padding: 20rpx 30rpx 40rpx;
|
||||||
display: flex;
|
|
||||||
gap: 20rpx;
|
|
||||||
// background-color: #fff;
|
|
||||||
|
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -489,10 +393,10 @@
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar {
|
.status-bar {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,240 +1,152 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @clickLeft="goBack">
|
<uni-nav-bar title="问卷调查" backgroundColor="transparent" :border="false" left-icon="left" @click-left="goBack" />
|
||||||
</uni-nav-bar>
|
|
||||||
|
|
||||||
|
|
||||||
<view style="width: 40vw;">
|
<view style="width: 40vw;">
|
||||||
<uni-segmented-control :current="currentTab" :values="tabs" @clickItem="switchTab" style-type="text"
|
<uni-segmented-control :current="currentTab" :values="tabs" @click-item="switchTab" style-type="text"
|
||||||
active-color="#007AFF" inactive-color="#999" class="seg-control"></uni-segmented-control>
|
active-color="#007AFF" inactive-color="#999" class="seg-control" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<scroll-view class="page" scroll-y="true">
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="list-container">
|
<view class="list-container">
|
||||||
<view v-if="currentList.length === 0" class="empty-state">
|
<view v-if="currentList.length === 0" class="empty-state">
|
||||||
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
||||||
<text class="empty-text">
|
<text class="empty-text">暂无数据</text>
|
||||||
{{ '暂无数据'}}
|
|
||||||
</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item, index) in currentList" :key="index" class="list-item" :class="{
|
|
||||||
|
<!-- 列表项:点击高亮 -->
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in currentList"
|
||||||
|
:key="index"
|
||||||
|
class="list-item"
|
||||||
|
:class="{
|
||||||
disabled: currentTab === 1,
|
disabled: currentTab === 1,
|
||||||
selected: currentTab === 0 && item.status === '已参与'
|
selected: selectedIndex === index // 点击才高亮
|
||||||
}" @click="handleItemClick(item)">
|
}"
|
||||||
|
@click="handleItemClick(item, index)"
|
||||||
|
>
|
||||||
<view class="item-content">
|
<view class="item-content">
|
||||||
<view class="item-title">{{ item.title }}</view>
|
<view class="item-title">{{ item.title }}</view>
|
||||||
<view class="item-info">
|
<view class="item-info">
|
||||||
<text class="info-time">{{ item.time }}</text>
|
<text class="info-time">{{ item.createTime }}</text>
|
||||||
<text class="info-community">{{ item.community }}</text>
|
<text class="info-community">{{ item.villageName }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-status"
|
<view
|
||||||
:class="{joined: currentTab === 0 &&item.status === '已参与',unjoined: item.status === '未参与'||currentTab === 1, }">
|
class="item-status"
|
||||||
{{ item.status }}
|
:class="{
|
||||||
|
joined: item.answerStatus === '1',
|
||||||
|
unjoined: item.answerStatus === '0'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ item.statusName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 占位 -->
|
<view style="width: 100%;height:2rpx;"></view>
|
||||||
<view style="width: 100%;height:2rpx;"> </view>
|
|
||||||
|
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, computed, onMounted } from 'vue'
|
||||||
onReady: function(e) {},
|
import {getQuestionnaireList} from '../api/apiSub.js'
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
// 状态栏高度
|
||||||
|
const statusBarHeight = ref(20)
|
||||||
|
// 当前选中tab
|
||||||
|
const currentTab = ref(0)
|
||||||
|
// tab标题
|
||||||
|
const tabs = ["收集中", "已结束"]
|
||||||
|
|
||||||
computed: {
|
// 收集中列表
|
||||||
|
const collectingList = ref([])
|
||||||
|
// 已结束列表
|
||||||
|
const endedList = ref([])
|
||||||
|
|
||||||
|
// 点击选中的索引(控制高亮)
|
||||||
|
const selectedIndex = ref(-1)
|
||||||
|
|
||||||
// 计算当前显示的列表
|
// 计算属性:当前显示列表
|
||||||
currentList() {
|
const currentList = computed(() => {
|
||||||
return this.currentTab === 0 ? this.collectingList : this.endedList;
|
return currentTab.value === 0 ? collectingList.value : endedList.value
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.getDataList()
|
|
||||||
},
|
|
||||||
|
|
||||||
onReady() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
/* 设定状态栏默认高度 */
|
|
||||||
statusBarHeight: 20,
|
|
||||||
currentTab: 0, // 0=收集中,1=已结束
|
|
||||||
tabs: ["收集中", "已结束"],
|
|
||||||
// 收集中列表数据
|
|
||||||
collectingList: [{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '已参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
}, {
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
}, {
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2026-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// 已结束列表数据
|
|
||||||
endedList: [{
|
|
||||||
title: '问卷调查名称问卷调查名称问卷调查...',
|
|
||||||
time: '2023-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '已参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称调查...',
|
|
||||||
time: '2023-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '问卷调查名称问卷调查名称调查...',
|
|
||||||
time: '2023-09-01 11:00:56',
|
|
||||||
community: '阳光海岸社区',
|
|
||||||
status: '未参与',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
// Tab切换
|
// Tab切换
|
||||||
|
const switchTab = (e) => {
|
||||||
|
currentTab.value = e.currentIndex
|
||||||
|
selectedIndex.value = -1 // 切换tab清空选中
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
switchTab(e) {
|
// 获取列表数据
|
||||||
this.currentTab = e.currentIndex;
|
const getDataList = async () => {
|
||||||
this.getDataList()
|
try{
|
||||||
},
|
let params ={
|
||||||
|
status: currentTab.value === 0 ? 1 : 2
|
||||||
|
}
|
||||||
|
const res = await getQuestionnaireList(params)
|
||||||
|
if(res.code === 200){
|
||||||
|
const list = (res.data || []).map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
statusName: item.answerStatus == "0" ? '未参与' : '已参与'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(currentTab.value === 0){
|
||||||
|
collectingList.value = list
|
||||||
|
}else{
|
||||||
|
endedList.value = list
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}catch(err){
|
||||||
|
uni.showToast({ title: err.msg ||'网络异常', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 列表项点击
|
// 列表项点击(index 控制高亮)
|
||||||
handleItemClick(item) {
|
const handleItemClick = (item, index) => {
|
||||||
if (item.status == '已参与') {
|
selectedIndex.value = index //点击哪个,哪个高亮
|
||||||
this.turnToDetail(item)
|
if (item.answerStatus === '1') {
|
||||||
|
turnToDetail(item)
|
||||||
} else {
|
} else {
|
||||||
if (this.currentTab === 0) {
|
// if (currentTab.value === 0) {
|
||||||
this.turnToFillout(item)
|
turnToFillout(item)
|
||||||
} else if (this.currentTab === 1) {
|
// }
|
||||||
// 未参与的已结束问卷
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
// 跳转到填写问卷
|
||||||
turnToFillout(item) {
|
const turnToFillout = (item) => {
|
||||||
// 跳转到问卷填写
|
uni.navigateTo({
|
||||||
uni.redirectTo({
|
url: `/pageSubPack/service-list/questionnaireFillout?id=${item.id}`
|
||||||
url: `/pageSubPack/service-list/questionnaireFillout`,
|
})
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
turnToDetail(item) {
|
|
||||||
// 跳转到问卷详情
|
|
||||||
uni.redirectTo({
|
|
||||||
url: `/pageSubPack/service-list/questionnaireDetail`,
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDataList() {
|
|
||||||
if (this.currentTab == 0) {
|
|
||||||
this.dataList = this.collectingList
|
|
||||||
} else if (this.currentTab == 1) {
|
|
||||||
|
|
||||||
this.dataList = this.endedList
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
onTabClick(e) {
|
// 跳转到详情
|
||||||
this.currentTab = e.currentIndex;
|
const turnToDetail = (item) => {
|
||||||
this.getDataList()
|
uni.navigateTo({
|
||||||
},
|
url: `/pageSubPack/service-list/questionnaireDetail?id=${item.id}`
|
||||||
goBack() {
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
const goBack = () => {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/serviceIndex/serviceIndex',
|
url: '/pages/serviceIndex/serviceIndex'
|
||||||
success: res => {},
|
})
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生命周期:页面挂载完成
|
||||||
|
onMounted(() => {
|
||||||
|
getDataList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f2f1f6;
|
background: #f2f1f6;
|
||||||
@@ -246,7 +158,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
/* 关键:占满屏幕高度 */
|
|
||||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,30 +166,12 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 0px 40rpx;
|
padding: 0px 40rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
/* background-color: #fff; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-container {
|
|
||||||
padding: 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- 分段控制器样式 --- */
|
|
||||||
.seg-control {
|
.seg-control {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardScroll {
|
|
||||||
padding: 0rpx 0rpx 0px 0rpx;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 列表区域 */
|
|
||||||
.list-scroll {
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-container {
|
.list-container {
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
}
|
}
|
||||||
@@ -289,35 +182,29 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border:2rpx solid #E6E6E6;
|
border: 2rpx solid #E6E6E6;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
|
|
||||||
.item-title,
|
|
||||||
.item-info {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
border:2rpx solid #2F77FD;
|
border: 2rpx solid #2F77FD;
|
||||||
background-color: #F5FAFF;
|
background-color: #F5FAFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-content {
|
.item-content {
|
||||||
// flex: 1;
|
|
||||||
width: calc(100% - 100rpx);
|
width: calc(100% - 100rpx);
|
||||||
// margin-right: 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-title {
|
.item-title {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #222222;
|
color: #222;
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
margin-bottom:10rpx;
|
margin-bottom: 10rpx;
|
||||||
/* 超长文本省略 */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -334,7 +221,6 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
line-height: 32rpx;
|
line-height: 32rpx;
|
||||||
/* 超长文本省略 */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -344,8 +230,7 @@
|
|||||||
.item-status {
|
.item-status {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding: 0px 0px;
|
border-radius: 8rpx;
|
||||||
border-radius:8rpx;
|
|
||||||
|
|
||||||
&.joined {
|
&.joined {
|
||||||
color: #2F77FD;
|
color: #2F77FD;
|
||||||
@@ -360,7 +245,7 @@
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
}
|
}
|
||||||
/* 空状态 */
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
<view class="location-area">
|
<view class="location-area">
|
||||||
<!-- 定位图标 -->
|
<!-- 定位图标 -->
|
||||||
<view class="location-icon">
|
<view class="location-icon">
|
||||||
<!-- <uni-icons type="location-filled" size="14" color="#333333"></uni-icons> -->
|
|
||||||
<image src="http://47.104.199.163:9090/images/home/adress.png" style="height: 100%;width: 100%;"></image>
|
<image src="http://47.104.199.163:9090/images/home/adress.png" style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 小区名称和下拉箭头 -->
|
<!-- 小区名称和下拉箭头 -->
|
||||||
@@ -166,7 +165,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import {onLoad,onUnload,onShow} from '@dcloudio/uni-app'
|
import {onLoad,onUnload,onShow} from '@dcloudio/uni-app'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import {getNoticeLatest,getCurrentVillage,getActivitylatest} from "/pageSubPack/api/api.js"
|
import {getNoticeLatest,getCurrentVillage,getActivitylatest,getBannarList} from "/pageSubPack/api/api.js"
|
||||||
|
|
||||||
|
|
||||||
// 列表数据状态
|
// 列表数据状态
|
||||||
@@ -177,7 +176,7 @@ const currentCommunity = ref('请认证小区')
|
|||||||
const currentVillageId = ref('')
|
const currentVillageId = ref('')
|
||||||
const bannerList = ref([
|
const bannerList = ref([
|
||||||
// 'http://47.104.199.163:9090/images/home/banner.png',
|
// 'http://47.104.199.163:9090/images/home/banner.png',
|
||||||
"http://47.104.199.163:9090/images/propertyImgs/serviceImg2.png"
|
// "http://47.104.199.163:9090/images/propertyImgs/serviceImg2.png"
|
||||||
|
|
||||||
])
|
])
|
||||||
const noticeText = ref('暂无公告')
|
const noticeText = ref('暂无公告')
|
||||||
@@ -196,6 +195,20 @@ const getNoticeMore = () =>{
|
|||||||
url:"/pageSubPack/notice-list/noticeList"
|
url:"/pageSubPack/notice-list/noticeList"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取bannar列表
|
||||||
|
const getbannarData = async () =>{
|
||||||
|
try{
|
||||||
|
const res = await getBannarList({villageId:uni.getStorageSync('currentVillageId')})
|
||||||
|
if(res.code === 200){
|
||||||
|
bannerList.value = res.data.map(item =>item.url)
|
||||||
|
}else{
|
||||||
|
uni.showToast({title:'获取失败',icon:'error'})
|
||||||
|
}
|
||||||
|
}catch (err){
|
||||||
|
const msg = err?.msg || (typeof err === 'string' ? err : '获取失败')
|
||||||
|
uni.showToast({title: msg,icon:'error'})
|
||||||
|
}
|
||||||
|
}
|
||||||
// 接收选择小区返回的参数
|
// 接收选择小区返回的参数
|
||||||
const slelctHomeData = (data) =>{
|
const slelctHomeData = (data) =>{
|
||||||
// console.log('收到B页面返回的数据:', data)
|
// console.log('收到B页面返回的数据:', data)
|
||||||
@@ -222,7 +235,7 @@ const getCurrentCommunityData = () => {
|
|||||||
}
|
}
|
||||||
}).catch(err =>{
|
}).catch(err =>{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '网络异常',
|
title: err.msg || '网络异常',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -252,7 +265,7 @@ const getNoticeData = async() =>{
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
// console.error('获取通知数据异常:', err)
|
// console.error('获取通知数据异常:', err)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg || '网络异常',
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
})
|
})
|
||||||
@@ -277,6 +290,7 @@ onLoad(() => {
|
|||||||
}
|
}
|
||||||
getNoticeData()
|
getNoticeData()
|
||||||
getNewActivityList()
|
getNewActivityList()
|
||||||
|
getbannarData()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 页面销毁时移除监听(防止内存泄漏)
|
// 页面销毁时移除监听(防止内存泄漏)
|
||||||
|
|||||||
Reference in New Issue
Block a user