完善订单操作

master
hequan_waynaqua 4 years ago
parent e7e70fe591
commit dafd08de98

@ -38,6 +38,13 @@ export function orderH5pay(data) {
})
}
export function testPayNotify(orderId) {
return request({
url: '/order/testPayNotify/' + orderId,
method: 'get'
})
}
export function orderList(data) {
return request({
url: '/order/list',
@ -45,3 +52,31 @@ export function orderList(data) {
params: data
})
}
export function orderCancel(orderId) {
return request({
url: '/order/cancel/' + orderId,
method: 'post'
})
}
export function orderRefund(orderId) {
return request({
url: '/order/refund/' + orderId,
method: 'post'
})
}
export function orderDelete(orderId) {
return request({
url: '/order/delete/' + orderId,
method: 'post'
})
}
export function orderConfirm(orderId) {
return request({
url: '/order/confirm/' + orderId,
method: 'post'
})
}

@ -139,7 +139,7 @@ export default {
this.$dialog
.confirm({ message: '确定要删除该订单吗?' })
.then(() => {
orderDelete({ orderId: id }).then(() => {
orderDelete(id).then(() => {
this.init()
this.$toast('已删除订单')
})
@ -150,7 +150,7 @@ export default {
this.$dialog
.confirm({ message: '确定要取消该订单吗?' })
.then(() => {
orderCancel({ orderId: id }).then(() => {
orderCancel(id).then(() => {
this.init()
this.$toast('已取消该订单')
})
@ -161,7 +161,7 @@ export default {
this.$dialog
.confirm({ message: '确定要申请退款吗?' })
.then(() => {
orderRefund({ orderId: id }).then(() => {
orderRefund(id).then(() => {
this.init()
this.$toast('已申请订单退款')
})
@ -174,7 +174,7 @@ export default {
message: '请确认收到货物, 确认收货后无法撤销!'
})
.then(() => {
orderConfirm({ orderId: id }).then(() => {
orderConfirm(id).then(() => {
this.init()
this.$toast('已确认收货')
})
@ -183,7 +183,7 @@ export default {
},
commentOrder(id) {},
toPay(id) {
this.$router.push({ name: 'payment', params: { orderId: id } })
this.$router.push({ name: 'OrderPay', params: { orderId: id } })
},
handleTabClick() {
this.page = 0

@ -36,7 +36,7 @@
</template>
<script>
import { orderDetail, orderPrepay, orderH5pay } from '@/api/order'
import { orderDetail, orderPrepay, orderH5pay, testPayNotify } from '@/api/order'
import _ from 'lodash'
import { getLocalStorage, setLocalStorage } from '@/utils/localStorage'
@ -141,6 +141,19 @@ export default {
}
} else {
// todo : alipay
testPayNotify(this.orderId)
.then((res) => {
this.$router.push({ name: 'User' })
})
.catch((err) => {
this.$dialog.alert({ message: '支付失败' })
this.$router.replace({
name: 'PayStatus',
params: {
status: 'failed'
}
})
})
}
})
},

Loading…
Cancel
Save