修复报修bug

This commit is contained in:
zhouyanli
2026-08-03 14:20:17 +08:00
parent 27b547a82f
commit 015ed25400
6 changed files with 159 additions and 101 deletions

View File

@@ -34,7 +34,13 @@
"Bash(perl -i -pe 's/^t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/' pages.json)", "Bash(perl -i -pe 's/^t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/' pages.json)",
"Bash(sed -i '113s|// loadRevenue\\(true\\)|loadRevenue\\(true\\)|' pageSubPack/inspection-revenue/public-revenue.vue)", "Bash(sed -i '113s|// loadRevenue\\(true\\)|loadRevenue\\(true\\)|' pageSubPack/inspection-revenue/public-revenue.vue)",
"Bash(sed -i '120s|// loadRevenue\\(\\)|loadRevenue\\(\\)|' pageSubPack/inspection-revenue/public-revenue.vue)", "Bash(sed -i '120s|// loadRevenue\\(\\)|loadRevenue\\(\\)|' pageSubPack/inspection-revenue/public-revenue.vue)",
"Bash(xxd pageSubPack/visitor/visitor-add.vue)" "Bash(xxd pageSubPack/visitor/visitor-add.vue)",
"Bash(sed -i '24s/^\\\\t\\\\t\\\\t\\\\t/\\\\t\\\\t /' pageSubPack/online-repair/publicRepair.vue)",
"Bash(sed -i '25s/^ \\\\t\\\\t\\\\t\\\\t/\\\\t\\\\t \\\\t/' pageSubPack/online-repair/publicRepair.vue)",
"Bash(sed -i '26s/^\\\\t\\\\t\\\\t\\\\t/\\\\t\\\\t \\\\t/' pageSubPack/online-repair/publicRepair.vue)",
"Bash(sed -i '27s/^\\\\t\\\\t\\\\t\\\\t/\\\\t\\\\t /' pageSubPack/online-repair/publicRepair.vue)",
"Bash(sed -i '416s/.*/ } else {\\\\n submitting.value = false\\\\n uni.showToast\\({ title: res.msg || '\\\\''提交失败'\\\\'', icon: '\\\\''none'\\\\'' }\\)\\\\n }/' pageSubPack/online-repair/personalRepair.vue)",
"Bash(sed -i '420s/.*/ } catch \\(e\\) {\\\\n submitting.value = false\\\\n uni.showToast\\({ title: '\\\\''提交失败,请检查网络或重试'\\\\'', icon: '\\\\''none'\\\\'' }\\)\\\\n } finally {\\\\n uni.hideLoading\\(\\)\\\\n }/' pageSubPack/online-repair/personalRepair.vue)"
] ]
} }
} }

View File

@@ -2,8 +2,8 @@
"name" : "花开物业", "name" : "花开物业",
"appid" : "__UNI__29C3D60", "appid" : "__UNI__29C3D60",
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息支持更换手机号、修改密码、消息通知设置、版本更新及账号退出一站式满足业主居家生活、社区服务、房产车辆管理需求实现社区生活数字化、便捷化。", "description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息支持更换手机号、修改密码、消息通知设置、版本更新及账号退出一站式满足业主居家生活、社区服务、房产车辆管理需求实现社区生活数字化、便捷化。",
"versionName" : "1.0.4", "versionName" : "1.0.5",
"versionCode" : 117, "versionCode" : 118,
"transformPx" : false, "transformPx" : false,
"uniCloud" : { "uniCloud" : {
"provider" : "aliyun", "provider" : "aliyun",

View File

@@ -22,13 +22,17 @@
<!-- 标题 --> <!-- 标题 -->
<view class="form-item"> <view class="form-item">
<text class="label">标题</text> <text class="label">标题</text>
<uni-easyinput v-model="form.title" placeholder="请输入内容" :inputBorder="false" maxlength="30"></uni-easyinput> <uni-easyinput v-model="form.title" placeholder="请输入内容最多30个字符" :inputBorder="false" maxlength="30"></uni-easyinput>
</view> </view>
<!-- 问题描述 --> <!-- 问题描述 -->
<view class="form-item-wenti"> <view class="form-item-wenti">
<text class="label">问题描述</text> <text class="label">问题描述</text>
<uni-easyinput v-model="form.desc" placeholder="请描述你的问题" type="textarea" maxlength="200"></uni-easyinput> <view class="textarea-wrap">
<textarea v-model="form.desc" placeholder="请描述你的问题最多200字" maxlength="200" class="desc-textarea" />
<text class="char-count">{{ form.desc.length }}/200</text>
</view>
<!-- <uni-easyinput v-model="form.desc" placeholder="请描述你的问题" type="textarea" maxlength="200"></uni-easyinput> -->
</view> </view>
<!-- 手机号 --> <!-- 手机号 -->
@@ -61,7 +65,9 @@
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<button class="submit-btn" @click="submitForm">提交</button> <button class="submit-btn" :disabled="submitting" @click="submitForm">{{ submitting ? '提交中...' : '提交' }}</button>
<!-- 提交中遮罩 -->
<view class="submit-mask" v-if="submitting" @touchmove.stop.prevent></view>
<!-- 时间选择弹窗 --> <!-- 时间选择弹窗 -->
<uni-popup ref="timePopupRef" type="bottom" :mask-click="false" border-radius="16rpx"> <uni-popup ref="timePopupRef" type="bottom" :mask-click="false" border-radius="16rpx">
@@ -149,6 +155,9 @@ const houseId = ref('')
const projectName = ref('') const projectName = ref('')
const projectId = ref('') const projectId = ref('')
// 提交状态锁
const submitting = ref(false)
// 表单数据 // 表单数据
const form = ref({ const form = ref({
title: '', title: '',
@@ -214,6 +223,11 @@ const closeTimePopup = () => {
const confirmTime = () => { const confirmTime = () => {
const selectedDateTime = `${selectedDate.value} ${selectedHour.value}:${selectedMinute.value}` const selectedDateTime = `${selectedDate.value} ${selectedHour.value}:${selectedMinute.value}`
const now = moment()
if (moment(selectedDateTime, 'YYYY-MM-DD HH:mm').isBefore(now)) {
uni.showToast({ title: '预约时间不能早于当前时间', icon: 'none' })
return
}
selectedTime.value = moment(selectedDateTime, 'YYYY-MM-DD HH:mm') selectedTime.value = moment(selectedDateTime, 'YYYY-MM-DD HH:mm')
form.value.datetime = selectedTime.value.format('YYYY-MM-DD HH:mm') form.value.datetime = selectedTime.value.format('YYYY-MM-DD HH:mm')
closeTimePopup() closeTimePopup()
@@ -355,15 +369,17 @@ const submitForm = async () => {
if (!form.value.title) return uni.showToast({ title: '请输入标题', icon: 'none' }) if (!form.value.title) return uni.showToast({ title: '请输入标题', icon: 'none' })
// if (!form.value.desc) return uni.showToast({ title: '请输入问题描述', icon: 'none' }) // if (!form.value.desc) return uni.showToast({ title: '请输入问题描述', icon: 'none' })
if (!/^1[3-9]\d{9}$/.test(form.value.phone)) return uni.showToast({ title: '手机号不正确', icon: 'none' }) if (!/^1[3-9]\d{9}$/.test(form.value.phone)) return uni.showToast({ title: '手机号不正确', icon: 'none' })
// if (!form.value.datetime) return uni.showToast({ title: '请选择预约时间', icon: 'none' }) if (!form.value.datetime) return uni.showToast({ title: '请选择预约时间', icon: 'none' })
if (moment(form.value.datetime, 'YYYY-MM-DD HH:mm').isBefore(moment())) return uni.showToast({ title: '预约时间不能早于当前时间', icon: 'none' })
const villageId = uni.getStorageSync('currentVillageId') const villageId = uni.getStorageSync('currentVillageId')
if (!villageId || villageId === '0') return uni.showToast({ title: '请先选择小区', icon: 'none' }) if (!villageId || villageId === '0') return uni.showToast({ title: '请先选择小区', icon: 'none' })
const userId = uni.getStorageSync('userId') const userId = uni.getStorageSync('userId')
if (!userId) return uni.showToast({ title: '用户信息失效', icon: 'none' }) if (!userId) return uni.showToast({ title: '用户信息失效', icon: 'none' })
submitting.value = true
uni.showLoading({ title: '提交中...' }) uni.showLoading({ title: '提交中...' ,mask:true})
try { try {
const imageUrls = await uploadImages() const imageUrls = await uploadImages()
@@ -399,9 +415,11 @@ const submitForm = async () => {
}) })
}, 1500) }, 1500)
} else { } else {
submitting.value = false
uni.showToast({ title: res.msg || '提交失败', icon: 'none' }) uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
} }
} catch (e) { } catch (e) {
submitting.value = false
uni.showToast({ title: '提交失败,请检查网络或重试', icon: 'none' }) uni.showToast({ title: '提交失败,请检查网络或重试', icon: 'none' })
} finally { } finally {
uni.hideLoading() uni.hideLoading()
@@ -438,9 +456,10 @@ const submitForm = async () => {
justify-content: space-between; justify-content: space-between;
} }
/* .time-value { .time-value {
color: #000; white-space: nowrap;
} */ font-size: 26rpx;
}
.input, .textarea { .input, .textarea {
flex: 1; flex: 1;
padding: 20rpx; padding: 20rpx;
@@ -458,6 +477,27 @@ const submitForm = async () => {
/* border-bottom: 1px solid #eee; */ /* border-bottom: 1px solid #eee; */
padding-bottom: 10px; padding-bottom: 10px;
} }
.textarea-wrap {
flex: 1;
position: relative;
}
.desc-textarea {
width: 100%;
height: 160rpx;
font-size: 28rpx;
padding: 10rpx 0;
box-sizing: border-box;
border: 1px solid #eee;
border-radius: 4px;
padding: 5px;
}
.char-count {
position: absolute;
right: 10rpx;
bottom: 10rpx;
font-size: 24rpx;
color: #999;
}
.switch { .switch {
font-size: 12px; font-size: 12px;
@@ -511,6 +551,16 @@ textarea {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
/* 提交中遮罩 */
.submit-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 9999;
}
.submit-btn { .submit-btn {
width: 100%; width: 100%;
background: #007aff; background: #007aff;

View File

@@ -1,20 +1,20 @@
<template> <template>
<view class="project-container"> <view class="select-container">
<!-- 搜索框 --> <!-- 搜索框 -->
<view class="search-bar"> <view class="search-bar">
<input type="text" placeholder="请输入关键字搜索" v-model="searchKey" /> <input type="text" placeholder="请输入关键字搜索" v-model="searchKey" />
<uni-icons type="search" size="18"></uni-icons> <uni-icons type="search" size="18"></uni-icons>
</view> </view>
<!-- 分类+项目 --> <!-- 分类选择 -->
<view class="category-wrap"> <view class="category-wrap">
<!-- 左侧分类 --> <!-- 左侧分类 -->
<scroll-view scroll-y class="category-left"> <scroll-view scroll-y class="category-left">
<view <view
class="category-item" class="category-item"
:class="{ active: activeCategory === item.id }" :class="{ active: activeCategory === item.id }"
@click="selectCategory(item)" @click="selectCategory(item)"
v-for="item in categoryList" v-for="item in categoryList"
:key="item.id" :key="item.id"
> >
{{ item.projectName }} {{ item.projectName }}
@@ -23,28 +23,16 @@
<!-- 右侧项目 --> <!-- 右侧项目 -->
<scroll-view scroll-y class="category-right"> <scroll-view scroll-y class="category-right">
<view <view
class="project-item" class="project-item"
:class="{ active: selectedProject.id === item.id }"
@click="selectProject(item)" @click="selectProject(item)"
v-for="item in currentProjectList" v-for="item in currentProjectList"
:key="item.id" :key="item.id"
> >
{{ item.projectName }} {{ item.projectName }}
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 空状态 -->
<view v-if="categoryList.length === 0 || currentProjectList.length === 0" class="empty-state">
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
<text class="empty-text">
暂无维修项目
</text>
</view>
<!-- 确认按钮 -->
<button class="confirm-btn" @click="confirmSelect">确认</button>
</view> </view>
</template> </template>
@@ -56,13 +44,11 @@ import { getRepairProjectList } from '../api/api.js'
// 分类列表 // 分类列表
const categoryList = ref([]) const categoryList = ref([])
// 项目列表 // 所有项目数据
const projectList = ref([]) const projectList = ref([])
// 选中状态 // 选中的分类
const activeCategory = ref(1) const activeCategory = ref(1)
const selectedProject = ref({}) // 选中的项目
const searchKey = ref('')
// 从接口获取个人报修项目列表 // 从接口获取个人报修项目列表
const fetchProjectList = async () => { const fetchProjectList = async () => {
@@ -89,7 +75,10 @@ onLoad(() => {
fetchProjectList() fetchProjectList()
}) })
// 筛选当前分类的项目 // 搜索关键词
const searchKey = ref('')
// 筛选当前分类的项目(含搜索)
const currentProjectList = computed(() => { const currentProjectList = computed(() => {
let list = projectList.value.filter(item => item.categoryId === activeCategory.value) let list = projectList.value.filter(item => item.categoryId === activeCategory.value)
if (searchKey.value) { if (searchKey.value) {
@@ -101,41 +90,34 @@ const currentProjectList = computed(() => {
// 选择分类 // 选择分类
const selectCategory = (item) => { const selectCategory = (item) => {
activeCategory.value = item.id activeCategory.value = item.id
selectedProject.value = {} // 切换分类清空选中项目
} }
// 选择项目 // 选择项目并返回
const selectProject = (item) => { const selectProject = (item) => {
selectedProject.value = item
}
// 确认选择
const confirmSelect = () => {
if (!selectedProject.value.id) {
uni.showToast({ title: '请选择维修项目', icon: 'none' })
return
}
// 获取分类名称 // 获取分类名称
const categoryName = categoryList.value.find(c => c.id === activeCategory.value).projectName const categoryName = categoryList.value.find(c => c.id === item.categoryId)?.projectName || ''
// 传递给表单页
// 用全局事件发送参数
uni.$emit('selectProject', { uni.$emit('selectProject', {
name: `${categoryName}-${selectedProject.value.projectName}`, name: `${categoryName}-${item.projectName}`,
id: selectedProject.value.id id: item.id
})
// 返回上一页
uni.navigateBack({
delta: 1
}) })
uni.navigateBack({ delta: 1 })
} }
</script> </script>
<style scoped> <style scoped>
.project-container { .select-container {
padding: 15px; padding: 10px;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
background-color: #f9f9f9;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #fff;
} }
.search-bar { .search-bar {
display: flex; display: flex;
@@ -144,6 +126,7 @@ const confirmSelect = () => {
background: #f5f5f5; background: #f5f5f5;
border-radius: 6px; border-radius: 6px;
margin-bottom: 10px; margin-bottom: 10px;
flex-shrink: 0;
} }
.search-bar input { .search-bar input {
flex: 1; flex: 1;
@@ -152,64 +135,39 @@ const confirmSelect = () => {
.category-wrap { .category-wrap {
display: flex; display: flex;
flex: 1; flex: 1;
margin-bottom: 20px; min-height: 0;
} }
.category-left { .category-left {
width: 80px; width: 120px;
height: 100%; background: #fff;
background: #f8f8f8;
border-radius: 6px 0 0 6px; border-radius: 6px 0 0 6px;
margin-right: 20rpx;
color: #666;
} }
.category-item { .category-item {
padding: 12px 10px; padding: 15px 10px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.category-item.active { .category-item.active {
background: #fff; background: #f9f9f9;
color: #007aff; color: #222;
font-weight: bold; font-weight: bold;
} }
.category-right { .category-right {
flex: 1; flex: 1;
height: 100%;
background: #fff; background: #fff;
border-radius: 0 6px 6px 0; border-radius: 0 6px 6px 0;
padding: 10px; padding: 10px;
text-align: center;
} }
.project-item { .project-item {
padding: 12px 10px; padding: 12px 10px;
font-size: 14px; font-size: 14px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.project-item.active { .project-item:active {
color: #007aff; background: #f5f5f5;
font-weight: bold;
} }
.confirm-btn { </style>
width: 100%;
height: 44px;
line-height: 44px;
background: #007aff;
color: #fff;
border-radius: 8px;
font-size: 16px;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
color: #ccc;
}
.empty-text {
font-size: 32rpx;
color: #999;
margin-top: 20rpx;
margin-bottom: 10rpx;
}
</style>

View File

@@ -15,13 +15,16 @@
<!-- 标题输入 --> <!-- 标题输入 -->
<view class="form-item"> <view class="form-item">
<text class="label">标题</text> <text class="label">标题</text>
<uni-easyinput v-model="form.title" placeholder="请输入内容" :inputBorder="false" maxlength="30"></uni-easyinput> <uni-easyinput v-model="form.title" placeholder="请输入内容最多30个字符" :inputBorder="false" maxlength="30"></uni-easyinput>
</view> </view>
<!-- 问题描述 --> <!-- 问题描述 -->
<view class="form-item-wenti"> <view class="form-item-wenti">
<text class="label">问题描述</text> <text class="label">问题描述</text>
<uni-easyinput v-model="form.desc" placeholder="请描述你的问题" type="textarea" maxlength="200"></uni-easyinput> <view class="textarea-wrap">
<textarea v-model="form.desc" placeholder="请描述你的问题最多200字" maxlength="200" class="desc-textarea" />
<text class="char-count">{{ form.desc.length }}/200</text>
</view>
</view> </view>
<!-- 手机号 --> <!-- 手机号 -->
@@ -49,7 +52,10 @@
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<button class="submit-btn" @click="submitForm">提交</button> <button class="submit-btn" :disabled="submitting" @click="submitForm">{{ submitting ? '提交中...' : '提交' }}</button>
<!-- 提交中遮罩 -->
<view class="submit-mask" v-if="submitting" @touchmove.stop.prevent></view>
</view> </view>
</template> </template>
@@ -63,6 +69,8 @@ import { getUserProfile } from '../api/apiSub.js'
const repairProject = ref('') const repairProject = ref('')
const projectId = ref('') const projectId = ref('')
// 提交状态锁
const submitting = ref(false)
// 表单数据 // 表单数据
const form = ref({ const form = ref({
title: '', title: '',
@@ -186,7 +194,8 @@ const submitForm = async () => {
return return
} }
uni.showLoading({ title: '提交中...' }) submitting.value = true
uni.showLoading({ title: '提交中...' ,mask:true})
try { try {
// 先上传图片 // 先上传图片
@@ -218,9 +227,11 @@ const submitForm = async () => {
uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair' }) uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair' })
}, 1500) }, 1500)
} else { } else {
submitting.value = false
uni.showToast({ title: res.msg || '提交失败', icon: 'none' }) uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
} }
} catch (e) { } catch (e) {
submitting.value = false
uni.showToast({ title: '网络异常', icon: 'none' }) uni.showToast({ title: '网络异常', icon: 'none' })
} finally { } finally {
uni.hideLoading() uni.hideLoading()
@@ -270,6 +281,27 @@ const submitForm = async () => {
.textarea { .textarea {
resize: none; resize: none;
} }
.textarea-wrap {
flex: 1;
position: relative;
}
.desc-textarea {
width: 100%;
height: 160rpx;
font-size: 28rpx;
padding: 10rpx 0;
box-sizing: border-box;
border: 1px solid #eee;
border-radius: 4px;
padding: 5px;
}
.char-count {
position: absolute;
right: 10rpx;
bottom: 10rpx;
font-size: 24rpx;
color: #999;
}
.upload-wrap { .upload-wrap {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -308,6 +340,16 @@ const submitForm = async () => {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
/* 提交中遮罩 */
.submit-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 9999;
}
.submit-btn { .submit-btn {
width: 100%; width: 100%;
background: #007aff; background: #007aff;

View File

@@ -117,14 +117,17 @@ const selectProject = (item) => {
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
background-color: #f9f9f9; background-color: #f9f9f9;
display: flex;
flex-direction: column;
} }
.search-bar { .search-bar {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 15px 10px; padding: 8px 10px;
background: #f5f5f5; background: #f5f5f5;
border-radius: 6px; border-radius: 6px;
margin-bottom: 10px; margin-bottom: 10px;
flex-shrink: 0;
} }
.search-bar input { .search-bar input {
flex: 1; flex: 1;
@@ -132,11 +135,11 @@ const selectProject = (item) => {
} }
.category-wrap { .category-wrap {
display: flex; display: flex;
height: calc(100% - 50px); flex: 1;
min-height: 0;
} }
.category-left { .category-left {
width: 120px; width: 120px;
height: 100%;
background: #fff; background: #fff;
border-radius: 6px 0 0 6px; border-radius: 6px 0 0 6px;
margin-right: 20rpx; margin-right: 20rpx;
@@ -155,7 +158,6 @@ const selectProject = (item) => {
} }
.category-right { .category-right {
flex: 1; flex: 1;
height: 100%;
background: #fff; background: #fff;
border-radius: 0 6px 6px 0; border-radius: 0 6px 6px 0;
padding: 10px; padding: 10px;