下单选择人数条件修改
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
let data = await this.api.productqueryShop({
|
let data = await this.api.productqueryShop({
|
||||||
code: uni.cache.get('tableCode'),
|
code: uni.cache.get('tableCode'),
|
||||||
})
|
})
|
||||||
if ( !data.data.shopTableInfo.choseCount ) {
|
if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) {
|
||||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||||
tableCode: tableCode,
|
tableCode: tableCode,
|
||||||
shopId: data.data.storeInfo.id,
|
shopId: data.data.storeInfo.id,
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
})
|
})
|
||||||
console.log()
|
console.log()
|
||||||
|
|
||||||
if ( !data.data.shopTableInfo.choseCount ) {
|
if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) {
|
||||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||||
tableCode: tableCode,
|
tableCode: tableCode,
|
||||||
shopId: data.data.storeInfo.id,
|
shopId: data.data.storeInfo.id,
|
||||||
|
|||||||
@@ -534,7 +534,7 @@
|
|||||||
if (this.shopId) {params.shopId = this.shopId}
|
if (this.shopId) {params.shopId = this.shopId}
|
||||||
let res = await this.api.productqueryShop(params)
|
let res = await this.api.productqueryShop(params)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if ( !res.data.shopTableInfo.choseCount && this.tableCode && !this.dinersNum ) {
|
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount) {
|
||||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||||
tableCode: this.tableCode,
|
tableCode: this.tableCode,
|
||||||
shopId: res.data.storeInfo.id,
|
shopId: res.data.storeInfo.id,
|
||||||
@@ -687,8 +687,8 @@
|
|||||||
"shopId": this.shopId,
|
"shopId": this.shopId,
|
||||||
"note": item.note,
|
"note": item.note,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": this.tableCode,
|
|
||||||
}
|
}
|
||||||
|
if (this.shopInfo.storeInfo.eatModel.indexOf('dine-in') != -1) { params.tableId = this.tableCode;}
|
||||||
this.addCart(params);
|
this.addCart(params);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -951,8 +951,8 @@
|
|||||||
"note": item.note,
|
"note": item.note,
|
||||||
"shopId": this.shopId,
|
"shopId": this.shopId,
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
"tableId": this.tableCode,
|
|
||||||
}
|
}
|
||||||
|
if (this.shopInfo.storeInfo.eatModel.indexOf('dine-in') != -1) { params.tableId = this.tableCode;}
|
||||||
//添加到购物车
|
//添加到购物车
|
||||||
this.addCart(params);
|
this.addCart(params);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<view class="tabBox" v-if="storeInfo.registerType == 'munchies'">
|
<view class="tabBox" v-if="storeInfo.registerType == 'munchies'">
|
||||||
<view class="tab">
|
<view class="tab">
|
||||||
<view :class="is_type==(index+1)?'tab_item'+is_type+' tab_item active ':'tab_item'" v-for="(item,index) in is_typeList" :key="index" @click="tabClick(index+1,item)">
|
<view v-if="item.show" :class="is_type==(index+1)?'tab_item'+is_type+' tab_item active ':'tab_item'" v-for="(item,index) in is_typeList" :key="index" @click="tabClick(index+1,item)">
|
||||||
<view></view>
|
<view></view>
|
||||||
<image class="icon" :src="is_type==(index+1)?item.url_active:item.url" mode="aspectFill"/>
|
<image class="icon" :src="is_type==(index+1)?item.url_active:item.url" mode="aspectFill"/>
|
||||||
<text class="title" :class="{active:is_type==(index+1)}">{{item.title}}</text>
|
<text class="title" :class="{active:is_type==(index+1)}">{{item.title}}</text>
|
||||||
@@ -187,8 +187,8 @@
|
|||||||
},
|
},
|
||||||
is_type: 1,
|
is_type: 1,
|
||||||
is_typeList: [
|
is_typeList: [
|
||||||
{ title: "送餐到桌", type: "table", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"},
|
{ title: "送餐到桌", show: false, type: "table", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"},
|
||||||
{ title: "打包外带", type: "takeself", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"},
|
{ title: "打包外带", show: false, type: "takeself", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"},
|
||||||
],
|
],
|
||||||
sendType: "table",
|
sendType: "table",
|
||||||
eatModel: [],
|
eatModel: [],
|
||||||
@@ -249,10 +249,8 @@
|
|||||||
this.listinfo.name = this.storeInfo.shopName;
|
this.listinfo.name = this.storeInfo.shopName;
|
||||||
this.listinfo.details = JSON.parse(e.cartLists).data;
|
this.listinfo.details = JSON.parse(e.cartLists).data;
|
||||||
this.listinfo.payAmount = JSON.parse(e.cartLists).amount;
|
this.listinfo.payAmount = JSON.parse(e.cartLists).amount;
|
||||||
if ( e.tableCode ) { this.tableCode = e.tableCode; }
|
if ( e.tableCode ) { this.tableCode = e.tableCode;}
|
||||||
if ( e.dinersNum ) {
|
if ( e.dinersNum ) { this.dinersNum = e.dinersNum;}
|
||||||
this.dinersNum = e.dinersNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
|
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
|
||||||
this.eatModel = ["dine-in"]
|
this.eatModel = ["dine-in"]
|
||||||
@@ -271,6 +269,13 @@
|
|||||||
this.handlemessage()
|
this.handlemessage()
|
||||||
}
|
}
|
||||||
this.getAount()
|
this.getAount()
|
||||||
|
|
||||||
|
this.is_typeList.map((item)=>{
|
||||||
|
console.log(this.storeInfo.eatModel.indexOf(item.val))
|
||||||
|
if ( this.storeInfo.eatModel.indexOf(item.val) != -1) {
|
||||||
|
item.show = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
@@ -306,6 +311,7 @@
|
|||||||
if (this.shopId) {params.shopId = this.shopId}
|
if (this.shopId) {params.shopId = this.shopId}
|
||||||
let res = await this.api.productqueryShop(params)
|
let res = await this.api.productqueryShop(params)
|
||||||
this.shopTableInfo = res.data.shopTableInfo;
|
this.shopTableInfo = res.data.shopTableInfo;
|
||||||
|
this.storeInfo = res.data.storeInfo;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -491,6 +497,13 @@
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( this.sendType == 'table' && !this.tableCode) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择桌台",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ( this.listinfo.details.length == 0) {
|
if ( this.listinfo.details.length == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "购物车为空,请添加商品",
|
title: "购物车为空,请添加商品",
|
||||||
@@ -767,7 +780,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 22rpx;
|
border-radius: 22rpx 22rpx 0 0;
|
||||||
background-color: $uni-bg-color;
|
background-color: $uni-bg-color;
|
||||||
.tab_item{
|
.tab_item{
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|||||||
Reference in New Issue
Block a user