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..e99b1338 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.post({ url: `/trade/order/delivery`, data }) +} + +// 订单备注 +export const remark = async (data) => { + return await request.post({ url: `/trade/order/remark`, data }) +} + +// 订单调价 +export const adjustPrice = async (data) => { + return await request.post({ url: `/trade/order/adjust-price`, data }) +} + +// 修改订单地址 +export const adjustAddress = async (data) => { + return await request.post({ url: `/trade/order/adjust-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/level/index.ts b/src/api/member/level/index.ts index 376246b8..0ded493a 100644 --- a/src/api/member/level/index.ts +++ b/src/api/member/level/index.ts @@ -5,7 +5,7 @@ export interface LevelVO { name: string experience: number value: number - discount: number + discountPercent: number icon: string bgUrl: string status: number diff --git a/src/api/point/config/index.ts b/src/api/member/point/config/index.ts similarity index 100% rename from src/api/point/config/index.ts rename to src/api/member/point/config/index.ts diff --git a/src/api/point/record/index.ts b/src/api/member/point/record/index.ts similarity index 86% rename from src/api/point/record/index.ts rename to src/api/member/point/record/index.ts index 1c60f754..f47ae467 100644 --- a/src/api/point/record/index.ts +++ b/src/api/member/point/record/index.ts @@ -8,10 +8,7 @@ export interface RecordVO { description: string point: number totalPoint: number - status: number userId: number - freezingTime: Date - thawingTime: Date createDate: Date } diff --git a/src/api/point/signInConfig/index.ts b/src/api/member/signin/config/index.ts similarity index 55% rename from src/api/point/signInConfig/index.ts rename to src/api/member/signin/config/index.ts index 246270ec..558bdc70 100644 --- a/src/api/point/signInConfig/index.ts +++ b/src/api/member/signin/config/index.ts @@ -8,26 +8,26 @@ export interface SignInConfigVO { } // 查询积分签到规则列表 -export const getSignInConfigPage = async () => { - return await request.get({ url: `/member/point/sign-in-config/list` }) +export const getSignInConfigList = async () => { + 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 new file mode 100644 index 00000000..7d137029 --- /dev/null +++ b/src/api/member/signin/record/index.ts @@ -0,0 +1,13 @@ +import request from '@/config/axios' + +export interface SignInRecordVO { + id: number + userId: number + day: number + point: number +} + +// 查询用户签到积分列表 +export const getSignInRecordPage = async (params) => { + return await request.get({ url: `/member/sign-in/record/page`, params }) +} diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts index 2a6b6ccf..3a789e9f 100644 --- a/src/api/member/user/index.ts +++ b/src/api/member/user/index.ts @@ -18,6 +18,25 @@ export interface UserVO { createTime: Date } +// TODO @梦:和 UserVO 搞成一个把。 +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 + sex: number + areaId: number | null | undefined + birthday: Date | null | undefined + mark: string | null | undefined + createTime: Date | null | undefined +} + // 查询会员用户列表 export const getUserPage = async (params) => { return await request.get({ url: `/member/user/page`, params }) diff --git a/src/api/point/signInRecord/index.ts b/src/api/point/signInRecord/index.ts deleted file mode 100644 index 909449f6..00000000 --- a/src/api/point/signInRecord/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import request from '@/config/axios' - -export interface SignInRecordVO { - id: number - userId: number - day: number - point: number -} - -// 查询用户签到积分列表 -export const getSignInRecordPage = async (params) => { - return await request.get({ url: `/member/point/sign-in-record/page`, params }) -} - -// 导出用户签到积分 Excel -export const exportSignInRecord = async (params) => { - return await request.download({ url: `/member/point/sign-in-record/export-excel`, params }) -} diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 3a4635f0..1a4741b6 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -31,7 +31,7 @@ let requestList: any[] = [] // 是否正在刷新中 let isRefreshToken = false // 请求白名单,无须token的接口 -const whiteList: string[] = ['/login', '/refresh-token', '/system/tenant/get-id-by-name'] +const whiteList: string[] = ['/login', '/refresh-token'] // 创建axios实例 const service: AxiosInstance = axios.create({ @@ -47,7 +47,8 @@ service.interceptors.request.use( let isToken = (config!.headers || {}).isToken === false whiteList.some((v) => { if (config.url) { - return (isToken = config.url.indexOf(v) > -1) + config.url.indexOf(v) > -1 + return (isToken = false) } }) if (getAccessToken() && !isToken) { diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 81f74d55..2d8e2b44 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[] = [ { @@ -347,9 +347,9 @@ const remainingRouter: AppRouteRecordRaw[] = [ ] }, { - path: '/property', + path: '/property', // TODO @puhui999:这里的 path 有问题,应该是 /product/property component: Layout, - name: 'property', + name: 'Property', meta: { hidden: true }, @@ -411,6 +411,40 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, + { + path: '/trade/order', + component: Layout, + name: 'Detail', + meta: { + hidden: true + }, + children: [ + { + path: 'detail/:orderId(\\d+)', + component: () => import('@/views/mall/trade/order/components/OrderDetailForm.vue'), + name: 'TradeOrderDetailForm', + meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' } + } + ] + }, + { + path: '/member', + component: Layout, + name: 'member', + meta: { hidden: true }, + children: [ + { + path: 'user/detail', + name: 'MemberUserDetail', + meta: { + title: '会员详情', + noCache: true, + hidden: true + }, + component: () => import('@/views/member/user/detail/index.vue') + } + ] + }, { path: '/pay', component: Layout, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 6ca48716..9ec2e994 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', @@ -142,7 +143,6 @@ export enum DICT_TYPE { // ========== MALL - 会员模块 ========== MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型 - MEMBER_POINT_STATUS = 'member_point_status', // 积分的状态 // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 @@ -156,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/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 190c5aa1..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" /> @@ -148,8 +148,6 @@ 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 { useIcon } from '@/hooks/web/useIcon' import * as authUtil from '@/utils/auth' @@ -246,7 +244,6 @@ const handleLogin = async (params) => { if (!res) { return } - wsCache.delete(CACHE_KEY.USER) // 清除上次登录用户信息 ElLoading.service({ lock: true, text: '正在加载系统中...', diff --git a/src/views/Profile/components/BasicInfo.vue b/src/views/Profile/components/BasicInfo.vue index 89c0cfbe..e2189b15 100644 --- a/src/views/Profile/components/BasicInfo.vue +++ b/src/views/Profile/components/BasicInfo.vue @@ -1,5 +1,5 @@ diff --git a/src/views/mall/promotion/bargain/activity/BargainActivityForm.vue b/src/views/mall/promotion/bargain/activity/BargainActivityForm.vue index 5384d6a1..bef1e994 100644 --- a/src/views/mall/promotion/bargain/activity/BargainActivityForm.vue +++ b/src/views/mall/promotion/bargain/activity/BargainActivityForm.vue @@ -51,7 +51,7 @@ 取 消 - + diff --git a/src/views/mall/promotion/components/SpuSelect.vue b/src/views/mall/promotion/components/SpuSelect.vue index c62e419c..166cf5ff 100644 --- a/src/views/mall/promotion/components/SpuSelect.vue +++ b/src/views/mall/promotion/components/SpuSelect.vue @@ -127,7 +127,8 @@ defineOptions({ name: 'PromotionSpuSelect' }) const props = defineProps({ // 默认不需要(不需要的情况下只返回 spu,需要的情况下返回 选中的 spu 和 sku 列表) // 其它活动需要选择商品和商品属性导入此组件即可,需添加组件属性 :isSelectSku='true' - isSelectSku: propTypes.bool.def(false) // 是否需要选择 sku 属性 + isSelectSku: propTypes.bool.def(false), // 是否需要选择 sku 属性 + radio: propTypes.bool.def(false) // 是否单选 sku }) const message = useMessage() // 消息弹窗 @@ -146,7 +147,7 @@ const queryParams = ref({ }) // 查询参数 const propertyList = ref([]) // 商品属性列表 const spuListRef = ref>() -const skuListRef = ref() // 商品属性选择 Ref +const skuListRef = ref>() // 商品属性选择 Ref const spuData = ref() // 商品详情 const isExpand = ref(false) // 控制 SKU 列表显示 const expandRowKeys = ref() // 控制展开行需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。 @@ -155,12 +156,30 @@ const expandRowKeys = ref() // 控制展开行需要设置 row-key 属 const selectedSpuId = ref(0) // 选中的商品 spuId const selectedSkuIds = ref([]) // 选中的商品 skuIds const selectSku = (val: ProductSpuApi.Sku[]) => { + const skuTable = skuListRef.value?.getSkuTableRef() if (selectedSpuId.value === 0) { message.warning('请先选择商品再选择相应的规格!!!') - skuListRef.value.clearSelection() + skuTable?.clearSelection() return } - selectedSkuIds.value = val.map((sku) => sku.id!) + if (val.length === 0) { + selectedSkuIds.value = [] + return + } + if (props.radio) { + // 只选择一个 + selectedSkuIds.value = [val.map((sku) => sku.id!)[0]] + // 如果大于1个 + if (val.length > 1) { + // 清空选择 + skuTable?.clearSelection() + // 变更为最后一次选择的 + skuTable?.toggleRowSelection(val.pop(), true) + return + } + } else { + selectedSkuIds.value = val.map((sku) => sku.id!) + } } const selectSpu = (val: ProductSpuApi.Spu[]) => { if (val.length === 0) { @@ -176,9 +195,9 @@ const selectSpu = (val: ProductSpuApi.Spu[]) => { // 如果大于1个 if (val.length > 1) { // 清空选择 - spuListRef.value.clearSelection() + spuListRef.value?.clearSelection() // 变更为最后一次选择的 - spuListRef.value.toggleRowSelection(val.pop(), true) + spuListRef.value?.toggleRowSelection(val.pop(), true) return } expandChange(val[0], val) @@ -194,7 +213,7 @@ const expandChange = async (row: ProductSpuApi.Spu, expandedRows?: ProductSpuApi expandRowKeys.value = [selectedSpuId.value] return } - // 如果以展开 skuList 则选择此对应的 spu 不需要重新获取渲染 skuList + // 如果已展开 skuList 则选择此对应的 spu 不需要重新获取渲染 skuList if (isExpand.value && spuData.value?.id === row.id) { return } diff --git a/src/views/mall/trade/delivery/pickUpStore/index.vue b/src/views/mall/trade/delivery/pickUpStore/index.vue index c8963442..2bf29d57 100644 --- a/src/views/mall/trade/delivery/pickUpStore/index.vue +++ b/src/views/mall/trade/delivery/pickUpStore/index.vue @@ -1,27 +1,27 @@