diff --git a/src/components/DishCategory.vue b/src/components/DishCategory.vue new file mode 100644 index 0000000..1d43391 --- /dev/null +++ b/src/components/DishCategory.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/components/DishItem.vue b/src/components/DishItem.vue new file mode 100644 index 0000000..1d43391 --- /dev/null +++ b/src/components/DishItem.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/pages/banquet/combo/detail.vue b/src/pages/banquet/combo/detail.vue index 95f611a..dc378ab 100644 --- a/src/pages/banquet/combo/detail.vue +++ b/src/pages/banquet/combo/detail.vue @@ -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); } diff --git a/src/pages/banquet/order/detail.vue b/src/pages/banquet/order/detail.vue index 0b64d99..3286383 100644 --- a/src/pages/banquet/order/detail.vue +++ b/src/pages/banquet/order/detail.vue @@ -158,13 +158,12 @@ 厨师姓名:{{ server_user.public_name }} 厨师联系方式:{{ server_user.phone }} 1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。 2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。 @@ -175,7 +174,7 @@ - - + --> - + 确定支付 + 取消支付 - @@ -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;