更新打包
This commit is contained in:
@@ -280,7 +280,7 @@
|
|||||||
this.is_type = 1;
|
this.is_type = 1;
|
||||||
}
|
}
|
||||||
this.getProductqueryShop();
|
this.getProductqueryShop();
|
||||||
this.getchoseEatModel();
|
this.getchoseEatModel('index',0);
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@@ -321,10 +321,16 @@
|
|||||||
methods: {
|
methods: {
|
||||||
setPayAmount ( cartLists ) {
|
setPayAmount ( cartLists ) {
|
||||||
console.log(cartLists)
|
console.log(cartLists)
|
||||||
|
let tableFee;
|
||||||
|
if ( this.is_type == 0 ) {
|
||||||
|
tableFee = this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0
|
||||||
|
} else{
|
||||||
|
tableFee = 0
|
||||||
|
}
|
||||||
if ( this.amountVIP.isVip == 1 && cartLists.memberAmount > 0 ) {
|
if ( this.amountVIP.isVip == 1 && cartLists.memberAmount > 0 ) {
|
||||||
this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
|
this.listinfo.payAmount = (cartLists.memberAmount+tableFee).toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
|
this.listinfo.payAmount = (cartLists.amount+tableFee).toFixed(2)
|
||||||
}
|
}
|
||||||
this.isPointsChecked = false;
|
this.isPointsChecked = false;
|
||||||
this.getCalcUsablePoints()
|
this.getCalcUsablePoints()
|
||||||
@@ -529,25 +535,45 @@
|
|||||||
* @param {Object} val
|
* @param {Object} val
|
||||||
*/
|
*/
|
||||||
tabClick ( index, item ) {
|
tabClick ( index, item ) {
|
||||||
this.is_type = index;
|
|
||||||
this.sendType = item.type
|
this.getchoseEatModel('tabClick', index, item);
|
||||||
this.eatModel = [];
|
|
||||||
this.eatModel.push(item.val);
|
|
||||||
this.getchoseEatModel();
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取堂食/外带菜品数据
|
* 获取堂食/外带菜品数据
|
||||||
*/
|
*/
|
||||||
async getchoseEatModel () {
|
async getchoseEatModel ( type , index, item) {
|
||||||
let params = {
|
let params = {
|
||||||
shopId: uni.cache.get('shopId'),
|
shopId: uni.cache.get('shopId'),
|
||||||
type: this.is_type,
|
type: index,
|
||||||
}
|
}
|
||||||
if ( this.eatModel == "dine-in" && this.tableCode ) { params.tableId = this.tableCode; }
|
if ( this.eatModel == "dine-in" && this.tableCode ) { params.tableId = this.tableCode; }
|
||||||
if ( this.shopTableInfo && this.shopTableInfo.seatNum ) { params.num = this.shopTableInfo.seatNum; }
|
if ( this.shopTableInfo && this.shopTableInfo.seatNum ) { params.num = this.shopTableInfo.seatNum; }
|
||||||
let res = await this.api.choseEatModel(params)
|
let res = await this.api.choseEatModel(params)
|
||||||
|
|
||||||
|
console.log(index)
|
||||||
|
if ( type == 'tabClick') {
|
||||||
|
if ( index == 1 ) {
|
||||||
|
if ( this.listinfo.details.length > 0) {
|
||||||
|
this.is_type = index;
|
||||||
|
this.sendType = item.type
|
||||||
|
this.eatModel = [];
|
||||||
|
this.eatModel.push(item.val);
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "没有可打包商品",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.is_type = index;
|
||||||
|
this.sendType = item.type
|
||||||
|
this.eatModel = [];
|
||||||
|
this.eatModel.push(item.val);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.listinfo.details = res.data.info;
|
this.listinfo.details = res.data.info;
|
||||||
this.packFee = res.data.packFee;
|
this.packFee = res.data.packFee;
|
||||||
this.setPayAmount(res.data)
|
this.setPayAmount(res.data)
|
||||||
|
|||||||
Reference in New Issue
Block a user