This commit is contained in:
parent
b7ce6a681a
commit
14f23ddcc3
@ -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 表示返回上一级
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<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;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
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;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
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,123 +184,140 @@
|
|||||||
</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
|
||||||
return {
|
} from "vue";
|
||||||
totalPrice: 0,
|
import {
|
||||||
server_user: {
|
CommonApi,
|
||||||
id: 0,
|
UserApi
|
||||||
phone: '',
|
} from "@/api";
|
||||||
public_name: '',
|
const {
|
||||||
|
colPickerData,
|
||||||
|
findChildrenByCode
|
||||||
|
} = useColPickerData()
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
totalPrice: 0,
|
||||||
|
server_user: {
|
||||||
|
id: 0,
|
||||||
|
phone: '',
|
||||||
|
public_name: '',
|
||||||
|
},
|
||||||
|
order_id: 0,
|
||||||
|
address_string: '',
|
||||||
|
banquetType: this.getBanquetType(),
|
||||||
|
propShowOrder: false,
|
||||||
|
orderInfo: [],
|
||||||
|
matchedItems_sp: [],
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.order_id = option.order_id;;
|
||||||
|
this.orderInfo.order_id = option.order_id;
|
||||||
|
this.getOrderDetail()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
close() {
|
||||||
|
this.propShowOrder = false;
|
||||||
},
|
},
|
||||||
order_id: 0,
|
// 微信支付
|
||||||
address_string: '',
|
payOrder(type) {
|
||||||
banquetType: this.getBanquetType(),
|
if (type === 1) {
|
||||||
propShowOrder: false,
|
//支付订单
|
||||||
orderInfo: [],
|
CommonApi.commonPost('/api/banquet/order/pay', {
|
||||||
matchedItems_sp: [],
|
order_id: this.order_id
|
||||||
|
}).catch((res) => {
|
||||||
};
|
if (res.code === 1) {
|
||||||
},
|
wx.requestPayment({
|
||||||
onLoad (option) {
|
"timeStamp": res.data.timeStamp,
|
||||||
this.order_id = option.order_id;;
|
"nonceStr": res.data.nonceStr,
|
||||||
this.orderInfo.order_id = option.order_id;
|
"package": res.data.package,
|
||||||
this.getOrderDetail()
|
"signType": res.data.signType,
|
||||||
},
|
"paySign": res.data.paySign,
|
||||||
methods: {
|
"success": function(res) {
|
||||||
close () {
|
console.log('success:' + JSON.stringify(res));
|
||||||
this.propShowOrder = false;
|
},
|
||||||
},
|
"fail": function(err) {
|
||||||
// 微信支付
|
console.log('fail:' + JSON.stringify(err));
|
||||||
payOrder (type) {
|
},
|
||||||
if (type === 1) {
|
"complete": function(res) {
|
||||||
//支付订单
|
console.log('complete:' + JSON.stringify(res));
|
||||||
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
}
|
||||||
if (res.code === 1) {
|
})
|
||||||
wx.requestPayment({
|
} else if (res.code == 9304) {
|
||||||
"timeStamp": res.data.timeStamp,
|
this.payOrder(1);
|
||||||
"nonceStr": res.data.nonceStr,
|
} else {
|
||||||
"package": res.data.package,
|
uni.$u.toast(res.msg);
|
||||||
"signType": res.data.signType,
|
}
|
||||||
"paySign": res.data.paySign,
|
|
||||||
"success": function (res) {
|
|
||||||
console.log('success:' + JSON.stringify(res));
|
|
||||||
},
|
|
||||||
"fail": function (err) {
|
|
||||||
console.log('fail:' + JSON.stringify(err));
|
|
||||||
},
|
|
||||||
"complete": function (res) {
|
|
||||||
console.log('complete:' + JSON.stringify(res));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else if (res.code == 9304) {
|
|
||||||
this.payOrder(1);
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
//取消订单
|
|
||||||
CommonApi.commonPost('/api/banquet/order/cancel', { order_id: this.order_id }).catch((res) => {
|
|
||||||
if (res.code === 1) {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
this.goBack()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//宴席类型
|
|
||||||
getBanquetType () {
|
|
||||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
|
||||||
if (res.code === 1) {
|
|
||||||
res.data.forEach(item => {
|
|
||||||
item.label = item.name;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.banquetType = res.data;
|
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
//取消订单
|
||||||
|
CommonApi.commonPost('/api/banquet/order/cancel', {
|
||||||
|
order_id: this.order_id
|
||||||
|
}).catch((res) => {
|
||||||
|
if (res.code === 1) {
|
||||||
|
uni.$u.toast(res.msg);
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.msg);
|
||||||
|
}
|
||||||
|
this.goBack()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
//宴席类型
|
||||||
|
getBanquetType() {
|
||||||
|
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||||
|
if (res.code === 1) {
|
||||||
|
res.data.forEach(item => {
|
||||||
|
item.label = item.name;
|
||||||
|
|
||||||
|
});
|
||||||
|
this.banquetType = res.data;
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// //购物车验证
|
||||||
|
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;
|
||||||
|
this.server_user.phone = res.data.server_info.certification.phone;
|
||||||
|
this.server_user.public_name = res.data.server_info.certification.public_name;
|
||||||
|
this.server_user.id = res.data.server_info.id;
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//点击详情
|
||||||
|
cookDetail(id: number) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/banquet/cook/detail?id=${id}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goBackHome() {
|
||||||
|
uni.switchTab({
|
||||||
|
// url: '/pages/index/index'
|
||||||
|
url: '/pages/tab/user/index'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 返回上一级
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1 // delta 表示返回的页面数,1 表示返回上一级
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// //购物车验证
|
});
|
||||||
getOrderDetail () {
|
</script>
|
||||||
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;
|
|
||||||
this.server_user.phone = res.data.server_info.certification.phone;
|
|
||||||
this.server_user.public_name = res.data.server_info.certification.public_name;
|
|
||||||
this.server_user.id = res.data.server_info.id;
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//点击详情
|
|
||||||
cookDetail (id: number) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/banquet/cook/detail?id=${id}`
|
|
||||||
});
|
|
||||||
},
|
|
||||||
goBackHome () {
|
|
||||||
uni.switchTab({
|
|
||||||
// url: '/pages/index/index'
|
|
||||||
url: '/pages/tab/user/index'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 返回上一级
|
|
||||||
goBack () {
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1 // delta 表示返回的页面数,1 表示返回上一级
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
Loading…
x
Reference in New Issue
Block a user