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

View File

@@ -22,13 +22,17 @@
<!-- 标题 -->
<view class="form-item">
<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 class="form-item-wenti">
<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>
<!-- 手机号 -->
@@ -61,7 +65,9 @@
</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">
@@ -149,6 +155,9 @@ const houseId = ref('')
const projectName = ref('')
const projectId = ref('')
// 提交状态锁
const submitting = ref(false)
// 表单数据
const form = ref({
title: '',
@@ -214,6 +223,11 @@ const closeTimePopup = () => {
const confirmTime = () => {
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')
form.value.datetime = selectedTime.value.format('YYYY-MM-DD HH:mm')
closeTimePopup()
@@ -355,15 +369,17 @@ const submitForm = async () => {
if (!form.value.title) 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 (!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')
if (!villageId || villageId === '0') return uni.showToast({ title: '请先选择小区', icon: 'none' })
const userId = uni.getStorageSync('userId')
if (!userId) return uni.showToast({ title: '用户信息失效', icon: 'none' })
submitting.value = true
uni.showLoading({ title: '提交中...' })
uni.showLoading({ title: '提交中...' ,mask:true})
try {
const imageUrls = await uploadImages()
@@ -399,9 +415,11 @@ const submitForm = async () => {
})
}, 1500)
} else {
submitting.value = false
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
}
} catch (e) {
submitting.value = false
uni.showToast({ title: '提交失败,请检查网络或重试', icon: 'none' })
} finally {
uni.hideLoading()
@@ -438,9 +456,10 @@ const submitForm = async () => {
justify-content: space-between;
}
/* .time-value {
color: #000;
} */
.time-value {
white-space: nowrap;
font-size: 26rpx;
}
.input, .textarea {
flex: 1;
padding: 20rpx;
@@ -458,6 +477,27 @@ const submitForm = async () => {
/* border-bottom: 1px solid #eee; */
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 {
font-size: 12px;
@@ -511,6 +551,16 @@ textarea {
color: #999;
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 {
width: 100%;
background: #007aff;

View File

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

View File

@@ -15,13 +15,16 @@
<!-- 标题输入 -->
<view class="form-item">
<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 class="form-item-wenti">
<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>
<!-- 手机号 -->
@@ -49,7 +52,10 @@
</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>
</template>
@@ -63,6 +69,8 @@ import { getUserProfile } from '../api/apiSub.js'
const repairProject = ref('')
const projectId = ref('')
// 提交状态锁
const submitting = ref(false)
// 表单数据
const form = ref({
title: '',
@@ -186,7 +194,8 @@ const submitForm = async () => {
return
}
uni.showLoading({ title: '提交中...' })
submitting.value = true
uni.showLoading({ title: '提交中...' ,mask:true})
try {
// 先上传图片
@@ -218,9 +227,11 @@ const submitForm = async () => {
uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair' })
}, 1500)
} else {
submitting.value = false
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
}
} catch (e) {
submitting.value = false
uni.showToast({ title: '网络异常', icon: 'none' })
} finally {
uni.hideLoading()
@@ -270,6 +281,27 @@ const submitForm = async () => {
.textarea {
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 {
display: flex;
flex-wrap: wrap;
@@ -308,6 +340,16 @@ const submitForm = async () => {
color: #999;
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 {
width: 100%;
background: #007aff;

View File

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