优化台桌下单问题
This commit is contained in:
@@ -60,12 +60,12 @@
|
||||
<div class="people_num_wrap" v-show="showPeopleNum">
|
||||
<div class="title">应选择就餐人数</div>
|
||||
<div class="num_btns">
|
||||
<div class="item" :class="{ active: peopleNum == item }" v-for="item in 8"
|
||||
@click="peopleNum = item">{{ item }}人</div>
|
||||
<div class="item" :class="{ active: peopleNum == 'custom' }">
|
||||
<div class="item" :class="{ active: peopleNum == item }"
|
||||
v-for="item in props.tableInfo.maxCapacity" @click="peopleNum = item">{{ item }}人</div>
|
||||
<!-- <div class="item" :class="{ active: peopleNum == 'custom' }">
|
||||
<input class="ipt" @focus="inputFocus" placeholder="自定义" v-model="peopleNumInputValue"
|
||||
@change="" />
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button type="primary" style="width: 100%;"
|
||||
@@ -92,6 +92,9 @@ import { formatDecimal } from '@/utils/index.js'
|
||||
import settleAccount from "@/views/home/components/settleAccount.vue";
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { clearTable } from '@/api/table.js'
|
||||
import { useShop } from '@/store/shop.js'
|
||||
|
||||
const shopStore = useShop()
|
||||
|
||||
const router = useRouter()
|
||||
const global = useGlobal()
|
||||
@@ -143,7 +146,11 @@ function showPayHandle() {
|
||||
|
||||
// 显示就就餐人数
|
||||
function showPeopleNumHandle() {
|
||||
showPeopleNum.value = true
|
||||
if (shopStore.info.isTableFee == 1) {
|
||||
orderDownHandle()
|
||||
} else {
|
||||
showPeopleNum.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// 清理桌台
|
||||
@@ -202,17 +209,16 @@ function isPositiveInteger(num) {
|
||||
|
||||
// 选择人数后确认下单
|
||||
function orderDownHandle() {
|
||||
if (peopleNum.value == 'custom') {
|
||||
if (!isPositiveInteger(parseFloat(peopleNumInputValue.value))) {
|
||||
ElMessage.error('请输入有效的就餐人数')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// if (peopleNum.value == 'custom') {
|
||||
// if (!isPositiveInteger(parseFloat(peopleNumInputValue.value))) {
|
||||
// ElMessage.error('请输入有效的就餐人数')
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// 直接点单
|
||||
global.setOrderTable({
|
||||
...props.tableInfo,
|
||||
num: peopleNum.value == 'custom' ? peopleNumInputValue.value : peopleNum.value
|
||||
num: peopleNum.value
|
||||
})
|
||||
router.push({
|
||||
name: 'home',
|
||||
|
||||
Reference in New Issue
Block a user