宴席2.0
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
sjeam 2025-08-15 14:53:07 +08:00
parent 3f4b19fcf6
commit 77ced33f14
3 changed files with 10 additions and 25 deletions

View File

@ -281,7 +281,7 @@
public_name: '', public_name: '',
}, },
server_user_id: 0, server_user_id: 0,
order_id: 0,//id
address_string: '', address_string: '',
banquetType: this.getBanquetType(), banquetType: this.getBanquetType(),
propShowOrder: false, propShowOrder: false,
@ -348,6 +348,7 @@
addOrder() { addOrder() {
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.propShowOrder = true; this.propShowOrder = true;
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
@ -356,10 +357,10 @@
}, },
// //
payOrder(order_id) { payOrder() {
CommonApi.commonPost('/api/banquet/order/pay', { CommonApi.commonPost('/api/banquet/order/pay', {
order_id: order_id order_id: this.order_id
}).catch((res) => { }).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
wx.requestPayment({ wx.requestPayment({

View File

@ -192,6 +192,7 @@
<wd-textarea readonly auto-height label="备注" v-model="orderInfo.remark" 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" />
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(2)">取消订单</wd-button> <wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(2)">取消订单</wd-button>
</wd-cell-group> </wd-cell-group>
</wd-form> </wd-form>
@ -273,18 +274,6 @@ export default defineComponent({
// }, // },
// //
// addOrder () {
// CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
// if (res.code === 1) {
// this.payOrder(res.data.order_id);
// this.propShowOrder = true;
// } else {
// uni.$u.toast(res.msg);
// }
// });
// },
// //
payOrder (type) { payOrder (type) {
@ -293,9 +282,7 @@ export default defineComponent({
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.payOrder(res.data.order_id);
// this.propShowOrder = true; // this.propShowOrder = true;
console.log(res.data); console.log(res.data);
wx.requestPayment({ wx.requestPayment({
"timeStamp": res.data.timeStamp, "timeStamp": res.data.timeStamp,
@ -322,10 +309,7 @@ export default defineComponent({
// //
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) { if (res.code === 1) {
// this.payOrder(res.data.order_id); uni.$u.toast(res.msg);
// this.propShowOrder = true;
console.log(res.data);
// this.close();
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }

View File

@ -53,10 +53,10 @@ body {
</view> </view>
</z-paging> </z-paging>
<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"
custom-style="width:calc(100vw - 50rpx)" @click="goBackHome"> custom-style="width:calc(100vw - 50rpx)" @click="goBackHome">
</up-button> </up-button> -->
<!-- </view> -->
</view> </view>
</template> </template>