Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dfa60c9a
authored
Aug 27, 2020
by
TengFengLian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
预约看房提示
parent
dffa0bec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
pages/appointment/appointment.js
pages/appointment/appointment.js
View file @
dfa60c9a
...
@@ -64,16 +64,41 @@ Page({
...
@@ -64,16 +64,41 @@ Page({
this
.
setData
({
this
.
setData
({
formName
:
funcValue
formName
:
funcValue
})
})
if
(
this
.
data
.
formName
===
''
)
{
this
.
setData
({
errorName
:
'请输入姓名'
})
}
else
{
this
.
setData
({
errorName
:
''
})
}
break
break
case
'phone'
:
case
'phone'
:
this
.
setData
({
this
.
setData
({
formPhone
:
funcValue
formPhone
:
funcValue
})
})
if
(
this
.
data
.
formPhone
===
''
)
{
this
.
setData
({
errorPhone
:
'请输入手机号码'
})
}
else
if
(
this
.
data
.
formPhone
.
length
!=
11
)
{
this
.
setData
({
errorPhone
:
'请输入11位手机号码'
})
}
else
{
this
.
setData
({
errorPhone
:
''
})
}
break
break
}
}
this
.
inspectForm
()
},
},
onQuantityCut
:
function
()
{
onQuantityCut
:
function
()
{
...
@@ -118,12 +143,12 @@ Page({
...
@@ -118,12 +143,12 @@ Page({
},
},
inspectForm
:
function
()
{
inspectForm
:
function
()
{
let
complete
=
true
if
(
this
.
data
.
formName
===
''
)
{
if
(
this
.
data
.
formName
===
''
)
{
this
.
setData
({
this
.
setData
({
canSubmit
:
false
,
errorName
:
'请输入姓名'
errorName
:
'请输入姓名'
})
})
return
complete
=
false
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
errorName
:
''
errorName
:
''
...
@@ -132,16 +157,14 @@ Page({
...
@@ -132,16 +157,14 @@ Page({
if
(
this
.
data
.
formPhone
===
''
)
{
if
(
this
.
data
.
formPhone
===
''
)
{
this
.
setData
({
this
.
setData
({
canSubmit
:
false
,
errorPhone
:
'请输入手机号码'
errorPhone
:
'请输入手机号码'
})
})
return
complete
=
false
}
else
if
(
this
.
data
.
formPhone
.
length
!=
11
)
{
}
else
if
(
this
.
data
.
formPhone
.
length
!=
11
)
{
this
.
setData
({
this
.
setData
({
canSubmit
:
false
,
errorPhone
:
'请输入11位手机号码'
errorPhone
:
'请输入11位手机号码'
})
})
return
complete
=
false
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
errorPhone
:
''
errorPhone
:
''
...
@@ -150,10 +173,9 @@ Page({
...
@@ -150,10 +173,9 @@ Page({
if
(
this
.
data
.
formQuantity
===
0
)
{
if
(
this
.
data
.
formQuantity
===
0
)
{
this
.
setData
({
this
.
setData
({
canSubmit
:
false
,
errorQuantity
:
'预约人数不能为 0'
errorQuantity
:
'预约人数不能为 0'
})
})
return
complete
=
false
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
errorQuantity
:
''
errorQuantity
:
''
...
@@ -161,9 +183,11 @@ Page({
...
@@ -161,9 +183,11 @@ Page({
}
}
this
.
setData
({
this
.
setData
({
canSubmit
:
tru
e
canSubmit
:
complet
e
})
})
return
complete
},
},
onSubmit
:
function
()
{
onSubmit
:
function
()
{
...
@@ -171,8 +195,7 @@ Page({
...
@@ -171,8 +195,7 @@ Page({
app
.
login
({
app
.
login
({
success
:
function
()
{
success
:
function
()
{
if
(
!
that
.
data
.
canSubmit
||
that
.
data
.
isSubmit
)
{
if
(
!
that
.
inspectForm
()
||
that
.
data
.
isSubmit
)
{
// that.inspectForm()
return
return
}
}
...
...
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