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
ddf48d6b
authored
Aug 20, 2020
by
TengFengLian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
预约看房/入园接口
parent
e44907b9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
31 deletions
pages/activity-entry/activity-entry.wxml
pages/appointment/appointment.js
pages/appointment/appointment.wxml
pages/home/home.js
pages/activity-entry/activity-entry.wxml
View file @
ddf48d6b
...
...
@@ -47,20 +47,6 @@
</view>
<view class="row align-c">
<view class="input-label row align-c">
<text space="ensp">报名人数</text>
</view>
<view class="input-wrap row con-b align-c">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="../../image/cut.png"></image>
</l-button>
<text>{{formInto.quantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="../../image/add.png"></image>
</l-button>
</view>
</view>
<view class="row align-c">
<view class="input-label row align-c">
<text space="ensp">报名时间</text>
</view>
<view class="input-wrap row con-b align-c">
...
...
@@ -74,6 +60,20 @@
<image class="input-icon" src="../../image/more.png"></image>
</view>
</view>
<view class="row align-c">
<view class="input-label row align-c">
<text space="ensp">报名人数</text>
</view>
<view class="input-wrap row con-b align-c">
<l-button special="{{true}}" bind:lintap="onQuantityCut">
<image class="input-icon" src="../../image/cut.png"></image>
</l-button>
<text>{{formInto.quantity}}</text>
<l-button special="{{true}}" bind:lintap="onQuantityAdd">
<image class="input-icon" src="../../image/add.png"></image>
</l-button>
</view>
</view>
</view>
<view class="entry-operation">
...
...
pages/appointment/appointment.js
View file @
ddf48d6b
import
iMiment
from
'../../npm/miment.js'
const
app
=
getApp
()
Page
({
data
:
{
...
...
@@ -17,6 +18,9 @@ Page({
isSubmit
:
false
,
winQuota
:
false
,
// 预约入园剩余名额
total
:
0
,
},
onLoad
:
function
(
options
)
{
...
...
@@ -35,6 +39,9 @@ Page({
formDate
:
funcDate
,
appointmentDate
:
funcDate
,
})
if
(
this
.
data
.
formType
===
1
)
{
// 入园预约
this
.
getResidue
()
}
},
onServic
:
function
()
{
...
...
@@ -71,26 +78,38 @@ Page({
errorQuantity
:
''
,
})
}
this
.
inspectForm
()
},
onQuantityAdd
:
function
()
{
if
(
this
.
data
.
formQuantity
<
5
)
{
if
(
this
.
data
.
total
*
1
==
0
)
{
this
.
setData
({
formQuantity
:
this
.
data
.
formQuantity
+
1
,
errorQuantity
:
''
,
errorQuantity
:
'所选日期预约名额已满'
})
}
else
{
}
else
if
(
this
.
data
.
formQuantity
>=
this
.
data
.
total
*
1
)
{
this
.
setData
({
errorQuantity
:
'所选日期预约的名额仅剩'
+
activityTime
.
residue
+
'人'
})
}
else
if
(
this
.
data
.
formQuantity
>=
5
)
{
this
.
setData
({
errorQuantity
:
'每个账号最多预约5人'
})
}
else
{
this
.
setData
({
formQuantity
:
this
.
data
.
formQuantity
+
1
,
errorQuantity
:
''
,
})
this
.
inspectForm
()
}
},
onSelectionDate
:
function
(
event
)
{
this
.
setData
({
formDate
:
event
.
detail
.
value
,
winQuota
:
true
})
if
(
this
.
data
.
formType
===
1
)
{
// 入园预约
this
.
getResidue
()
}
},
inspectForm
:
function
()
{
...
...
@@ -112,6 +131,12 @@ Page({
errorPhone
:
'请输入手机号码'
})
return
}
else
if
(
this
.
data
.
formPhone
.
length
!=
11
)
{
this
.
setData
({
isSubmit
:
false
,
errorPhone
:
'请输入11位手机号码'
})
return
}
else
{
this
.
setData
({
errorPhone
:
''
...
...
@@ -133,6 +158,7 @@ Page({
this
.
setData
({
isSubmit
:
true
})
},
onSubmit
:
function
()
{
...
...
@@ -140,10 +166,37 @@ Page({
this
.
inspectForm
()
return
}
this
.
setData
({
appointmentComplete
:
true
wx
.
lin
.
showToast
({
icon
:
'loading'
,
title
:
'提交中'
,
show
:
true
,
})
let
that
=
this
app
.
wxRequest
({
url
:
'/api/v1/subscribe/doSubscribe'
,
data
:
{
mobile
:
that
.
data
.
formPhone
,
subscribeNum
:
that
.
data
.
formQuantity
,
subscribeDate
:
that
.
data
.
formDate
+
' 00:00:00'
,
name
:
that
.
data
.
formName
,
type
:
this
.
data
.
formType
===
1
?
0
:
1
,
},
success
:
function
(
res
)
{
that
.
setData
({
appointmentComplete
:
true
})
wx
.
lin
.
hideToast
()
},
fail
:
function
(
err
)
{
wx
.
lin
.
hideToast
()
wx
.
lin
.
showToast
({
icon
:
'error'
,
title
:
err
.
msg
,
})
}
})
},
onAppointmentComplete
:
function
()
{
...
...
@@ -154,4 +207,25 @@ Page({
delta
:
1
})
},
// 预约入园查询返回剩余名额
getResidue
()
{
var
that
=
this
app
.
wxRequest
({
url
:
'/api/v1/subscribe/getResidue'
,
data
:
{
subscribeDate
:
that
.
data
.
formDate
+
' 00:00:00'
,
type
:
0
,
},
success
:
function
(
res
)
{
that
.
setData
({
total
:
res
.
data
.
total
,
winQuota
:
true
,
})
}
})
},
})
\ No newline at end of file
pages/appointment/appointment.wxml
View file @
ddf48d6b
<l-toast></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" backIcon="/image/back-w.png"></navigation>
...
...
@@ -28,7 +29,7 @@
<text>名</text>
</view>
<view class="input-wrap row align-c">
<input class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
<input
maxlength="16"
class="text" placeholder-class="input-tip" placeholder="请输入名字" data-type="name" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
...
...
@@ -43,7 +44,7 @@
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
<input
maxlength="11" type="number"
class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
...
...
@@ -89,7 +90,7 @@
</view>
<view class="quota row con-e align-c" hidden="{{!winQuota}}">
<text>剩余名额:</text>
<text>
100
</text>
<text>
{{total}}人
</text>
</view>
</view>
...
...
@@ -122,7 +123,7 @@
</view>
</view>
<view class="form-error row align-c">
<text hidden="{{errorName ? false : true}}">{{errorName}}</text>
<text
maxlength="16"
hidden="{{errorName ? false : true}}">{{errorName}}</text>
</view>
<!-- 手机输入 -->
...
...
@@ -133,7 +134,7 @@
<text>号</text>
</view>
<view class="input-wrap row align-c">
<input class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
<input
maxlength="11" type="number"
class="text" placeholder-class="input-tip" placeholder="请输入手机号" data-type="phone" bindblur="onInputBlur"></input>
</view>
</view>
<view class="form-error row align-c">
...
...
pages/home/home.js
View file @
ddf48d6b
...
...
@@ -241,16 +241,19 @@ Page({
})
if
(
res
.
data
.
list
.
length
>
0
)
{
let
count
=
that
.
data
.
strategyList
.
length
let
tempArray
=
[]
res
.
data
.
list
.
forEach
(
item
=>
{
for
(
let
i
=
0
;
i
<
res
.
data
.
list
.
length
;
i
++
)
{
let
item
=
res
.
data
.
list
[
i
]
let
strategy
=
{
id
:
item
.
id
,
image
:
item
.
cover
,
title
:
item
.
title
,
date
:
item
.
updateDate
,
index
:
count
+
i
-
1
,
}
tempArray
.
push
(
strategy
)
}
)
}
console
.
log
(
'tempArray'
,
tempArray
)
...
...
@@ -271,7 +274,6 @@ Page({
strategyList
:
tempArray
})
}
// 游客攻略瀑布列表
wx
.
lin
.
renderWaterFlow
(
that
.
data
.
strategyList
,
false
,
()
=>
{})
...
...
@@ -288,7 +290,7 @@ Page({
},
onReachBottom
:
function
()
{
console
.
log
(
'触底啦'
)
//
console.log('触底啦')
if
(
this
.
data
.
loading
||
!
this
.
data
.
moreData
)
{
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