diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index c78bef47..5cc4d8fe 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -104,5 +104,5 @@ export const exportSpu = async (params) => { // 获得商品 SPU 精简列表 export const getSpuSimpleList = async () => { - return request.get({ url: '/product/spu/get-simple-list' }) + return request.get({ url: '/product/spu/list-all-simple' }) } diff --git a/src/api/mall/promotion/article/index.ts b/src/api/mall/promotion/article/index.ts new file mode 100644 index 00000000..824958ad --- /dev/null +++ b/src/api/mall/promotion/article/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface ArticleVO { + id: number + categoryId: number + title: string + author: string + picUrl: string + introduction: string + browseCount: string + sort: number + status: number + spuId: number + recommendHot: boolean + recommendBanner: boolean + content: string +} + +// 查询文章管理列表 +export const getArticlePage = async (params) => { + return await request.get({ url: `/promotion/article/page`, params }) +} + +// 查询文章管理详情 +export const getArticle = async (id: number) => { + return await request.get({ url: `/promotion/article/get?id=` + id }) +} + +// 新增文章管理 +export const createArticle = async (data: ArticleVO) => { + return await request.post({ url: `/promotion/article/create`, data }) +} + +// 修改文章管理 +export const updateArticle = async (data: ArticleVO) => { + return await request.put({ url: `/promotion/article/update`, data }) +} + +// 删除文章管理 +export const deleteArticle = async (id: number) => { + return await request.delete({ url: `/promotion/article/delete?id=` + id }) +} diff --git a/src/api/mall/promotion/articleCategory/index.ts b/src/api/mall/promotion/articleCategory/index.ts new file mode 100644 index 00000000..47f5e934 --- /dev/null +++ b/src/api/mall/promotion/articleCategory/index.ts @@ -0,0 +1,39 @@ +import request from '@/config/axios' + +export interface ArticleCategoryVO { + id: number + name: string + picUrl: string + status: number + sort: number +} + +// 查询文章分类列表 +export const getArticleCategoryPage = async (params) => { + return await request.get({ url: `/promotion/article-category/page`, params }) +} + +// 查询文章分类精简信息列表 +export const getSimpleArticleCategoryList = async () => { + return await request.get({ url: `/promotion/article-category/list-all-simple` }) +} + +// 查询文章分类详情 +export const getArticleCategory = async (id: number) => { + return await request.get({ url: `/promotion/article-category/get?id=` + id }) +} + +// 新增文章分类 +export const createArticleCategory = async (data: ArticleCategoryVO) => { + return await request.post({ url: `/promotion/article-category/create`, data }) +} + +// 修改文章分类 +export const updateArticleCategory = async (data: ArticleCategoryVO) => { + return await request.put({ url: `/promotion/article-category/update`, data }) +} + +// 删除文章分类 +export const deleteArticleCategory = async (id: number) => { + return await request.delete({ url: `/promotion/article-category/delete?id=` + id }) +} diff --git a/src/api/mall/promotion/discount/discountActivity.ts b/src/api/mall/promotion/discount/discountActivity.ts new file mode 100644 index 00000000..e755c1bd --- /dev/null +++ b/src/api/mall/promotion/discount/discountActivity.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' +import { Sku, Spu } from '@/api/mall/product/spu' + +export interface DiscountActivityVO { + id?: number + spuId?: number + name?: string + status?: number + remark?: string + startTime?: Date + endTime?: Date + products?: DiscountProductVO[] +} +// 限时折扣相关 属性 +export interface DiscountProductVO { + spuId: number + skuId: number + discountType: number + discountPercent: number + discountPrice: number +} + +// 扩展 Sku 配置 +export type SkuExtension = Sku & { + productConfig: DiscountProductVO +} + +export interface SpuExtension extends Spu { + skus: SkuExtension[] // 重写类型 +} + +// 查询限时折扣活动列表 +export const getDiscountActivityPage = async (params) => { + return await request.get({ url: '/promotion/discount-activity/page', params }) +} + +// 查询限时折扣活动详情 +export const getDiscountActivity = async (id: number) => { + return await request.get({ url: '/promotion/discount-activity/get?id=' + id }) +} + +// 新增限时折扣活动 +export const createDiscountActivity = async (data: DiscountActivityVO) => { + return await request.post({ url: '/promotion/discount-activity/create', data }) +} + +// 修改限时折扣活动 +export const updateDiscountActivity = async (data: DiscountActivityVO) => { + return await request.put({ url: '/promotion/discount-activity/update', data }) +} + +// 关闭限时折扣活动 +export const closeDiscountActivity = async (id: number) => { + return await request.put({ url: '/promotion/discount-activity/close?id=' + id }) +} + +// 删除限时折扣活动 +export const deleteDiscountActivity = async (id: number) => { + return await request.delete({ url: '/promotion/discount-activity/delete?id=' + id }) +} diff --git a/src/api/mall/statistics/common.ts b/src/api/mall/statistics/common.ts new file mode 100644 index 00000000..3d964392 --- /dev/null +++ b/src/api/mall/statistics/common.ts @@ -0,0 +1,5 @@ +/** 数据对照 Response VO */ +export interface DataComparisonRespVO { + value: T + reference: T +} diff --git a/src/api/mall/statistics/member.ts b/src/api/mall/statistics/member.ts index d4680d3d..92af031e 100644 --- a/src/api/mall/statistics/member.ts +++ b/src/api/mall/statistics/member.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' import dayjs from 'dayjs' -import { TradeStatisticsComparisonRespVO } from '@/api/mall/statistics/trade' +import { DataComparisonRespVO } from '@/api/mall/statistics/common' import { formatDate } from '@/utils/formatTime' /** 会员分析 Request VO */ @@ -10,17 +10,17 @@ export interface MemberAnalyseReqVO { /** 会员分析 Response VO */ export interface MemberAnalyseRespVO { - visitorCount: number + visitUserCount: number orderUserCount: number payUserCount: number atv: number - comparison: TradeStatisticsComparisonRespVO + comparison: DataComparisonRespVO } /** 会员分析对照数据 Response VO */ export interface MemberAnalyseComparisonRespVO { - userCount: number - activeUserCount: number + registerUserCount: number + visitUserCount: number rechargeUserCount: number } @@ -29,8 +29,8 @@ export interface MemberAreaStatisticsRespVO { areaId: number areaName: string userCount: number - orderCreateCount: number - orderPayCount: number + orderCreateUserCount: number + orderPayUserCount: number orderPayPrice: number } @@ -54,6 +54,20 @@ export interface MemberTerminalStatisticsRespVO { userCount: number } +/** 会员数量统计 Response VO */ +export interface MemberCountRespVO { + /** 用户访问量 */ + visitUserCount: string + /** 注册用户数量 */ + registerUserCount: number +} + +/** 会员注册数量 Response VO */ +export interface MemberRegisterCountRespVO { + date: string + count: number +} + // 查询会员统计 export const getMemberSummary = () => { return request.get({ @@ -72,20 +86,38 @@ export const getMemberAnalyse = (params: MemberAnalyseReqVO) => { // 按照省份,查询会员统计列表 export const getMemberAreaStatisticsList = () => { return request.get({ - url: '/statistics/member/get-area-statistics-list' + url: '/statistics/member/area-statistics-list' }) } // 按照性别,查询会员统计列表 export const getMemberSexStatisticsList = () => { return request.get({ - url: '/statistics/member/get-sex-statistics-list' + url: '/statistics/member/sex-statistics-list' }) } // 按照终端,查询会员统计列表 export const getMemberTerminalStatisticsList = () => { return request.get({ - url: '/statistics/member/get-terminal-statistics-list' + url: '/statistics/member/terminal-statistics-list' + }) +} + +// 获得用户数量量对照 +export const getUserCountComparison = () => { + return request.get>({ + url: '/statistics/member/user-count-comparison' + }) +} + +// 获得会员注册数量列表 +export const getMemberRegisterCountList = ( + beginTime: dayjs.ConfigType, + endTime: dayjs.ConfigType +) => { + return request.get({ + url: '/statistics/member/register-count-list', + params: { times: [formatDate(beginTime), formatDate(endTime)] } }) } diff --git a/src/api/mall/statistics/pay.ts b/src/api/mall/statistics/pay.ts new file mode 100644 index 00000000..f5d14c9d --- /dev/null +++ b/src/api/mall/statistics/pay.ts @@ -0,0 +1,12 @@ +import request from '@/config/axios' + +/** 支付统计 */ +export interface PaySummaryRespVO { + /** 充值金额,单位分 */ + rechargePrice: number +} + +/** 获取钱包充值金额 */ +export const getWalletRechargePrice = async () => { + return await request.get({ url: `/statistics/pay/summary` }) +} diff --git a/src/api/mall/statistics/trade.ts b/src/api/mall/statistics/trade.ts index f7829ccb..94052597 100644 --- a/src/api/mall/statistics/trade.ts +++ b/src/api/mall/statistics/trade.ts @@ -1,12 +1,7 @@ import request from '@/config/axios' import dayjs from 'dayjs' import { formatDate } from '@/utils/formatTime' - -/** 交易统计对照 Response VO */ -export interface TradeStatisticsComparisonRespVO { - value: T - reference: T -} +import { DataComparisonRespVO } from '@/api/mall/statistics/common' /** 交易统计 Response VO */ export interface TradeSummaryRespVO { @@ -24,46 +19,100 @@ export interface TradeTrendReqVO { /** 交易状况统计 Response VO */ export interface TradeTrendSummaryRespVO { time: string - turnover: number + turnoverPrice: number orderPayPrice: number rechargePrice: number expensePrice: number - balancePrice: number + walletPayPrice: number brokerageSettlementPrice: number - orderRefundPrice: number + afterSaleRefundPrice: number +} + +/** 交易订单数量 Response VO */ +export interface TradeOrderCountRespVO { + /** 待发货 */ + undelivered?: number + /** 待核销 */ + pickUp?: number + /** 退款中 */ + afterSaleApply?: number + /** 提现待审核 */ + auditingWithdraw?: number +} + +/** 交易订单统计 Response VO */ +export interface TradeOrderSummaryRespVO { + /** 支付订单商品数 */ + orderPayCount?: number + /** 总支付金额,单位:分 */ + orderPayPrice?: number +} + +/** 订单量趋势统计 Response VO */ +export interface TradeOrderTrendRespVO { + /** 日期 */ + date: string + /** 订单数量 */ + orderPayCount: number + /** 订单支付金额 */ + orderPayPrice: number } // 查询交易统计 export const getTradeStatisticsSummary = () => { - return request.get>({ + return request.get>({ url: '/statistics/trade/summary' }) } // 获得交易状况统计 export const getTradeTrendSummary = (params: TradeTrendReqVO) => { - return request.get>({ + return request.get>({ url: '/statistics/trade/trend/summary', params: formatDateParam(params) }) } // 获得交易状况明细 -export const getTradeTrendList = (params: TradeTrendReqVO) => { +export const getTradeStatisticsList = (params: TradeTrendReqVO) => { return request.get({ - url: '/statistics/trade/trend/list', + url: '/statistics/trade/list', params: formatDateParam(params) }) } // 导出交易状况明细 -export const exportTradeTrend = (params: TradeTrendReqVO) => { +export const exportTradeStatisticsExcel = (params: TradeTrendReqVO) => { return request.download({ - url: '/statistics/trade/trend/export-excel', + url: '/statistics/trade/export-excel', params: formatDateParam(params) }) } +// 获得交易订单数量 +export const getOrderCount = async () => { + return await request.get({ url: `/statistics/trade/order-count` }) +} + +// 获得交易订单数量对照 +export const getOrderComparison = async () => { + return await request.get>({ + url: `/statistics/trade/order-comparison` + }) +} + +// 获得订单量趋势统计 +export const getOrderCountTrendComparison = ( + type: number, + beginTime: dayjs.ConfigType, + endTime: dayjs.ConfigType +) => { + return request.get[]>({ + url: '/statistics/trade/order-count-trend', + params: { type, beginTime: formatDate(beginTime), endTime: formatDate(endTime) } + }) +} + /** 时间参数需要格式化, 确保接口能识别 */ const formatDateParam = (params: TradeTrendReqVO) => { return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index ea78275f..364483b8 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -1,6 +1,7 @@ import request from '@/config/axios' export interface OrderVO { + // ========== 订单基本信息 ========== id?: number | null // 订单编号 no?: string // 订单流水号 createTime?: Date | null // 下单时间 @@ -15,35 +16,43 @@ export interface OrderVO { cancelTime?: Date | null // 订单取消时间 cancelType?: number | null // 取消类型 remark?: string // 商家备注 + + // ========== 价格 + 支付基本信息 ========== payOrderId?: number | null // 支付订单编号 - payed?: boolean // 是否已支付 + payStatus?: boolean // 是否已支付 payTime?: Date | null // 付款时间 payChannelCode?: string // 支付渠道 totalPrice?: number | null // 商品原价(总) - orderPrice?: number | null // 订单原价(总) discountPrice?: number | null // 订单优惠(总) deliveryPrice?: number | null // 运费金额 adjustPrice?: number | null // 订单调价(总) payPrice?: number | null // 应付金额(总) + // ========== 收件 + 物流基本信息 ========== deliveryType?: number | null // 发货方式 + pickUpStoreId?: number // 自提门店编号 + pickUpVerifyCode?: string // 自提核销码 deliveryTemplateId?: number | null // 配送模板编号 - logisticsId?: number | null | null // 发货物流公司编号 + logisticsId?: number | null // 发货物流公司编号 logisticsNo?: string // 发货物流单号 - deliveryStatus?: number | null // 发货状态 deliveryTime?: Date | null // 发货时间 receiveTime?: Date | null // 收货时间 receiverName?: string // 收件人名称 receiverMobile?: string // 收件人手机 - receiverAreaId?: number | null // 收件人地区编号 receiverPostCode?: number | null // 收件人邮编 + receiverAreaId?: number | null // 收件人地区编号 + receiverAreaName?: string //收件人地区名字 receiverDetailAddress?: string // 收件人详细地址 + + // ========== 售后基本信息 ========== afterSaleStatus?: number | null // 售后状态 refundPrice?: number | null // 退款金额 + + // ========== 营销基本信息 ========== couponId?: number | null // 优惠劵编号 couponPrice?: number | null // 优惠劵减免金额 - vipPrice?: number | null // VIP 减免金额 pointPrice?: number | null // 积分抵扣的金额 - receiverAreaName?: string //收件人地区名字 + vipPrice?: number | null // VIP 减免金额 + items?: OrderItemRespVO[] // 订单项列表 // 下单用户信息 user?: { @@ -99,11 +108,28 @@ export interface ProductPropertiesVO { valueName?: string // 属性值的名称 } +/** 交易订单统计 */ +export interface TradeOrderSummaryRespVO { + /** 订单数量 */ + orderCount?: number + /** 订单金额 */ + orderPayPrice?: string + /** 退款单数 */ + afterSaleCount?: number + /** 退款金额 */ + afterSalePrice?: string +} + // 查询交易订单列表 -export const getOrderPage = async (params) => { +export const getOrderPage = async (params: any) => { return await request.get({ url: `/trade/order/page`, params }) } +// 查询交易订单统计 +export const getOrderSummary = async (params: any) => { + return await request.get({ url: `/trade/order/summary`, params }) +} + // 查询交易订单详情 export const getOrder = async (id: number | null) => { return await request.get({ url: `/trade/order/get-detail?id=` + id }) @@ -142,5 +168,21 @@ export const updateOrderAddress = async (data: any) => { // 订单核销 export const pickUpOrder = async (id: number) => { - return await request.put({ url: `/trade/order/pick-up?id=${id}` }) + return await request.put({ url: `/trade/order/pick-up-by-id?id=${id}` }) +} + +// 订单核销 +export const pickUpOrderByVerifyCode = async (pickUpVerifyCode: string) => { + return await request.put({ + url: `/trade/order/pick-up-by-verify-code`, + params: { pickUpVerifyCode } + }) +} + +// 查询核销码对应的订单 +export const getOrderByPickUpVerifyCode = async (pickUpVerifyCode: string) => { + return await request.get({ + url: `/trade/order/get-by-pick-up-verify-code`, + params: { pickUpVerifyCode } + }) } diff --git a/src/api/pay/wallet/index.ts b/src/api/pay/wallet/balance/index.ts similarity index 77% rename from src/api/pay/wallet/index.ts rename to src/api/pay/wallet/balance/index.ts index b57deeb0..3e5ab369 100644 --- a/src/api/pay/wallet/index.ts +++ b/src/api/pay/wallet/balance/index.ts @@ -3,7 +3,6 @@ import request from '@/config/axios' /** 用户钱包查询参数 */ export interface PayWalletUserReqVO { userId: number - userType: number } /** 钱包 VO */ export interface WalletVO { @@ -20,3 +19,8 @@ export interface WalletVO { export const getWallet = async (params: PayWalletUserReqVO) => { return await request.get({ url: `/pay/wallet/get`, params }) } + +// 查询会员钱包列表 +export const getWalletPage = async (params) => { + return await request.get({ url: `/pay/wallet/page`, params }) +} diff --git a/src/api/pay/wallet/rechargePackage/index.ts b/src/api/pay/wallet/rechargePackage/index.ts new file mode 100644 index 00000000..c8e4cc9c --- /dev/null +++ b/src/api/pay/wallet/rechargePackage/index.ts @@ -0,0 +1,34 @@ +import request from '@/config/axios' + +export interface WalletRechargePackageVO { + id: number + name: string + payPrice: number + bonusPrice: number + status: number +} + +// 查询套餐充值列表 +export const getWalletRechargePackagePage = async (params) => { + return await request.get({ url: '/pay/wallet-recharge-package/page', params }) +} + +// 查询套餐充值详情 +export const getWalletRechargePackage = async (id: number) => { + return await request.get({ url: '/pay/wallet-recharge-package/get?id=' + id }) +} + +// 新增套餐充值 +export const createWalletRechargePackage = async (data: WalletRechargePackageVO) => { + return await request.post({ url: '/pay/wallet-recharge-package/create', data }) +} + +// 修改套餐充值 +export const updateWalletRechargePackage = async (data: WalletRechargePackageVO) => { + return await request.put({ url: '/pay/wallet-recharge-package/update', data }) +} + +// 删除套餐充值 +export const deleteWalletRechargePackage = async (id: number) => { + return await request.delete({ url: '/pay/wallet-recharge-package/delete?id=' + id }) +} diff --git a/src/api/pay/wallet/transaction/index.ts b/src/api/pay/wallet/transaction/index.ts new file mode 100644 index 00000000..3377ffaa --- /dev/null +++ b/src/api/pay/wallet/transaction/index.ts @@ -0,0 +1,14 @@ +import request from '@/config/axios' + +export interface WalletTransactionVO { + id: number + walletId: number + title: string + price: number + balance: number +} + +// 查询会员钱包流水列表 +export const getWalletTransactionPage = async (params) => { + return await request.get({ url: `/pay/wallet-transaction/page`, params }) +} diff --git a/src/components/ShortcutDateRangePicker/index.vue b/src/components/ShortcutDateRangePicker/index.vue new file mode 100644 index 00000000..d7fa90cb --- /dev/null +++ b/src/components/ShortcutDateRangePicker/index.vue @@ -0,0 +1,89 @@ + + diff --git a/src/views/mall/statistics/trade/components/TradeTrendValue.vue b/src/components/SummaryCard/index.vue similarity index 95% rename from src/views/mall/statistics/trade/components/TradeTrendValue.vue rename to src/components/SummaryCard/index.vue index 10fa9517..52da6da9 100644 --- a/src/views/mall/statistics/trade/components/TradeTrendValue.vue +++ b/src/components/SummaryCard/index.vue @@ -35,8 +35,8 @@ import { propTypes } from '@/utils/propTypes' import { toNumber } from 'lodash-es' -/** 交易状况统计值组件 */ -defineOptions({ name: 'TradeTrendValue' }) +/** 统计卡片 */ +defineOptions({ name: 'SummaryCard' }) defineProps({ title: propTypes.string.def(''), diff --git a/src/utils/index.ts b/src/utils/index.ts index 41d70a5b..d5301ddb 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -236,3 +236,16 @@ export const yuanToFen = (amount: string | number): number => { export const fenToYuan = (price: string | number): number => { return formatToFraction(price) } + +/** + * 计算环比 + * + * @param value 当前数值 + * @param reference 对比数值 + */ +export const calculateRelativeRate = (value?: number, reference?: number) => { + // 防止除0 + if (!reference) return 0 + + return ((100 * ((value || 0) - reference)) / reference).toFixed(0) +} diff --git a/src/views/mall/home/components/ComparisonCard.vue b/src/views/mall/home/components/ComparisonCard.vue new file mode 100644 index 00000000..ee1c2f0c --- /dev/null +++ b/src/views/mall/home/components/ComparisonCard.vue @@ -0,0 +1,42 @@ + + diff --git a/src/views/mall/home/components/MemberStatisticsCard.vue b/src/views/mall/home/components/MemberStatisticsCard.vue new file mode 100644 index 00000000..2f9d7ab5 --- /dev/null +++ b/src/views/mall/home/components/MemberStatisticsCard.vue @@ -0,0 +1,91 @@ + + diff --git a/src/views/mall/home/components/OperationDataCard.vue b/src/views/mall/home/components/OperationDataCard.vue new file mode 100644 index 00000000..b905203b --- /dev/null +++ b/src/views/mall/home/components/OperationDataCard.vue @@ -0,0 +1,92 @@ + + diff --git a/src/views/mall/home/components/ShortcutCard.vue b/src/views/mall/home/components/ShortcutCard.vue new file mode 100644 index 00000000..9fdd5cd4 --- /dev/null +++ b/src/views/mall/home/components/ShortcutCard.vue @@ -0,0 +1,79 @@ + + diff --git a/src/views/mall/home/components/TradeTrendCard.vue b/src/views/mall/home/components/TradeTrendCard.vue new file mode 100644 index 00000000..a8cab828 --- /dev/null +++ b/src/views/mall/home/components/TradeTrendCard.vue @@ -0,0 +1,208 @@ + + diff --git a/src/views/mall/home/index.vue b/src/views/mall/home/index.vue new file mode 100644 index 00000000..feaa46a9 --- /dev/null +++ b/src/views/mall/home/index.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/views/mall/promotion/article/ArticleForm.vue b/src/views/mall/promotion/article/ArticleForm.vue new file mode 100644 index 00000000..92976931 --- /dev/null +++ b/src/views/mall/promotion/article/ArticleForm.vue @@ -0,0 +1,238 @@ + + diff --git a/src/views/mall/promotion/article/category/ArticleCategoryForm.vue b/src/views/mall/promotion/article/category/ArticleCategoryForm.vue new file mode 100644 index 00000000..ac7e9f38 --- /dev/null +++ b/src/views/mall/promotion/article/category/ArticleCategoryForm.vue @@ -0,0 +1,120 @@ + + diff --git a/src/views/mall/promotion/article/category/index.vue b/src/views/mall/promotion/article/category/index.vue new file mode 100644 index 00000000..73d1420c --- /dev/null +++ b/src/views/mall/promotion/article/category/index.vue @@ -0,0 +1,199 @@ + + + diff --git a/src/views/mall/promotion/article/index.vue b/src/views/mall/promotion/article/index.vue new file mode 100644 index 00000000..fb5c48d8 --- /dev/null +++ b/src/views/mall/promotion/article/index.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue new file mode 100644 index 00000000..d7a98061 --- /dev/null +++ b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue @@ -0,0 +1,179 @@ + + diff --git a/src/views/mall/promotion/discountActivity/discountActivity.data.ts b/src/views/mall/promotion/discountActivity/discountActivity.data.ts new file mode 100644 index 00000000..d79dcab7 --- /dev/null +++ b/src/views/mall/promotion/discountActivity/discountActivity.data.ts @@ -0,0 +1,119 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter2 } from '@/utils/formatTime' + +// TODO @zhangshai: +// 表单校验 +export const rules = reactive({ + spuId: [required], + name: [required], + startTime: [required], + endTime: [required], + discountType: [required] +}) + +// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/ +const crudSchemas = reactive([ + { + label: '活动名称', + field: 'name', + isSearch: true, + form: { + colProps: { + span: 24 + } + }, + table: { + width: 120 + } + }, + { + label: '活动开始时间', + field: 'startTime', + formatter: dateFormatter2, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange' + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'date', + valueFormat: 'x' + } + }, + table: { + width: 120 + } + }, + { + label: '活动结束时间', + field: 'endTime', + formatter: dateFormatter2, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange' + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'date', + valueFormat: 'x' + } + }, + table: { + width: 120 + } + }, + { + label: '优惠类型', + field: 'discountType', + dictType: DICT_TYPE.PROMOTION_DISCOUNT_TYPE, + dictClass: 'number', + isSearch: true, + form: { + component: 'Radio', + value: 1 + } + }, + { + label: '活动商品', + field: 'spuId', + isTable: true, + isSearch: false, + form: { + colProps: { + span: 24 + } + }, + table: { + width: 300 + } + }, + { + label: '备注', + field: 'remark', + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + rows: 4 + }, + colProps: { + span: 24 + } + }, + table: { + width: 300 + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/src/views/mall/promotion/discountActivity/index.vue b/src/views/mall/promotion/discountActivity/index.vue new file mode 100644 index 00000000..b7dd5c20 --- /dev/null +++ b/src/views/mall/promotion/discountActivity/index.vue @@ -0,0 +1,237 @@ + + + diff --git a/src/views/mall/statistics/member/components/MemberFunnelCard.vue b/src/views/mall/statistics/member/components/MemberFunnelCard.vue new file mode 100644 index 00000000..fc847ef3 --- /dev/null +++ b/src/views/mall/statistics/member/components/MemberFunnelCard.vue @@ -0,0 +1,119 @@ + + + diff --git a/src/views/mall/statistics/member/components/MemberTerminalCard.vue b/src/views/mall/statistics/member/components/MemberTerminalCard.vue new file mode 100644 index 00000000..7bbab76c --- /dev/null +++ b/src/views/mall/statistics/member/components/MemberTerminalCard.vue @@ -0,0 +1,69 @@ + + diff --git a/src/views/mall/statistics/member/index.vue b/src/views/mall/statistics/member/index.vue index 8dd7c593..2390be5e 100644 --- a/src/views/mall/statistics/member/index.vue +++ b/src/views/mall/statistics/member/index.vue @@ -2,7 +2,7 @@
- - - - - - -
-
-
-
-
- 注册用户数量:{{ analyseData?.comparison?.value?.userCount || 0 }} -
-
- 环比增长率:{{ - calculateRelativeRate( - analyseData?.comparison?.value?.userCount, - analyseData?.comparison?.reference?.userCount - ) - }}% -
-
-
-
- {{ analyseData?.visitorCount || 0 }} - 访客 -
-
-
-
-
-
- 活跃用户数量:{{ analyseData?.comparison?.value?.activeUserCount || 0 }} -
-
- 环比增长率:{{ - calculateRelativeRate( - analyseData?.comparison?.value?.activeUserCount, - analyseData?.comparison?.reference?.activeUserCount - ) - }}% -
-
-
-
- {{ analyseData?.orderUserCount || 0 }} - 下单 -
-
-
-
-
-
-
- 充值用户数量:{{ analyseData?.comparison?.value?.rechargeUserCount || 0 }} -
-
- 环比增长率:{{ - calculateRelativeRate( - analyseData?.comparison?.value?.rechargeUserCount, - analyseData?.comparison?.reference?.rechargeUserCount - ) - }}% -
-
-
-
客单价:{{ fenToYuan(analyseData?.atv || 0) }}
-
-
-
-
- {{ analyseData?.payUserCount || 0 }} - 成交用户 -
-
-
-
+ +
- - - + +
- + + @@ -180,14 +82,14 @@ /> - + + @@ -214,62 +119,33 @@
diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index 7d0a88ac..38b9342e 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -54,7 +54,7 @@ @@ -235,6 +235,7 @@ import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express' import { useTagsViewStore } from '@/store/modules/tagsView' import { DeliveryTypeEnum, TradeOrderStatusEnum } from '@/utils/constants' import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore' +import { propTypes } from '@/utils/propTypes' defineOptions({ name: 'TradeOrderDetail' }) @@ -294,8 +295,12 @@ const handlePickUp = async () => { /** 获得详情 */ const { params } = useRoute() // 查询参数 +const props = defineProps({ + id: propTypes.number.def(undefined), // 订单ID + showPickUp: propTypes.bool.def(true) // 显示核销按钮 +}) +const id = (params.id || props.id) as unknown as number const getDetail = async () => { - const id = params.id as unknown as number if (id) { const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO // 没有表单信息则关闭页面返回 diff --git a/src/views/mall/trade/order/form/OrderPickUpForm.vue b/src/views/mall/trade/order/form/OrderPickUpForm.vue new file mode 100644 index 00000000..529263c4 --- /dev/null +++ b/src/views/mall/trade/order/form/OrderPickUpForm.vue @@ -0,0 +1,108 @@ + + diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 33d98548..4a85a30e 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -128,6 +128,7 @@ class="!w-280px" clearable placeholder="请输入" + :type="queryType.queryParam === 'userId' ? 'number' : 'text'" > + diff --git a/src/views/pay/wallet/balance/index.vue b/src/views/pay/wallet/balance/index.vue new file mode 100644 index 00000000..296b567b --- /dev/null +++ b/src/views/pay/wallet/balance/index.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/views/pay/wallet/rechargePackage/WalletRechargePackageForm.vue b/src/views/pay/wallet/rechargePackage/WalletRechargePackageForm.vue new file mode 100644 index 00000000..f538b78c --- /dev/null +++ b/src/views/pay/wallet/rechargePackage/WalletRechargePackageForm.vue @@ -0,0 +1,122 @@ + + diff --git a/src/views/pay/wallet/rechargePackage/index.vue b/src/views/pay/wallet/rechargePackage/index.vue new file mode 100644 index 00000000..f097577c --- /dev/null +++ b/src/views/pay/wallet/rechargePackage/index.vue @@ -0,0 +1,185 @@ + + + diff --git a/src/views/pay/wallet/transaction/WalletTransactionList.vue b/src/views/pay/wallet/transaction/WalletTransactionList.vue new file mode 100644 index 00000000..c440778b --- /dev/null +++ b/src/views/pay/wallet/transaction/WalletTransactionList.vue @@ -0,0 +1,68 @@ + + + + diff --git a/src/views/system/notify/template/NotifyTemplateSendForm.vue b/src/views/system/notify/template/NotifyTemplateSendForm.vue index 78103d71..964f6b98 100644 --- a/src/views/system/notify/template/NotifyTemplateSendForm.vue +++ b/src/views/system/notify/template/NotifyTemplateSendForm.vue @@ -15,7 +15,21 @@ type="textarea" /> - + + + + {{ dict.label }} + + + + + + + import * as UserApi from '@/api/system/user' import * as NotifyTemplateApi from '@/api/system/notify/template' +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' defineOptions({ name: 'SystemNotifyTemplateSendForm' }) @@ -57,6 +72,7 @@ const formData = ref({ content: '', params: {}, userId: null, + userType: 1, templateCode: '', templateParams: new Map() }) @@ -122,7 +138,8 @@ const resetForm = () => { params: {}, mobile: '', templateCode: '', - templateParams: new Map() + templateParams: new Map(), + userType: 1 } as any formRef.value?.resetFields() }