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
3dd4bb6a
Commit
3dd4bb6a
authored
Aug 08, 2024
by
刘玉宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remake校验
parent
206cf3ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
46 deletions
+87
-46
remark.vue
src/pages/order/remark.vue
+87
-46
No files found.
src/pages/order/remark.vue
View file @
3dd4bb6a
...
@@ -9,29 +9,52 @@
...
@@ -9,29 +9,52 @@
<view
class=
"item01"
prop=
"merchantServices"
>
<view
class=
"item01"
prop=
"merchantServices"
>
<text
class=
"label"
>
评分
</text>
<text
class=
"label"
>
评分
</text>
<!-- 评分 -->
<!-- 评分 -->
<wd-rate
v-model=
"formdata.merchantServices"
active-color=
"#ff0000"
size=
"50rpx"
space=
"10px"
<wd-rate
@
change=
"handlemerchant"
/>
v-model=
"formdata.merchantServices"
active-color=
"#ff0000"
size=
"50rpx"
space=
"10px"
@
change=
"handlemerchant"
/>
</view>
</view>
<view
class=
"item02"
>
<view
class=
"item02"
>
<text>
{{
merList
[
formdata
.
merchantServices
]
}}
</text>
<text>
{{
merList
[
formdata
.
merchantServices
]
}}
</text>
</view>
</view>
</view>
</view>
<!-- 内容描述 -->
<!-- 内容描述 -->
<view
prop=
"evaluation"
>
<view
class=
"item03"
>
<wd-textarea
v-model=
"formdata.evaluation"
placeholder=
"亲,分享您的看法,给其他人一个参考哦!"
/>
<wd-textarea
prop=
"evaluation"
type=
"textarea"
v-model=
"formdata.evaluation"
placeholder=
"亲,分享您的看法,给其他人一个参考哦!"
clearable
/>
</view>
</view>
<wd-cell
title-width=
"0px"
></wd-cell>
<text
class=
"textarea"
>
上传图片/视频
</text>
<text
class=
"textarea"
>
上传图片/视频
</text>
<!-- 图片上传 -->
<!-- 图片上传 -->
<view
class=
"wdUpload"
prop=
"images"
>
<view
class=
"wdUpload"
prop=
"images"
>
<wd-upload
multiple
:action=
"action"
@
change=
"handleFile"
:file-list=
"formdata.images"
<wd-upload
:before-remove=
"beforeRemove"
:header=
"headers"
></wd-upload>
multiple
:action=
"action"
@
change=
"handleFile"
:file-list=
"formdata.images"
:before-remove=
"beforeRemove"
:header=
"headers"
></wd-upload>
</view>
</view>
<!-- 匿名评价 -->
<!-- 匿名评价 -->
<wd-cell
title=
"匿名评价"
prop=
"isAnonymous"
class=
"itemSwichval"
>
<wd-cell
title=
"匿名评价"
prop=
"isAnonymous"
class=
"itemSwichval"
>
<wd-switch
size=
"48rpx"
active-color=
"#EC1B1B"
v-model=
"formdata.isAnonymous"
active-value=
"1"
<wd-switch
inactive-value=
"0"
/>
size=
"48rpx"
active-color=
"#EC1B1B"
v-model=
"formdata.isAnonymous"
active-value=
"1"
inactive-value=
"0"
/>
</wd-cell>
</wd-cell>
</wd-cell-group>
</wd-cell-group>
</wd-form>
</wd-form>
...
@@ -70,7 +93,7 @@ onLoad((options) => {
...
@@ -70,7 +93,7 @@ onLoad((options) => {
const
formdata
=
reactive
<
{
const
formdata
=
reactive
<
{
orderNumber
:
string
;
orderNumber
:
string
;
evaluation
:
string
;
evaluation
:
null
|
string
;
images
:
string
[];
images
:
string
[];
isAnonymous
:
number
;
isAnonymous
:
number
;
descriptionMatches
:
number
;
descriptionMatches
:
number
;
...
@@ -88,33 +111,59 @@ const formdata = reactive<{
...
@@ -88,33 +111,59 @@ const formdata = reactive<{
* 表单验证规则
* 表单验证规则
*/
*/
const
rules
=
{
const
rules
=
{
// images: [
images
:
[
// {
{
// required: true,
required
:
true
,
// message: '请上传图片1',
validator
:
(
value
:
any
)
=>
{
// validator: (value: any) => {
if
(
value
.
length
)
{
// if (value.length) {
return
true
;
// console.log('上传成功');
}
else
{
// } else {
xma
.
showToast
({
// console.log('请上传图片');
title
:
'最少上传一张图片'
,
// }
icon
:
'none'
,
// },
duration
:
2000
,
// },
});
// ],
return
false
;
evaluation
:
[{
required
:
true
,
message
:
'请填写评价内容'
}],
}
// merchantServices: [
},
// {
},
// required: true,
],
// message: '请选择商家服务评分',
evaluation
:
[
// validator: (value: any) => {
{
// if (value >= 1 && value
<=
5
)
{
required
:
true
,
// console.log('评分成功');
message
:
'请填你的看法'
,
// } else {
validator
:
(
value
:
string
)
=>
{
// console.log('请选择评分');
console
.
log
(
'看法'
,
value
);
// }
if
(
value
&&
value
.
length
)
{
// },
return
true
;
// },
}
else
{
// ],
xma
.
showToast
({
title
:
'请填你的看法'
,
icon
:
'none'
,
duration
:
2000
,
});
return
false
;
}
},
},
],
merchantServices
:
[
{
required
:
true
,
validator
:
(
value
:
any
)
=>
{
if
(
value
>=
1
&&
value
<=
5
)
{
return
true
;
}
else
{
xma
.
showToast
({
title
:
'请选服务评分'
,
icon
:
'none'
,
duration
:
2000
,
});
return
false
;
}
},
},
],
};
};
/**
/**
...
@@ -180,18 +229,10 @@ const hdSubmit = async () => {
...
@@ -180,18 +229,10 @@ const hdSubmit = async () => {
};
};
const
handleSubmit
=
async
()
=>
{
const
handleSubmit
=
async
()
=>
{
form
.
value
form
.
value
.
validate
().
then
(({
valid
,
errors
})
=>
{
.
validate
()
.
then
(({
valid
,
errors
})
=>
{
console
.
log
(
'valid'
,
errors
);
if
(
valid
)
{
if
(
valid
)
{
// uToast.info({ msg: '校验通过' });
console
.
log
(
'校验通过'
);
hdSubmit
();
hdSubmit
();
}
}
})
.
catch
((
error
:
any
)
=>
{
console
.
log
(
error
,
'error'
);
});
});
};
};
</
script
>
</
script
>
...
...
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