宴席2.0 页面优化
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
sjeam 2025-08-15 17:41:46 +08:00
parent 6119af35df
commit 2ae9c80165
2 changed files with 141 additions and 129 deletions

View File

@ -1,29 +1,29 @@
<style lang='scss'>
.custom-count-down {
display: inline-block;
width: 22px;
color: #ff3232;
font-size: 12px;
text-align: center;
background-color: #ff404021;
border-radius: 2px;
}
.custom-count-down {
display: inline-block;
width: 22px;
color: #ff3232;
font-size: 12px;
text-align: center;
background-color: #ff404021;
border-radius: 2px;
}
.custom-count-down-colon {
display: inline-block;
margin: 0 4px;
color: #ff4040;
}
.custom-count-down-colon {
display: inline-block;
margin: 0 4px;
color: #ff4040;
}
.cell-icon {
display: block;
box-sizing: border-box;
width: 16px;
height: 16px;
margin-right: 4px;
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
background-size: cover;
}
.cell-icon {
display: block;
box-sizing: border-box;
width: 16px;
height: 16px;
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,10 @@
<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>
<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>
</template>
</wd-card>
<view class="p-2"></view>
@ -180,109 +180,121 @@
</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() {
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;
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: {
id: 0,
phone: '',
public_name: '',
},
//
payOrder(type) {
if (type === 1) {
//
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
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);
}
order_id: 0,
address_string: '',
banquetType: this.getBanquetType(),
propShowOrder: false,
orderInfo: [],
matchedItems_sp: [],
};
},
onLoad (option) {
this.order_id = option.id;;
this.orderInfo.order_id = option.id;
this.getOrderDetail()
},
methods: {
close () {
this.propShowOrder = false;
},
//
payOrder (type) {
if (type === 1) {
//
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
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 {
//
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);
}
});
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>

View File

@ -17,7 +17,7 @@
<wd-card >
<template #title>
<view class="title">
<view> 创建时间{{ item.create_time }} </view>
<view class="font-size-28">创建时间{{ item.create_time }} </view>
<text v-if="item.paid === 0">
<wd-tag custom-class="space" mark>未付款</wd-tag>
</text>