宴席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

@ -1,5 +1,5 @@
<style lang='scss'> <style lang='scss'>
.custom-count-down { .custom-count-down {
display: inline-block; display: inline-block;
width: 22px; width: 22px;
color: #ff3232; color: #ff3232;
@ -7,15 +7,15 @@
text-align: center; text-align: center;
background-color: #ff404021; background-color: #ff404021;
border-radius: 2px; border-radius: 2px;
} }
.custom-count-down-colon { .custom-count-down-colon {
display: inline-block; display: inline-block;
margin: 0 4px; margin: 0 4px;
color: #ff4040; color: #ff4040;
} }
.cell-icon { .cell-icon {
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
width: 16px; width: 16px;
@ -23,7 +23,7 @@
margin-right: 4px; margin-right: 4px;
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat; background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
background-size: cover; background-size: cover;
} }
</style> </style>
<template> <template>
<view> <view>
@ -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,12 +184,23 @@
</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'
export default defineComponent({ import {
data () { defineComponent
} from "vue";
import {
CommonApi,
UserApi
} from "@/api";
const {
colPickerData,
findChildrenByCode
} = useColPickerData()
export default defineComponent({
data() {
return { return {
totalPrice: 0, totalPrice: 0,
server_user: { server_user: {
@ -202,20 +217,22 @@ export default defineComponent({
}; };
}, },
onLoad (option) { onLoad(option) {
this.order_id = option.order_id;; this.order_id = option.order_id;;
this.orderInfo.order_id = option.order_id; this.orderInfo.order_id = option.order_id;
this.getOrderDetail() this.getOrderDetail()
}, },
methods: { methods: {
close () { close() {
this.propShowOrder = false; this.propShowOrder = false;
}, },
// //
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,
@ -223,13 +240,13 @@ export default defineComponent({
"package": res.data.package, "package": res.data.package,
"signType": res.data.signType, "signType": res.data.signType,
"paySign": res.data.paySign, "paySign": res.data.paySign,
"success": function (res) { "success": function(res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
}, },
"fail": function (err) { "fail": function(err) {
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
}, },
"complete": function (res) { "complete": function(res) {
console.log('complete:' + JSON.stringify(res)); console.log('complete:' + JSON.stringify(res));
} }
}) })
@ -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 {
@ -252,7 +271,7 @@ 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) {
res.data.forEach(item => { res.data.forEach(item => {
@ -266,8 +285,10 @@ 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;
@ -280,23 +301,23 @@ export default defineComponent({
}); });
}, },
// //
cookDetail (id: number) { cookDetail(id: number) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/cook/detail?id=${id}` url: `/pages/banquet/cook/detail?id=${id}`
}); });
}, },
goBackHome () { goBackHome() {
uni.switchTab({ uni.switchTab({
// url: '/pages/index/index' // url: '/pages/index/index'
url: '/pages/tab/user/index' url: '/pages/tab/user/index'
}); });
}, },
// //
goBack () { goBack() {
uni.navigateBack({ uni.navigateBack({
delta: 1 // delta 1 delta: 1 // delta 1
}); });
}, },
}, },
}); });
</script> </script>