diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index d4a22944..730a57a6 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -51,12 +51,13 @@ export interface OrderVO { avatar?: string } // 订单操作日志 - orderLog: orderLog[] + logs?: logs[] } -export interface orderLog { +export interface logs { content?: string createTime?: Date + userType?: number } export interface OrderItemRespVO { diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 1a4741b6..f126f26d 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -191,6 +191,10 @@ service.interceptors.response.use( } return Promise.reject('error') } else { + // 前端处理 data 为 null 的情况,进行提示 + if (data.msg !== '') { + ElNotification.error({ title: msg }) + } return data } }, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 2a7bfd12..6f8f3779 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -60,13 +60,19 @@ export const getBoolDictOptions = (dictType: string) => { return dictOption } -export const getDictObj = (dictType: string, value: any) => { +/** + * 获取指定字典类型的指定值对应的字典对象 + * @param dictType 字典类型 + * @param value 字典值 + * @return DictDataType 字典对象 + */ +export const getDictObj = (dictType: string, value: any): DictDataType | undefined => { const dictOptions: DictDataType[] = getDictOptions(dictType) - dictOptions.forEach((dict: DictDataType) => { - if (dict.value === value.toString()) { + for (const dict of dictOptions) { + if (dict.value === value + '') { return dict } - }) + } } /** @@ -74,12 +80,13 @@ export const getDictObj = (dictType: string, value: any) => { * * @param dictType 字典类型 * @param value 字典数据的值 + * @return 字典名称 */ -export const getDictLabel = (dictType: string, value: any) => { +export const getDictLabel = (dictType: string, value: any): string => { const dictOptions: DictDataType[] = getDictOptions(dictType) const dictLabel = ref('') dictOptions.forEach((dict: DictDataType) => { - if (dict.value === value) { + if (dict.value === value + '') { dictLabel.value = dict.label } }) diff --git a/src/views/mall/promotion/components/SpuAndSkuList.vue b/src/views/mall/promotion/components/SpuAndSkuList.vue index db29de2d..1f8041bb 100644 --- a/src/views/mall/promotion/components/SpuAndSkuList.vue +++ b/src/views/mall/promotion/components/SpuAndSkuList.vue @@ -41,7 +41,7 @@ import { SpuProperty } from '@/views/mall/promotion/components/index' defineOptions({ name: 'PromotionSpuAndSkuList' }) const props = defineProps<{ - spuList: T[] // TODO 为了方便兼容后续可能有需要展示多个 spu 的情况暂时保持,如果后续都是只操作一个 spu 的话则可更改为接受一个 spu 或保持 + spuList: T[] ruleConfig: RuleConfig[] spuPropertyListP: SpuProperty[] }>() diff --git a/src/views/mall/trade/afterSale/detail/index.vue b/src/views/mall/trade/afterSale/detail/index.vue index 190a4b33..643d2775 100644 --- a/src/views/mall/trade/afterSale/detail/index.vue +++ b/src/views/mall/trade/afterSale/detail/index.vue @@ -126,14 +126,12 @@ - - 用户类型: - +
售后状态(之前): 操作明细:{{ saleLog.content }} - +
+
@@ -160,28 +166,50 @@