product.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import request from '@/config/axios'
  2. import { DataComparisonRespVO } from '@/api/mall/statistics/common'
  3. export interface ProductStatisticsVO {
  4. id: number
  5. day: string
  6. spuId: number
  7. spuName: string
  8. spuPicUrl: string
  9. browseCount: number
  10. browseUserCount: number
  11. favoriteCount: number
  12. cartCount: number
  13. orderCount: number
  14. orderPayCount: number
  15. orderPayPrice: number
  16. afterSaleCount: number
  17. afterSaleRefundPrice: number
  18. browseConvertPercent: number
  19. }
  20. // 产品统计 API
  21. export const ProductStatisticsApi = {
  22. // 获得产品统计分析
  23. getProductStatisticsAnalyse: (params: any) => {
  24. return request.get<DataComparisonRespVO<ProductStatisticsVO>>({
  25. url: '/statistics/product/analyse',
  26. params
  27. })
  28. },
  29. // 获得产品状况明细
  30. getProductStatisticsList: (params: any) => {
  31. return request.get<ProductStatisticsVO[]>({
  32. url: '/statistics/product/list',
  33. params
  34. })
  35. },
  36. // 导出获得产品状况明细 Excel
  37. exportProductStatisticsExcel: (params: any) => {
  38. return request.download({
  39. url: '/statistics/product/export-excel',
  40. params
  41. })
  42. },
  43. // 获得产品排行榜分页
  44. getProductStatisticsRankPage: async (params: any) => {
  45. return await request.get({
  46. url: `/statistics/product/rank-page`,
  47. params
  48. })
  49. }
  50. }