Commit 39687ba8 authored by zhengke's avatar zhengke

取消订单接口

parent 80c9b98b
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</div> </div>
<div class="text-body2 q-mt-lg text-grey-6">请打开微信(WeChat),使用 [扫一扫]扫描上方二维码进行支付</div> <div class="text-body2 q-mt-lg text-grey-6">请打开微信(WeChat),使用 [扫一扫]扫描上方二维码进行支付</div>
<div class="q-mt-xl text-right"> <div class="q-mt-xl text-right">
<el-button class="q-px-md q-mr-md" @click="close">取消支付</el-button> <el-button class="q-px-md q-mr-md" @click="close" :loading="CancelLoading">取消支付</el-button>
<el-button type="primary" class="q-px-md" @click="CompletePayment">已完成付款</el-button> <el-button type="primary" class="q-px-md" @click="CompletePayment">已完成付款</el-button>
</div> </div>
</div> </div>
...@@ -21,7 +21,7 @@ import { ref } from "vue"; ...@@ -21,7 +21,7 @@ import { ref } from "vue";
import QRCode from '../QRCode/QRCode.vue'; import QRCode from '../QRCode/QRCode.vue';
import OrderService from "@/services/OrderService"; import OrderService from "@/services/OrderService";
import { ApiResult } from "@/configs/axios"; import { ApiResult } from "@/configs/axios";
import { ElMessage } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
const props = defineProps({ const props = defineProps({
orderid: { orderid: {
type: Number, type: Number,
...@@ -34,8 +34,33 @@ const emit = defineEmits<{ ...@@ -34,8 +34,33 @@ const emit = defineEmits<{
const orders = ref({} as any) const orders = ref({} as any)
const loading = ref(false) const loading = ref(false)
const close = ()=>{ const CancelLoading = ref(false)
emit('close') const close = async ()=>{
ElMessageBox.confirm(
`此操作将取消该订单,是否确定?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
try {
await CanceltOrders()
} catch (error) { }
})
.catch(() => { });
}
const CanceltOrders = async ()=>{
if(CancelLoading.value)return
CancelLoading.value=true
const response = await OrderService.CancelPPTOrder(props.orderid)
if(response.data.resultCode == ApiResult.SUCCESS){
emit('success')
}
CancelLoading.value=false
} }
const CompletePayment = async () => { const CompletePayment = async () => {
......
...@@ -82,6 +82,7 @@ import { ref, onMounted } from "vue"; ...@@ -82,6 +82,7 @@ import { ref, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { openNewBlank } from '@/utils/common' import { openNewBlank } from '@/utils/common'
import WePay from '@/components/Pay/WePay.vue' import WePay from '@/components/Pay/WePay.vue'
import { ElMessageBox } from "element-plus";
const activeName = ref<string>('all') const activeName = ref<string>('all')
const parameters = ref({ const parameters = ref({
pageIndex:1, pageIndex:1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment