Commit cb4ceeb8ca57ed29c41550d24b0499ceac7d13e0

Authored by wangfan
1 parent 8cb7d1fe

ui fix

... ... @@ -3,60 +3,78 @@ import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset: 0,
limit: 10,
hasMore: true,
list:{},
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
},
/**
* 页面的初始数据
*/
data: {
/**
* 生命周期函数--监听页面加载
*/
enter_params: {},
onLoad: function (options) {
this.enter_params = util.cache('enter_params');
this.seller_id=options.seller_id||this.enter_params.seller_id;
this.getMembers();
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
/**
* 生命周期函数--监听页面加载
*/
enter_params:{},
onLoad: function (options) {
this.enter_params=util.cache('enter_params');
App.Reserve.SellerInfo(this.enter_params).then(res=>{
this.setData({
seller:res.data.seller,
user:res.data.seller_user
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.SmsInfo({seller_id:this.enter_params.seller_id}).then(res=>{
if(res.ret==404){
res.data={
last_num:100,
meals:[
{id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
{id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
{id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
],
};
}
this.setData({
sms:res.data,
})
})
},
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.getMembers(true);
}
},
getMembers(hasReachBottom=false){
App.Reserve.Members({
sid: this.seller_id,
manager_id:this.enter_params.manager_id,
offset: this.offset,
limit: this.limit,
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
//r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}
this.setData(obj)
})
},
})
\ No newline at end of file
... ...
<!--pages/book/setting/index.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav>
<view class="page">
<formids url="/pages/book/setting/sms">
<view class="row flex-lr">
<block wx:if="{{list.length>0}}">
<view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" >
<view>短信管理</view>
<view class="flex-rr">
<view class="right lastNum">剩余{{sms.last_num||0}}条</view>
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/book/smsbatch/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>短信营销</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/book/crm/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>我的客户</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/customer/index?islove=customer">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到顾客模式</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
</block>
<view wx:else="" class="history-is-empty flex-vc Medium">
<image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
<view>暂时还没有客户</view>
</view>
<view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view>
</view>
<tabBar></tabBar>
... ...
... ... @@ -3,35 +3,16 @@
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.header{
height: 302rpx;
background-color: #199095;
margin-top: -2rpx;
}
.header .info{
color:#FEFEFE;
width: 90%;
padding-top: 86rpx;
margin: 0 auto;
}
.header .info .nick{
font-size: 44rpx;
font-weight: bold;
margin-bottom: 28rpx;
}
.header .info .seller{
font-size: 34rpx;
}
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 34rpx;
}
.row{
font-size: 34rpx;
height: 106rpx;
border-bottom: 2rpx solid #F1F0F4;
padding-top: 34rpx;
}
.row .right{
font-size: 30rpx;
... ... @@ -39,4 +20,15 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
}
.row .more{
margin-left: 20rpx;
}
.history-is-empty{
margin: 200rpx auto;
font-size: 34rpx;
}
.history-is-empty image{
width: 376rpx;
height: 310rpx;
margin-bottom: 122rpx;
}
\ No newline at end of file
... ...
... ... @@ -130,4 +130,7 @@ export default {
'App.Orders.ClearCookById': null,
//购物车
'App.Orders.GetOrderById': null,
/**crm**/
'App.Reserve.Members':null,
}
\ No newline at end of file
... ...