From 2eb740765e76e7ea4e4559de5441e2c3e7c9993e Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 20 Aug 2023 02:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=EF=BC=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=87=8D=E6=9E=84=20=E2=91=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/trade/order/index.ts | 122 ++- src/api/mall/trade/order/type/orderType.ts | 228 ----- src/views/Login/components/LoginForm.vue | 8 +- src/views/mall/trade/order/detail/index.vue | 367 +++++++ src/views/mall/trade/order/index.vue | 948 +++++++----------- src/views/mall/trade/order/testData.ts | 167 +++ .../mall/trade/order/tradeOrderDetail.vue | 365 ------- 7 files changed, 1024 insertions(+), 1181 deletions(-) delete mode 100644 src/api/mall/trade/order/type/orderType.ts create mode 100644 src/views/mall/trade/order/detail/index.vue create mode 100644 src/views/mall/trade/order/testData.ts delete mode 100644 src/views/mall/trade/order/tradeOrderDetail.vue diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index 9d0fab2e..5a6be83c 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -1,12 +1,110 @@ -import request from '@/config/axios' - -// 获得交易订单分页 -// TODO @xiaobai:改成 getOrderPage -export const getOrderList = (params: PageParam) => { - return request.get({ url: '/trade/order/page', params }) -} - -// 获得交易订单详情 -export const getOrderDetail = (id: number) => { - return request.get({ url: '/trade/order/get-detail?id=' + id }) -} +import request from '@/config/axios' + +export interface OrderVO { + id?: number // 订单编号 + no?: string // 订单流水号 + createTime?: Date // 下单时间 + type?: number // 订单类型 + terminal?: number // 订单来源 + userId?: number // 用户编号 + userIp?: string // 用户 IP + userRemark?: string // 用户备注 + status?: number // 订单状态 + productCount?: number // 购买的商品数量 + finishTime?: Date // 订单完成时间 + cancelTime?: Date // 订单取消时间 + cancelType?: number // 取消类型 + remark?: string // 商家备注 + payOrderId: number // 支付订单编号 + payed?: boolean // 是否已支付 + payTime?: Date // 付款时间 + payChannelCode?: string // 支付渠道 + originalPrice?: number // 商品原价(总) + orderPrice?: number // 订单原价(总) + discountPrice?: number // 订单优惠(总) + deliveryPrice?: number // 运费金额 + adjustPrice?: number // 订单调价(总) + payPrice?: number // 应付金额(总) + deliveryType?: number // 发货方式 + deliveryTemplateId?: number // 配送模板编号 + logisticsId?: number // 发货物流公司编号 + logisticsNo?: string // 发货物流单号 + deliveryStatus?: number // 发货状态 + deliveryTime?: Date // 发货时间 + receiveTime?: Date // 收货时间 + receiverName?: string // 收件人名称 + receiverMobile?: string // 收件人手机 + receiverAreaId?: number // 收件人地区编号 + receiverPostCode?: number // 收件人邮编 + receiverDetailAddress?: string // 收件人详细地址 + afterSaleStatus?: number // 售后状态 + refundPrice?: number // 退款金额 + couponId?: number // 优惠劵编号 + couponPrice?: number // 优惠劵减免金额 + pointPrice?: number // 积分抵扣的金额 + receiverAreaName?: string //收件人地区名字 + items?: OrderItemRespVO[] // 订单项列表 + //用户信息 + user?: { + id?: number + nickname?: string + avatar?: string + } +} + +export interface OrderItemRespVO { + // ========== 订单项基本信息 ========== + id?: number // 编号 + userId?: number // 用户编号 + orderId?: number // 订单编号 + // ========== 商品基本信息 ========== + spuId?: number // 商品 SPU 编号 + spuName?: string //商品 SPU 名称 + skuId?: number // 商品 SKU 编号 + picUrl?: string //商品图片 + count?: number //购买数量 + // ========== 价格 + 支付基本信息 ========== + originalPrice?: number //商品原价(总) + originalUnitPrice?: number //商品原价(单) + discountPrice?: number //商品优惠(总) + payPrice?: number //商品实付金额(总) + orderPartPrice?: number //子订单分摊金额(总) + orderDividePrice?: number //分摊后子订单实付金额(总) + // ========== 营销基本信息 ========== + // TODO 芋艿:在捉摸一下 + // ========== 售后基本信息 ========== + afterSaleStatus?: number // 售后状态 + properties?: ProductPropertiesVO[] //属性数组 +} + +export interface ProductPropertiesVO { + propertyId?: number // 属性的编号 + propertyName?: string // 属性的名称 + valueId?: number //属性值的编号 + valueName?: string // 属性值的名称 +} + +// 查询交易订单列表 +export const getOrderPage = async (params) => { + return await request.get({ url: `/trade/order/page`, params }) +} + +// 查询交易订单详情 +export const getOrder = async (id: number) => { + return await request.get({ url: `/trade/order/get?id=` + id }) +} + +// 新增交易订单 +export const createOrder = async (data: OrderVO) => { + return await request.post({ url: `/trade/order/create`, data }) +} + +// 修改交易订单 +export const updateOrder = async (data: OrderVO) => { + return await request.put({ url: `/trade/order/update`, data }) +} + +// 删除交易订单 +export const deleteOrder = async (id: number) => { + return await request.delete({ url: `/trade/order/delete?id=` + id }) +} diff --git a/src/api/mall/trade/order/type/orderType.ts b/src/api/mall/trade/order/type/orderType.ts deleted file mode 100644 index e5185769..00000000 --- a/src/api/mall/trade/order/type/orderType.ts +++ /dev/null @@ -1,228 +0,0 @@ -// TODO @xiaobai:这个放到 order/index.ts 里哈 -// TODO @xiaobai:注释放到变量后面,这样简洁一点 -// TODO @xiaobai:这个改成 TradeOrderRespVO -export interface TradeOrderPageItemRespVO { - // 订单编号 - id?: number - // 订单流水号 - no?: string - // 下单时间 - createTime?: Date - // 订单类型 - type?: number - // 订单来源 - terminal?: number - // 用户编号 - userId?: number - // 用户 IP - userIp?: string - // 用户备注 - userRemark?: string - // 订单状态 - status?: number - // 购买的商品数量 - productCount?: number - // 订单完成时间 - finishTime?: Date - // 订单取消时间 - cancelTime?: Date - // 取消类型 - cancelType?: number - // 商家备注 - remark?: string - // 支付订单编号 - payOrderId: number - // 是否已支付 - payed?: boolean - // 付款时间 - payTime?: Date - // 支付渠道 - payChannelCode?: string - // 商品原价(总) - originalPrice?: number - // 订单原价(总) - orderPrice?: number - // 订单优惠(总) - discountPrice?: number - // 运费金额 - deliveryPrice?: number - // 订单调价(总) - adjustPrice?: number - // 应付金额(总) - payPrice?: number - // 配送模板编号 - deliveryTemplateId?: number - // 发货物流公司编号 - logisticsId?: number - // 发货物流单号 - logisticsNo?: string - // 发货状态 - deliveryStatus?: number - // 发货时间 - deliveryTime?: Date - // 收货时间 - receiveTime?: Date - // 收件人名称 - receiverName?: string - // 收件人手机 - receiverMobile?: string - // 收件人地区编号 - receiverAreaId?: number - // 收件人邮编 - receiverPostCode?: number - // 收件人详细地址 - receiverDetailAddress?: string - // 售后状态 - afterSaleStatus?: number - // 退款金额 - refundPrice?: number - // 优惠劵编号 - couponId?: number - // 优惠劵减免金额 - couponPrice?: number - // 积分抵扣的金额 - pointPrice?: number - //收件人地区名字 - receiverAreaName?: string - // 订单项列表 - items?: TradeOrderItemBaseVO[] - //用户信息 - user?: MemberUserRespDTO -} - -// TODO @xiaobai:这个改成 TradeOrderItemRespVO -/** - * 交易订单项 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - */ -export interface TradeOrderItemBaseVO { - // ========== 订单项基本信息 ========== - /** - * 编号 - */ - id?: number - /** - * 用户编号 - */ - userId?: number - /** - * 订单编号 - */ - orderId?: number - // ========== 商品基本信息 ========== - /** - * 商品 SPU 编号 - */ - spuId?: number - /** - * 商品 SPU 名称 - */ - spuName?: string - /** - * 商品 SKU 编号 - */ - skuId?: number - /** - * 商品图片 - */ - picUrl?: string - /** - * 购买数量 - */ - count?: number - // ========== 价格 + 支付基本信息 ========== - /** - * 商品原价(总) - */ - originalPrice?: number - /** - * 商品原价(单) - */ - originalUnitPrice?: number - /** - * 商品优惠(总) - */ - discountPrice?: number - /** - * 商品实付金额(总) - */ - payPrice?: number - /** - * 子订单分摊金额(总) - */ - orderPartPrice?: number - /** - * 分摊后子订单实付金额(总) - */ - orderDividePrice?: number - // ========== 营销基本信息 ========== - // TODO 芋艿:在捉摸一下 - // ========== 售后基本信息 ========== - /** - * 售后状态 - */ - afterSaleStatus?: number - //属性数组 - properties?: ProductPropertyValueDetailRespVO[] -} - -/** - * 管理后台 - 商品属性值的明细 Response VO - */ -export interface ProductPropertyValueDetailRespVO { - /** - * 属性的编号 - */ - propertyId?: number - /** - * 属性的名称 - */ - propertyName?: string - /** - * 属性值的编号 - */ - valueId?: number - /** - * 属性值的名称 - */ - valueName?: string -} - -/** - * 订单详情查询 请求 - */ -export interface TradeOrderPageReqVO { - pageNo: number - pageSize: number - no?: string - userId?: string - userNickname?: string - userMobile?: string - receiverName?: string - receiverMobile?: string - terminal?: string - type?: number - status?: number - payChannelCode?: string - createTime?: [Date, Date] - spuName?: string - itemCount?: string - all?: string -} - -//用户信息 -export interface MemberUserRespDTO { - id?: number - nickname?: string - status?: number - avatar?: string - mobile?: string -} -//订单详情选中type -export interface SelectType { - queryParams: TradeOrderPageReqVO - selectTotal: number //选中的数量 - selectAllFlag: boolean //全选标识 - selectData: Map> //存放涉及选中得页面以及每页选中得数据订单号 全选时根据条件查询 排除取消的list订单 - unSelectList: Set //登记取消的list 全选标识为true 时登记单独取消的list,再次选中时排除, 全选标识为false 时清空list -} diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 190c5aa1..87880328 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -21,8 +21,8 @@ v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse" - type="primary" link + type="primary" /> @@ -148,8 +148,8 @@ import { ElLoading } from 'element-plus' import LoginFormTitle from './LoginFormTitle.vue' import type { RouteLocationNormalizedLoaded } from 'vue-router' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -const { wsCache } = useCache() +// import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +// const { wsCache } = useCache() import { useIcon } from '@/hooks/web/useIcon' import * as authUtil from '@/utils/auth' @@ -246,7 +246,7 @@ const handleLogin = async (params) => { if (!res) { return } - wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 + // wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 ElLoading.service({ lock: true, text: '正在加载系统中...', diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue new file mode 100644 index 00000000..394b15de --- /dev/null +++ b/src/views/mall/trade/order/detail/index.vue @@ -0,0 +1,367 @@ + + + diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 1e4f6eb3..e0a5a290 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -1,572 +1,376 @@ - - + + + diff --git a/src/views/mall/trade/order/testData.ts b/src/views/mall/trade/order/testData.ts new file mode 100644 index 00000000..fcf3adaf --- /dev/null +++ b/src/views/mall/trade/order/testData.ts @@ -0,0 +1,167 @@ +import { OrderVO } from '@/api/mall/trade/order' + +export const testData: OrderVO = [ + { + id: 2, + no: '20230817002', + createTime: new Date('2023-08-17T11:30:00'), + type: 2, + terminal: 10, + userId: 1002, + userIp: '192.168.1.2', + userRemark: 'Urgent delivery required', + status: 20, + productCount: 2, + finishTime: null, + cancelTime: null, + cancelType: null, + remark: '', + payOrderId: 10002, + payed: false, + payTime: null, + payChannelCode: 'wx_app', + originalPrice: 80, + orderPrice: 80, + discountPrice: 0, + deliveryPrice: 5, + adjustPrice: 0, + payPrice: 85, + deliveryTemplateId: 2002, + logisticsId: null, + logisticsNo: '', + deliveryStatus: 0, + deliveryTime: null, + receiveTime: null, + receiverName: 'Jane Smith', + receiverMobile: '987-654-3210', + receiverAreaId: 4002, + receiverPostCode: 54321, + receiverDetailAddress: '456 Elm St, Apt 2C', + afterSaleStatus: 0, + refundPrice: 0, + couponId: null, + couponPrice: 0, + pointPrice: 0, + receiverAreaName: 'Townsville', + items: [ + { + id: 103, + userId: 1002, + orderId: 2, + spuId: 5003, + spuName: 'Widget C', + skuId: 6003, + picUrl: 'https://example.com/images/widget_c.jpg', + count: 1, + originalPrice: 40, + originalUnitPrice: 40, + discountPrice: 0, + payPrice: 40, + orderPartPrice: 40, + orderDividePrice: 40, + afterSaleStatus: 0, + properties: [ + { propertyId: 7001, propertyName: 'Color', valueId: 8004, valueName: 'Green' }, + { propertyId: 7002, propertyName: 'Size', valueId: 8002, valueName: 'Medium' } + ] + }, + { + id: 104, + userId: 1002, + orderId: 2, + spuId: 5004, + spuName: 'Widget D', + skuId: 6004, + picUrl: 'https://example.com/images/widget_d.jpg', + count: 1, + originalPrice: 40, + originalUnitPrice: 40, + discountPrice: 0, + payPrice: 40, + orderPartPrice: 40, + orderDividePrice: 40, + afterSaleStatus: 0, + properties: [ + { propertyId: 7003, propertyName: 'Color', valueId: 8005, valueName: 'Yellow' }, + { propertyId: 7002, propertyName: 'Size', valueId: 8002, valueName: 'Medium' } + ] + } + ], + user: { + id: 1002, + nickname: 'janesmith', + avatar: 'https://example.com/images/avatar.jpg' + } + }, + { + id: 3, + no: '20230817003', + createTime: new Date('2023-08-17T12:00:00'), + type: 1, + terminal: 10, + userId: 1003, + userIp: '192.168.1.3', + userRemark: '', + status: 10, + productCount: 1, + finishTime: new Date('2023-08-18T09:15:00'), + cancelTime: null, + cancelType: null, + remark: '', + payOrderId: 10003, + payed: true, + payTime: new Date('2023-08-17T12:30:00'), + payChannelCode: 'alipay_app', + originalPrice: 25, + orderPrice: 20, + discountPrice: 5, + deliveryPrice: 5, + adjustPrice: 0, + payPrice: 20, + deliveryTemplateId: 2001, + logisticsId: 3002, + logisticsNo: 'DEF987654', + deliveryStatus: 2, + deliveryTime: new Date('2023-08-18T10:30:00'), + receiveTime: new Date('2023-08-19T11:30:00'), + receiverName: 'Sarah Johnson', + receiverMobile: '555-123-4567', + receiverAreaId: 4003, + receiverPostCode: 67890, + receiverDetailAddress: '789 Oak Ave', + afterSaleStatus: 0, + refundPrice: 0, + couponId: 2001, + couponPrice: 5, + pointPrice: 0, + receiverAreaName: 'Villageville', + items: [ + { + id: 105, + userId: 1003, + orderId: 3, + spuId: 5005, + spuName: 'Widget E', + skuId: 6005, + picUrl: 'https://example.com/images/widget_e.jpg', + count: 1, + originalPrice: 20, + originalUnitPrice: 20, + discountPrice: 5, + payPrice: 15, + orderPartPrice: 15, + orderDividePrice: 15, + afterSaleStatus: 0, + properties: [ + { propertyId: 7001, propertyName: 'Color', valueId: 8006, valueName: 'Black' }, + { propertyId: 7002, propertyName: 'Size', valueId: 8002, valueName: 'Medium' } + ] + } + ], + user: { + id: 1003, + nickname: 'sarahjohnson', + avatar: 'https://example.com/images/avatar.jpg' + } + } +] diff --git a/src/views/mall/trade/order/tradeOrderDetail.vue b/src/views/mall/trade/order/tradeOrderDetail.vue deleted file mode 100644 index 1e61f799..00000000 --- a/src/views/mall/trade/order/tradeOrderDetail.vue +++ /dev/null @@ -1,365 +0,0 @@ - - -