宴席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: '',
|
||||
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);
|
||||
}
|
||||
|
@ -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) {
|
||||
// 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')
|
||||
})
|
||||
// //表单验证
|
||||
// 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.addOrder();
|
||||
// }
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log(error, 'error')
|
||||
// })
|
||||
|
||||
},
|
||||
// },
|
||||
|
||||
//提交订单
|
||||
addOrder () {
|
||||
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.propShowOrder = true;
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// //提交订单
|
||||
// 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 () {
|
||||
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(); // 确保在发生错误时也能完成操作以避免卡顿
|
||||
payOrder (type) {
|
||||
if (type === 1) {
|
||||
//支付订单
|
||||
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.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);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//取消支付
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// //获取地址
|
||||
// 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,10 +388,9 @@ 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)
|
||||
console.log(res)
|
||||
// this.matchedItems_sp = res.data.cart_list;
|
||||
// this.totalPrice = res.data.total_price;
|
||||
// this.server_user.phone = res.data.server_user.certification.phone;
|
||||
|
Loading…
x
Reference in New Issue
Block a user