调试订单支付
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
lewis 2025-08-15 16:12:17 +08:00
parent c5b11daed3
commit dd3e5e53fc
2 changed files with 140 additions and 255 deletions

View File

@ -132,12 +132,6 @@
</up-cell-group> </up-cell-group>
</view> </view>
<!-- <template #footer>
<view>
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
<wd-button size="small" plain>立即使用</wd-button>
</view>
</template> -->
</wd-card> </wd-card>
</view> </view>
@ -223,10 +217,6 @@
message: '做宴地址不能为空,请填写' message: '做宴地址不能为空,请填写'
} }
]"></wd-col-picker> ]"></wd-col-picker>
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址" <wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
:rules="[ :rules="[
{ {
@ -241,7 +231,7 @@
<view class="pb-4" /> <view class="pb-4" />
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" <wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
@click="handleSubmit(1)">确定预定做席后再支付</wd-button> @click="handleSubmit(1)">确定预定做席后再支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button> <wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(2)">付定金锁定订单</wd-button>
</wd-cell-group> </wd-cell-group>
</wd-form> </wd-form>
@ -324,8 +314,6 @@
}, },
// //
handleSubmit(reservation_type) { handleSubmit(reservation_type) {
// this.propShowOrder = true;
// console.log(this.orderInfo);
this.orderInfo.reservation_type = reservation_type; // this.orderInfo.reservation_type = reservation_type; //
this.$refs.form.validate() this.$refs.form.validate()
.then(({ .then(({
@ -334,7 +322,6 @@
}) => { }) => {
if (valid) { if (valid) {
this.orderInfo.address = this.address_string + this.orderInfo.street_name; this.orderInfo.address = this.address_string + this.orderInfo.street_name;
// console.log(this.orderInfo);
this.addOrder(); this.addOrder();
} }
}) })
@ -349,7 +336,9 @@
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => { CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.order_id = res.data.order_id; this.order_id = res.data.order_id;
this.propShowOrder = true; uni.navigateTo({
url: `/pages/banquet/order/detail?order_id=${res.data.order_id}`
});
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }

View File

@ -56,7 +56,6 @@
</wd-count-down> </wd-count-down>
</view> </view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@ -73,8 +72,6 @@
</view> </view>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="prop-flex-bottom"> <view class="prop-flex-bottom">
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal" <up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
@ -82,11 +79,8 @@
</up-button> </up-button>
</view> </view>
</wd-cell-group> </wd-cell-group>
</u-popup> </u-popup>
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index"> <view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
<wd-card> <wd-card>
<template #title> <template #title>
@ -114,8 +108,8 @@
</template> </template>
<template #title> <template #title>
<view class="h-60 flex"> <view class="h-60 flex">
<up-text size="28rpx" :text="`${item.dishes_info.name}`" :flex1="true" align="left" wordWrap="normal" <up-text size="28rpx" :text="`${item.dishes_info.name}`" :flex1="true" align="left"
:show="true" prefixIcon="" customStyle="font-weight:bold" wordWrap="normal" :show="true" prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<u-icon slot="right" label-color="red" readonly :label="`¥${item.dishes_info.price}元`"></u-icon> <u-icon slot="right" label-color="red" readonly :label="`¥${item.dishes_info.price}元`"></u-icon>
@ -123,8 +117,8 @@
</template> </template>
<template #label> <template #label>
<view class="h-60 flex color-gray"> <view class="h-60 flex color-gray">
<up-text size="26rpx" :text="`${item.dishes_info.intro}`" :flex1="true" align="left" wordWrap="normal" <up-text size="26rpx" :text="`${item.dishes_info.intro}`" :flex1="true" align="left"
:show="true" prefixIcon="" customStyle="" wordWrap="normal" :show="true" prefixIcon="" customStyle=""
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<u-icon slot="right" label-color="red" readonly :label="`X${item.number}`"></u-icon> <u-icon slot="right" label-color="red" readonly :label="`X${item.number}`"></u-icon>
@ -136,10 +130,6 @@
</view> </view>
<template #footer> <template #footer>
<!-- <view>
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
<wd-button size="small" plain>立即使用</wd-button>
</view> -->
<view class="title font-size-32"> <view class="title font-size-32">
<view>费用合计</view> <view>费用合计</view>
<view class="title-tip"> <view class="title-tip">
@ -180,16 +170,6 @@
<wd-form ref="form" :model="orderInfo" errorType="message"> <wd-form ref="form" :model="orderInfo" errorType="message">
<wd-cell-group border> <wd-cell-group border>
<!--
<view class="pb-4" />
<wd-input readonly label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name"
placeholder="请填写联系姓名" />
<wd-input readonly label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话" />
<wd-input readonly label="宴席类型" prop="banquet_type" clearable v-model="orderInfo.banquet_type"
placeholder="请填写详细地址" />
<wd-textarea readonly auto-height label="详细地址" prop="address" clearable v-model="orderInfo.address"
placeholder="请填写详细地址" />
<wd-textarea readonly auto-height label="备注" v-model="orderInfo.remark" placeholder="请填写备注" /> -->
<view class="pb-4" /> <view class="pb-4" />
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button> <wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
<view class="pb-2" /> <view class="pb-2" />
@ -207,7 +187,6 @@
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";
// import { setToken, getToken, isLogin } from '@/utils/auth';
const { colPickerData, findChildrenByCode } = useColPickerData() const { colPickerData, findChildrenByCode } = useColPickerData()
export default defineComponent({ export default defineComponent({
data() { data() {
@ -222,68 +201,26 @@ export default defineComponent({
address_string: '', address_string: '',
banquetType: this.getBanquetType(), banquetType: this.getBanquetType(),
propShowOrder: false, propShowOrder: false,
// area: [],
// value: [],
orderInfo: [], orderInfo: [],
// orderInfo: {
// district_name: [],
// street_name: '',
// // cart_ids: [],
// customer_name: '',
// phone: '',
// address: '',
// remark: '',
// banquet_type: '1',
// reservation_type: 1,
// order_id: 0,
// // table_number: 0,
// // banquet_date: '',
// },
matchedItems_sp: [], matchedItems_sp: [],
}; };
}, },
onLoad(option) { onLoad(option) {
this.order_id = option.id;; this.order_id = option.order_id;;
this.orderInfo.order_id = option.id; this.orderInfo.order_id = option.order_id;
this.getOrderDetail() this.getOrderDetail()
// this.getArea()
},
created () {
}, },
methods: { methods: {
close() { close() {
this.propShowOrder = false; this.propShowOrder = false;
}, },
// //
// handleSubmit (reservation_type) {
// // console.log(this.orderInfo);
// this.orderInfo.reservation_type = reservation_type; //
// this.$refs.form.validate()
// .then(({ valid, errors }) => {
// if (valid) {
// this.orderInfo.address = this.address_string + this.orderInfo.street_name;
// console.log(this.orderInfo);
// this.addOrder();
// }
// })
// .catch((error) => {
// console.log(error, 'error')
// })
// },
// //
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) {
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
console.log(res.data);
wx.requestPayment({ wx.requestPayment({
"timeStamp": res.data.timeStamp, "timeStamp": res.data.timeStamp,
"nonceStr": res.data.nonceStr, "nonceStr": res.data.nonceStr,
@ -300,7 +237,6 @@ export default defineComponent({
console.log('complete:' + JSON.stringify(res)); console.log('complete:' + JSON.stringify(res));
} }
}) })
// this.close();
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -315,39 +251,7 @@ export default defineComponent({
} }
}); });
} }
}, },
// //
// getArea () {
// this.area = [colPickerData.map(item => ({
// value: item.value,
// label: item.text
// }))];
// },
// //--
// handleConfirm (value) {
// this.address_string = value.selectedItems.map(item => item.label).join('')
// },
// //
// columnChange ({ selectedItem, resolve, finish }) {
// try {
// const areaData = findChildrenByCode(colPickerData, selectedItem.value);
// if (areaData && areaData.length) {
// resolve(areaData.map(item => ({
// value: item.value,
// label: item.text
// })));
// } else {
// finish();
// }
// } catch (error) {
// console.error(':', error);
// finish(); //
// }
// },
// //
getBanquetType() { getBanquetType() {
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => { CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
@ -366,16 +270,11 @@ 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) {
console.log(res)
this.matchedItems_sp = res.data.order_info; this.matchedItems_sp = res.data.order_info;
// this.totalPrice = res.data.total_price;
this.orderInfo = res.data.order; this.orderInfo = res.data.order;
this.server_user.phone = res.data.server_info.certification.phone; 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.public_name = res.data.server_info.certification.public_name;
this.server_user.id = res.data.server_info.id; this.server_user.id = res.data.server_info.id;
// this.$refs.pagingRefSP?.complete(res.data);
// console.log(res);
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -383,14 +282,11 @@ export default defineComponent({
}, },
// //
cookDetail(id : number) { cookDetail(id : number) {
// console.log(id);
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/cook/detail?id=${id}` url: `/pages/banquet/cook/detail?id=${id}`
}); });
}, },
}, },
}); });
</script> </script>