|
|
@@ -26,7 +26,11 @@ Page({
|
|
|
cashTotal: 0,
|
|
|
orderprice:[4,10,10],//单点价格早,中,晚
|
|
|
ordersubprice:[2,4,4],//订餐价格早,中,晚
|
|
|
- checkAll:false//全选
|
|
|
+ checkAll:false,//全选
|
|
|
+ loading:false,//是否执行中
|
|
|
+ can1:true,//单点时早餐是否可选
|
|
|
+ can2:true,//单点时中餐是否可选
|
|
|
+ can3:true//单点时晚餐是否可选
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
@@ -94,15 +98,16 @@ Page({
|
|
|
return `${year}-${month}-${day}`;
|
|
|
},
|
|
|
bindDateChange: function(e) {
|
|
|
- console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
+ console.log('picker1发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
date1: e.detail.value,
|
|
|
startdate2: e.detail.value
|
|
|
})
|
|
|
+ this.getSingleRule();
|
|
|
this.calcOrder();
|
|
|
},
|
|
|
bindDateChange2: function(e) {
|
|
|
- console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
+ console.log('picker2发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
date2: e.detail.value
|
|
|
})
|
|
|
@@ -114,6 +119,7 @@ Page({
|
|
|
this.setData({
|
|
|
checkbox:[]
|
|
|
});
|
|
|
+ this.getSingleRule();
|
|
|
}
|
|
|
this.setData({
|
|
|
ordertype:e.detail.value,
|
|
|
@@ -121,6 +127,22 @@ Page({
|
|
|
});
|
|
|
this.calcOrder();
|
|
|
},
|
|
|
+ getSingleRule() {
|
|
|
+ var that = this
|
|
|
+ var url = 'newapi:food/check-date?date='+this.data.date1;
|
|
|
+ var params = {
|
|
|
+ }
|
|
|
+ var success = function (res) {
|
|
|
+ console.log('res',res)
|
|
|
+ var data = res.data.data;
|
|
|
+ that.setData({
|
|
|
+ can1:data['1'],
|
|
|
+ can2:data['2'],
|
|
|
+ can3:data['3'],
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _request.$get(url, params, success)
|
|
|
+ },
|
|
|
getOrdrList:function(e){
|
|
|
var that = this
|
|
|
var url = 'newapi:food/get-info'
|
|
|
@@ -408,6 +430,9 @@ Page({
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
+ this.setData({
|
|
|
+ loading:true
|
|
|
+ })
|
|
|
|
|
|
var that = this
|
|
|
var url = 'newapi:food/order-food'
|
|
|
@@ -429,6 +454,11 @@ Page({
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
+ setTimeout(function(){
|
|
|
+ that.setData({
|
|
|
+ loading:false
|
|
|
+ })
|
|
|
+ },500)
|
|
|
}
|
|
|
}
|
|
|
_request.$post(url, JSON.stringify(paramorder), success);
|