|
...
|
...
|
@@ -22,6 +22,7 @@ Page({ |
|
|
|
cookbooklist: [{}, {}, {}, {}, {}, {}, {},],
|
|
|
|
showSkeleton: true,
|
|
|
|
order: {},
|
|
|
|
orderItemCount:0,
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -40,8 +41,13 @@ Page({ |
|
|
|
identity:this.data.options.identity,
|
|
|
|
status:'0,1'
|
|
|
|
}).then(res => {
|
|
|
|
let orderItemCount=0;
|
|
|
|
res.data.cookbooklist.forEach(cb=>{
|
|
|
|
orderItemCount+=parseInt(cb.num)
|
|
|
|
})
|
|
|
|
this.setData({
|
|
|
|
order: res.data,
|
|
|
|
orderItemCount:orderItemCount,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
...
|
...
|
@@ -233,7 +239,7 @@ Page({ |
|
|
|
},100)
|
|
|
|
},
|
|
|
|
gotoCart(){
|
|
|
|
if(this.data.order.cookbooklist.length<1){
|
|
|
|
if(this.data.orderItemCount<1){
|
|
|
|
return util.toast('请添加菜品','none');
|
|
|
|
}
|
|
|
|
//购物车
|
...
|
...
|
|