This commit is contained in:
parent
b7ce6a681a
commit
14f23ddcc3
@ -293,7 +293,7 @@
|
||||
reservation_type: 1,
|
||||
server_user_id: 0,
|
||||
table_number: 1, //酒店
|
||||
banquet_date: '', //酒店
|
||||
banquet_date: null, //酒店
|
||||
},
|
||||
matchedItems_sp: [],
|
||||
showDatePicker: false
|
||||
@ -343,6 +343,9 @@
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/order/detail?order_id=${res.data.order_id}`
|
||||
});
|
||||
}else if (res.code === 0) {
|
||||
uni.$u.toast('请求错误,请从新下单!');
|
||||
this.goBack();
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
@ -447,7 +450,12 @@
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 返回上一级
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1 // delta 表示返回的页面数,1 表示返回上一级
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<style lang='scss'>
|
||||
.custom-count-down {
|
||||
.custom-count-down {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
color: #ff3232;
|
||||
@ -7,15 +7,15 @@
|
||||
text-align: center;
|
||||
background-color: #ff404021;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-count-down-colon {
|
||||
.custom-count-down-colon {
|
||||
display: inline-block;
|
||||
margin: 0 4px;
|
||||
color: #ff4040;
|
||||
}
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
.cell-icon {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 16px;
|
||||
@ -23,7 +23,7 @@
|
||||
margin-right: 4px;
|
||||
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view>
|
||||
@ -169,10 +169,14 @@
|
||||
<view>4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。</view>
|
||||
|
||||
<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" />
|
||||
<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>
|
||||
</wd-card>
|
||||
<view class="p-2"></view>
|
||||
@ -180,12 +184,23 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useColPickerData, useModal } from '@/hooks'
|
||||
import { defineComponent } from "vue";
|
||||
import { CommonApi, UserApi } from "@/api";
|
||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
export default defineComponent({
|
||||
data () {
|
||||
import {
|
||||
useColPickerData,
|
||||
useModal
|
||||
} from '@/hooks'
|
||||
import {
|
||||
defineComponent
|
||||
} from "vue";
|
||||
import {
|
||||
CommonApi,
|
||||
UserApi
|
||||
} from "@/api";
|
||||
const {
|
||||
colPickerData,
|
||||
findChildrenByCode
|
||||
} = useColPickerData()
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
totalPrice: 0,
|
||||
server_user: {
|
||||
@ -202,20 +217,22 @@ export default defineComponent({
|
||||
|
||||
};
|
||||
},
|
||||
onLoad (option) {
|
||||
onLoad(option) {
|
||||
this.order_id = option.order_id;;
|
||||
this.orderInfo.order_id = option.order_id;
|
||||
this.getOrderDetail()
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
close() {
|
||||
this.propShowOrder = false;
|
||||
},
|
||||
// 微信支付
|
||||
payOrder (type) {
|
||||
payOrder(type) {
|
||||
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) {
|
||||
wx.requestPayment({
|
||||
"timeStamp": res.data.timeStamp,
|
||||
@ -223,13 +240,13 @@ export default defineComponent({
|
||||
"package": res.data.package,
|
||||
"signType": res.data.signType,
|
||||
"paySign": res.data.paySign,
|
||||
"success": function (res) {
|
||||
"success": function(res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
"fail": function (err) {
|
||||
"fail": function(err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
},
|
||||
"complete": function (res) {
|
||||
"complete": function(res) {
|
||||
console.log('complete:' + JSON.stringify(res));
|
||||
}
|
||||
})
|
||||
@ -241,7 +258,9 @@ export default defineComponent({
|
||||
});
|
||||
} 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) {
|
||||
uni.$u.toast(res.msg);
|
||||
} else {
|
||||
@ -252,7 +271,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
//宴席类型
|
||||
getBanquetType () {
|
||||
getBanquetType() {
|
||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||
if (res.code === 1) {
|
||||
res.data.forEach(item => {
|
||||
@ -266,8 +285,10 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
// //购物车验证
|
||||
getOrderDetail () {
|
||||
CommonApi.commonGet('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
|
||||
getOrderDetail() {
|
||||
CommonApi.commonGet('/api/banquet/order/detail', {
|
||||
order_id: this.order_id
|
||||
}).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.matchedItems_sp = res.data.order_info;
|
||||
this.orderInfo = res.data.order;
|
||||
@ -280,23 +301,23 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
//点击详情
|
||||
cookDetail (id: number) {
|
||||
cookDetail(id: number) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/cook/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
goBackHome () {
|
||||
goBackHome() {
|
||||
uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
url: '/pages/tab/user/index'
|
||||
});
|
||||
},
|
||||
// 返回上一级
|
||||
goBack () {
|
||||
goBack() {
|
||||
uni.navigateBack({
|
||||
delta: 1 // delta 表示返回的页面数,1 表示返回上一级
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user