diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index d4a22944cc34ab035fe59866ddc59864b0cdccc6..730a57a6885a8bfb78c420f92375f0644ccd595c 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 1a4741b692ba291a2cf2844bd69c38237dd6a676..f126f26df01383791f73723889c1594c59ff7f01 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 2a7bfd1297218dd7334b08410a61c70661662fee..6f8f377973dd428b32922bc4cf4a8c26212a1b13 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 db29de2dcb2d53ee7a203c7672086aeece5005f0..1f8041bb2666eb999d0553e45f884844ceb79979 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 190a4b33e45b6c963fd4056fd10dd55aa129472d..643d27756a25b2659a07dd856f0a9f9192e17860 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 @@