并转桌子
This commit is contained in:
@@ -24,6 +24,17 @@ export function $bind(data) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 转/并桌
|
||||||
|
export function tableswitch(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/switch',
|
||||||
|
method: "put",
|
||||||
|
data: {
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
//获取台桌详情状态
|
//获取台桌详情状态
|
||||||
export function $returnTableDetail(data) {
|
export function $returnTableDetail(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -51,6 +51,9 @@
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
import color from '@/commons/color.js';
|
import color from '@/commons/color.js';
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
tbShopPurveyorput
|
tbShopPurveyorput
|
||||||
} from '@/http/yskApi/requestAll.js';
|
} from '@/http/yskApi/requestAll.js';
|
||||||
@@ -62,17 +65,15 @@
|
|||||||
type: String
|
type: String
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onLoad((d)=>{
|
||||||
datas.form = JSON.parse(props.item)
|
datas.form = JSON.parse(d.item)
|
||||||
})
|
})
|
||||||
|
|
||||||
function sumbit() {
|
function sumbit() {
|
||||||
tbShopPurveyorput({
|
tbShopPurveyorput({
|
||||||
shopId: uni.getStorageSync("shopId"),
|
shopId: uni.getStorageSync("shopId"),
|
||||||
|
|
||||||
...datas.form
|
...datas.form
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// go.to('PAGES_SUPPLIER')
|
|
||||||
go.back()
|
go.back()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #suffixIcon>
|
<template #suffixIcon>
|
||||||
<view class='show-tips' @tap="vdata.isShowPwd = !vdata.isShowPwd ">
|
<view class='show-tips' @tap="vdata.isShowPwd = !vdata.isShowPwd ">
|
||||||
{{ vdata.isShowPwd ? '隐藏' : '显示' }}</view>
|
{{ vdata.isShowPwd ? '隐藏' : '显示' }}
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
@@ -55,7 +56,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import {
|
import {
|
||||||
login
|
login
|
||||||
} from '@/http/businessApiManger.js';
|
} from '@/http/businessApiManger.js';
|
||||||
@@ -112,7 +112,6 @@
|
|||||||
formUtil.validate(loginFormRef.value).then(() => {
|
formUtil.validate(loginFormRef.value).then(() => {
|
||||||
|
|
||||||
login(vdata.formData).then((res) => {
|
login(vdata.formData).then((res) => {
|
||||||
console.log(res);
|
|
||||||
useStorage.set('token', res.data.token);
|
useStorage.set('token', res.data.token);
|
||||||
useStorage.set('userInfo', res.data.user);
|
useStorage.set('userInfo', res.data.user);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -630,6 +630,13 @@
|
|||||||
"navigationBarTitleText": "确认订单"
|
"navigationBarTitleText": "确认订单"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_ROTATING_TABLES",
|
||||||
|
"path": "confirm-order/rotatingTables",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "转桌/并桌"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pageId": "PAGES_CHOOSE_TABLE",
|
"pageId": "PAGES_CHOOSE_TABLE",
|
||||||
"path": "choose-table/choose-table",
|
"path": "choose-table/choose-table",
|
||||||
|
|||||||
@@ -249,7 +249,7 @@
|
|||||||
})
|
})
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
vdata.formData.username = '17792050546'
|
vdata.formData.username = '17792050546'
|
||||||
vdata.formData.pwd = 'sy666888'
|
vdata.formData.pwd = 'qwer1234'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// vdata.formData.username = '15699991111'
|
// vdata.formData.username = '15699991111'
|
||||||
@@ -301,6 +301,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loginFunc() {
|
function loginFunc() {
|
||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
formUtil.validate(loginFormRef.value).then(() => {
|
formUtil.validate(loginFormRef.value).then(() => {
|
||||||
if (!vdata.isSelectedAgreement) {
|
if (!vdata.isSelectedAgreement) {
|
||||||
@@ -375,11 +376,17 @@
|
|||||||
storageManage.shopId(loginBizData.shopId)
|
storageManage.shopId(loginBizData.shopId)
|
||||||
storageManage.shopUserId(loginBizData.user.user.id)
|
storageManage.shopUserId(loginBizData.user.user.id)
|
||||||
storageManage.userInfo(loginBizData)
|
storageManage.userInfo(loginBizData)
|
||||||
|
uni.showToast({
|
||||||
|
title: loginBizData.expireDate + '后到期',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
// 跳转到首页
|
// 跳转到首页
|
||||||
go.to("PAGES_INDEX", {
|
go.to("PAGES_INDEX", {
|
||||||
isGetCid: true
|
isGetCid: true
|
||||||
}, go.GO_TYPE_RELAUNCH)
|
}, go.GO_TYPE_RELAUNCH)
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 点击发送验证码的函数
|
// 点击发送验证码的函数
|
||||||
|
|||||||
@@ -112,6 +112,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="goods.list[0].tableId">
|
||||||
|
<!-- 不免餐位费 -->
|
||||||
|
<view class="block" @tap="rotatingTables"
|
||||||
|
style="display: flex;align-items: center;justify-content: space-between;">
|
||||||
|
<view>转桌/并桌</view>
|
||||||
|
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<view class="block">
|
<view class="block">
|
||||||
@@ -367,6 +376,11 @@
|
|||||||
return Number(n).toFixed(2)
|
return Number(n).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rotatingTables() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesCreateOrder/confirm-order/rotatingTables?item='+JSON.stringify(goods.list),
|
||||||
|
})
|
||||||
|
}
|
||||||
// 单品打折
|
// 单品打折
|
||||||
async function discountconfirm(form) {
|
async function discountconfirm(form) {
|
||||||
if (form.discountMoney != '.') {
|
if (form.discountMoney != '.') {
|
||||||
|
|||||||
179
pagesCreateOrder/confirm-order/rotatingTables.vue
Normal file
179
pagesCreateOrder/confirm-order/rotatingTables.vue
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
<template>
|
||||||
|
<view style="padding: 20rpx;">
|
||||||
|
<view class="uni-padding-wrap uni-common-mt">
|
||||||
|
<uni-segmented-control :current="datas.current" :values=" ['转桌', '并桌']" style-type="button"
|
||||||
|
active-color="#007aff" @clickItem="onClickItem" />
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-48">
|
||||||
|
请选择其他桌:
|
||||||
|
</view>
|
||||||
|
<view class="uni-list">
|
||||||
|
<radio-group @change="radioChange">
|
||||||
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in datas.tableList" :key="index">
|
||||||
|
<view class="u-m-t-48 u-m-b-48" v-if="item.status=='using'">
|
||||||
|
<radio :value="item" /> {{item.name}}
|
||||||
|
</view>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="uni-list" v-if="datas.current==0">
|
||||||
|
<view class="u-m-t-48">
|
||||||
|
请选择需要转桌的菜品:
|
||||||
|
</view>
|
||||||
|
<checkbox-group @change="checkboxChange">
|
||||||
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item,index) in datas.item" :key="index">
|
||||||
|
<view class="u-flex u-m-t-48 u-m-b-48" style="justify-content: space-between;align-items: center;">
|
||||||
|
<view class="u-flex">
|
||||||
|
<checkbox :value="item.id" />
|
||||||
|
<image class="img" v-if="item.coverImg" :src="item.coverImg" mode=""></image>
|
||||||
|
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<view class=" u-relative">
|
||||||
|
<template v-if="item.isGift">
|
||||||
|
<text class="line-th color-999">¥{{formatPrice(item.salePrice*item.number) }}</text>
|
||||||
|
<view class="u-absolute" style="right: 0;bottom: 100%;">
|
||||||
|
<text class="font-bold">¥0</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="isVip&&item.memberPrice&&item.memberPrice*1!=item.salePrice*1">
|
||||||
|
<text
|
||||||
|
class="line-th color-999">¥{{formatPrice(item.salePrice*item.number) }}</text>
|
||||||
|
<view class="u-absolute" style="right: 0;bottom: 100%;">
|
||||||
|
<text
|
||||||
|
class="font-bold">¥{{formatPrice(item.memberPrice*item.number) }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view class="font-bold">
|
||||||
|
<text>¥</text>
|
||||||
|
<text class="">{{formatPrice(item.salePrice*item.number) }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
<view class="color-999 u-text-right u-font-24 u-m-t-12">×{{item.number}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- <text class=" color-999">¥{{formatPrice(item.salePrice*item.number) }}</text> -->
|
||||||
|
</view>
|
||||||
|
</label>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<my-button shape="circle" @tap="confirm">确定</my-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
reactive,
|
||||||
|
defineProps
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import go from '@/commons/utils/go.js';
|
||||||
|
import {
|
||||||
|
$table,
|
||||||
|
tableswitch
|
||||||
|
} from '@/http/yskApi/table.js'
|
||||||
|
let datas = reactive({
|
||||||
|
current: 0,
|
||||||
|
item: "",
|
||||||
|
// 桌台列表
|
||||||
|
tableList: [],
|
||||||
|
// 并桌选中
|
||||||
|
selecttableList: '',
|
||||||
|
// 转桌数据
|
||||||
|
changeTable: []
|
||||||
|
})
|
||||||
|
const props = defineProps({
|
||||||
|
item: {
|
||||||
|
type: Array
|
||||||
|
},
|
||||||
|
})
|
||||||
|
onLoad((opt) => {
|
||||||
|
// console.log(JSON.parse(opt.item) ,'调试1')
|
||||||
|
gettableList()
|
||||||
|
datas.item = JSON.parse(opt.item)
|
||||||
|
})
|
||||||
|
|
||||||
|
async function confirm() {
|
||||||
|
console.log(datas.selecttableList, 'debug')
|
||||||
|
console.log(datas.item, 'debug2')
|
||||||
|
// 是否选择其他桌
|
||||||
|
if (datas.selecttableList) {
|
||||||
|
if (datas.current == 0) {
|
||||||
|
// 转桌是否选择菜品
|
||||||
|
if (datas.changeTable.length) {
|
||||||
|
let res = await tableswitch({
|
||||||
|
masterId: datas.item[0].masterId,
|
||||||
|
useType: datas.item[0].useType,
|
||||||
|
cartIds: datas.changeTable,
|
||||||
|
currentTableId: datas.item[0].tableId,
|
||||||
|
targetTableId: datas.selecttableList.tableId
|
||||||
|
})
|
||||||
|
if (res) {
|
||||||
|
go.back()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let res = await tableswitch({
|
||||||
|
masterId: datas.item[0].masterId,
|
||||||
|
useType: datas.item[0].useType,
|
||||||
|
isFull: true,
|
||||||
|
currentTableId: datas.item[0].tableId,
|
||||||
|
targetTableId: datas.selecttableList.tableId
|
||||||
|
})
|
||||||
|
if (res) {
|
||||||
|
go.back()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function radioChange(d) {
|
||||||
|
datas.selecttableList = d.detail.value
|
||||||
|
}
|
||||||
|
// 切换转/并桌
|
||||||
|
function onClickItem(e) {
|
||||||
|
if (datas.current !== e.currentIndex) {
|
||||||
|
datas.current = e.currentIndex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取桌台
|
||||||
|
async function gettableList() {
|
||||||
|
const res = await $table.get({
|
||||||
|
page: 1,
|
||||||
|
size: 999
|
||||||
|
})
|
||||||
|
datas.tableList = res.content
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPrice(n) {
|
||||||
|
return Number(n).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkboxChange(e) {
|
||||||
|
datas.changeTable = e.detail.value
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.goods {
|
||||||
|
// padding-bottom: 30rpx;
|
||||||
|
border-bottom: 1px dashed #E5E5E5;
|
||||||
|
|
||||||
|
.item {}
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 84rpx;
|
||||||
|
height: 84rpx;
|
||||||
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user