宴席2.0 跳转调整
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
sjeam 2025-08-17 10:28:45 +08:00
parent b7ce6a681a
commit 14f23ddcc3
2 changed files with 172 additions and 143 deletions

View File

@ -293,7 +293,7 @@
reservation_type: 1, reservation_type: 1,
server_user_id: 0, server_user_id: 0,
table_number: 1, // table_number: 1, //
banquet_date: '', // banquet_date: null, //
}, },
matchedItems_sp: [], matchedItems_sp: [],
showDatePicker: false showDatePicker: false
@ -343,6 +343,9 @@
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/order/detail?order_id=${res.data.order_id}` url: `/pages/banquet/order/detail?order_id=${res.data.order_id}`
}); });
}else if (res.code === 0) {
uni.$u.toast('请求错误,请从新下单!');
this.goBack();
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -447,7 +450,12 @@
}); });
}, },
//
goBack() {
uni.navigateBack({
delta: 1 // delta 1
});
},
}, },

View File

@ -169,10 +169,14 @@
<view>4.在此感谢您对此平台以及厨师们的支持您的支持就是我们前进的最大动力</view> <view>4.在此感谢您对此平台以及厨师们的支持您的支持就是我们前进的最大动力</view>
<template #footer> <template #footer>
<view class="pb-4" />
<wd-button plain hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(1)">确定支付</wd-button>
<view class="pb-2" /> <view class="pb-2" />
<wd-button hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(2)">取消订单</wd-button> <wd-button plain hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(2)">取消订单</wd-button>
<view class="pb-2" />
<wd-button hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(1)">确定支付</wd-button>
<view class="pb-2" />
<wd-button hairline custom-style="width: calc(100vw - 120rpx);" @click="goBackHome()">返回首页</wd-button>
</template> </template>
</wd-card> </wd-card>
<view class="p-2"></view> <view class="p-2"></view>
@ -180,10 +184,21 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { useColPickerData, useModal } from '@/hooks' import {
import { defineComponent } from "vue"; useColPickerData,
import { CommonApi, UserApi } from "@/api"; useModal
const { colPickerData, findChildrenByCode } = useColPickerData() } from '@/hooks'
import {
defineComponent
} from "vue";
import {
CommonApi,
UserApi
} from "@/api";
const {
colPickerData,
findChildrenByCode
} = useColPickerData()
export default defineComponent({ export default defineComponent({
data() { data() {
return { return {
@ -215,7 +230,9 @@ export default defineComponent({
payOrder(type) { payOrder(type) {
if (type === 1) { if (type === 1) {
// //
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => { CommonApi.commonPost('/api/banquet/order/pay', {
order_id: this.order_id
}).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
wx.requestPayment({ wx.requestPayment({
"timeStamp": res.data.timeStamp, "timeStamp": res.data.timeStamp,
@ -241,7 +258,9 @@ export default defineComponent({
}); });
} else { } else {
// //
CommonApi.commonPost('/api/banquet/order/cancel', { order_id: this.order_id }).catch((res) => { CommonApi.commonPost('/api/banquet/order/cancel', {
order_id: this.order_id
}).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} else { } else {
@ -267,7 +286,9 @@ export default defineComponent({
}, },
// // // //
getOrderDetail() { getOrderDetail() {
CommonApi.commonGet('/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) {
this.matchedItems_sp = res.data.order_info; this.matchedItems_sp = res.data.order_info;
this.orderInfo = res.data.order; this.orderInfo = res.data.order;