Showing
4 changed files
with
90 additions
and
97 deletions
| @@ -3,60 +3,78 @@ import util from '../../../utils/util'; | @@ -3,60 +3,78 @@ 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 | + offset: 0, | ||
| 7 | + limit: 10, | ||
| 8 | + hasMore: true, | ||
| 9 | + list:{}, | ||
| 10 | + /** | ||
| 11 | + * 页面的初始数据 | ||
| 12 | + */ | ||
| 13 | + data: { | ||
| 14 | + list:[], | ||
| 15 | + hasMore:true, | ||
| 16 | + }, | ||
| 6 | 17 | ||
| 7 | - /** | ||
| 8 | - * 页面的初始数据 | ||
| 9 | - */ | ||
| 10 | - data: { | 18 | + /** |
| 19 | + * 生命周期函数--监听页面加载 | ||
| 20 | + */ | ||
| 21 | + enter_params: {}, | ||
| 22 | + onLoad: function (options) { | ||
| 23 | + this.enter_params = util.cache('enter_params'); | ||
| 24 | + this.seller_id=options.seller_id||this.enter_params.seller_id; | ||
| 25 | + this.getMembers(); | ||
| 26 | + }, | ||
| 11 | 27 | ||
| 12 | - }, | 28 | + /** |
| 29 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 30 | + */ | ||
| 31 | + onReady: function () { | ||
| 13 | 32 | ||
| 14 | - /** | ||
| 15 | - * 生命周期函数--监听页面加载 | ||
| 16 | - */ | ||
| 17 | - enter_params:{}, | ||
| 18 | - onLoad: function (options) { | ||
| 19 | - this.enter_params=util.cache('enter_params'); | ||
| 20 | - App.Reserve.SellerInfo(this.enter_params).then(res=>{ | ||
| 21 | - this.setData({ | ||
| 22 | - seller:res.data.seller, | ||
| 23 | - user:res.data.seller_user | ||
| 24 | - }) | ||
| 25 | - }) | ||
| 26 | - }, | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 30 | - */ | ||
| 31 | - onReady: function () { | 33 | + }, |
| 32 | 34 | ||
| 33 | - }, | 35 | + /** |
| 36 | + * 生命周期函数--监听页面显示 | ||
| 37 | + */ | ||
| 38 | + onShow: function () { | ||
| 34 | 39 | ||
| 35 | - /** | ||
| 36 | - * 生命周期函数--监听页面显示 | ||
| 37 | - */ | ||
| 38 | - onShow: function () { | ||
| 39 | - App.Reserve.SmsInfo({seller_id:this.enter_params.seller_id}).then(res=>{ | ||
| 40 | - if(res.ret==404){ | ||
| 41 | - res.data={ | ||
| 42 | - last_num:100, | ||
| 43 | - meals:[ | ||
| 44 | - {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0}, | ||
| 45 | - {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0}, | ||
| 46 | - {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1}, | ||
| 47 | - ], | ||
| 48 | - }; | ||
| 49 | - } | ||
| 50 | - this.setData({ | ||
| 51 | - sms:res.data, | ||
| 52 | - }) | ||
| 53 | - }) | ||
| 54 | - }, | 40 | + }, |
| 55 | 41 | ||
| 56 | - /** | ||
| 57 | - * 生命周期函数--监听页面隐藏 | ||
| 58 | - */ | ||
| 59 | - onHide: function () { | 42 | + /** |
| 43 | + * 生命周期函数--监听页面隐藏 | ||
| 44 | + */ | ||
| 45 | + onHide: function () { | ||
| 60 | 46 | ||
| 61 | - }, | 47 | + }, |
| 48 | + /** | ||
| 49 | + * 页面上拉触底事件的处理函数 | ||
| 50 | + */ | ||
| 51 | + onReachBottom: function () { | ||
| 52 | + if(this.hasMore){ | ||
| 53 | + this.getMembers(true); | ||
| 54 | + } | ||
| 55 | + }, | ||
| 56 | + getMembers(hasReachBottom=false){ | ||
| 57 | + App.Reserve.Members({ | ||
| 58 | + sid: this.seller_id, | ||
| 59 | + manager_id:this.enter_params.manager_id, | ||
| 60 | + offset: this.offset, | ||
| 61 | + limit: this.limit, | ||
| 62 | + }).then(res => { | ||
| 63 | + let list = this.data.list; | ||
| 64 | + let dl=res.data.length; | ||
| 65 | + if (dl > 0) { | ||
| 66 | + res.data.forEach(r => { | ||
| 67 | + //r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II') | ||
| 68 | + list.push(r) | ||
| 69 | + this.list[r.id] = r; | ||
| 70 | + }) | ||
| 71 | + } | ||
| 72 | + let obj={list:list}; | ||
| 73 | + if(dl<this.limit && hasReachBottom){ | ||
| 74 | + this.hasMore=false; | ||
| 75 | + obj.hasMore=false; | ||
| 76 | + } | ||
| 77 | + this.setData(obj) | ||
| 78 | + }) | ||
| 79 | + }, | ||
| 62 | }) | 80 | }) |
| 1 | <!--pages/book/setting/index.wxml--> | 1 | <!--pages/book/setting/index.wxml--> |
| 2 | <nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav> | 2 | <nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav> |
| 3 | <view class="page"> | 3 | <view class="page"> |
| 4 | - <formids url="/pages/book/setting/sms"> | ||
| 5 | - <view class="row flex-lr"> | 4 | + <block wx:if="{{list.length>0}}"> |
| 5 | + <view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" > | ||
| 6 | <view>短信管理</view> | 6 | <view>短信管理</view> |
| 7 | <view class="flex-rr"> | 7 | <view class="flex-rr"> |
| 8 | <view class="right lastNum">剩余{{sms.last_num||0}}条</view> | 8 | <view class="right lastNum">剩余{{sms.last_num||0}}条</view> |
| 9 | <view class="more"></view> | 9 | <view class="more"></view> |
| 10 | </view> | 10 | </view> |
| 11 | </view> | 11 | </view> |
| 12 | - </formids> | ||
| 13 | - <formids url="/pages/book/smsbatch/index"> | ||
| 14 | - <view class="row flex-lr" style="padding-top: 34rpx;"> | ||
| 15 | - <view>短信营销</view> | ||
| 16 | - <view class="flex-rr"> | ||
| 17 | - <view class="more"></view> | ||
| 18 | - </view> | ||
| 19 | - </view> | ||
| 20 | - </formids> | ||
| 21 | - <formids url="/pages/book/crm/index"> | ||
| 22 | - <view class="row flex-lr" style="padding-top: 34rpx;"> | ||
| 23 | - <view>我的客户</view> | ||
| 24 | - <view class="flex-rr"> | ||
| 25 | - <view class="more"></view> | ||
| 26 | - </view> | ||
| 27 | - </view> | ||
| 28 | - </formids> | ||
| 29 | - <formids url="/pages/customer/index?islove=customer"> | ||
| 30 | - <view class="row flex-lr" style="padding-top: 34rpx;"> | ||
| 31 | - <view>切换到顾客模式</view> | ||
| 32 | - <view class="flex-rr"> | ||
| 33 | - <view class="more"></view> | ||
| 34 | - </view> | ||
| 35 | - </view> | ||
| 36 | - </formids> | 12 | + </block> |
| 13 | + <view wx:else="" class="history-is-empty flex-vc Medium"> | ||
| 14 | + <image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image> | ||
| 15 | + <view>暂时还没有客户</view> | ||
| 16 | + </view> | ||
| 17 | + <view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view> | ||
| 37 | </view> | 18 | </view> |
| 38 | -<tabBar></tabBar> |
| @@ -3,35 +3,16 @@ | @@ -3,35 +3,16 @@ | ||
| 3 | http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png | 3 | http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png |
| 4 | http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | 4 | http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png |
| 5 | */ | 5 | */ |
| 6 | -.header{ | ||
| 7 | - height: 302rpx; | ||
| 8 | - background-color: #199095; | ||
| 9 | - margin-top: -2rpx; | ||
| 10 | -} | ||
| 11 | -.header .info{ | ||
| 12 | - color:#FEFEFE; | ||
| 13 | - width: 90%; | ||
| 14 | - padding-top: 86rpx; | ||
| 15 | - margin: 0 auto; | ||
| 16 | -} | ||
| 17 | -.header .info .nick{ | ||
| 18 | - font-size: 44rpx; | ||
| 19 | - font-weight: bold; | ||
| 20 | - margin-bottom: 28rpx; | ||
| 21 | -} | ||
| 22 | -.header .info .seller{ | ||
| 23 | - font-size: 34rpx; | ||
| 24 | -} | ||
| 25 | .page{ | 6 | .page{ |
| 26 | width: 90%; | 7 | width: 90%; |
| 27 | margin: 0 auto; | 8 | margin: 0 auto; |
| 28 | color: #353535; | 9 | color: #353535; |
| 29 | - padding-top: 34rpx; | ||
| 30 | } | 10 | } |
| 31 | .row{ | 11 | .row{ |
| 32 | font-size: 34rpx; | 12 | font-size: 34rpx; |
| 33 | height: 106rpx; | 13 | height: 106rpx; |
| 34 | border-bottom: 2rpx solid #F1F0F4; | 14 | border-bottom: 2rpx solid #F1F0F4; |
| 15 | + padding-top: 34rpx; | ||
| 35 | } | 16 | } |
| 36 | .row .right{ | 17 | .row .right{ |
| 37 | font-size: 30rpx; | 18 | font-size: 30rpx; |
| @@ -39,4 +20,15 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | @@ -39,4 +20,15 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | ||
| 39 | } | 20 | } |
| 40 | .row .more{ | 21 | .row .more{ |
| 41 | margin-left: 20rpx; | 22 | margin-left: 20rpx; |
| 23 | +} | ||
| 24 | + | ||
| 25 | +.history-is-empty{ | ||
| 26 | + margin: 200rpx auto; | ||
| 27 | + font-size: 34rpx; | ||
| 28 | + | ||
| 29 | +} | ||
| 30 | +.history-is-empty image{ | ||
| 31 | + width: 376rpx; | ||
| 32 | + height: 310rpx; | ||
| 33 | + margin-bottom: 122rpx; | ||
| 42 | } | 34 | } |
| @@ -130,4 +130,7 @@ export default { | @@ -130,4 +130,7 @@ export default { | ||
| 130 | 'App.Orders.ClearCookById': null, | 130 | 'App.Orders.ClearCookById': null, |
| 131 | //购物车 | 131 | //购物车 |
| 132 | 'App.Orders.GetOrderById': null, | 132 | 'App.Orders.GetOrderById': null, |
| 133 | + | ||
| 134 | + /**crm**/ | ||
| 135 | + 'App.Reserve.Members':null, | ||
| 133 | } | 136 | } |
-
Please register or login to post a comment