b_desk.js
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import util from '../../utils/util';
import comm from '../../utils/bookCommon';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
data:{
},
onLoad:function(opt){
console.log(opt)
util.setBarTitle('选择桌位');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(350/radio);
if(opt.tid==0){
delete opt.tid
}
this.setData({
sellerid:util.cache('sellerid'),
opt:opt
})
this.getdesklist();
},
onShow:function(){
},
changedesk:function(e){
var tableid=e.detail;
this.setData({
tableid:util.cache('tableid') && util.cache('tableid').length>0 ? util.cache('tableid') :null
})
},
back:function(){
this.setData({
buttonClick:true
})
wx.removeStorage({key:'tableid'})
wx.navigateBack();
},
getdesklist:function(){
var formdata=this.data.opt;
formdata.sid=this.data.sellerid;
var that=this;
App.Reserve.GetTableList(formdata).then(function (json) {
if(json.ret==200){
if(json.data.length>0){
json.data.forEach(function(v,i){
v.list.forEach(function(r,n){
r.isselect=false
})
})
}
that.setData({
desklist:json.data
})
}
})
},
})