Showing
6 changed files
with
57 additions
and
36 deletions
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | </sendsms> | 25 | </sendsms> |
| 26 | </view> | 26 | </view> |
| 27 | </block> | 27 | </block> |
| 28 | - <block wx:else=""> | 28 | + <block wx:elif="{{item.status!=0}}"> |
| 29 | <formids url="/pages/book/smsbatch/detail?id={{item.id}}&seller_id={{item.sid}}"> | 29 | <formids url="/pages/book/smsbatch/detail?id={{item.id}}&seller_id={{item.sid}}"> |
| 30 | <view class="opt-but">查看详情</view> | 30 | <view class="opt-but">查看详情</view> |
| 31 | </formids> | 31 | </formids> |
| @@ -3,7 +3,9 @@ import util from '../../../utils/util'; | @@ -3,7 +3,9 @@ import util from '../../../utils/util'; | ||
| 3 | import App from '../../../utils/api'; | 3 | import App from '../../../utils/api'; |
| 4 | const {regeneratorRuntime} = global | 4 | const {regeneratorRuntime} = global |
| 5 | Page({ | 5 | Page({ |
| 6 | - | 6 | + offset:0, |
| 7 | + limit:10, | ||
| 8 | + hasMore:true, | ||
| 7 | /** | 9 | /** |
| 8 | * 页面的初始数据 | 10 | * 页面的初始数据 |
| 9 | */ | 11 | */ |
| @@ -11,6 +13,7 @@ Page({ | @@ -11,6 +13,7 @@ Page({ | ||
| 11 | hasScene:0, | 13 | hasScene:0, |
| 12 | seller_id:'', | 14 | seller_id:'', |
| 13 | list:[], | 15 | list:[], |
| 16 | + hasMore:true, | ||
| 14 | }, | 17 | }, |
| 15 | 18 | ||
| 16 | /** | 19 | /** |
| @@ -73,23 +76,35 @@ Page({ | @@ -73,23 +76,35 @@ Page({ | ||
| 73 | onUnload: function () { | 76 | onUnload: function () { |
| 74 | 77 | ||
| 75 | }, | 78 | }, |
| 76 | - SmsBatchList(){ | 79 | + /** |
| 80 | + * 页面上拉触底事件的处理函数 | ||
| 81 | + */ | ||
| 82 | + onReachBottom: function () { | ||
| 83 | + if(this.hasMore){ | ||
| 84 | + this.SmsBatchList(true); | ||
| 85 | + } | ||
| 86 | + }, | ||
| 87 | + SmsBatchList(hasReachBottom=false){ | ||
| 77 | App.Reserve.SmsBatchList({ | 88 | App.Reserve.SmsBatchList({ |
| 78 | - sid:this.seller_id, | ||
| 79 | - offset:0, | ||
| 80 | - limit:1, | ||
| 81 | - }).then(res=>{ | ||
| 82 | - let list=[]; | ||
| 83 | - if(res.data.length>0){ | ||
| 84 | - res.data.forEach(r=>{ | 89 | + sid: this.seller_id, |
| 90 | + offset: this.offset, | ||
| 91 | + limit: this.limit, | ||
| 92 | + }).then(res => { | ||
| 93 | + let list = this.data.list; | ||
| 94 | + let dl=res.data.length; | ||
| 95 | + if (dl > 0) { | ||
| 96 | + res.data.forEach(r => { | ||
| 85 | r.addtimeStr=util.unixtoTime(r.addtime,'YYYY.MM.DD') | 97 | r.addtimeStr=util.unixtoTime(r.addtime,'YYYY.MM.DD') |
| 86 | list.push(r) | 98 | list.push(r) |
| 87 | - this.list[r.id]=r; | 99 | + this.list[r.id] = r; |
| 88 | }) | 100 | }) |
| 89 | } | 101 | } |
| 90 | - this.setData({ | ||
| 91 | - list:list, | ||
| 92 | - }) | 102 | + let obj={list:list}; |
| 103 | + if(dl<this.limit && hasReachBottom){ | ||
| 104 | + this.hasMore=false; | ||
| 105 | + obj.hasMore=false; | ||
| 106 | + } | ||
| 107 | + this.setData(obj) | ||
| 93 | }) | 108 | }) |
| 94 | }, | 109 | }, |
| 95 | sendMsg(e){ | 110 | sendMsg(e){ |
| @@ -3,31 +3,27 @@ | @@ -3,31 +3,27 @@ | ||
| 3 | <view class="header flex-vc"> | 3 | <view class="header flex-vc"> |
| 4 | <view class="info"> | 4 | <view class="info"> |
| 5 | <view>流失客户召回,新老客户回馈</view> | 5 | <view>流失客户召回,新老客户回馈</view> |
| 6 | - <view>沉默客户激活</view> | 6 | + <view style="margin-top: 10rpx;">沉默客户激活</view> |
| 7 | </view> | 7 | </view> |
| 8 | <formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}"> | 8 | <formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}"> |
| 9 | <view class="button-create Semibold">立即创建</view> | 9 | <view class="button-create Semibold">立即创建</view> |
| 10 | </formids> | 10 | </formids> |
| 11 | </view> | 11 | </view> |
| 12 | -<view class="page history"> | ||
| 13 | - <view class="page" style="padding-top: 0"> | ||
| 14 | - <view class="title Medium flex-lr"> | ||
| 15 | - <view>短信记录</view> | ||
| 16 | - <formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}"> | ||
| 17 | - <view class="flex-rr"> | ||
| 18 | - <view style="margin-right: 20rpx;color: #999999;">更多</view> | ||
| 19 | - <view class="more"></view> | ||
| 20 | - </view> | ||
| 21 | - </formids> | ||
| 22 | - </view> | ||
| 23 | - <view class="flex-vc lists"> | 12 | +<view class="page"> |
| 13 | + <view class="title Medium flex-lr"> | ||
| 14 | + <view>短信记录</view> | ||
| 15 | + <formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}"> | ||
| 16 | + <view style="color: #999999;font-size: 30rpx;">历史记录</view> | ||
| 17 | + </formids> | ||
| 18 | + </view> | ||
| 19 | + <view class="flex-vc"> | ||
| 24 | <block wx:if="{{list.length>0}}"> | 20 | <block wx:if="{{list.length>0}}"> |
| 25 | - <view style="width: 100%" wx:for="{{list}}" wx:key="list.key" > | 21 | + <view class="list-rows" wx:for="{{list}}" wx:key="list.key" style="width: 100%;"> |
| 26 | <rows item="{{item}}"></rows> | 22 | <rows item="{{item}}"></rows> |
| 27 | </view> | 23 | </view> |
| 28 | </block> | 24 | </block> |
| 29 | - <view wx:else="">暂无</view> | ||
| 30 | - </view> | 25 | + <view wx:else="">暂无短信记录</view> |
| 26 | + <view wx:if="{{!hasMore}}">已经到底了</view> | ||
| 31 | </view> | 27 | </view> |
| 32 | </view> | 28 | </view> |
| 33 | <view class="page"> | 29 | <view class="page"> |
| 1 | /* pages/book/smsbatch/index.wxss */ | 1 | /* pages/book/smsbatch/index.wxss */ |
| 2 | -page{ | ||
| 3 | - background-color: #F5F5F5; | ||
| 4 | -} | ||
| 5 | .page{ | 2 | .page{ |
| 6 | width: 90%; | 3 | width: 90%; |
| 7 | margin: 0 auto; | 4 | margin: 0 auto; |
| @@ -35,6 +32,19 @@ page{ | @@ -35,6 +32,19 @@ page{ | ||
| 35 | margin-top: 20rpx; | 32 | margin-top: 20rpx; |
| 36 | height: 340rpx; | 33 | height: 340rpx; |
| 37 | } | 34 | } |
| 35 | +.history .title{ | ||
| 36 | + height: 40rpx; | ||
| 37 | + line-height: 40rpx; | ||
| 38 | +} | ||
| 38 | .history .lists{ | 39 | .history .lists{ |
| 39 | height: 300rpx; | 40 | height: 300rpx; |
| 41 | +} | ||
| 42 | + | ||
| 43 | +.list-rows{ | ||
| 44 | + height: 140rpx; | ||
| 45 | + line-height: 140rpx; | ||
| 46 | + border-bottom: 2rpx solid #F1F0F4; | ||
| 47 | +} | ||
| 48 | +.list-rows:last-child{ | ||
| 49 | + border-bottom-width: 0; | ||
| 40 | } | 50 | } |
| @@ -8,7 +8,7 @@ Page({ | @@ -8,7 +8,7 @@ Page({ | ||
| 8 | hasMore:true, | 8 | hasMore:true, |
| 9 | seller_id:0, | 9 | seller_id:0, |
| 10 | hasScene:0, | 10 | hasScene:0, |
| 11 | - list:[], | 11 | + list:{}, |
| 12 | /** | 12 | /** |
| 13 | * 页面的初始数据 | 13 | * 页面的初始数据 |
| 14 | */ | 14 | */ |
| @@ -66,7 +66,7 @@ Page({ | @@ -66,7 +66,7 @@ Page({ | ||
| 66 | */ | 66 | */ |
| 67 | onReachBottom: function () { | 67 | onReachBottom: function () { |
| 68 | if(this.hasMore){ | 68 | if(this.hasMore){ |
| 69 | - this.SmsBatchList(hasReachBottom); | 69 | + this.SmsBatchList(true); |
| 70 | } | 70 | } |
| 71 | }, | 71 | }, |
| 72 | 72 |
-
Please register or login to post a comment