Commit 6642a3b0b22243e60710eb18e4f9838a2951e84e

Authored by wangfan
1 parent bfd95d75

快速预定

... ... @@ -11,6 +11,10 @@ Component({
order:{
type:Object,
value:{},
},
identity:{
type:String,
value:"",
}
},
... ... @@ -51,5 +55,10 @@ Component({
})
},
}
//规格 增加/减少 回调
foodSpecCallback(e){
let opt=e.detail;
this.triggerEvent('foodCardCallback',opt);
},
},
})
... ...
... ... @@ -13,13 +13,13 @@
<view class="price">¥{{item.price}}/份</view>
<view class="flex-lr opt">
<foodSpec item="{{item}}" type="-" id="foodSpecDel"
sellerid="{{order.sellerid}}" orderid="{{order.id}}"
sellerid="{{order.sellerid}}" orderid="{{order.id}}" identity="{{identity}}"
bindfoodSpecCallback="foodSpecCallback">
<view class='jian'></view>
</foodSpec>
<view class="t-align-c">{{item.num||10}}</view>
<view class="t-align-c">{{item.num}}</view>
<foodSpec item="{{item}}" type="+"
sellerid="{{order.sellerid}}" orderid="{{order.id}}"
sellerid="{{order.sellerid}}" orderid="{{order.id}}" identity="{{identity}}"
bindfoodSpecCallback="foodSpecCallback">
<view class='add'></view>
</foodSpec>
... ...
... ... @@ -216,7 +216,7 @@ Component({
//加菜面板
addCook:function(e){
console.log('addCook',this.data.item,e);
var cookbookid = this.data.item.id
var cookbookid = this.data.item.cookbookid
var price=this.data.item.price;
this.initKindMenu().then(res=>{
... ... @@ -258,7 +258,7 @@ Component({
//减菜面板
subtractCook(){
console.log('addFunction',this.data.item);
var cookbookid = this.data.item.id
var cookbookid = this.data.item.cookbookid
var price=this.data.item.price;
this.initKindMenu().then(res=>{
//打开了规格窗口
... ...
... ... @@ -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');
}
//购物车
... ...
... ... @@ -39,7 +39,7 @@
<view class="cart flex-ll" bindtap="dispalyCart">
<view class="icon">
<image src="http://qn.colorcun.com/custom/lite-yd-cook/image/cart.png"/>
<view class="dot" wx:if="{{order.cookbooklist.length>0}}">{{order.cookbooklist.length}}</view>
<view class="dot" wx:if="{{orderItemCount>0}}">{{orderItemCount}}</view>
</view>
<view class="text Semibold">¥{{order.price}}</view>
</view>
... ... @@ -50,4 +50,4 @@
<cookClass id="menu" bind:changeList="changeList"
cooklist="{{cookbooklist}}" hasListModel="{{hasListModel}}">
</cookClass>
<cart rid="{{options.rid}}" id="cart" order="{{order}}"></cart>
\ No newline at end of file
<cart rid="{{options.rid}}" id="cart" order="{{order}}" identity="{{options.identity}}" bindfoodCardCallback="foodCardCallback"></cart>
\ No newline at end of file
... ...