Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
tjty-app
Project
Project
Details
Activity
Releases
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
王永飞
tjty-app
Commits
c1fa22c1
Commit
c1fa22c1
authored
Nov 25, 2022
by
王宝峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
留言咨询姓名正则匹配只能是汉字和字母二选一问题修复
parent
8ff77192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
tity_message_consult.vue
...s_new_media/tity_message_consult/tity_message_consult.vue
+9
-8
No files found.
tjty-app/pages_new_media/tity_message_consult/tity_message_consult.vue
View file @
c1fa22c1
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
<uni-forms
ref=
"form"
:modelValue=
"personnel"
label-position=
"top"
>
<uni-forms
ref=
"form"
:modelValue=
"personnel"
label-position=
"top"
>
<uni-forms-item
name=
"consultContent"
>
<uni-forms-item
name=
"consultContent"
>
<uni-easyinput
type=
"textarea"
:inputBorder=
"false"
v-model=
"personnel.consultContent"
<uni-easyinput
type=
"textarea"
:inputBorder=
"false"
v-model=
"personnel.consultContent"
placeholder=
"请输入留言内容"
:trim=
"both"
@
focus=
"contentFlag = false"
maxlength=
"140"
/>
placeholder=
"请输入留言内容"
:trim=
"both"
@
focus=
"contentFlag = false"
maxlength=
"140"
/>
<view
v-if=
"contentFlag"
class=
"contentVerify"
>
内容不能为空格或回车
</view>
<view
v-if=
"contentFlag"
class=
"contentVerify"
>
内容不能为空格或回车
</view>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
label=
"姓名"
:required=
"true"
name=
"nickName"
>
<uni-forms-item
label=
"姓名"
:required=
"true"
name=
"nickName"
>
<uni-easyinput
:inputBorder=
"false"
type=
"text"
v-model=
"personnel.nickName"
<uni-easyinput
:inputBorder=
"false"
type=
"text"
v-model=
"personnel.nickName"
maxlength=
"16"
maxlength=
"16"
placeholder=
"请输入姓名"
/>
placeholder=
"请输入姓名"
/>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
label=
"手机号"
:required=
"true"
name=
"phone"
>
<uni-forms-item
label=
"手机号"
:required=
"true"
name=
"phone"
>
<uni-easyinput
:inputBorder=
"false"
type=
"text"
v-model=
"personnel.phone"
maxlength=
"11"
<uni-easyinput
:inputBorder=
"false"
type=
"text"
v-model=
"personnel.phone"
maxlength=
"11"
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
contentFlag
:
false
,
contentFlag
:
false
,
url
:
''
,
url
:
''
,
personnel
:
{
personnel
:
{
consultType
:
''
,
consultType
:
''
,
consultContent
:
''
,
consultContent
:
''
,
nickName
:
''
,
nickName
:
''
,
phone
:
''
,
phone
:
''
,
...
@@ -88,12 +88,13 @@
...
@@ -88,12 +88,13 @@
{
{
validateFunction
:
function
(
rule
,
value
,
data
,
callback
)
{
validateFunction
:
function
(
rule
,
value
,
data
,
callback
)
{
console
.
log
(
"姓名--》"
,
value
)
console
.
log
(
"姓名--》"
,
value
)
// 只能输入字母或者汉字,二选一
let
nameReg
=
/^
[\u
4E00-
\u
9FA5
]{2,16}
$|^
[
a-zA-Z
]{2,16}
$/
// let nameReg =/^[\u4E00-\u9FA5]{2,16}$|^[a-zA-Z]{2,16}$/
// let nameReg2 =//
// 只能输入字母或者汉字,字母和汉字可以混一起
let
nameReg
=
/^
[
a-zA-Z
\u
4E00-
\u
9FA5
]{2,16}
$/
if
(
!
nameReg
.
test
(
value
))
{
if
(
!
nameReg
.
test
(
value
))
{
callback
(
'姓名只能输入汉字或者大小写字母,请重新填写'
)
callback
(
'姓名只能输入汉字或者大小写字母,请重新填写'
)
}
}
return
true
return
true
}
}
...
...
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