Commit 3483886002c16f1ab4f1c39667cea99a54019c7b
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into test
Showing
4 changed files
with
56 additions
and
19 deletions
packageA/pages/distribution/rank/rank.js
| @@ -14,7 +14,9 @@ Page({ | @@ -14,7 +14,9 @@ Page({ | ||
| 14 | list: null, | 14 | list: null, |
| 15 | isLoading: false, // 检测是否已经发送请求,防止重复发送请求 | 15 | isLoading: false, // 检测是否已经发送请求,防止重复发送请求 |
| 16 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 | 16 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
| 17 | - pageNum: 1, // 当前页数 | 17 | + pageNum: 1, // 当前页数 |
| 18 | + listUrl:"/api/weshop/users/distribut/rankinglist", | ||
| 19 | + userUrl:"/api/weshop/users/distribut/rankingUser", | ||
| 18 | }, | 20 | }, |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| @@ -272,9 +274,10 @@ Page({ | @@ -272,9 +274,10 @@ Page({ | ||
| 272 | // 数据总量 | 274 | // 数据总量 |
| 273 | let total = this.data.list.total; | 275 | let total = this.data.list.total; |
| 274 | // 单页最大数据量 | 276 | // 单页最大数据量 |
| 275 | - let pageSize = this.data.list.pageSize; | 277 | + let pageSize = this.data.list.pageSize; |
| 278 | + let page = this.data.list.page; | ||
| 276 | // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ | 279 | // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ |
| 277 | - if((total != 0)&&(total <= pageSize)) { | 280 | + if((total != 0)&&(total <= pageSize*page)) { |
| 278 | this.setData({ | 281 | this.setData({ |
| 279 | noMore: true | 282 | noMore: true |
| 280 | }); | 283 | }); |
packageA/pages/distribution/rank/rank.wxml
| 1 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | ||
| 1 | <view> | 2 | <view> |
| 2 | <view> | 3 | <view> |
| 3 | <view class="flex jc_sb pd bg-red ai-center"> | 4 | <view class="flex jc_sb pd bg-red ai-center"> |
| 4 | <view> | 5 | <view> |
| 5 | <view class="t1">排行榜</view> | 6 | <view class="t1">排行榜</view> |
| 6 | <view class="t2 pdt10 pdr40" wx:if="{{userRanking.rownum == 1}}">恭喜您当前排名第一!</view> | 7 | <view class="t2 pdt10 pdr40" wx:if="{{userRanking.rownum == 1}}">恭喜您当前排名第一!</view> |
| 7 | - <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.mindistribut_money}}">您距离前一名还差<text class="money">{{userRanking.mindistribut_money - userRanking.distribut_money}}</text></view> | 8 | + <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.mindistribut_money}}">您距离前一名还差<text class="money">{{filters.toFix(userRanking.mindistribut_money - userRanking.distribut_money,2)}}</text></view> |
| 8 | <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.underling_number}}">您距离前一名还差{{userRanking.underling_number}}人</view> | 9 | <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.underling_number}}">您距离前一名还差{{userRanking.underling_number}}人</view> |
| 9 | <view class="t2 pdt10 pdr40" wx:else>好好努力,天天向上!</view> | 10 | <view class="t2 pdt10 pdr40" wx:else>好好努力,天天向上!</view> |
| 10 | </view> | 11 | </view> |
pages/user/index/index.js
| @@ -582,16 +582,31 @@ Page({ | @@ -582,16 +582,31 @@ Page({ | ||
| 582 | 582 | ||
| 583 | //------卡片的显示和关闭-------- | 583 | //------卡片的显示和关闭-------- |
| 584 | show_tc: function () { | 584 | show_tc: function () { |
| 585 | + var that=this; | ||
| 585 | if (!this.data.userInfo) return false; | 586 | if (!this.data.userInfo) return false; |
| 586 | - | ||
| 587 | - //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | ||
| 588 | - var val = this.data.userInfo.mobile + "|" + ut.formatTime()+"|"+this.data.getusercode_vailtime; | ||
| 589 | - val = "^" + ut.base64_encode(val); | ||
| 590 | - | ||
| 591 | - qrcode('qrcode', val, 480, 480, this); | ||
| 592 | - this.setData({ | ||
| 593 | - tc_hide: false, | ||
| 594 | - }); | 587 | + var getnowtime; |
| 588 | + rq.get("/api/weshop/users/getServerTime", { | ||
| 589 | + success: function (res) { | ||
| 590 | + if (res.data.code == 0) | ||
| 591 | + { | ||
| 592 | + getnowtime=res.data.data; | ||
| 593 | + if (!getnowtime) | ||
| 594 | + { | ||
| 595 | + getApp().showWarning("获取服务时间失败"); | ||
| 596 | + return; | ||
| 597 | + } | ||
| 598 | + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | ||
| 599 | + var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; | ||
| 600 | + val = "^" + ut.base64_encode(val); | ||
| 601 | + | ||
| 602 | + qrcode('qrcode', val, 480, 480, that); | ||
| 603 | + that.setData({ | ||
| 604 | + tc_hide: false, | ||
| 605 | + }); | ||
| 606 | + } | ||
| 607 | + } | ||
| 608 | + }) | ||
| 609 | + | ||
| 595 | }, | 610 | }, |
| 596 | hide_tc: function () { | 611 | hide_tc: function () { |
| 597 | this.setData({ | 612 | this.setData({ |
pages/user/userinfo/userinfo.js
| @@ -867,16 +867,34 @@ Page({ | @@ -867,16 +867,34 @@ Page({ | ||
| 867 | 867 | ||
| 868 | //------卡片的显示和关闭-------- | 868 | //------卡片的显示和关闭-------- |
| 869 | show_tc: function() { | 869 | show_tc: function() { |
| 870 | + var that=this; | ||
| 871 | + var req = t; | ||
| 870 | if (!getApp().globalData.userInfo) return false; | 872 | if (!getApp().globalData.userInfo) return false; |
| 871 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | 873 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') |
| 872 | - var val=getApp().globalData.userInfo.mobile+"|"+ut.formatTime()+"|"+this.data.getusercode_vailtime; | ||
| 873 | - val="^"+ut.base64_encode(val); | 874 | + var getnowtime; |
| 875 | + req.get("/api/weshop/users/getServerTime", { | ||
| 876 | + success: function (res) { | ||
| 877 | + if (res.data.code == 0) | ||
| 878 | + { | ||
| 879 | + getnowtime=res.data.data; | ||
| 880 | + if (!getnowtime) | ||
| 881 | + { | ||
| 882 | + getApp().showWarning("获取服务时间失败"); | ||
| 883 | + return; | ||
| 884 | + } | ||
| 885 | + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | ||
| 886 | + var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; | ||
| 887 | + val = "^" + ut.base64_encode(val); | ||
| 888 | + | ||
| 889 | + qrcode('qrcode', val, 480, 480, that); | ||
| 890 | + that.setData({ | ||
| 891 | + tc_hide: false, | ||
| 892 | + }); | ||
| 893 | + } | ||
| 894 | + } | ||
| 895 | + }) | ||
| 874 | 896 | ||
| 875 | - qrcode('qrcode', val, 480, 480, this); | ||
| 876 | 897 | ||
| 877 | - this.setData({ | ||
| 878 | - tc_hide: false, | ||
| 879 | - }); | ||
| 880 | }, | 898 | }, |
| 881 | hide_tc: function() { | 899 | hide_tc: function() { |
| 882 | this.setData({ | 900 | this.setData({ |