feat: 新增订单重试领取按钮

This commit is contained in:
wangsongsole 2023-12-20 14:07:05 +08:00
parent dc7313aa19
commit 5f392248c1
2 changed files with 30 additions and 1 deletions

View File

@ -994,4 +994,9 @@ export const queryConfig = (data) => {
return req("get", baseurl + "/voucher/queryConfig", data) return req("get", baseurl + "/voucher/queryConfig", data)
} }
/* 重试领取 */
export const receiveRetry = (data) => {
return req("post", baseurl + "/voucher/receiveRetry", data)
}
export { req } export { req }

View File

@ -6,7 +6,8 @@ import {
putOrderCancel, putOrderCancel,
putOrderSuccess, putOrderSuccess,
refund, refund,
resendCardCode resendCardCode,
receiveRetry
} from "@/assets/api.js" } from "@/assets/api.js"
import "@/assets/comm.css" import "@/assets/comm.css"
import { nowDay, nowMonth } from "@/assets/comm.js" import { nowDay, nowMonth } from "@/assets/comm.js"
@ -506,6 +507,19 @@ export default class orderList extends React.Component {
}) })
} }
/* 重试领取 */
handlerReceiveRetry(order_number) {
receiveRetry({ order_number }).then(({ code, message }) => {
Notify.clear()
if (code === 200) {
Notify.success(message)
this.getOrderFn()
} else {
Notify.error(message)
}
})
}
// 监听组件内部状态的变化: // 监听组件内部状态的变化:
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
// 参数分别为改变之前的数据状态对象 // 参数分别为改变之前的数据状态对象
@ -783,6 +797,16 @@ export default class orderList extends React.Component {
</span> </span>
</> </>
) : null} ) : null}
{rowData.type === 2 &&
rowData.status === 2 &&
rowData.received_num !== rowData.num ? (
<span
className="grid-link"
onClick={() => this.handlerReceiveRetry(rowData.order_number)}
>
重试领取
</span>
) : null}
{rowData.type == 1 && {rowData.type == 1 &&
rowData.product_type == 2 && rowData.product_type == 2 &&
rowData.product.card_show == 1 && rowData.product.card_show == 1 &&