1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

添加管理员后台取消订单并退款功能;订单发货、取消订单添加二次确认弹窗

This commit is contained in:
程序员小墨 2023-04-24 22:34:00 +08:00
parent 2d82571303
commit 9a8f3d050c
5 changed files with 54 additions and 13 deletions

View File

@ -362,6 +362,22 @@ const envVersion = "【⚠此处修改为当前小程序环境】" // 正式版
##### 配置 Gateway 限流策略(可选)
> 如果你不懂这是在做什么,请直接跳过这一步
修改 `backend/microservice-gateway/src/main/resources/application.yml` 文件中 `routes` 中各个微服务的 `filters` 例如:
```yml
filters: # 路由过滤器,使用自定义的限流过滤器工厂
- name: RateLimitByIp # 设置每秒允许5个请求每次请求需要1个令牌
args:
rate: 5.0
permits: 1
```
##### 打 jar 包 ##### 打 jar 包
IDEA 中右侧 Maven 双击 Lifestyle 的 package打包完成后的 jar 包可在以下位置找到 IDEA 中右侧 Maven 双击 Lifestyle 的 package打包完成后的 jar 包可在以下位置找到

View File

@ -45,7 +45,7 @@ spring:
args: args:
rate: 5.0 rate: 5.0
permits: 1 permits: 1
- id: access - id: access
uri: lb://microservice-provider-access uri: lb://microservice-provider-access
predicates: predicates:

View File

@ -295,13 +295,12 @@ public class OrderController {
/** /**
* 管理员取消订单 * 管理员取消订单
* *
* @param params * @param orderId
* @return * @return
*/ */
@PostMapping("/manage/cancelOrder") @PostMapping("/manage/cancelOrder")
@ResponseBody @ResponseBody
public Res cancelOrderByManager(@RequestBody JSONObject params) { public Res cancelOrderByManager(Long orderId) {
Long orderId = params.getLong("orderId");
if (orderId == null) { if (orderId == null) {
return Res.error("参数错误"); return Res.error("参数错误");
} }

View File

@ -42,7 +42,7 @@ export function deliverOrder(params) {
* 关闭订单 * 关闭订单
* @returns * @returns
*/ */
export function cancelOrder(params) { export function withdrawOrder(params) {
return send_request({ return send_request({
url: '/shop/order/manage/cancelOrder', url: '/shop/order/manage/cancelOrder',
method: 'POST', method: 'POST',

View File

@ -86,6 +86,8 @@
<!-- 该订单已被取消 --> <!-- 该订单已被取消 -->
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button v-if="orderDetail.orderStatusCode == 'Processing'" type="danger"
@click="withdrawOrder">取消发货并退款</el-button>
<el-button <el-button
v-if="orderDetail.orderStatusCode == 'Processing' || orderDetail.orderStatusCode == 'Shipped'" v-if="orderDetail.orderStatusCode == 'Processing' || orderDetail.orderStatusCode == 'Shipped'"
type="primary" @click="saveEdit">保存发货信息</el-button> type="primary" @click="saveEdit">保存发货信息</el-button>
@ -142,14 +144,38 @@ const editHandle = async function (tabIndex: number, row: any, refreshFunc: Func
const saveEdit = function () { const saveEdit = function () {
// //
shopOrderApi.deliverOrder({ ElMessageBox.confirm('确定要进行发货操作吗?发货后订单将不可撤销。(用户点击收货前仍可以修改发货信息)', '提示', { type: 'warning' })
orderId: orderDetail.value.id, .then(async () => {
...shippingInfo.value shopOrderApi.deliverOrder({
}).then(function (data) { orderId: orderDetail.value.id,
ElMessage.success({ message: data }) ...shippingInfo.value
visible.value = false }).then(function (data) {
completeCallback() if (data) { //
}) ElMessage.success({ message: data })
visible.value = false
completeCallback()
}
})
})
.catch(() => { });
}
const withdrawOrder = function () {
//
ElMessageBox.confirm('确定要取消此订单吗?该操作不可撤销。', '提示', { type: 'warning' })
.then(async () => {
shopOrderApi.withdrawOrder({
orderId: orderDetail.value.id,
...shippingInfo.value
}).then(function (data) {
if (data) { //
ElMessage.success({ message: data })
visible.value = false
completeCallback()
}
})
})
.catch(() => { });
} }
</script> </script>