Commit fc05c6d560972640d79b334e8bb0e875c95aec7e

Authored by zhangyan
1 parent b9e6b2f8

预定列表

... ... @@ -17,7 +17,8 @@ Page({
{ month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }
],
form:{
time:0
time:0,
keywords:''
}
},
sellerid:0,
... ... @@ -25,7 +26,7 @@ Page({
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(165/radio)
var contentHeight=util.getsystem().windowHeight-Math.ceil(120/radio)
var todayobj=bookOrder.changedate(d*1000);
if(opt.seller_id){
this.sellerid=opt.seller_id;
... ... @@ -42,7 +43,7 @@ Page({
sellerid:this.sellerid,
systemInfo:util.getsystem(),
contentHeight:contentHeight,
listHeight:contentHeight-Math.ceil(140/radio),
listHeight:contentHeight-Math.ceil(210/radio),
dateStr:dateStr,
showyear:todayobj.year,
showmonth:todayobj.month,
... ... @@ -61,70 +62,43 @@ Page({
},1000);
var that=this;
this.setData({
pagex:1,
bookList:null,
isloading:false,
})
this.getbooklist();
util.postSuccessFun=function(json,uri_code){
switch (uri_code) {
case uri.CGI_USER_GETRESERVELIST__CODE:
if(json.ret==200){
var booklist=[];
if(json.data.length>0){
json.data.forEach(item=>{
item.order_time=util.unixtoTime(item.rdate,'HH:II')
booklist.push(item)
})
}
that.setData({
bookList:booklist,
isloading:true,
currenlist:json.data
})
}else{
that.setData({
isloading:true
})
}
break;
}
}
},
getbooklist:function(){
util.post(uri.CGI_USER_GETRESERVELIST,{sid:this.data.sellerid,x:this.data.pagex,y:10,sort:this.data.p_sort},uri.CGI_USER_GETRESERVELIST__CODE)
async getbooklist(){
var formdata=this.data.form;
if(formdata.keywords==''){
delete formdata.keywords;
}
formdata.sid=this.data.sellerid;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,this.data.form.time);
formdata.rdate=rdate;
var that=this;
App.Reserve.GetReserveInfoFormKeys(formdata).then(function(json){
console.log(json)
if(json.ret==200){
that.setData({
isloading:true,
bookList:json.data.length==0 ? null : json.data
})
}
})
// util.post(uri.CGI_USER_GETRESERVELIST,{sid:this.data.sellerid,x:this.data.pagex,y:10,sort:this.data.p_sort},uri.CGI_USER_GETRESERVELIST__CODE)
},
timeorder:function(){
if(this.data.p_sort==null){
this.setData({
p_sort:1
})
}else{
this.setData({
p_sort:null
})
}
var booklist=this.data.bookList;
booklist.forEach(function(v,i){
var thislist=[];
v.list.forEach(function(r,n){
thislist.unshift(r)
})
v.list=thislist;
})
this.setData({
bookList:booklist.reverse()
})
console.log(this.data.bookList)
},
addbooklist: function(e){
console.log(e)
if(e.detail.scrollTop>200*this.data.pagex && this.data.currenlist.length>0){
this.setData({
pagex:this.data.pagex+1
})
console.log(this.data.pagex)
searchinput:function(e){
this.data.form.keywords=e.detail.value;
this.setData({
form:this.data.form
})
if(e.detail.value==''){
this.getbooklist();
}
},
... ... @@ -141,7 +115,7 @@ Page({
var myDate = new Date(parseInt(currentime)*1000);
var week=bookOrder.getweek(myDate.getDay());
var dateStr=(event.detail.month<10 ? '0'+event.detail.month : event.detail.month)+'-'+(event.detail.day<10 ? '0'+event.detail.day : event.detail.day);
if(currentime-new Date()/1000<=86400){
if(currentime-new Date()/1000<=86400 && currentime-new Date()/1000>0){
dateStr+=' 明天'
}else{
dateStr+=' '+week
... ... @@ -158,6 +132,7 @@ Page({
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
},
calendarClose(){
this.setData({
... ... @@ -168,5 +143,10 @@ Page({
this.setData({
form:{time:e.currentTarget.dataset.value}
})
this.getbooklist();
},
searchbook:function(e){
console.log(this.data.form)
this.getbooklist();
}
})
\ No newline at end of file
... ...
<nav>订座</nav>
<block wx:if="{{isloading==true}}">
<block wx:if="{{!bookList}}">
<nothingBook></nothingBook>
</block>
<block wx:else>
<view style="height:{{contentHeight}}px;" bindcsroll="onPullDownRefresh">
<view class="book-page bg_white">
<view class="book-search flex-ll">
<image src="../image/search.png" class="search-icon"></image>
<input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input"/>
</view>
<view class="search-easy flex-lr">
<view class="block flex-vc" bindtap="calendarShow">
<view class="black-font font30r">时间</view>
<view class="green-font font34r font-bold flex-cc" style="margin-top:40rpx;height:54rpx;">{{dateStr}}</view>
<view class="book-page bg_white">
<view class="book-search flex-ll">
<image src="../image/search.png" class="search-icon"></image>
<input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{form.keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>
</view>
<view class="search-easy flex-lr">
<view class="block flex-vc" bindtap="calendarShow">
<view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>
</view>
<view class="block section flex-vc">
<view class="tab flex-cc">
<item class="item {{form.time==0?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="0">
早市
</item>
<item class="item {{form.time==1?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="1">
午市
</item>
<item class="item {{form.time==2?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="2">
晚市
</item>
</view>
</view>
</view>
</view>
<block wx:if="{{!bookList}}">
<nothingBook height="{{listHeight}}"></nothingBook>
</block>
<block wx:else>
<view bindcsroll="onPullDownRefresh" class="bg_white">
<view class="book-list-cut flex-ll font26r black-font">
<text>已定 {{bookList.length}}</text>
</view>
<view class="block section flex-vc">
<view class="black-font font30r">时段</view>
<view class="tab flex-cc" style="margin-top:40rpx;">
<item class="item {{form.time==0?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="0">
早市
</item>
<item class="item {{form.time==1?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="1">
午市
</item>
<item class="item {{form.time==2?'checked':''}} flex-cc"
bindtap="selectedValue" data-key="time" data-value="2">
晚市
</item>
</view>
<view class="book-list-thead flex-lr font34r black-font">
<view>桌号</view>
<view class="flex-cc">预定人</view>
<view class="flex-cc" bindtap="timeorder">时间<image src="../image/direction.png" class="icon22-26" background-size="cover"></image></view>
<view class="flex-rr">操作</view>
</view>
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}">
<bookList item="{{item}}"></bookList>
</block>
</view>
</view>
</view>
<view class="book-list-cut flex-ll font26r black-font">
<text>已定 {{bookList.length}}</text>
</view>
<view class="book-list-thead flex-lr font34r black-font">
<view>桌号</view>
<view class="flex-cc">预定人</view>
<view class="flex-cc" bindtap="timeorder">时间<image src="../image/direction.png" class="icon22-26" background-size="cover"></image></view>
<view class="flex-rr">操作</view>
</view>
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}">
<bookList item="{{item}}"></bookList>
</block>
</view>
</view>
</view>
</view>
</block>
</block>
</block>
<tabBar></tabBar>
... ...
... ... @@ -11,6 +11,7 @@ page{
border-radius:40rpx;
box-shadow: 0 0 8px #ccc;
margin:0 auto;
margin-bottom:10rpx;
}
.search-icon{
width:40rpx;
... ... @@ -60,8 +61,8 @@ page{
}
.search-easy{
height:160rpx;
padding:30rpx 0;
height:80rpx;
padding:20rpx 0;
}
.search-easy .block{
width: 50%;
... ...
... ... @@ -45,6 +45,10 @@ export default {
'App.SendSMS.Message':{
silence:false,
},
'App.Reserve.GetReserveUser':null
//手机号搜索
'App.Reserve.GetReserveUser':null,
//预定列表
'App.Reserve.GetReserveInfoFormKeys':null
}
\ No newline at end of file
... ...