修复bug
This commit is contained in:
@@ -46,7 +46,10 @@
|
||||
<text class="label-text">问题描述</text>
|
||||
</view>
|
||||
<view class="row-right desc-right">
|
||||
<textarea v-model="description" placeholder="请描述您的问题" class="desc-input" auto-height maxlength="500"></textarea>
|
||||
<view class="desc-input-wrap">
|
||||
<textarea v-model="description" placeholder="请描述您的问题" class="desc-input" auto-height maxlength="200"></textarea>
|
||||
<text class="desc-count">{{ description.length }}/200</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -56,7 +59,7 @@
|
||||
<text class="label-text">投诉人姓名</text>
|
||||
</view>
|
||||
<view class="row-right">
|
||||
<input v-model="name" placeholder="请输入姓名" class="text-input" type="text" />
|
||||
<input v-model="name" placeholder="请输入姓名" class="text-input" type="text" maxlength="20" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -97,7 +100,7 @@
|
||||
|
||||
<!-- 底部下一步按钮 -->
|
||||
<view class="bottom-btn-wrap">
|
||||
<button class="next-btn" @click="submitForm">提交</button>
|
||||
<button class="next-btn" :disabled="isSubmitting" @click="submitForm">提交</button>
|
||||
</view>
|
||||
|
||||
<!-- ================== 自定义Popup弹窗(纯view实现) ================== -->
|
||||
@@ -161,7 +164,9 @@ const villageId = ref('')
|
||||
const tempFilePaths = ref([])
|
||||
const maxCount = ref(9)
|
||||
|
||||
// 关闭所有弹窗
|
||||
const isSubmitting = ref(false)
|
||||
|
||||
// 关闭所有弹窗
|
||||
const closeAllPopup = () => {
|
||||
showTypePopup.value = false
|
||||
showPropertyPopup.value = false
|
||||
@@ -238,12 +243,14 @@ const submitForm = async () => {
|
||||
if (!selectedTypeId.value) {
|
||||
return uni.showToast({ title: '请选择投诉类型', icon: 'none' })
|
||||
}
|
||||
if (selectedType.value === '物业服务' && !selectedProperty.value) {
|
||||
return uni.showToast({ title: '请选择物业', icon: 'none' })
|
||||
}
|
||||
// if (selectedType.value === '物业服务' && !selectedProperty.value) {
|
||||
// return uni.showToast({ title: '请选择物业', icon: 'none' })
|
||||
// }
|
||||
if (!description.value.trim()) {
|
||||
return uni.showToast({ title: '请输入问题描述', icon: 'none' })
|
||||
}
|
||||
if (isSubmitting.value) return
|
||||
isSubmitting.value = true
|
||||
|
||||
uni.showLoading({ title: '提交中...', mask: true })
|
||||
|
||||
@@ -272,14 +279,14 @@ const submitForm = async () => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '提交成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
} else {
|
||||
isSubmitting.value = false
|
||||
uni.showToast({ title: res.msg || '提交失败', icon: 'none' })
|
||||
}
|
||||
} catch (err) {
|
||||
isSubmitting.value = false
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: err.msg || '提交失败,请重试',
|
||||
@@ -391,20 +398,35 @@ const submitForm = async () => {
|
||||
|
||||
.desc-right {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.desc-input-wrap {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
border: 1rpx solid #f0f0f0;
|
||||
border-radius: 8rpx;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.desc-input {
|
||||
width: calc(100vw - 84rpx);
|
||||
width: 100%;
|
||||
min-height: 80px;
|
||||
margin-top: 20rpx;
|
||||
padding: 24rpx;
|
||||
border: 1rpx solid #f0f0f0;
|
||||
border-radius: 8rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
box-sizing: border-box;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.desc-count {
|
||||
display: block;
|
||||
text-align: right;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
/* 照片上传区域 */
|
||||
|
||||
Reference in New Issue
Block a user