This commit is contained in:
parent
6119af35df
commit
2ae9c80165
@ -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,10 @@
|
|||||||
<view>4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。</view>
|
<view>4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。</view>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<view class="pb-4" />
|
<view class="pb-4" />
|
||||||
<wd-button plain hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(1)">确定支付</wd-button>
|
<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 hairline custom-style="width: calc(100vw - 120rpx);" @click="payOrder(2)">取消订单</wd-button>
|
||||||
</template>
|
</template>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
<view class="p-2"></view>
|
<view class="p-2"></view>
|
||||||
@ -180,109 +180,121 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useColPickerData, useModal } from '@/hooks'
|
import { useColPickerData, useModal } from '@/hooks'
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import { CommonApi, UserApi } from "@/api";
|
import { CommonApi, UserApi } from "@/api";
|
||||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
server_user: {
|
server_user: {
|
||||||
id: 0,
|
id: 0,
|
||||||
phone: '',
|
phone: '',
|
||||||
public_name: '',
|
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,
|
||||||
payOrder(type) {
|
address_string: '',
|
||||||
if (type === 1) {
|
banquetType: this.getBanquetType(),
|
||||||
//支付订单
|
propShowOrder: false,
|
||||||
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
orderInfo: [],
|
||||||
if (res.code === 1) {
|
matchedItems_sp: [],
|
||||||
wx.requestPayment({
|
|
||||||
"timeStamp": res.data.timeStamp,
|
};
|
||||||
"nonceStr": res.data.nonceStr,
|
},
|
||||||
"package": res.data.package,
|
onLoad (option) {
|
||||||
"signType": res.data.signType,
|
this.order_id = option.id;;
|
||||||
"paySign": res.data.paySign,
|
this.orderInfo.order_id = option.id;
|
||||||
"success": function (res) {
|
this.getOrderDetail()
|
||||||
console.log('success:' + JSON.stringify(res));
|
},
|
||||||
},
|
methods: {
|
||||||
"fail": function (err) {
|
close () {
|
||||||
console.log('fail:' + JSON.stringify(err));
|
this.propShowOrder = false;
|
||||||
},
|
},
|
||||||
"complete": function (res) {
|
// 微信支付
|
||||||
console.log('complete:' + JSON.stringify(res));
|
payOrder (type) {
|
||||||
}
|
if (type === 1) {
|
||||||
})
|
//支付订单
|
||||||
} else {
|
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
||||||
uni.$u.toast(res.msg);
|
if (res.code === 1) {
|
||||||
}
|
wx.requestPayment({
|
||||||
|
"timeStamp": res.data.timeStamp,
|
||||||
|
"nonceStr": res.data.nonceStr,
|
||||||
|
"package": res.data.package,
|
||||||
|
"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 {
|
||||||
|
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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
//宴席类型
|
|
||||||
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}`
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
// //购物车验证
|
||||||
|
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 表示返回上一级
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<wd-card >
|
<wd-card >
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view> 创建时间:{{ item.create_time }} </view>
|
<view class="font-size-28">创建时间:{{ item.create_time }} </view>
|
||||||
<text v-if="item.paid === 0">
|
<text v-if="item.paid === 0">
|
||||||
<wd-tag custom-class="space" mark>未付款</wd-tag>
|
<wd-tag custom-class="space" mark>未付款</wd-tag>
|
||||||
</text>
|
</text>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user