Showing
1 changed file
with
20 additions
and
9 deletions
| @@ -18,7 +18,8 @@ Page({ | @@ -18,7 +18,8 @@ Page({ | ||
| 18 | ], | 18 | ], |
| 19 | form:{ | 19 | form:{ |
| 20 | time:0, | 20 | time:0, |
| 21 | - keywords:'' | 21 | + keywords:'', |
| 22 | + sort:'' | ||
| 22 | } | 23 | } |
| 23 | }, | 24 | }, |
| 24 | sellerid:0, | 25 | sellerid:0, |
| @@ -67,10 +68,12 @@ Page({ | @@ -67,10 +68,12 @@ Page({ | ||
| 67 | this.getbooklist(); | 68 | this.getbooklist(); |
| 68 | }, | 69 | }, |
| 69 | async getbooklist(){ | 70 | async getbooklist(){ |
| 70 | - var formdata=this.data.form; | ||
| 71 | - if(formdata.keywords==''){ | ||
| 72 | - delete formdata.keywords; | ||
| 73 | - delete formdata.time; | 71 | + var formdata={}; |
| 72 | + if(this.data.form.keywords!=''){ | ||
| 73 | + formdata.keywords=this.data.form.keywords; | ||
| 74 | + } | ||
| 75 | + if(this.data.form.sort!=''){ | ||
| 76 | + formdata.sort=1; | ||
| 74 | } | 77 | } |
| 75 | formdata.sid=this.data.sellerid; | 78 | formdata.sid=this.data.sellerid; |
| 76 | formdata.x=1; | 79 | formdata.x=1; |
| @@ -81,20 +84,28 @@ Page({ | @@ -81,20 +84,28 @@ Page({ | ||
| 81 | App.Reserve.GetReserveList(formdata).then(function(json){ | 84 | App.Reserve.GetReserveList(formdata).then(function(json){ |
| 82 | console.log(json) | 85 | console.log(json) |
| 83 | if(json.ret==200){ | 86 | if(json.ret==200){ |
| 87 | + json.data.forEach(function(v,i){ | ||
| 88 | + var obj=bookOrder.changedate(Number(v.rdate)*1000); | ||
| 89 | + v.order_time=(obj.hour<10 ? '0'+obj.hour : obj.hour)+':'+(obj.minute==0 ? '0'+obj.minute : obj.minute); | ||
| 90 | + }) | ||
| 84 | that.setData({ | 91 | that.setData({ |
| 85 | isloading:true, | 92 | isloading:true, |
| 86 | bookList:json.data.length==0 ? null : json.data | 93 | bookList:json.data.length==0 ? null : json.data |
| 87 | }) | 94 | }) |
| 88 | } | 95 | } |
| 89 | }) | 96 | }) |
| 90 | - | ||
| 91 | - // 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) | ||
| 92 | }, | 97 | }, |
| 93 | timeorder:function(){ | 98 | timeorder:function(){ |
| 94 | - var booklist=this.data.bookList; | 99 | + if(this.data.form.sort==''){ |
| 100 | + this.data.form.sort=1; | ||
| 101 | + }else{ | ||
| 102 | + this.data.form.sort=''; | ||
| 103 | + } | ||
| 104 | + | ||
| 95 | this.setData({ | 105 | this.setData({ |
| 96 | - bookList:booklist.reverse() | 106 | + form:this.data.form |
| 97 | }) | 107 | }) |
| 108 | + this.getbooklist(); | ||
| 98 | }, | 109 | }, |
| 99 | searchinput:function(e){ | 110 | searchinput:function(e){ |
| 100 | this.data.form.keywords=e.detail.value; | 111 | this.data.form.keywords=e.detail.value; |
-
Please register or login to post a comment