Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
34b2385c
Commit
34b2385c
authored
Aug 07, 2024
by
刘玉宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验
parent
d0f15039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
remark.vue
src/pages/order/remark.vue
+32
-18
No files found.
src/pages/order/remark.vue
View file @
34b2385c
...
...
@@ -103,9 +103,21 @@ const formdata = reactive<{
* 表单验证规则
*/
const
rules
=
{
images
:
{
required
:
true
,
message
:
'请上传图片'
},
evaluation
:
{
required
:
true
,
message
:
'请填写评价内容'
},
merchantServices
:
{
required
:
true
,
message
:
'请选择商家服务评分'
},
images
:
[
{
required
:
true
,
message
:
'请上传图片'
,
validator
:
(
value
:
any
)
=>
{
if
(
value
)
{
console
.
log
(
'123456'
);
}
else
{
console
.
log
(
'963852'
);
}
},
},
],
evaluation
:
[{
required
:
true
,
message
:
'请填写评价内容'
}],
merchantServices
:
[{
required
:
true
,
message
:
'请选择商家服务评分'
}],
};
/**
...
...
@@ -158,7 +170,7 @@ const deleteImg = () => {
/**
* Release提交
*/
const
h
d
Submit
=
async
()
=>
{
const
h
andle
Submit
=
async
()
=>
{
await
evaluation
({
...
formdata
,
images
:
proImage
(),
...
...
@@ -169,20 +181,19 @@ const hdSubmit = async () => {
});
};
const
handleSubmit
=
async
()
=>
{
console
.
log
(
form
.
value
.
validate
());
form
.
value
.
validate
()
.
then
(({
valid
,
errors
})
=>
{
console
.
log
(
'valid'
,
valid
);
if
(
valid
)
{
uToast
.
info
({
msg
:
'校验通过'
});
}
})
.
catch
((
error
:
any
)
=>
{
console
.
log
(
error
,
'error'
);
});
};
// const handleSubmit = async () => {
// console.log(form.value.validate());
// form.value
// .validate()
// .then(({ valid, errors }) => {
// if (valid) {
// uToast.info({ msg: '校验通过' });
// }
// })
// .catch((error: any) => {
// console.log(error, 'error');
// });
// };
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
...
...
@@ -227,6 +238,9 @@ const handleSubmit = async () => {
margin-top
:
25rpx
;
margin-bottom
:
172rpx
;
padding
:
20rpx
;
:deep
(
.wd-textarea
)
{
padding
:
0
30rpx
;
}
.itemPicker
{
display
:
flex
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment