Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
64423d8b
You need to sign in or sign up before continuing.
Commit
64423d8b
authored
Jan 09, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券分页加载
parent
f8718be9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
26 deletions
+14
-26
coupons.js
src/pages/coupons/coupons.js
+13
-24
coupons.wxml
src/pages/coupons/coupons.wxml
+1
-2
No files found.
src/pages/coupons/coupons.js
View file @
64423d8b
...
...
@@ -158,43 +158,33 @@ wxService.page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
// 可使用 0 or 已失效 1
const
{
currentTab
,
pageNo
,
pageSize
,
totalPages
,
invalidPageNo
,
invalidTotalPages
}
=
this
.
data
if
(
currentTab
==
0
)
{
if
(
pageNo
<
totalPages
)
{
//scoll view 触到底部
onBottom
()
{
const
{
currentTab
,
pageNo
,
pageSize
,
totalPages
,
invalidPageNo
,
invalidTotalPages
}
=
this
.
data
if
(
currentTab
==
0
)
{
if
(
pageNo
<
totalPages
)
{
this
.
setData
({
pageNo
:
pageNo
+
1
,
})
// status 1
this
.
getCouponList
(
this
.
data
.
pageNo
,
pageSize
,
1
)
this
.
getCouponList
(
this
.
data
.
pageNo
,
pageSize
,
1
)
}
else
{
this
.
setData
({
noMoreCoupon
:
true
})
}
}
else
{
// if ( invalidPageNo < invalidTotalPages) {
// this.setData({
// invalidPageNo: invalidPageNo + 1,
// })
// // status 0
// this.getCouponList(this.data.invalidPageNo, pageSize, 0)
// } else {
// this.setData({
// noMoreCouponInvalid: true
// })
// }
this
.
setData
({
noMoreCouponInvalid
:
true
})
}
},
onPullDownRefresh
:
function
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
}
},
})
\ No newline at end of file
src/pages/coupons/coupons.wxml
View file @
64423d8b
...
...
@@ -7,7 +7,7 @@
<!--bindchange="swiperTab"-->
<swiper current="{{currentTab}}" duration="300" bindchange="swiperTab">
<swiper-item>
<scroll-view scroll-y wx:if="{{couponList.length}}">
<scroll-view scroll-y wx:if="{{couponList.length}}"
bindscrolltolower="onBottom"
>
<view class='coupon-wrap'>
<view
class='coupon-list'
...
...
@@ -31,7 +31,6 @@
</view>
</view>
</view>
<no-more wx:if="{{noMoreCoupon}}" />
</scroll-view>
<view class='empty-wrap' wx:if="{{!couponList.length}}">
...
...
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