product.ts 1.3 KB
Newer Older
Addons committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
import request from '@/config/axios'
import { DataComparisonRespVO } from '@/api/mall/statistics/common'

export interface ProductStatisticsVO {
  id: number
  day: string
  spuId: number
  spuName: string
  spuPicUrl: string
  browseCount: number
  browseUserCount: number
  favoriteCount: number
  cartCount: number
  orderCount: number
  orderPayCount: number
  orderPayPrice: number
  afterSaleCount: number
  afterSaleRefundPrice: number
  browseConvertPercent: number
}

// 商品统计 API
export const ProductStatisticsApi = {
  // 获得商品统计分析
  getProductStatisticsAnalyse: (params: any) => {
    return request.get<DataComparisonRespVO<ProductStatisticsVO>>({
      url: '/statistics/product/analyse',
      params
    })
  },
  // 获得商品状况明细
  getProductStatisticsList: (params: any) => {
    return request.get<ProductStatisticsVO[]>({
      url: '/statistics/product/list',
      params
    })
  },
  // 导出获得商品状况明细 Excel
  exportProductStatisticsExcel: (params: any) => {
    return request.download({
      url: '/statistics/product/export-excel',
      params
    })
  },
  // 获得商品排行榜分页
  getProductStatisticsRankPage: async (params: any) => {
    return await request.get({
      url: `/statistics/product/rank-page`,
      params
    })
  }
}