This commit is contained in:
BianLzhaoMin 2025-03-11 14:31:33 +08:00
parent 5af27bd5ad
commit ab1f5a54e3
2 changed files with 37 additions and 16 deletions

View File

@ -15,6 +15,7 @@
v-model="opinionModel.userName"
class="input-content"
placeholder="填写姓名"
clearable
/>
</up-form-item>
<up-form-item label="电话" prop="userPhone" required>
@ -22,6 +23,7 @@
v-model="opinionModel.userPhone"
class="input-content"
placeholder="填写电话"
clearable
/>
</up-form-item>
<up-form-item label="意见归属单位/部门" prop="userCompany">
@ -29,6 +31,7 @@
v-model="opinionModel.unit"
class="input-content"
placeholder="填写归属单位/部门"
clearable
/>
</up-form-item>
<up-form-item label="意见" prop="options" required>
@ -36,18 +39,23 @@
v-model="opinionModel.options"
placeholder="请输入内容"
class="input-content"
style="min-height: 30vh"
:maxlength="500"
count
maxlength="500"
/>
style="max-height: 500px; overflow-y: auto"
height="300px"
clearable
>
</up-textarea>
</up-form-item>
<up-button
type="primary"
text="提交意见"
style="margin-top: 30rpx"
@tap="onSubmitOptions"
/>
<up-form-item>
<up-button
type="primary"
text="提交意见"
style="margin-top: 30rpx"
@tap="onSubmitOptions"
/>
</up-form-item>
</up-form>
</template>
@ -95,13 +103,24 @@ const opinionModel = ref({
unit: '',
options: '',
})
const opinionRules = ref({
userName: {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change'],
},
userName: [
{
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change'],
},
{
pattern: /^[\u4e00-\u9fa5]{2,6}$/,
//
transform(value) {
return String(value)
},
message: '请填写正确的姓名',
},
],
userPhone: [
{
type: 'string',
@ -190,9 +209,11 @@ const onConfirm = () => {
flex-direction: column;
align-items: center;
background-color: #f5f5f5;
overflow-y: auto;
}
::v-deep .opinion-form {
width: 90%;
height: auto;
}
.input-content {

View File

@ -95,7 +95,7 @@ export const http = (options) => {
fail(err) {
uni.showToast({
icon: 'none',
title: '请求失败',
title: '网络错误,请更换网络后尝试',
})
console.log(err, '请求失败')
reject(err)