From 26d97d8461a73001e5964d018fd5d5cb4d519f8e Mon Sep 17 00:00:00 2001
From: sjeam <359824901@qq.com>
Date: Wed, 13 Aug 2025 16:38:33 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=B4=E5=B8=AD2.1=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages.json | 4 +-
src/pages/banquet/combo/detail.vue | 432 +++++++++---------
src/pages/banquet/combo/index.vue | 106 ++---
src/pages/banquet/order/{pay.vue => list.vue} | 0
4 files changed, 268 insertions(+), 274 deletions(-)
rename src/pages/banquet/order/{pay.vue => list.vue} (100%)
diff --git a/src/pages.json b/src/pages.json
index c4baea3..153210d 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -182,9 +182,9 @@
"needLogin": true
},
{
- "path": "order/pay",
+ "path": "order/list",
"style": {
- "navigationBarTitleText": "付款详情",
+ "navigationBarTitleText": "付款列表",
"navigationStyle": "custom"
},
"needLogin": true
diff --git a/src/pages/banquet/combo/detail.vue b/src/pages/banquet/combo/detail.vue
index 1f75029..1ac442d 100644
--- a/src/pages/banquet/combo/detail.vue
+++ b/src/pages/banquet/combo/detail.vue
@@ -33,185 +33,206 @@
-
-
-
-
-
-
- 支付金额
+
+
+
+
+
+
+ 支付金额
+
+
+ 剩余时间
+
+
+
+ {{ current.hours > 10 ? current.hours : '0' + current.hours
+ }}
+ :
+ {{ current.minutes }}
+ :
+ {{ current.seconds }}
+
+
-
- 剩余时间
-
-
-
- {{ current.hours > 10 ? current.hours : '0' + current.hours }}
- :
- {{ current.minutes }}
- :
- {{ current.seconds }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
- 第一餐
-
- ¥213213.00元
+
+
+
+
+ 第{{ parseInt(index) + 1 }}餐
+
+
+
+
+ 做宴时段:{{ matchedItems[0].banquet_date }}
+
+ 做宴时段:{{ matchedItems[0].banquet_time }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 做宴时段:2025-11-12
-
- 做宴时段:早上
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ -->
+
+
+
+
费用合计:
- ¥213213.00元
+ ¥{{ totalPrice }}元
+
+
+ 厨师姓名:{{ server_user.public_name }}
+ 厨师联系方式:{{ server_user.phone }}
+
+ 查看详情
+
+
+
+
+
+
+ 1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。
+ 2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。
+ 3.如若档期冲突订单被厨师取消,定金将原路返回,请放心下单。
+ 4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
确定预定(做席后再支付)
- 付定金锁定订单
+ @click="handleSubmit(1)">确定预定(做席后再支付)
+ 付定金锁定订单
@@ -233,37 +254,40 @@ const { colPickerData, findChildrenByCode } = useColPickerData()
export default defineComponent({
data () {
return {
- search: {
- category_id: '',
- keyword: '',
- page: 1,
- limit: 10,
+ totalPrice: 0,
+ server_user: {
+ phone: '',
+ public_name: '',
},
+ server_user_id: 0,
+
+ address_string: '',
+ banquetType: this.getBanquetType(),
propShowOrder: false,
area: [],
value: [],
orderInfo: {
- name: '',
- phone: '',
district_name: [],
street_name: '',
+ // cart_ids: [], 酒店
+ customer_name: '',
+ phone: '',
+ address: '',
remark: '',
+ banquet_type: '',
+ reservation_type: 1,
+ server_user_id: 0,
+ // table_number: 0, 酒店
+ // banquet_date: '', 酒店
},
- // keyword_sp: '',
- categoryIndex: 0,
- childrenIndex: 0,
- categoryList: [],
- tabList: [],
- good_list: [],
matchedItems_sp: [],
};
},
- onLoad () {
- // if (isLogin()) {
- this.getCategoryList()
- // }
- this.changeSP(1)
+ onLoad (option) {
+ this.server_user_id = option.id;;
+ this.orderInfo.server_user_id = option.id;
+ this.getCartCheck()
this.getArea()
},
created () {
@@ -273,38 +297,51 @@ export default defineComponent({
close () {
this.propShowOrder = false;
},
- handleSubmit () {
- this.propShowOrder = true;
- },
- //确认当餐信息
- addOrder () {
+ //表单验证
+ handleSubmit (reservation_type) {
+ // console.log(this.orderInfo);
+ this.orderInfo.reservation_type = reservation_type; //付款类型
this.$refs.form.validate()
.then(({ valid, errors }) => {
if (valid) {
- this.menu_list[this.currentTab].is_set = 1;
- this.menu_list[this.currentTab].orderInfo = this.orderInfo;
- // this.menu_list[this.currentTab].orderInfo.columns = this.columns[this.currentTab].value;
- // this.menu_list[this.currentTab].orderInfo.total_price = this.totalPrice;
- this.close();
-
+ 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);
+ }
+ });
+ },
+
+ // 微信支付
+ payOrder() {
+ this.close();
+ },
+ //获取地址
getArea () {
this.area = [colPickerData.map(item => ({
value: item.value,
label: item.text
}))];
},
-
+ //选择地址后--记录地址字符串
handleConfirm (value) {
- console.log(value)
- console.log(this.value)
+ this.address_string = value.selectedItems.map(item => item.label).join('')
},
+ //地址改版事件
columnChange ({ selectedItem, resolve, finish }) {
try {
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
@@ -321,69 +358,36 @@ export default defineComponent({
finish(); // 确保在发生错误时也能完成操作以避免卡顿
}
},
-
- handleClickCategory (index: number) {
- this.categoryIndex = index;
- this.tabList = this.categoryList[index].children;
- this.handleChildrenClick(0);
- },
- handleChildrenClick (index: number) {
- this.childrenIndex = index;
- this.search.category_id = this.tabList[index].id;
- this.$refs.pagingRefSP?.reload();
- },
-
- getCategoryList () {
- CommonApi.commonGet('/api/dishes/category').catch((res) => {
+ //宴席类型
+ getBanquetType () {
+ CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
if (res.code === 1) {
- this.categoryList = res.data;
- this.handleClickCategory(0)
+ this.banquetType = res.data;
+ res.data.forEach(item => {
+ item.label = item.name;
+
+ });
} else {
uni.$u.toast(res.msg);
}
});
},
- //搜索事件
- searchSP () {
- this.$refs.pagingRefSP?.reload();
- // this.changeSP(1);
- },
- //列表分页
- changeSP (pageNo: number) {
- console.log(pageNo);
- this.search.page = pageNo;
- CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
+ // //购物车验证
+ getCartCheck () {
+ CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.server_user_id }).catch((res) => {
if (res.code === 1) {
- this.matchedItems_sp = res.data;
+ this.matchedItems_sp = res.data.cart_list;
+ this.totalPrice = res.data.total_price;
+ this.server_user.phone = res.data.server_user.certification.phone;
+ this.server_user.public_name = res.data.server_user.certification.public_name;
this.$refs.pagingRefSP?.complete(res.data);
// console.log(res);
} else {
uni.$u.toast(res.msg);
}
});
-
- },
- //点击详情
- goodsDetail (id: number) {
- console.log(id);
- uni.navigateTo({
- url: `/pages/common/goods/detail?id=${id}&is_add=1`
- });
},
- //加入购物车
- addCart (id) {
- CommonApi.commonPost('/api/cart/add', {
- buy_now: false,
- dishes_id: id,
- }).catch((res) => {
- if (res.code === 1) {
- uni.$u.toast('加入购物车成功');
- } else {
- uni.$u.toast(res.msg);
- }
- });
- }
},
diff --git a/src/pages/banquet/combo/index.vue b/src/pages/banquet/combo/index.vue
index 1a36c66..0254c92 100644
--- a/src/pages/banquet/combo/index.vue
+++ b/src/pages/banquet/combo/index.vue
@@ -57,9 +57,9 @@ body {
-
-
+
+
@@ -122,7 +122,7 @@ body {
{{ orderInfo.is_set ? '修改餐标' : '设置餐标' }}
-
+