code review:完善订单详情和售后退款 TODO 提到的问题

(cherry picked from commit 3c315cf287)
This commit is contained in:
YunaiV 2023-09-09 01:44:08 +08:00 committed by shizhong
parent ba8840de4f
commit 58f01a8bc5
4 changed files with 17 additions and 21 deletions

View File

@ -54,6 +54,7 @@ export interface OrderVO {
logs?: logs[]
}
// TODO @puhui999OrderLogRespVO 会不会更好哈。
export interface logs {
content?: string
createTime?: Date

View File

@ -191,6 +191,7 @@ service.interceptors.response.use(
}
return Promise.reject('error')
} else {
// TODO @puhui999这个先不用支持哈
// 前端处理 data 为 null 的情况,进行提示
if (data.msg !== '') {
ElNotification.error({ title: msg })

View File

@ -132,23 +132,11 @@
placement="top"
>
<div class="el-timeline-right-content">
<span>售后状态(之前)</span>
<dict-tag
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
:value="saleLog.beforeStatus"
class="mr-10px"
/>
<span>售后状态(之后)</span>
<dict-tag
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
:value="saleLog.afterStatus"
class="mr-10px"
/>
<span>操作明细{{ saleLog.content }}</span>
<span>{{ saleLog.content }}</span>
</div>
<template #dot>
<span
:style="{ backgroundColor: updateStyles(saleLog.userType) }"
:style="{ backgroundColor: getUserTypeColor(saleLog.userType) }"
class="dot-node-style"
>
{{ getDictLabel(DICT_TYPE.USER_TYPE, saleLog.userType)[0] || '系' }}
@ -185,7 +173,8 @@ const formData = ref({
})
const updateAuditReasonFormRef = ref() // Ref
const updateStyles = (type: number) => {
/** 获得 userType 颜色 */
const getUserTypeColor = (type: number) => {
const dict = getDictObj(DICT_TYPE.USER_TYPE, type)
switch (dict?.colorType) {
case 'success':

View File

@ -167,7 +167,7 @@
</div>
<template #dot>
<span
:style="{ backgroundColor: updateStyles(log.userType!) }"
:style="{ backgroundColor: getUserTypeColor(log.userType!) }"
class="dot-node-style"
>
{{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}
@ -201,7 +201,8 @@ defineOptions({ name: 'TradeOrderDetail' })
const message = useMessage() //
const updateStyles = (type: number) => {
/** 获得 userType 颜色 */
const getUserTypeColor = (type: number) => {
const dict = getDictObj(DICT_TYPE.USER_TYPE, type)
switch (dict?.colorType) {
case 'success':
@ -221,22 +222,24 @@ const formData = ref<TradeOrderApi.OrderVO>({
logs: []
})
const deliveryFormRef = ref() // Ref
/** 各种操作 */
const updateRemarkForm = ref() // Ref
const updateAddressFormRef = ref() // Ref
const updatePriceFormRef = ref() // Ref
const remark = () => {
updateRemarkForm.value?.open(formData.value)
}
const deliveryFormRef = ref() // Ref
const delivery = () => {
deliveryFormRef.value?.open(formData.value)
}
const updateAddressFormRef = ref() // Ref
const updateAddress = () => {
updateAddressFormRef.value?.open(formData.value)
}
const updatePriceFormRef = ref() // Ref
const updatePrice = () => {
updatePriceFormRef.value?.open(formData.value)
}
/** 获得详情 */
const { params } = useRoute() //
const getDetail = async () => {
@ -250,13 +253,15 @@ const getDetail = async () => {
formData.value = res
}
}
/** 关闭 tag */
const { delView } = useTagsViewStore() //
const { push, currentRoute } = useRouter() //
/** 关闭 tag */
const close = () => {
delView(unref(currentRoute))
push({ name: 'TradeAfterSale' })
}
/** 复制 */
const clipboardSuccess = () => {
message.success('复制成功')