修复代客下单加菜未禁止切换就餐模式

This commit is contained in:
YeMingfei666 2024-10-08 10:44:13 +08:00
parent 83b8d0574b
commit 7cf34508b5
3 changed files with 94 additions and 91 deletions

View File

@ -1,95 +1,95 @@
<template> <template>
<view class="page-gray color-333 u-font-28"> <view class="page-gray color-333 u-font-28">
<view class="block"> <template v-if="true">
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view>选择用户</view>
<view class="u-m-t-24 u-flex u-row-between " @tap="chooseUser">
<view v-if="!user">选择用户</view>
<view class="u-flex" v-else>
<up-avatar :src="user.headImg" shape="square" :size="30"></up-avatar>
<!-- <view class="headeimg">
<image class="img" :src="user.headImg" mode=""></image>
</view> -->
<view class="u-m-l-20">{{user.nickName}}</view>
<view class="color-main u-m-l-10 u-font-24">{{user.isVip?'会员':'' }}</view>
<view class="u-font-24 u-m-l-30"><text>余额</text><text class="color-main">{{user.amount}}</text>
</view>
<view class="u-font-24 u-m-l-30"><text>积分</text><text
class="color-main">{{user.totalScore}}</text></view>
</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view>就餐类型</view>
<view class="u-m-t-24 u-flex ">
<view class="u-flex color-666">
<up-radio-group :disabled="option.type=='add'" v-model="eatTypes.active" placement="row">
<up-radio :customStyle="{marginRight: '30px'}" v-for="(item, index) in eatTypes.list"
:key="index" :label="item.name" :name="item.value">
</up-radio>
</up-radio-group>
</view>
</view>
</view>
<view class=" " @tap="chooseTable">
<view>选择桌码</view>
<view class="u-m-t-24 u-flex u-row-between ">
<view>
<text v-if="table">{{table.name}}</text>
<text v-else>不选择桌台</text>
</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<template v-if="user">
<view class="block"> <view class="block">
<view class=""> <view class="u-p-b-24 u-m-b-24 border-bottom">
<view class="u-flex border-bottom u-p-b-24 "> <view>选择用户</view>
<up-avatar :src="user.headImg" shape="square" :size="60"></up-avatar> <view class="u-m-t-24 u-flex u-row-between " @tap="chooseUser">
<!-- <image class="headeimg" src="@/static/uni.png" mode=""></image> --> <view v-if="!user">选择用户</view>
<view class="u-m-l-32"> <view class="u-flex" v-else>
<view class="">{{user.nickName}}</view> <up-avatar :src="user.headImg" shape="square" :size="30"></up-avatar>
<view class="color-main u-font-24">{{user.isVip?'会员':'' }}</view> <!-- <view class="headeimg">
<image class="img" :src="user.headImg" mode=""></image>
</view> -->
<view class="u-m-l-20">{{user.nickName}}</view>
<view class="color-main u-m-l-10 u-font-24">{{user.isVip?'会员':'' }}</view>
<view class="u-font-24 u-m-l-30"><text>余额</text><text class="color-main">{{user.amount}}</text>
</view>
<view class="u-font-24 u-m-l-30"><text>积分</text><text
class="color-main">{{user.totalScore}}</text></view>
</view> </view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view> </view>
<view class="u-flex u-m-t-24 u-row-between u-font-24 color-999"> </view>
<view class="u-flex"> <view class="u-p-b-24 u-m-b-24 border-bottom">
<view>余额</view> <view>就餐类型</view>
<view class="color-333 u-m-l-10"> {{user.amount}}</view> <view class="u-m-t-24 u-flex ">
</view> <view class="u-flex color-666">
<view class="u-flex"> <up-radio-group :disabled="option.type=='add'" v-model="eatTypes.active" placement="row">
<view>积分</view> <up-radio :customStyle="{marginRight: '30px'}" v-for="(item, index) in eatTypes.list"
<view class="color-333 u-m-l-10"> {{user.totalScore}}</view> :key="index" :label="item.name" :name="item.value">
</view> </up-radio>
<view class="u-flex"> </up-radio-group>
<view>已消费</view>
<view class="color-333 u-m-l-10"> 0.00</view>
</view> </view>
</view> </view>
</view> </view>
</view>
</template>
<template v-if="!$shop.isTableFee">
<!-- 不免餐位费 -->
<view class="block">
<view class=" ">
<view>用餐人数</view>
<picker @change="userNumberChange" :value="userNumbers.defaultCateIndex" :range="userNumbers.list">
<view class="u-m-t-24 u-flex u-row-between ">
<view class="color-333">{{userNumbers.defaultCateIndex||''}}</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</picker>
</view>
</view>
</template>
<view class=" " @tap="chooseTable">
<view>选择桌码</view>
<view class="u-m-t-24 u-flex u-row-between ">
<view>
<text v-if="table">{{table.name}}</text>
<text v-else>不选择桌台</text>
</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<template v-if="user">
<view class="block">
<view class="">
<view class="u-flex border-bottom u-p-b-24 ">
<up-avatar :src="user.headImg" shape="square" :size="60"></up-avatar>
<!-- <image class="headeimg" src="@/static/uni.png" mode=""></image> -->
<view class="u-m-l-32">
<view class="">{{user.nickName}}</view>
<view class="color-main u-font-24">{{user.isVip?'会员':'' }}</view>
</view>
</view>
<view class="u-flex u-m-t-24 u-row-between u-font-24 color-999">
<view class="u-flex">
<view>余额</view>
<view class="color-333 u-m-l-10"> {{user.amount}}</view>
</view>
<view class="u-flex">
<view>积分</view>
<view class="color-333 u-m-l-10"> {{user.totalScore}}</view>
</view>
<view class="u-flex">
<view>已消费</view>
<view class="color-333 u-m-l-10"> 0.00</view>
</view>
</view>
</view>
</view>
</template>
<template v-if="!$shop.isTableFee">
<!-- 不免餐位费 -->
<view class="block">
<view class=" ">
<view>用餐人数</view>
<picker @change="userNumberChange" :value="userNumbers.defaultCateIndex" :range="userNumbers.list">
<view class="u-m-t-24 u-flex u-row-between ">
<view class="color-333">{{userNumbers.defaultCateIndex||''}}</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</picker>
</view>
</view>
</template>
</template>
<view class="block"> <view class="block">
<view class="u-p-b-24 "> <view class="u-p-b-24 ">

View File

@ -120,9 +120,9 @@
if(props.data.length<=0){ if(props.data.length<=0){
return infoBox.showToast('还没有选择商品') return infoBox.showToast('还没有选择商品')
} }
const {tableId,name,maxCapacity,status}=props.table const {tableId,name,maxCapacity,status,type}=props.table
go.to('PAGES_CONFIRM_ORDER',{ go.to('PAGES_CONFIRM_ORDER',{
masterId:props.masterId, masterId:props.masterId,type,
tableId,name,maxCapacity,status tableId,name,maxCapacity,status
}) })
} }

View File

@ -134,7 +134,7 @@
computed, computed,
reactive, reactive,
ref, ref,
nextTick, nextTick,getCurrentInstance ,
watch watch
} from 'vue'; } from 'vue';
import myCar from './components/car' import myCar from './components/car'
@ -149,7 +149,7 @@
import { import {
tbShopInfo tbShopInfo
} from '@/http/yskApi/user.js' } from '@/http/yskApi/user.js'
const instance = getCurrentInstance();
// //
const lingshi=reactive({ const lingshi=reactive({
show:false show:false
@ -288,7 +288,7 @@
// //
function addCart(par) { function addCart(par) {
if(!data.table.tableId){ if(!data.table.tableId){
return infoBox.showToast('请先选择桌!') return infoBox.showToast('请先选择')
} }
const submitPar = { const submitPar = {
masterId: data.masterId, masterId: data.masterId,
@ -352,7 +352,7 @@
} }
// //
async function getTableInfo(){ async function getTableInfo(){
const res=await $table.get({qrcode:data.table.tableId}) const res=await $table.get({qrcode:data.table.tableId})
console.log(res); console.log(res);
@ -385,7 +385,7 @@
return isShow; return isShow;
}); });
if(!data.table.tableId){ if(!data.table.tableId){
// //
setTabBar(category, goods, []) setTabBar(category, goods, [])
return return
} }
@ -608,6 +608,9 @@
} }
function chooseGuige(foodsindex, index) { function chooseGuige(foodsindex, index) {
if(!canAddGoods()){
return infoBox.showToast('清先选择桌台')
}
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
guigeModelData.title = $goods.name guigeModelData.title = $goods.name
const specList = $goods.specList; const specList = $goods.specList;
@ -709,7 +712,7 @@
} }
async function goodsUpdate(foodsindex, index, isAdd) { async function goodsUpdate(foodsindex, index, isAdd) {
if(!canAddGoods()){ if(!canAddGoods()){
return infoBox.showToast('清先选择桌') return infoBox.showToast('清先选择')
} }
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
if ($goods.isDan) { if ($goods.isDan) {
@ -786,7 +789,7 @@
// //
function getElRect(elClass, dataVal) { function getElRect(elClass, dataVal) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(instance.proxy);
query.select('.' + elClass).fields({ query.select('.' + elClass).fields({
size: true size: true
}, res => { }, res => {
@ -921,7 +924,7 @@
uni.setStorageSync('useType',opt.useType) uni.setStorageSync('useType',opt.useType)
} }
// if (!opt.tableId) { // if (!opt.tableId) {
// infoBox.showErrorToast('') // infoBox.showErrorToast('')
// return setTimeout(() => { // return setTimeout(() => {
// go.back() // go.back()
// }, 1500) // }, 1500)
@ -1075,7 +1078,7 @@
} }
.class-item:last-child { .class-item:last-child {
min-height: 100vh; min-height: 50vh;
} }
.item-title { .item-title {