Commit dd41f392 authored by Junling Bu's avatar Junling Bu
Browse files

feat[litemall-wx]: 部分页面支持下拉刷新

parent e211b61d
{ {
"backgroundColor": "#f4f4f4", "enablePullDownRefresh": true,
"navigationBarTitleText": "购物车" "navigationBarTitleText": "购物车"
} }
\ No newline at end of file
...@@ -66,6 +66,13 @@ Page({ ...@@ -66,6 +66,13 @@ Page({
this.getCommentCount(); this.getCommentCount();
this.getCommentList(); this.getCommentList();
}, },
onPullDownRefresh() {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.getCommentCount();
this.getCommentList();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
onReady: function() { onReady: function() {
// 页面渲染完成 // 页面渲染完成
......
{ {
"enablePullDownRefresh": true,
"navigationBarTitleText": "评价" "navigationBarTitleText": "评价"
} }
\ No newline at end of file
{ {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"zan-capsule": "../../lib/zanui-weapp/capsule/index" "zan-capsule": "../../lib/zanui-weapp/capsule/index"
} }
......
...@@ -68,6 +68,13 @@ Page({ ...@@ -68,6 +68,13 @@ Page({
this.getCommentCount(); this.getCommentCount();
this.getCommentList(); this.getCommentList();
}, },
onPullDownRefresh() {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.getCommentCount();
this.getCommentList();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
},
onReady: function() { onReady: function() {
// 页面渲染完成 // 页面渲染完成
......
{ {
"enablePullDownRefresh": true,
"navigationBarTitleText": "评论" "navigationBarTitleText": "评论"
} }
\ No newline at end of file
...@@ -54,8 +54,11 @@ Page({ ...@@ -54,8 +54,11 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function() { onPullDownRefresh() {
wx.showNavigationBarLoading() //在标题栏中显示加载
this.getCouponList();
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}, },
/** /**
...@@ -89,7 +92,7 @@ Page({ ...@@ -89,7 +92,7 @@ Page({
that.setData({ that.setData({
scrollTop: 0, scrollTop: 0,
couponList: res.data.list, couponList: res.data.list,
showPage: true, showPage: res.data.total > that.data.limit,
count: res.data.total count: res.data.total
}); });
} }
......
{ {
"enablePullDownRefresh": true,
"navigationBarTitleText": "我的优惠券" "navigationBarTitleText": "我的优惠券"
} }
\ No newline at end of file
...@@ -129,7 +129,7 @@ page { ...@@ -129,7 +129,7 @@ page {
.container .b .item { .container .b .item {
position: relative; position: relative;
height: 290rpx; height: 290rpx;
background: gray; background: #ccc7c7;
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-left: 30rpx; margin-left: 30rpx;
margin-right: 30rpx; margin-right: 30rpx;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment