Commit 4bd6b0addda8dff246609e3963c9e17782a79588

Authored by zhangyan
1 parent c43b7fbb

预定列表

@@ -16,10 +16,10 @@ Page({ @@ -16,10 +16,10 @@ Page({
16 { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }, 16 { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' },
17 { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' } 17 { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }
18 ], 18 ],
  19 + keywords:'',
  20 + sort:'',
19 form:{ 21 form:{
20 time:0, 22 time:0,
21 - keywords:'',  
22 - sort:''  
23 } 23 }
24 }, 24 },
25 sellerid:0, 25 sellerid:0,
@@ -68,13 +68,13 @@ Page({ @@ -68,13 +68,13 @@ Page({
68 this.getbooklist(); 68 this.getbooklist();
69 }, 69 },
70 async getbooklist(){ 70 async getbooklist(){
71 - var formdata=this.data.form;  
72 - if(formdata.keywords!=''){  
73 - delete formdata.keywords 71 + var formdata={};
  72 + if(this.data.sort!=''){
  73 + formdata.sort=this.data.sort
  74 + }
  75 + if(this.data.keywords!=''){
  76 + formdata.keywords=this.data.keywords
74 } 77 }
75 - // if(formdata.sort==''){  
76 - // delete formdata.sort  
77 - // }  
78 formdata.sid=this.data.sellerid; 78 formdata.sid=this.data.sellerid;
79 formdata.x=1; 79 formdata.x=1;
80 formdata.y=200; 80 formdata.y=200;
@@ -92,31 +92,29 @@ Page({ @@ -92,31 +92,29 @@ Page({
92 isloading:true, 92 isloading:true,
93 bookList:json.data.length==0 ? null : json.data 93 bookList:json.data.length==0 ? null : json.data
94 }) 94 })
95 - if(json.data.length>0){  
96 - that.boolists=that.selectAllComponents('.orderbook');  
97 - that.boolists.forEach(function(v,i){  
98 - v.changeitem();  
99 - })  
100 - } 95 + that.boolists=that.selectAllComponents('.orderbook');
  96 + that.boolists.forEach(function(v,i){
  97 + v.changeitem();
  98 + })
101 } 99 }
102 }) 100 })
103 }, 101 },
104 timeorder:function(){ 102 timeorder:function(){
105 - if(this.data.form.sort==''){ 103 + if(this.data.sort==''){
106 this.data.form.sort=1; 104 this.data.form.sort=1;
107 }else{ 105 }else{
108 - this.data.form.sort=''; 106 + this.data.sort='';
109 } 107 }
110 108
111 this.setData({ 109 this.setData({
112 - form:this.data.form 110 + sort:this.data.sort
113 }) 111 })
114 this.getbooklist(); 112 this.getbooklist();
115 }, 113 },
116 searchinput:function(e){ 114 searchinput:function(e){
117 - this.data.form.keywords=e.detail.value; 115 + this.data.keywords=e.detail.value;
118 this.setData({ 116 this.setData({
119 - form:this.data.form 117 + keywords:this.data.keywords
120 }) 118 })
121 if(e.detail.value==''){ 119 if(e.detail.value==''){
122 this.getbooklist(); 120 this.getbooklist();
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="book-page bg_white"> 3 <view class="book-page bg_white">
4 <view class="book-search flex-ll"> 4 <view class="book-search flex-ll">
5 <image src="../image/search.png" class="search-icon"></image> 5 <image src="../image/search.png" class="search-icon"></image>
6 - <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"/> 6 + <input placeholder="桌位·预定人姓名·手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>
7 </view> 7 </view>
8 <view class="search-easy flex-lr"> 8 <view class="search-easy flex-lr">
9 <view class="block flex-vc" bindtap="calendarShow"> 9 <view class="block flex-vc" bindtap="calendarShow">