宴席2.0
This commit is contained in:
parent
949007e1cd
commit
c906d4132d
31
src/components/DishCategory.vue
Normal file
31
src/components/DishCategory.vue
Normal 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>
|
31
src/components/DishItem.vue
Normal file
31
src/components/DishItem.vue
Normal 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>
|
@ -271,7 +271,7 @@ export default defineComponent({
|
|||||||
phone: '',
|
phone: '',
|
||||||
address: '',
|
address: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
banquet_type: '',
|
banquet_type: '1',
|
||||||
reservation_type: 1,
|
reservation_type: 1,
|
||||||
server_user_id: 0,
|
server_user_id: 0,
|
||||||
// table_number: 0, 酒店
|
// table_number: 0, 酒店
|
||||||
@ -324,8 +324,23 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 微信支付
|
// 微信支付
|
||||||
payOrder() {
|
payOrder (order_id) {
|
||||||
this.close();
|
|
||||||
|
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 () {
|
getArea () {
|
||||||
@ -359,11 +374,12 @@ export default defineComponent({
|
|||||||
getBanquetType () {
|
getBanquetType () {
|
||||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.banquetType = res.data;
|
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
item.label = item.name;
|
item.label = item.name;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
this.banquetType = res.data;
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
|
@ -158,13 +158,12 @@
|
|||||||
<view>厨师姓名:{{ server_user.public_name }}</view>
|
<view>厨师姓名:{{ server_user.public_name }}</view>
|
||||||
<view>厨师联系方式:{{ server_user.phone }}</view>
|
<view>厨师联系方式:{{ server_user.phone }}</view>
|
||||||
<template #footer>
|
<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>
|
</template>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
<wd-card>
|
<wd-card>
|
||||||
<template #title>
|
<template #title>
|
||||||
<!-- <u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert> -->
|
|
||||||
</template>
|
</template>
|
||||||
<view>1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。</view>
|
<view>1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。</view>
|
||||||
<view>2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。</view>
|
<view>2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。</view>
|
||||||
@ -175,7 +174,7 @@
|
|||||||
<wd-cell-group border>
|
<wd-cell-group border>
|
||||||
|
|
||||||
<view class="pb-4" />
|
<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="[
|
:rules="[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
@ -224,18 +223,15 @@
|
|||||||
message: '请输入详细地址'
|
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);"
|
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
|
||||||
@click="handleSubmit(1)">确定预定(做席后再支付)</wd-button>
|
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(2)">取消支付</wd-button>
|
||||||
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button> -->
|
|
||||||
|
|
||||||
</wd-cell-group>
|
</wd-cell-group>
|
||||||
</wd-form>
|
</wd-form>
|
||||||
|
|
||||||
<!-- 一般的,检举内容由承办的党的委员会或纪律检查委员会将处理意见或复议、复查结论同申诉人见面,听取其意见。复议、复查的结论和决定,应交给申诉人一份。 -->
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- <wd-button size="small" plain>查看详情</wd-button> -->
|
|
||||||
</template>
|
</template>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
</view>
|
</view>
|
||||||
@ -270,7 +266,7 @@ export default defineComponent({
|
|||||||
phone: '',
|
phone: '',
|
||||||
address: '',
|
address: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
banquet_type: '',
|
banquet_type: '1',
|
||||||
reservation_type: 1,
|
reservation_type: 1,
|
||||||
order_id: 0,
|
order_id: 0,
|
||||||
// table_number: 0, 酒店
|
// table_number: 0, 酒店
|
||||||
@ -284,7 +280,7 @@ export default defineComponent({
|
|||||||
this.order_id = option.id;;
|
this.order_id = option.id;;
|
||||||
this.orderInfo.order_id = option.id;
|
this.orderInfo.order_id = option.id;
|
||||||
this.getOrderDetail()
|
this.getOrderDetail()
|
||||||
this.getArea()
|
// this.getArea()
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|
||||||
@ -293,76 +289,98 @@ export default defineComponent({
|
|||||||
close () {
|
close () {
|
||||||
this.propShowOrder = false;
|
this.propShowOrder = false;
|
||||||
},
|
},
|
||||||
//表单验证
|
// //表单验证
|
||||||
handleSubmit (reservation_type) {
|
// handleSubmit (reservation_type) {
|
||||||
// console.log(this.orderInfo);
|
// // console.log(this.orderInfo);
|
||||||
this.orderInfo.reservation_type = reservation_type; //付款类型
|
// this.orderInfo.reservation_type = reservation_type; //付款类型
|
||||||
this.$refs.form.validate()
|
// this.$refs.form.validate()
|
||||||
.then(({ valid, errors }) => {
|
// .then(({ valid, errors }) => {
|
||||||
if (valid) {
|
// if (valid) {
|
||||||
this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
// this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
||||||
console.log(this.orderInfo);
|
// console.log(this.orderInfo);
|
||||||
this.addOrder();
|
// this.addOrder();
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
console.log(error, 'error')
|
// console.log(error, 'error')
|
||||||
})
|
// })
|
||||||
|
|
||||||
},
|
// },
|
||||||
|
|
||||||
//提交订单
|
// //提交订单
|
||||||
addOrder () {
|
// addOrder () {
|
||||||
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
// CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
||||||
if (res.code === 1) {
|
// if (res.code === 1) {
|
||||||
this.propShowOrder = true;
|
// this.payOrder(res.data.order_id);
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
// this.propShowOrder = true;
|
||||||
}
|
// } else {
|
||||||
});
|
// uni.$u.toast(res.msg);
|
||||||
},
|
// }
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
|
||||||
// 微信支付
|
// 微信支付
|
||||||
payOrder () {
|
payOrder (type) {
|
||||||
this.close();
|
if (type === 1) {
|
||||||
},
|
//支付订单
|
||||||
//获取地址
|
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
||||||
getArea () {
|
if (res.code === 1) {
|
||||||
this.area = [colPickerData.map(item => ({
|
// this.payOrder(res.data.order_id);
|
||||||
value: item.value,
|
|
||||||
label: item.text
|
// this.propShowOrder = true;
|
||||||
}))];
|
|
||||||
},
|
console.log(res.data);
|
||||||
//选择地址后--记录地址字符串
|
// this.close();
|
||||||
handleConfirm (value) {
|
} else {
|
||||||
this.address_string = value.selectedItems.map(item => item.label).join('')
|
uni.$u.toast(res.msg);
|
||||||
},
|
}
|
||||||
//地址改版事件
|
});
|
||||||
columnChange ({ selectedItem, resolve, finish }) {
|
} else {
|
||||||
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 () {
|
getBanquetType () {
|
||||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.banquetType = res.data;
|
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
item.label = item.name;
|
item.label = item.name;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
this.banquetType = res.data;
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
@ -370,10 +388,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
// //购物车验证
|
// //购物车验证
|
||||||
getOrderDetail () {
|
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) {
|
if (res.code === 1) {
|
||||||
|
console.log(res)
|
||||||
console.log(res)
|
|
||||||
// this.matchedItems_sp = res.data.cart_list;
|
// this.matchedItems_sp = res.data.cart_list;
|
||||||
// this.totalPrice = res.data.total_price;
|
// this.totalPrice = res.data.total_price;
|
||||||
// this.server_user.phone = res.data.server_user.certification.phone;
|
// this.server_user.phone = res.data.server_user.certification.phone;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user