宴席2.0

This commit is contained in:
sjeam 2025-08-15 09:40:08 +08:00
parent 949007e1cd
commit c906d4132d
4 changed files with 169 additions and 74 deletions

View File

@ -0,0 +1,31 @@
<template>
<div class="dish-category">
<h4>{{ title }}</h4>
<slot></slot>
</div>
</template>
<script>
import { defineComponent } from 'vue';
export default defineComponent({
props: {
title: {
type: String,
required: true,
},
},
});
</script>
<style scoped>
.dish-category {
margin-bottom: 20px;
}
.dish-category h4 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,31 @@
<template>
<div class="dish-category">
<h4>{{ title }}</h4>
<slot></slot>
</div>
</template>
<script>
import { defineComponent } from 'vue';
export default defineComponent({
props: {
title: {
type: String,
required: true,
},
},
});
</script>
<style scoped>
.dish-category {
margin-bottom: 20px;
}
.dish-category h4 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
</style>

View File

@ -271,7 +271,7 @@ export default defineComponent({
phone: '',
address: '',
remark: '',
banquet_type: '',
banquet_type: '1',
reservation_type: 1,
server_user_id: 0,
// table_number: 0,
@ -324,8 +324,23 @@ export default defineComponent({
},
//
payOrder() {
this.close();
payOrder (order_id) {
CommonApi.commonPost('/api/banquet/order/pay', {order_id:order_id}).catch((res) => {
if (res.code === 1) {
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
console.log(res.data);
// this.close();
} else {
uni.$u.toast(res.msg);
}
});
},
//
getArea () {
@ -359,11 +374,12 @@ export default defineComponent({
getBanquetType () {
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
if (res.code === 1) {
this.banquetType = res.data;
res.data.forEach(item => {
item.label = item.name;
});
this.banquetType = res.data;
} else {
uni.$u.toast(res.msg);
}

View File

@ -158,13 +158,12 @@
<view>厨师姓名{{ server_user.public_name }}</view>
<view>厨师联系方式{{ server_user.phone }}</view>
<template #footer>
<wd-button size="small" plain @click="cookDetail( server_user.id)">查看详情</wd-button>
<wd-button size="small" plain @click="cookDetail(server_user.id)">查看详情</wd-button>
</template>
</wd-card>
<wd-card>
<template #title>
<!-- <u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert> -->
</template>
<view>1.(不交定金)如若厨师接到更高价订单可能会将您的订单取消</view>
<view>2.(付定金)如若厨师的做席档期存在冲突可能会致电与您沟通并推荐您更换厨师</view>
@ -175,7 +174,7 @@
<wd-cell-group border>
<view class="pb-4" />
<wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
<!-- <wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
:rules="[
{
required: false,
@ -224,18 +223,15 @@
message: '请输入详细地址'
}
]" />
<wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" />
<wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" /> -->
<!-- <wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
@click="handleSubmit(1)">确定预定做席后再支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button> -->
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(2)">取消支付</wd-button>
</wd-cell-group>
</wd-form>
<!-- 一般的检举内容由承办的党的委员会或纪律检查委员会将处理意见或复议复查结论同申诉人见面听取其意见复议复查的结论和决定应交给申诉人一份 -->
<template #footer>
<!-- <wd-button size="small" plain>查看详情</wd-button> -->
</template>
</wd-card>
</view>
@ -270,7 +266,7 @@ export default defineComponent({
phone: '',
address: '',
remark: '',
banquet_type: '',
banquet_type: '1',
reservation_type: 1,
order_id: 0,
// table_number: 0,
@ -284,7 +280,7 @@ export default defineComponent({
this.order_id = option.id;;
this.orderInfo.order_id = option.id;
this.getOrderDetail()
this.getArea()
// this.getArea()
},
created () {
@ -293,76 +289,98 @@ export default defineComponent({
close () {
this.propShowOrder = false;
},
//
handleSubmit (reservation_type) {
// //
// handleSubmit (reservation_type) {
// // console.log(this.orderInfo);
// this.orderInfo.reservation_type = reservation_type; //
// this.$refs.form.validate()
// .then(({ valid, errors }) => {
// if (valid) {
// this.orderInfo.address = this.address_string + this.orderInfo.street_name;
// console.log(this.orderInfo);
this.orderInfo.reservation_type = reservation_type; //
this.$refs.form.validate()
.then(({ valid, errors }) => {
if (valid) {
this.orderInfo.address = this.address_string + this.orderInfo.street_name;
console.log(this.orderInfo);
this.addOrder();
}
})
.catch((error) => {
console.log(error, 'error')
})
// this.addOrder();
// }
// })
// .catch((error) => {
// console.log(error, 'error')
// })
},
// },
//
addOrder () {
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
// //
// addOrder () {
// CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
// if (res.code === 1) {
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
// } else {
// uni.$u.toast(res.msg);
// }
// });
// },
//
payOrder (type) {
if (type === 1) {
//
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
if (res.code === 1) {
this.propShowOrder = true;
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
console.log(res.data);
// this.close();
} else {
uni.$u.toast(res.msg);
}
});
},
//
payOrder () {
this.close();
},
//
getArea () {
this.area = [colPickerData.map(item => ({
value: item.value,
label: item.text
}))];
},
//--
handleConfirm (value) {
this.address_string = value.selectedItems.map(item => item.label).join('')
},
//
columnChange ({ selectedItem, resolve, finish }) {
try {
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
if (areaData && areaData.length) {
resolve(areaData.map(item => ({
value: item.value,
label: item.text
})));
} else {
finish();
}
} catch (error) {
console.error('处理列变更时出错:', error);
finish(); //
//
}
},
// //
// getArea () {
// this.area = [colPickerData.map(item => ({
// value: item.value,
// label: item.text
// }))];
// },
// //--
// handleConfirm (value) {
// this.address_string = value.selectedItems.map(item => item.label).join('')
// },
// //
// columnChange ({ selectedItem, resolve, finish }) {
// try {
// const areaData = findChildrenByCode(colPickerData, selectedItem.value);
// if (areaData && areaData.length) {
// resolve(areaData.map(item => ({
// value: item.value,
// label: item.text
// })));
// } else {
// finish();
// }
// } catch (error) {
// console.error(':', error);
// finish(); //
// }
// },
//
getBanquetType () {
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
if (res.code === 1) {
this.banquetType = res.data;
res.data.forEach(item => {
item.label = item.name;
});
this.banquetType = res.data;
} else {
uni.$u.toast(res.msg);
}
@ -370,9 +388,8 @@ export default defineComponent({
},
// //
getOrderDetail () {
CommonApi.commonPost('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
CommonApi.commonGet('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
if (res.code === 1) {
console.log(res)
// this.matchedItems_sp = res.data.cart_list;
// this.totalPrice = res.data.total_price;