From dd41f392b8dac15a94fdfd1f8aee233d2398775f Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Sun, 24 Nov 2019 17:03:23 +0800 Subject: [PATCH] =?UTF-8?q?feat[litemall-wx]:=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=94=AF=E6=8C=81=E4=B8=8B=E6=8B=89=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-wx/pages/cart/cart.json | 2 +- litemall-wx/pages/comment/comment.js | 7 +++++++ litemall-wx/pages/comment/comment.json | 1 + litemall-wx/pages/index/index.json | 1 + litemall-wx/pages/topicComment/topicComment.js | 7 +++++++ litemall-wx/pages/topicComment/topicComment.json | 1 + litemall-wx/pages/ucenter/couponList/couponList.js | 9 ++++++--- litemall-wx/pages/ucenter/couponList/couponList.json | 1 + litemall-wx/pages/ucenter/couponList/couponList.wxss | 2 +- 9 files changed, 26 insertions(+), 5 deletions(-) diff --git a/litemall-wx/pages/cart/cart.json b/litemall-wx/pages/cart/cart.json index 2c3ab45a..ef6c8d4b 100644 --- a/litemall-wx/pages/cart/cart.json +++ b/litemall-wx/pages/cart/cart.json @@ -1,4 +1,4 @@ { - "backgroundColor": "#f4f4f4", + "enablePullDownRefresh": true, "navigationBarTitleText": "购物车" } \ No newline at end of file diff --git a/litemall-wx/pages/comment/comment.js b/litemall-wx/pages/comment/comment.js index 48bdb19e..ada797f5 100644 --- a/litemall-wx/pages/comment/comment.js +++ b/litemall-wx/pages/comment/comment.js @@ -66,6 +66,13 @@ Page({ this.getCommentCount(); this.getCommentList(); }, + onPullDownRefresh() { + wx.showNavigationBarLoading() //在标题栏中显示加载 + this.getCommentCount(); + this.getCommentList(); + wx.hideNavigationBarLoading() //完成停止加载 + wx.stopPullDownRefresh() //停止下拉刷新 + }, onReady: function() { // 页面渲染完成 diff --git a/litemall-wx/pages/comment/comment.json b/litemall-wx/pages/comment/comment.json index 1ce26b43..6da5ff8d 100644 --- a/litemall-wx/pages/comment/comment.json +++ b/litemall-wx/pages/comment/comment.json @@ -1,3 +1,4 @@ { + "enablePullDownRefresh": true, "navigationBarTitleText": "评价" } \ No newline at end of file diff --git a/litemall-wx/pages/index/index.json b/litemall-wx/pages/index/index.json index 51a4f9e0..7368d159 100644 --- a/litemall-wx/pages/index/index.json +++ b/litemall-wx/pages/index/index.json @@ -1,5 +1,6 @@ { "navigationBarTitleText": "首页", + "enablePullDownRefresh": true, "usingComponents": { "zan-capsule": "../../lib/zanui-weapp/capsule/index" } diff --git a/litemall-wx/pages/topicComment/topicComment.js b/litemall-wx/pages/topicComment/topicComment.js index 8688a671..5fc4ce42 100644 --- a/litemall-wx/pages/topicComment/topicComment.js +++ b/litemall-wx/pages/topicComment/topicComment.js @@ -68,6 +68,13 @@ Page({ this.getCommentCount(); this.getCommentList(); }, + onPullDownRefresh() { + wx.showNavigationBarLoading() //在标题栏中显示加载 + this.getCommentCount(); + this.getCommentList(); + wx.hideNavigationBarLoading() //完成停止加载 + wx.stopPullDownRefresh() //停止下拉刷新 + }, onReady: function() { // 页面渲染完成 diff --git a/litemall-wx/pages/topicComment/topicComment.json b/litemall-wx/pages/topicComment/topicComment.json index eee523f9..7541072f 100644 --- a/litemall-wx/pages/topicComment/topicComment.json +++ b/litemall-wx/pages/topicComment/topicComment.json @@ -1,3 +1,4 @@ { + "enablePullDownRefresh": true, "navigationBarTitleText": "评论" } \ No newline at end of file diff --git a/litemall-wx/pages/ucenter/couponList/couponList.js b/litemall-wx/pages/ucenter/couponList/couponList.js index 60a7cc14..e37773b6 100644 --- a/litemall-wx/pages/ucenter/couponList/couponList.js +++ b/litemall-wx/pages/ucenter/couponList/couponList.js @@ -54,8 +54,11 @@ Page({ /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function() { - + onPullDownRefresh() { + wx.showNavigationBarLoading() //在标题栏中显示加载 + this.getCouponList(); + wx.hideNavigationBarLoading() //完成停止加载 + wx.stopPullDownRefresh() //停止下拉刷新 }, /** @@ -89,7 +92,7 @@ Page({ that.setData({ scrollTop: 0, couponList: res.data.list, - showPage: true, + showPage: res.data.total > that.data.limit, count: res.data.total }); } diff --git a/litemall-wx/pages/ucenter/couponList/couponList.json b/litemall-wx/pages/ucenter/couponList/couponList.json index 08f4c911..91a15805 100644 --- a/litemall-wx/pages/ucenter/couponList/couponList.json +++ b/litemall-wx/pages/ucenter/couponList/couponList.json @@ -1,3 +1,4 @@ { + "enablePullDownRefresh": true, "navigationBarTitleText": "我的优惠券" } \ No newline at end of file diff --git a/litemall-wx/pages/ucenter/couponList/couponList.wxss b/litemall-wx/pages/ucenter/couponList/couponList.wxss index 931d755b..f6a06976 100644 --- a/litemall-wx/pages/ucenter/couponList/couponList.wxss +++ b/litemall-wx/pages/ucenter/couponList/couponList.wxss @@ -129,7 +129,7 @@ page { .container .b .item { position: relative; height: 290rpx; - background: gray; + background: #ccc7c7; margin-bottom: 30rpx; margin-left: 30rpx; margin-right: 30rpx;