diff --git a/src/api/mall/product/comment.ts b/src/api/mall/product/comment.ts new file mode 100644 index 00000000..defdbb93 --- /dev/null +++ b/src/api/mall/product/comment.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface CommentVO { + id: number + userId: number + userNickname: string + userAvatar: string + anonymous: boolean + orderId: number + orderItemId: number + spuId: number + spuName: string + skuId: number + visible: boolean + scores: number + descriptionScores: number + benefitScores: number + content: string + picUrls: string + replyStatus: boolean + replyUserId: number + replyContent: string + replyTime: Date +} + +// 查询商品评论列表 +export const getCommentPage = async (params) => { + return await request.get({ url: `/product/comment/page`, params }) +} + +// 查询商品评论详情 +export const getComment = async (id: number) => { + return await request.get({ url: `/product/comment/get?id=` + id }) +} + +// 添加自评 +export const createComment = async (data: CommentVO) => { + return await request.post({ url: `/product/comment/create`, data }) +} + +// 显示 / 隐藏评论 +export const updateCommentVisible = async (data: any) => { + return await request.put({ url: `/product/comment/update-visible`, data }) +} + +// 商家回复 +export const replyComment = async (data: any) => { + return await request.put({ url: `/product/comment/reply`, data }) +} diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 0ea324b8..2ad9bc60 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -9,18 +9,19 @@ export interface Property { export interface Sku { id?: number // 商品 SKU 编号 + name?: string // 商品 SKU 名称 spuId?: number // SPU 编号 properties?: Property[] // 属性数组 - price?: number // 商品价格 - marketPrice?: number // 市场价 - costPrice?: number // 成本价 + price?: number | string // 商品价格 + marketPrice?: number | string // 市场价 + costPrice?: number | string // 成本价 barCode?: string // 商品条码 picUrl?: string // 图片地址 stock?: number // 库存 weight?: number // 商品重量,单位:kg 千克 volume?: number // 商品体积,单位:m^3 平米 - subCommissionFirstPrice?: number // 一级分销的佣金 - subCommissionSecondPrice?: number // 二级分销的佣金 + subCommissionFirstPrice?: number | string // 一级分销的佣金 + subCommissionSecondPrice?: number | string // 二级分销的佣金 salesCount?: number // 商品销量 } diff --git a/src/api/mall/promotion/bargain/bargainActivity.ts b/src/api/mall/promotion/bargain/bargainActivity.ts index a23477d9..1e5d5f78 100644 --- a/src/api/mall/promotion/bargain/bargainActivity.ts +++ b/src/api/mall/promotion/bargain/bargainActivity.ts @@ -7,18 +7,20 @@ export interface BargainActivityVO { startTime?: Date endTime?: Date status?: number - spuId?: number userSize?: number // 达到该人数,才能砍到低价 bargainCount?: number // 最大帮砍次数 totalLimitCount?: number // 最大购买次数 - stock?: number // 活动总库存 + spuId: number + skuId: number + bargainFirstPrice: number // 砍价起始价格,单位分 + bargainPrice: number // 砍价底价 + stock: number // 活动库存 randomMinPrice?: number // 用户每次砍价的最小金额,单位:分 randomMaxPrice?: number // 用户每次砍价的最大金额,单位:分 successCount?: number // 砍价成功数量 - products?: BargainProductVO[] } -// 砍价活动所需属性 +// 砍价活动所需属性。选择的商品和属性的时候使用方便使用活动的通用封装 export interface BargainProductVO { spuId: number skuId: number diff --git a/src/api/mall/trade/delivery/express/index.ts b/src/api/mall/trade/delivery/express/index.ts index 95429a40..0070bcd6 100644 --- a/src/api/mall/trade/delivery/express/index.ts +++ b/src/api/mall/trade/delivery/express/index.ts @@ -19,6 +19,11 @@ export const getDeliveryExpress = async (id: number) => { return await request.get({ url: '/trade/delivery/express/get?id=' + id }) } +// 获得快递公司精简信息列表 +export const getSimpleDeliveryExpressList = () => { + return request.get({ url: '/trade/delivery/express/list-all-simple' }) +} + // 新增快递公司 export const createDeliveryExpress = async (data: DeliveryExpressVO) => { return await request.post({ url: '/trade/delivery/express/create', data }) diff --git a/src/api/mall/trade/delivery/pickUpStore/index.ts b/src/api/mall/trade/delivery/pickUpStore/index.ts index 90fb3d01..82ba66c4 100644 --- a/src/api/mall/trade/delivery/pickUpStore/index.ts +++ b/src/api/mall/trade/delivery/pickUpStore/index.ts @@ -16,7 +16,7 @@ export interface DeliveryPickUpStoreVO { } // 查询自提门店列表 -export const getDeliveryPickUpStorePage = async (params: DeliveryPickUpStorePageReqVO) => { +export const getDeliveryPickUpStorePage = async (params) => { return await request.get({ url: '/trade/delivery/pick-up-store/page', params }) } @@ -25,6 +25,11 @@ export const getDeliveryPickUpStore = async (id: number) => { return await request.get({ url: '/trade/delivery/pick-up-store/get?id=' + id }) } +// 查询自提门店精简列表 +export const getListAllSimple = async () => { + return await request.get({ url: '/trade/delivery/pick-up-store/list-all-simple' }) +} + // 新增自提门店 export const createDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => { return await request.post({ url: '/trade/delivery/pick-up-store/create', data }) @@ -39,8 +44,3 @@ export const updateDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => export const deleteDeliveryPickUpStore = async (id: number) => { return await request.delete({ url: '/trade/delivery/pick-up-store/delete?id=' + id }) } - -// 导出自提门店 Excel -export const exportDeliveryPickUpStoreApi = async (params) => { - return await request.download({ url: '/trade/delivery/pick-up-store/export-excel', params }) -} diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index 9d0fab2e..9413b73c 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -1,12 +1,121 @@ -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 | null // 订单编号 + no?: string // 订单流水号 + createTime?: Date | null // 下单时间 + type?: number | null // 订单类型 + terminal?: number | null // 订单来源 + userId?: number | null // 用户编号 + userIp?: string // 用户 IP + userRemark?: string // 用户备注 + status?: number | null // 订单状态 + productCount?: number | null // 购买的商品数量 + finishTime?: Date | null // 订单完成时间 + cancelTime?: Date | null // 订单取消时间 + cancelType?: number | null // 取消类型 + remark?: string // 商家备注 + payOrderId: number | null // 支付订单编号 + payed?: boolean // 是否已支付 + payTime?: Date | null // 付款时间 + payChannelCode?: string // 支付渠道 + originalPrice?: number | null // 商品原价(总) + orderPrice?: number | null // 订单原价(总) + discountPrice?: number | null // 订单优惠(总) + deliveryPrice?: number | null // 运费金额 + adjustPrice?: number | null // 订单调价(总) + payPrice?: number | null // 应付金额(总) + deliveryType?: number | null // 发货方式 + deliveryTemplateId?: number | null // 配送模板编号 + logisticsId?: number | null | null // 发货物流公司编号 + logisticsNo?: string // 发货物流单号 + deliveryStatus?: number | null // 发货状态 + deliveryTime?: Date | null // 发货时间 + receiveTime?: Date | null // 收货时间 + receiverName?: string // 收件人名称 + receiverMobile?: string // 收件人手机 + receiverAreaId?: number | null // 收件人地区编号 + receiverPostCode?: number | null // 收件人邮编 + receiverDetailAddress?: string // 收件人详细地址 + afterSaleStatus?: number | null // 售后状态 + refundPrice?: number | null // 退款金额 + couponId?: number | null // 优惠劵编号 + couponPrice?: number | null // 优惠劵减免金额 + pointPrice?: number | null // 积分抵扣的金额 + receiverAreaName?: string //收件人地区名字 + items?: OrderItemRespVO[] // 订单项列表 + //用户信息 + user?: { + id?: number | null + nickname?: string + avatar?: string + } +} + +export interface OrderItemRespVO { + // ========== 订单项基本信息 ========== + id?: number | null // 编号 + userId?: number | null // 用户编号 + orderId?: number | null // 订单编号 + // ========== 商品基本信息 ========== + spuId?: number | null // 商品 SPU 编号 + spuName?: string //商品 SPU 名称 + skuId?: number | null // 商品 SKU 编号 + picUrl?: string //商品图片 + count?: number | null //购买数量 + // ========== 价格 + 支付基本信息 ========== + originalPrice?: number | null //商品原价(总) + originalUnitPrice?: number | null //商品原价(单) + discountPrice?: number | null //商品优惠(总) + payPrice?: number | null //商品实付金额(总) + orderPartPrice?: number | null //子订单分摊金额(总) + orderDividePrice?: number | null //分摊后子订单实付金额(总) + // ========== 营销基本信息 ========== + // TODO 芋艿:在捉摸一下 + // ========== 售后基本信息 ========== + afterSaleStatus?: number | null // 售后状态 + properties?: ProductPropertiesVO[] //属性数组 +} + +export interface ProductPropertiesVO { + propertyId?: number | null // 属性的编号 + propertyName?: string // 属性的名称 + valueId?: number | null //属性值的编号 + valueName?: string // 属性值的名称 +} + +// 查询交易订单列表 +export const getOrderPage = async (params) => { + return await request.get({ url: `/trade/order/page`, params }) +} + +// 查询交易订单详情 +export const getOrder = async (id: number | null) => { + return await request.get({ url: `/trade/order/get-detail?id=` + id }) +} + +export interface DeliveryVO { + id: number // 订单编号 + logisticsId: number | null // 物流公司编号 + logisticsNo: string // 物流编号 +} + +// 订单发货 +export const delivery = async (data: DeliveryVO) => { + return await request.put({ url: `/trade/order/delivery`, data }) +} + +// 订单备注 +export const updateRemark = async (data: any) => { + return await request.put({ url: `/trade/order/update-remark`, data }) +} + +// 订单调价 +export const updatePrice = async (data: any) => { + return await request.put({ url: `/trade/order/update-price`, data }) +} + +// 修改订单地址 +export const updateAddress = async (data: any) => { + return await request.put({ url: `/trade/order/update-address`, data }) +} 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/api/member/address/index.ts b/src/api/member/address/index.ts new file mode 100644 index 00000000..a914f979 --- /dev/null +++ b/src/api/member/address/index.ts @@ -0,0 +1,15 @@ +import request from '@/config/axios' + +export interface AddressVO { + id: number + name: string + mobile: string + areaId: number + detailAddress: string + defaultStatus: boolean +} + +// 查询用户收件地址列表 +export const getAddressList = async (params) => { + return await request.get({ url: `/member/address/list`, params }) +} diff --git a/src/api/member/group/index.ts b/src/api/member/group/index.ts new file mode 100644 index 00000000..df3054e2 --- /dev/null +++ b/src/api/member/group/index.ts @@ -0,0 +1,38 @@ +import request from '@/config/axios' + +export interface GroupVO { + id: number + name: string + remark: string + status: number +} + +// 查询用户分组列表 +export const getGroupPage = async (params: any) => { + return await request.get({ url: `/member/group/page`, params }) +} + +// 查询用户分组详情 +export const getGroup = async (id: number) => { + return await request.get({ url: `/member/group/get?id=` + id }) +} + +// 新增用户分组 +export const createGroup = async (data: GroupVO) => { + return await request.post({ url: `/member/group/create`, data }) +} + +// 查询用户分组 - 精简信息列表 +export const getSimpleGroupList = async () => { + return await request.get({ url: `/member/group/list-all-simple` }) +} + +// 修改用户分组 +export const updateGroup = async (data: GroupVO) => { + return await request.put({ url: `/member/group/update`, data }) +} + +// 删除用户分组 +export const deleteGroup = async (id: number) => { + return await request.delete({ url: `/member/group/delete?id=` + id }) +} diff --git a/src/api/member/level/index.ts b/src/api/member/level/index.ts new file mode 100644 index 00000000..0ded493a --- /dev/null +++ b/src/api/member/level/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface LevelVO { + id: number + name: string + experience: number + value: number + discountPercent: number + icon: string + bgUrl: string + status: number +} + +// 查询会员等级列表 +export const getLevelList = async (params) => { + return await request.get({ url: `/member/level/list`, params }) +} + +// 查询会员等级详情 +export const getLevel = async (id: number) => { + return await request.get({ url: `/member/level/get?id=` + id }) +} + +// 查询会员等级 - 精简信息列表 +export const getSimpleLevelList = async () => { + return await request.get({ url: `/member/level/list-all-simple` }) +} + +// 新增会员等级 +export const createLevel = async (data: LevelVO) => { + return await request.post({ url: `/member/level/create`, data }) +} + +// 修改会员等级 +export const updateLevel = async (data: LevelVO) => { + return await request.put({ url: `/member/level/update`, data }) +} + +// 删除会员等级 +export const deleteLevel = async (id: number) => { + return await request.delete({ url: `/member/level/delete?id=` + id }) +} diff --git a/src/api/member/point/record/index.ts b/src/api/member/point/record/index.ts index 869421f1..f47ae467 100644 --- a/src/api/member/point/record/index.ts +++ b/src/api/member/point/record/index.ts @@ -8,20 +8,9 @@ export interface RecordVO { description: string point: number totalPoint: number - status: number userId: number - freezingTime: Date - thawingTime: Date createDate: Date } -export interface RecordQueryVO { - bizType: string | null | undefined - title: string | null | undefined - pageNo: number - pageSize: number - userId: number | null | undefined - createDate: string[] -} // 查询用户积分记录列表 export const getRecordPage = async (params) => { diff --git a/src/api/member/signin/config/index.ts b/src/api/member/signin/config/index.ts index 833c2e16..558bdc70 100644 --- a/src/api/member/signin/config/index.ts +++ b/src/api/member/signin/config/index.ts @@ -9,25 +9,25 @@ export interface SignInConfigVO { // 查询积分签到规则列表 export const getSignInConfigList = async () => { - return await request.get({ url: `/member/point/sign-in-config/list` }) + return await request.get({ url: `/member/sign-in/config/list` }) } // 查询积分签到规则详情 export const getSignInConfig = async (id: number) => { - return await request.get({ url: `/member/point/sign-in-config/get?id=` + id }) + return await request.get({ url: `/member/sign-in/config/get?id=` + id }) } // 新增积分签到规则 export const createSignInConfig = async (data: SignInConfigVO) => { - return await request.post({ url: `/member/point/sign-in-config/create`, data }) + return await request.post({ url: `/member/sign-in/config/create`, data }) } // 修改积分签到规则 export const updateSignInConfig = async (data: SignInConfigVO) => { - return await request.put({ url: `/member/point/sign-in-config/update`, data }) + return await request.put({ url: `/member/sign-in/config/update`, data }) } // 删除积分签到规则 export const deleteSignInConfig = async (id: number) => { - return await request.delete({ url: `/member/point/sign-in-config/delete?id=` + id }) + return await request.delete({ url: `/member/sign-in/config/delete?id=` + id }) } diff --git a/src/api/member/signin/record/index.ts b/src/api/member/signin/record/index.ts index 509bcc8d..7d137029 100644 --- a/src/api/member/signin/record/index.ts +++ b/src/api/member/signin/record/index.ts @@ -6,17 +6,8 @@ export interface SignInRecordVO { day: number point: number } -export interface SignInRecordQueryVO { - pageNo: number - pageSize: number - userId?: number - nickname: number | undefined | null - day?: number | null | undefined - point?: number | null | undefined - createTime: string[] | null | undefined -} // 查询用户签到积分列表 export const getSignInRecordPage = async (params) => { - return await request.get({ url: `/member/point/sign-in-record/page`, params }) + return await request.get({ url: `/member/sign-in/record/page`, params }) } diff --git a/src/api/member/tag/index.ts b/src/api/member/tag/index.ts index 04d0536c..7ff6e9bf 100644 --- a/src/api/member/tag/index.ts +++ b/src/api/member/tag/index.ts @@ -6,7 +6,7 @@ export interface TagVO { } // 查询会员标签列表 -export const getMemberTagPage = async (params) => { +export const getMemberTagPage = async (params: any) => { return await request.get({ url: `/member/tag/page`, params }) } @@ -15,6 +15,11 @@ export const getMemberTag = async (id: number) => { return await request.get({ url: `/member/tag/get?id=` + id }) } +// 查询会员标签 - 精简信息列表 +export const getSimpleTagList = async () => { + return await request.get({ url: `/member/tag/list-all-simple` }) +} + // 新增会员标签 export const createMemberTag = async (data: TagVO) => { return await request.post({ url: `/member/tag/create`, data }) diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts index e9315370..4d60988c 100644 --- a/src/api/member/user/index.ts +++ b/src/api/member/user/index.ts @@ -2,38 +2,26 @@ import request from '@/config/axios' export interface UserVO { id: number - mobile: string - password: string - status: number - registerIp: string + avatar: string | undefined + birthday: number | undefined + createTime: number | undefined + loginDate: number | undefined loginIp: string - loginDate: Date - nickname: string - avatar: string - name: string - sex: number - areaId: number - birthday: Date mark: string - createTime: Date -} -export interface UserBaseInfoVO { - id: number | undefined | null mobile: string - password: string | null | undefined - status: number - registerIp: string | null | undefined - loginIp: string | null | undefined - loginDate: Date | null | undefined - nickname: string | null | undefined - avatar: string | null | undefined - name: string | null | undefined + name: string | undefined + nickname: string | undefined + registerIp: string sex: number - areaId: number | null | undefined - birthday: Date | null | undefined - mark: string | null | undefined - createTime: Date | null | undefined + status: number + areaId: number | undefined + areaName: string | undefined + levelName: string | null + point: number | undefined | null + totalPoint: number | undefined | null + experience: number | null | undefined } + // 查询会员用户列表 export const getUserPage = async (params) => { return await request.get({ url: `/member/user/page`, params }) @@ -48,3 +36,8 @@ export const getUser = async (id: number) => { export const updateUser = async (data: UserVO) => { return await request.put({ url: `/member/user/update`, data }) } + +// 修改会员用户等级 +export const updateUserLevel = async (data: any) => { + return await request.put({ url: `/member/user/update-level`, data }) +} diff --git a/src/assets/svgs/member_balance.svg b/src/assets/svgs/member_balance.svg new file mode 100644 index 00000000..5395b236 --- /dev/null +++ b/src/assets/svgs/member_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_expenditure_balance.svg b/src/assets/svgs/member_expenditure_balance.svg new file mode 100644 index 00000000..02d498cd --- /dev/null +++ b/src/assets/svgs/member_expenditure_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_level.svg b/src/assets/svgs/member_level.svg new file mode 100644 index 00000000..cbcc686d --- /dev/null +++ b/src/assets/svgs/member_level.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_point.svg b/src/assets/svgs/member_point.svg new file mode 100644 index 00000000..b849ddb4 --- /dev/null +++ b/src/assets/svgs/member_point.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svgs/member_recharge_balance.svg b/src/assets/svgs/member_recharge_balance.svg new file mode 100644 index 00000000..7519bb23 --- /dev/null +++ b/src/assets/svgs/member_recharge_balance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Card/index.ts b/src/components/Card/index.ts new file mode 100644 index 00000000..f4c0d86c --- /dev/null +++ b/src/components/Card/index.ts @@ -0,0 +1,3 @@ +import CardTitle from './src/CardTitle.vue' + +export { CardTitle } diff --git a/src/views/member/user/components/card-title.vue b/src/components/Card/src/CardTitle.vue similarity index 94% rename from src/views/member/user/components/card-title.vue rename to src/components/Card/src/CardTitle.vue index 4bd3ee93..041c116a 100644 --- a/src/views/member/user/components/card-title.vue +++ b/src/components/Card/src/CardTitle.vue @@ -1,8 +1,8 @@ + + + + diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 81f74d55..87ffd1e5 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -5,32 +5,32 @@ const { t } = useI18n() * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 * name:'router-name' 设定路由的名字,一定要填写不然使用时会出现各种问题 * meta : { - hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false) + hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false) - alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式, - 只有一个时,会将那个子路由当做根路由显示在侧边栏, - 若你想不管路由下面的 children 声明的个数都显示你的根路由, - 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则, - 一直显示根路由(默认 false) + alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式, + 只有一个时,会将那个子路由当做根路由显示在侧边栏, + 若你想不管路由下面的 children 声明的个数都显示你的根路由, + 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则, + 一直显示根路由(默认 false) - title: 'title' 设置该路由在侧边栏和面包屑中展示的名字 + title: 'title' 设置该路由在侧边栏和面包屑中展示的名字 - icon: 'svg-name' 设置该路由的图标 + icon: 'svg-name' 设置该路由的图标 - noCache: true 如果设置为true,则不会被 缓存(默认 false) + noCache: true 如果设置为true,则不会被 缓存(默认 false) - breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true) + breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true) - affix: true 如果设置为true,则会一直固定在tag项中(默认 false) + affix: true 如果设置为true,则会一直固定在tag项中(默认 false) - noTagsView: true 如果设置为true,则不会出现在tag中(默认 false) + noTagsView: true 如果设置为true,则不会出现在tag中(默认 false) - activeMenu: '/dashboard' 显示高亮的路由路径 + activeMenu: '/dashboard' 显示高亮的路由路径 - followAuth: '/dashboard' 跟随哪个路由进行权限过滤 + followAuth: '/dashboard' 跟随哪个路由进行权限过滤 - canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false) - } + canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false) + } **/ const remainingRouter: AppRouteRecordRaw[] = [ { @@ -346,22 +346,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, - { - path: '/property', - component: Layout, - name: 'property', - meta: { - hidden: true - }, - children: [ - { - path: 'value/:propertyId(\\d+)', - component: () => import('@/views/mall/product/property/value/index.vue'), - name: 'ProductPropertyValue', - meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } - } - ] - }, { path: '/product', component: Layout, @@ -408,6 +392,53 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '商品详情', activeMenu: '/product/product-spu' } + }, + { + path: 'property/value/:propertyId(\\d+)', + component: () => import('@/views/mall/product/property/value/index.vue'), + name: 'ProductPropertyValue', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:view', + title: '商品属性值', + activeMenu: '/product/property' + } + } + ] + }, + { + path: '/trade/order', + component: Layout, + name: 'Detail', + meta: { + hidden: true + }, + children: [ + { + path: 'detail/:orderId(\\d+)', + component: () => import('@/views/mall/trade/order/detail/index.vue'), + name: 'TradeOrderDetailForm', + meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' } + } + ] + }, + { + path: '/member', + component: Layout, + name: 'member', + meta: { hidden: true }, + children: [ + { + path: 'user/detail/:id', + name: 'MemberUserDetail', + meta: { + title: '会员详情', + noCache: true, + hidden: true + }, + component: () => import('@/views/member/user/detail/index.vue') } ] }, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 52045c9a..6b163628 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -90,6 +90,7 @@ export enum DICT_TYPE { USER_TYPE = 'user_type', COMMON_STATUS = 'common_status', SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id', + TERMINAL = 'terminal', // 终端 // ========== SYSTEM 模块 ========== SYSTEM_USER_SEX = 'system_user_sex', @@ -130,7 +131,7 @@ export enum DICT_TYPE { BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type', // ========== PAY 模块 ========== - PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型 + PAY_CHANNEL_CODE = 'pay_channel_code_type', // 支付渠道编码类型 PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态 PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态 PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态 @@ -155,7 +156,7 @@ export enum DICT_TYPE { TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型 TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态 TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态 - TERMINAL = 'terminal', // 终端 + TRADE_DELIVERY_TYPE = 'trade_delivery_type', // 配送方式 // ========== MALL - 营销模块 ========== PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型 diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 5e5c854d..87409260 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -11,7 +11,7 @@ import dayjs from 'dayjs' * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ" * @returns 返回拼接后的时间字符串 */ -export function formatDate(date: Date, format?: string): string { +export function formatDate(date: Date | number, format?: string): string { // 日期不存在,则返回空 if (!date) { return '' diff --git a/src/utils/index.ts b/src/utils/index.ts index 3d596a36..c73b8d2f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -174,7 +174,6 @@ export const copyValueToTarget = (target, source) => { Object.assign(target, newObj) } -// TODO @puhui999:返回要带上 .00 哈.例如说 1.00 /** * 将一个整数转换为分数保留两位小数 * @param num @@ -185,6 +184,31 @@ export const formatToFraction = (num: number | string | undefined): number => { return parseFloat((parsedNumber / 100).toFixed(2)) } +/** + * 将一个数转换为 1.00 这样 + * 数据呈现的时候使用 + * + * @param num 整数 + */ +export const floatToFixed2 = (num: number | string | undefined): string => { + let str = '0.00' + if (typeof num === 'undefined') { + return str + } + const f = formatToFraction(num) + const decimalPart = f.toString().split('.')[1] + const len = decimalPart ? decimalPart.length : 0 + switch (len) { + case 0: + str = f.toString() + '.00' + break + case 1: + str = f.toString() + '0' + break + } + return str +} + /** * 将一个分数转换为整数 * @param num diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 82dbe3fc..ffadf8b5 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" /> diff --git a/src/views/infra/codegen/PreviewCode.vue b/src/views/infra/codegen/PreviewCode.vue index 16e63847..f95febaf 100644 --- a/src/views/infra/codegen/PreviewCode.vue +++ b/src/views/infra/codegen/PreviewCode.vue @@ -45,9 +45,9 @@ {{ t('common.copy') }} -
+
-
+ diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue new file mode 100644 index 00000000..77557437 --- /dev/null +++ b/src/views/mall/product/comment/CommentForm.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/views/mall/product/comment/ReplyForm.vue b/src/views/mall/product/comment/ReplyForm.vue new file mode 100644 index 00000000..4c8bd4d5 --- /dev/null +++ b/src/views/mall/product/comment/ReplyForm.vue @@ -0,0 +1,76 @@ + + + diff --git a/src/views/mall/product/comment/index.vue b/src/views/mall/product/comment/index.vue new file mode 100644 index 00000000..1b0745ba --- /dev/null +++ b/src/views/mall/product/comment/index.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/views/mall/product/property/index.vue b/src/views/mall/product/property/index.vue index 00597dc3..042bc980 100644 --- a/src/views/mall/product/property/index.vue +++ b/src/views/mall/product/property/index.vue @@ -73,9 +73,7 @@ > 编辑 - - 属性值 - + 属性值 { } catch {} } +/** 跳转商品属性列表 */ +const goValueList = (id: number) => { + push({ path: '/product/property/value/' + id }) +} + /** 初始化 **/ onMounted(() => { getList() diff --git a/src/views/mall/product/spu/addForm.vue b/src/views/mall/product/spu/addForm.vue index b577ece9..910bad4a 100644 --- a/src/views/mall/product/spu/addForm.vue +++ b/src/views/mall/product/spu/addForm.vue @@ -42,7 +42,9 @@ import { useTagsViewStore } from '@/store/modules/tagsView' import { BasicInfoForm, DescriptionForm, OtherSettingsForm } from './components' // 业务api import * as ProductSpuApi from '@/api/mall/product/spu' -import { convertToInteger, formatToFraction } from '@/utils' +import { convertToInteger, floatToFixed2, formatToFraction } from '@/utils' + +// TODO @芋艿:后续稍微调整下; defineOptions({ name: 'ProductSpuForm' }) @@ -107,12 +109,20 @@ const getDetail = async () => { try { const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.Spu res.skus?.forEach((item) => { - // 回显价格分转元 - item.price = formatToFraction(item.price) - item.marketPrice = formatToFraction(item.marketPrice) - item.costPrice = formatToFraction(item.costPrice) - item.subCommissionFirstPrice = formatToFraction(item.subCommissionFirstPrice) - item.subCommissionSecondPrice = formatToFraction(item.subCommissionSecondPrice) + if (isDetail.value === true) { + item.price = floatToFixed2(item.price) + item.marketPrice = floatToFixed2(item.marketPrice) + item.costPrice = floatToFixed2(item.costPrice) + item.subCommissionFirstPrice = floatToFixed2(item.subCommissionFirstPrice) + item.subCommissionSecondPrice = floatToFixed2(item.subCommissionSecondPrice) + } else { + // 回显价格分转元 + item.price = formatToFraction(item.price) + item.marketPrice = formatToFraction(item.marketPrice) + item.costPrice = formatToFraction(item.costPrice) + item.subCommissionFirstPrice = formatToFraction(item.subCommissionFirstPrice) + item.subCommissionSecondPrice = formatToFraction(item.subCommissionSecondPrice) + } }) formData.value = res } finally { @@ -132,19 +142,19 @@ const submitForm = async () => { await unref(descriptionRef)?.validate() await unref(otherSettingsRef)?.validate() // 深拷贝一份, 这样最终 server 端不满足,不需要恢复, - const deepCopyFormData = cloneDeep(unref(formData.value)) + const deepCopyFormData = cloneDeep(unref(formData.value)) as ProductSpuApi.Spu // 兜底处理 sku 空数据 formData.value.skus!.forEach((sku) => { // 因为是空数据这里判断一下商品条码是否为空就行 if (sku.barCode === '') { - const index = deepCopyFormData.skus.findIndex( + const index = deepCopyFormData.skus!.findIndex( (item) => JSON.stringify(item.properties) === JSON.stringify(sku.properties) ) // 删除这条 sku - deepCopyFormData.skus.splice(index, 1) + deepCopyFormData.skus!.splice(index, 1) } }) - deepCopyFormData.skus.forEach((item) => { + deepCopyFormData.skus!.forEach((item) => { // 给sku name赋值 item.name = deepCopyFormData.name // sku相关价格元转分 @@ -156,7 +166,7 @@ const submitForm = async () => { }) // 处理轮播图列表 const newSliderPicUrls: any[] = [] - deepCopyFormData.sliderPicUrls.forEach((item: any) => { + deepCopyFormData.sliderPicUrls!.forEach((item: any) => { // 如果是前端选的图 typeof item === 'object' ? newSliderPicUrls.push(item.url) : newSliderPicUrls.push(item) }) diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 7fbb9011..1cc70298 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -334,7 +334,7 @@ const validateSku = () => { for (const sku of formData.value!.skus!) { // 作为活动组件的校验 if (props.isActivityComponent) { - for (const rule of props.ruleConfig) { + for (const rule of props?.ruleConfig) { const arg = getValue(sku, rule.name) if (!rule.rule(arg)) { validate = false // 只要有一个不通过则直接不通过 @@ -534,9 +534,10 @@ watch( } ) const activitySkuListRef = ref>() -const clearSelection = () => { - activitySkuListRef.value.clearSelection() + +const getSkuTableRef = () => { + return activitySkuListRef.value } // 暴露出生成 sku 方法,给添加属性成功时调用 -defineExpose({ generateTableData, validateSku, clearSelection }) +defineExpose({ generateTableData, validateSku, getSkuTableRef }) diff --git a/src/views/mall/product/spu/components/SkuTableSelect.vue b/src/views/mall/product/spu/components/SkuTableSelect.vue new file mode 100644 index 00000000..8bbc50cf --- /dev/null +++ b/src/views/mall/product/spu/components/SkuTableSelect.vue @@ -0,0 +1,94 @@ + + + diff --git a/src/views/mall/product/spu/components/SpuTableSelect.vue b/src/views/mall/product/spu/components/SpuTableSelect.vue new file mode 100644 index 00000000..f8560aa3 --- /dev/null +++ b/src/views/mall/product/spu/components/SpuTableSelect.vue @@ -0,0 +1,167 @@ + + + diff --git a/src/views/mall/product/spu/components/index.ts b/src/views/mall/product/spu/components/index.ts index 1160dbd1..405dfde5 100644 --- a/src/views/mall/product/spu/components/index.ts +++ b/src/views/mall/product/spu/components/index.ts @@ -7,7 +7,6 @@ import SkuList from './SkuList.vue' import { Spu } from '@/api/mall/product/spu' -// TODO @puhui999:Properties 改成 Property 更合适?Property 在 Spu 中已存在避免冲突 PropertyAndValues interface PropertyAndValues { id: number name: string diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index 75bd02e0..9ea06cd5 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -80,7 +80,7 @@