Skip to content

Commit 3c315cf

Browse files
committed
code review:完善订单详情和售后退款 TODO 提到的问题
1 parent dbfabcb commit 3c315cf

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

src/api/mall/trade/order/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export interface OrderVO {
5454
logs?: logs[]
5555
}
5656

57+
// TODO @puhui999:OrderLogRespVO 会不会更好哈。
5758
export interface logs {
5859
content?: string
5960
createTime?: Date

src/config/axios/service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ service.interceptors.response.use(
191191
}
192192
return Promise.reject('error')
193193
} else {
194+
// TODO @puhui999:这个先不用支持哈;
194195
// 前端处理 data 为 null 的情况,进行提示
195196
if (data.msg !== '') {
196197
ElNotification.error({ title: msg })

src/views/mall/trade/afterSale/detail/index.vue

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,11 @@
132132
placement="top"
133133
>
134134
<div class="el-timeline-right-content">
135-
<span>售后状态(之前):</span>
136-
<dict-tag
137-
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
138-
:value="saleLog.beforeStatus"
139-
class="mr-10px"
140-
/>
141-
<span>售后状态(之后):</span>
142-
<dict-tag
143-
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
144-
:value="saleLog.afterStatus"
145-
class="mr-10px"
146-
/>
147-
<span>操作明细:{{ saleLog.content }}</span>
135+
<span>{{ saleLog.content }}</span>
148136
</div>
149137
<template #dot>
150138
<span
151-
:style="{ backgroundColor: updateStyles(saleLog.userType) }"
139+
:style="{ backgroundColor: getUserTypeColor(saleLog.userType) }"
152140
class="dot-node-style"
153141
>
154142
{{ getDictLabel(DICT_TYPE.USER_TYPE, saleLog.userType)[0] || '系' }}
@@ -185,7 +173,8 @@ const formData = ref({
185173
})
186174
const updateAuditReasonFormRef = ref() // 拒绝售后表单 Ref
187175
188-
const updateStyles = (type: number) => {
176+
/** 获得 userType 颜色 */
177+
const getUserTypeColor = (type: number) => {
189178
const dict = getDictObj(DICT_TYPE.USER_TYPE, type)
190179
switch (dict?.colorType) {
191180
case 'success':

src/views/mall/trade/order/detail/index.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
</div>
168168
<template #dot>
169169
<span
170-
:style="{ backgroundColor: updateStyles(log.userType!) }"
170+
:style="{ backgroundColor: getUserTypeColor(log.userType!) }"
171171
class="dot-node-style"
172172
>
173173
{{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}
@@ -201,7 +201,8 @@ defineOptions({ name: 'TradeOrderDetail' })
201201
202202
const message = useMessage() // 消息弹窗
203203
204-
const updateStyles = (type: number) => {
204+
/** 获得 userType 颜色 */
205+
const getUserTypeColor = (type: number) => {
205206
const dict = getDictObj(DICT_TYPE.USER_TYPE, type)
206207
switch (dict?.colorType) {
207208
case 'success':
@@ -221,22 +222,24 @@ const formData = ref<TradeOrderApi.OrderVO>({
221222
logs: []
222223
})
223224
224-
const deliveryFormRef = ref() // 发货表单 Ref
225+
/** 各种操作 */
225226
const updateRemarkForm = ref() // 订单备注表单 Ref
226-
const updateAddressFormRef = ref() // 收货地址表单 Ref
227-
const updatePriceFormRef = ref() // 订单调价表单 Ref
228227
const remark = () => {
229228
updateRemarkForm.value?.open(formData.value)
230229
}
230+
const deliveryFormRef = ref() // 发货表单 Ref
231231
const delivery = () => {
232232
deliveryFormRef.value?.open(formData.value)
233233
}
234+
const updateAddressFormRef = ref() // 收货地址表单 Ref
234235
const updateAddress = () => {
235236
updateAddressFormRef.value?.open(formData.value)
236237
}
238+
const updatePriceFormRef = ref() // 订单调价表单 Ref
237239
const updatePrice = () => {
238240
updatePriceFormRef.value?.open(formData.value)
239241
}
242+
240243
/** 获得详情 */
241244
const { params } = useRoute() // 查询参数
242245
const getDetail = async () => {
@@ -250,13 +253,15 @@ const getDetail = async () => {
250253
formData.value = res
251254
}
252255
}
256+
257+
/** 关闭 tag */
253258
const { delView } = useTagsViewStore() // 视图操作
254259
const { push, currentRoute } = useRouter() // 路由
255-
/** 关闭 tag */
256260
const close = () => {
257261
delView(unref(currentRoute))
258262
push({ name: 'TradeAfterSale' })
259263
}
264+
260265
/** 复制 */
261266
const clipboardSuccess = () => {
262267
message.success('复制成功')

0 commit comments

Comments
 (0)