|
...
|
...
|
@@ -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 |
...
|
...
|
|