parent
3f4b19fcf6
commit
77ced33f14
@ -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({
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user