const USE_MOCK = true;

const generateDates = (days: number) => {
  const dates: string[] = [];
  const today = new Date();
  for (let i = days - 1; i >= 0; i--) {
    const date = new Date(today);
    date.setDate(date.getDate() - i);
    dates.push(`${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`);
  }
  return dates;
};

const generateRandomData = (length: number, min: number, max: number) => {
  return Array.from({ length }, () => Math.floor(Math.random() * (max - min + 1)) + min);
};

export const mockStatisticsOverview = () => {
  return {
    totalSales: 1586320.50,
    totalProfit: 425680.35,
    avgProfitRate: 26.83,
    totalOrders: 12580,
    totalUsers: 8920,
    totalDevices: 156,
    onlineDevices: 142,
    totalShops: 48,
    avgOrderAmount: 126.10,
    categoryList: [
      { category: "饮料", salesAmount: 458620.00, profitAmount: 125680.00, profitRate: 27.40 },
      { category: "零食", salesAmount: 386540.00, profitAmount: 98560.00, profitRate: 25.50 },
      { category: "方便食品", salesAmount: 298760.00, profitAmount: 82340.00, profitRate: 27.56 },
      { category: "乳制品", salesAmount: 186540.00, profitAmount: 52180.00, profitRate: 27.97 },
      { category: "日用百货", salesAmount: 125680.00, profitAmount: 35620.00, profitRate: 28.35 },
      { category: "水果", salesAmount: 78920.00, profitAmount: 18650.00, profitRate: 23.63 },
      { category: "面包糕点", salesAmount: 35260.00, profitAmount: 8670.00, profitRate: 24.59 },
      { category: "其他", salesAmount: 16000.50, profitAmount: 3980.35, profitRate: 24.88 }
    ]
  };
};

export const mockCategoryOverview = () => {
  return [
    { category: "饮料", quantity: 28560, salesAmount: 458620.00, costAmount: 332940.00, profitAmount: 125680.00, profitRate: 27.40, orderCount: 3856, percentage: 28.90 },
    { category: "零食", quantity: 18920, salesAmount: 386540.00, costAmount: 287980.00, profitAmount: 98560.00, profitRate: 25.50, orderCount: 2980, percentage: 24.37 },
    { category: "方便食品", quantity: 12450, salesAmount: 298760.00, costAmount: 216420.00, profitAmount: 82340.00, profitRate: 27.56, orderCount: 2156, percentage: 18.84 },
    { category: "乳制品", quantity: 8960, salesAmount: 186540.00, costAmount: 134360.00, profitAmount: 52180.00, profitRate: 27.97, orderCount: 1680, percentage: 11.76 },
    { category: "日用百货", quantity: 5680, salesAmount: 125680.00, costAmount: 90060.00, profitAmount: 35620.00, profitRate: 28.35, orderCount: 986, percentage: 7.92 },
    { category: "水果", quantity: 3560, salesAmount: 78920.00, costAmount: 60270.00, profitAmount: 18650.00, profitRate: 23.63, orderCount: 568, percentage: 4.98 },
    { category: "面包糕点", quantity: 2180, salesAmount: 35260.00, costAmount: 26590.00, profitAmount: 8670.00, profitRate: 24.59, orderCount: 320, percentage: 2.22 },
    { category: "其他", quantity: 1250, salesAmount: 16000.50, costAmount: 12020.15, profitAmount: 3980.35, profitRate: 24.88, orderCount: 230, percentage: 1.01 }
  ];
};

export const mockCategoryTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "饮料", data: generateRandomData(30, 12000, 18000) },
      { name: "零食", data: generateRandomData(30, 10000, 15000) },
      { name: "方便食品", data: generateRandomData(30, 8000, 12000) },
      { name: "乳制品", data: generateRandomData(30, 5000, 8000) }
    ]
  };
};

export const mockProductList = (page: number, pageSize: number) => {
  const allProducts = [
    { productId: 1, productCode: "SP001", productName: "可口可乐500ml", category: "饮料", quantity: 3560, salesAmount: 10680.00, costAmount: 7120.00, profitAmount: 3560.00, profitRate: 33.33, orderCount: 3560, userCount: 2850 },
    { productId: 2, productCode: "SP002", productName: "百事可乐500ml", category: "饮料", quantity: 2890, salesAmount: 8670.00, costAmount: 5780.00, profitAmount: 2890.00, profitRate: 33.33, orderCount: 2890, userCount: 2310 },
    { productId: 3, productCode: "SP003", productName: "农夫山泉550ml", category: "饮料", quantity: 4520, salesAmount: 9040.00, costAmount: 6330.00, profitAmount: 2710.00, profitRate: 29.98, orderCount: 4520, userCount: 3620 },
    { productId: 4, productCode: "SP004", productName: "乐事薯片原味", category: "零食", quantity: 1680, salesAmount: 11760.00, costAmount: 8400.00, profitAmount: 3360.00, profitRate: 28.57, orderCount: 1560, userCount: 1250 },
    { productId: 5, productCode: "SP005", productName: "康师傅红烧牛肉面", category: "方便食品", quantity: 2340, salesAmount: 11700.00, costAmount: 8190.00, profitAmount: 3510.00, profitRate: 30.00, orderCount: 2100, userCount: 1680 },
    { productId: 6, productCode: "SP006", productName: "伊利纯牛奶250ml", category: "乳制品", quantity: 3120, salesAmount: 15600.00, costAmount: 10920.00, profitAmount: 4680.00, profitRate: 30.00, orderCount: 2800, userCount: 2240 },
    { productId: 7, productCode: "SP007", productName: "旺旺雪饼", category: "零食", quantity: 1890, salesAmount: 9450.00, costAmount: 6615.00, profitAmount: 2835.00, profitRate: 30.00, orderCount: 1750, userCount: 1400 },
    { productId: 8, productCode: "SP008", productName: "统一冰红茶500ml", category: "饮料", quantity: 2680, salesAmount: 8040.00, costAmount: 5360.00, profitAmount: 2680.00, profitRate: 33.33, orderCount: 2680, userCount: 2140 },
    { productId: 9, productCode: "SP009", productName: "奥利奥饼干", category: "零食", quantity: 1560, salesAmount: 10920.00, costAmount: 7800.00, profitAmount: 3120.00, profitRate: 28.57, orderCount: 1420, userCount: 1140 },
    { productId: 10, productCode: "SP010", productName: "蒙牛酸酸乳", category: "乳制品", quantity: 2450, salesAmount: 9800.00, costAmount: 6860.00, profitAmount: 2940.00, profitRate: 30.00, orderCount: 2200, userCount: 1760 },
    { productId: 11, productCode: "SP011", productName: "王老吉凉茶", category: "饮料", quantity: 1980, salesAmount: 9900.00, costAmount: 6930.00, profitAmount: 2970.00, profitRate: 30.00, orderCount: 1850, userCount: 1480 },
    { productId: 12, productCode: "SP012", productName: "达利园蛋黄派", category: "面包糕点", quantity: 1350, salesAmount: 8100.00, costAmount: 5670.00, profitAmount: 2430.00, profitRate: 30.00, orderCount: 1200, userCount: 960 },
    { productId: 13, productCode: "SP013", productName: "红牛功能饮料", category: "饮料", quantity: 1680, salesAmount: 13440.00, costAmount: 10080.00, profitAmount: 3360.00, profitRate: 25.00, orderCount: 1520, userCount: 1220 },
    { productId: 14, productCode: "SP014", productName: "卫龙辣条", category: "零食", quantity: 2890, salesAmount: 8670.00, costAmount: 5780.00, profitAmount: 2890.00, profitRate: 33.33, orderCount: 2680, userCount: 2140 },
    { productId: 15, productCode: "SP015", productName: "今麦郎方便面", category: "方便食品", quantity: 1860, salesAmount: 7440.00, costAmount: 5210.00, profitAmount: 2230.00, profitRate: 29.97, orderCount: 1680, userCount: 1340 }
  ];
  
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    list: allProducts.slice(start, end),
    total: allProducts.length,
    pageSize,
    currentPage: page
  };
};

export const mockProductTop = (type: string) => {
  const products = mockProductList(1, 15).list;
  if (type === "quantity") {
    return products.sort((a, b) => b.quantity - a.quantity).slice(0, 10);
  }
  return products.sort((a, b) => b.salesAmount - a.salesAmount).slice(0, 10);
};

export const mockProductTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "销售额", data: generateRandomData(30, 300, 500) }
    ]
  };
};

export const mockDeviceOverview = () => {
  return {
    totalDevices: 156,
    onlineDevices: 142,
    offlineDevices: 14,
    onlineRate: "91.0%",
    totalSales: 1586320.50,
    totalOrders: 12580
  };
};

export const mockDeviceList = (page: number, pageSize: number) => {
  const allDevices = [
    { deviceId: "D001", deviceName: "写字楼A座1楼", shopId: 1, shopName: "科技园店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 856, userCount: 425, salesAmount: 42800.00, avgOrderAmount: 50.00, dailySalesAmount: 1426.67 },
    { deviceId: "D002", deviceName: "写字楼A座2楼", shopId: 1, shopName: "科技园店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 723, userCount: 361, salesAmount: 36150.00, avgOrderAmount: 50.00, dailySalesAmount: 1205.00 },
    { deviceId: "D003", deviceName: "地铁站C出口", shopId: 2, shopName: "地铁商圈店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 1256, userCount: 628, salesAmount: 62800.00, avgOrderAmount: 50.00, dailySalesAmount: 2093.33 },
    { deviceId: "D004", deviceName: "商场B区2楼", shopId: 2, shopName: "地铁商圈店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 1580, userCount: 790, salesAmount: 79000.00, avgOrderAmount: 50.00, dailySalesAmount: 2633.33 },
    { deviceId: "D005", deviceName: "医院门诊楼", shopId: 3, shopName: "医院店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 645, userCount: 322, salesAmount: 32250.00, avgOrderAmount: 50.00, dailySalesAmount: 1075.00 },
    { deviceId: "D006", deviceName: "体育馆入口", shopId: 4, shopName: "体育馆店", status: 0, statusLabel: "离线", statusColor: "info", orderCount: 0, userCount: 0, salesAmount: 0, avgOrderAmount: 0, dailySalesAmount: 0 },
    { deviceId: "D007", deviceName: "公园东门", shopId: 5, shopName: "公园店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 423, userCount: 211, salesAmount: 21150.00, avgOrderAmount: 50.00, dailySalesAmount: 705.00 },
    { deviceId: "D008", deviceName: "图书馆大厅", shopId: 6, shopName: "图书馆店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 512, userCount: 256, salesAmount: 25600.00, avgOrderAmount: 50.00, dailySalesAmount: 853.33 },
    { deviceId: "D009", deviceName: "火车站候车室", shopId: 7, shopName: "火车站店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 1890, userCount: 945, salesAmount: 94500.00, avgOrderAmount: 50.00, dailySalesAmount: 3150.00 },
    { deviceId: "D010", deviceName: "机场T1航站楼", shopId: 8, shopName: "机场店", status: 1, statusLabel: "在线", statusColor: "success", orderCount: 2156, userCount: 1078, salesAmount: 107800.00, avgOrderAmount: 50.00, dailySalesAmount: 3593.33 }
  ];
  
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    list: allDevices.slice(start, end),
    total: allDevices.length,
    pageSize,
    currentPage: page
  };
};

export const mockDeviceTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "销售额", data: generateRandomData(30, 1000, 3000) }
    ]
  };
};

export const mockShopOverview = () => {
  return {
    totalShops: 48,
    activeShops: 45,
    totalSales: 1586320.50,
    totalOrders: 12580
  };
};

export const mockShopList = (page: number, pageSize: number) => {
  const allShops = [
    { shopId: 1, shopName: "科技园店", province: "广东省", city: "深圳市", district: "南山区", address: "科技园路88号", status: 1, statusLabel: "启用", deviceCount: 12, orderCount: 2856, userCount: 1428, salesAmount: 142800.00, avgOrderAmount: 50.00, dailySalesAmount: 4760.00, deviceOutput: 11900.00 },
    { shopId: 2, shopName: "地铁商圈店", province: "广东省", city: "深圳市", district: "福田区", address: "福田地铁站B出口", status: 1, statusLabel: "启用", deviceCount: 8, orderCount: 1890, userCount: 945, salesAmount: 94500.00, avgOrderAmount: 50.00, dailySalesAmount: 3150.00, deviceOutput: 11812.50 },
    { shopId: 3, shopName: "大学城店", province: "广东省", city: "深圳市", district: "南山区", address: "大学城学府路", status: 1, statusLabel: "启用", deviceCount: 15, orderCount: 3256, userCount: 1628, salesAmount: 162800.00, avgOrderAmount: 50.00, dailySalesAmount: 5426.67, deviceOutput: 10853.33 },
    { shopId: 4, shopName: "医院店", province: "广东省", city: "深圳市", district: "福田区", address: "福田医院门诊楼", status: 1, statusLabel: "启用", deviceCount: 6, orderCount: 1256, userCount: 628, salesAmount: 62800.00, avgOrderAmount: 50.00, dailySalesAmount: 2093.33, deviceOutput: 10466.67 },
    { shopId: 5, shopName: "体育馆店", province: "广东省", city: "深圳市", district: "龙岗区", address: "大运体育馆", status: 1, statusLabel: "启用", deviceCount: 10, orderCount: 1890, userCount: 945, salesAmount: 94500.00, avgOrderAmount: 50.00, dailySalesAmount: 3150.00, deviceOutput: 9450.00 },
    { shopId: 6, shopName: "公园店", province: "广东省", city: "深圳市", district: "南山区", address: "深圳湾公园", status: 1, statusLabel: "启用", deviceCount: 5, orderCount: 856, userCount: 428, salesAmount: 42800.00, avgOrderAmount: 50.00, dailySalesAmount: 1426.67, deviceOutput: 8560.00 },
    { shopId: 7, shopName: "图书馆店", province: "广东省", city: "深圳市", district: "福田区", address: "深圳图书馆", status: 1, statusLabel: "启用", deviceCount: 4, orderCount: 723, userCount: 361, salesAmount: 36150.00, avgOrderAmount: 50.00, dailySalesAmount: 1205.00, deviceOutput: 9037.50 },
    { shopId: 8, shopName: "火车站店", province: "广东省", city: "深圳市", district: "罗湖区", address: "深圳火车站", status: 1, statusLabel: "启用", deviceCount: 18, orderCount: 4520, userCount: 2260, salesAmount: 226000.00, avgOrderAmount: 50.00, dailySalesAmount: 7533.33, deviceOutput: 12555.56 },
    { shopId: 9, shopName: "机场店", province: "广东省", city: "深圳市", district: "宝安区", address: "宝安国际机场", status: 1, statusLabel: "启用", deviceCount: 20, orderCount: 5680, userCount: 2840, salesAmount: 284000.00, avgOrderAmount: 50.00, dailySalesAmount: 9466.67, deviceOutput: 14200.00 },
    { shopId: 10, shopName: "购物中心店", province: "广东省", city: "深圳市", district: "福田区", address: "COCO Park购物中心", status: 1, statusLabel: "启用", deviceCount: 14, orderCount: 3560, userCount: 1780, salesAmount: 178000.00, avgOrderAmount: 50.00, dailySalesAmount: 5933.33, deviceOutput: 12714.29 }
  ];
  
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    list: allShops.slice(start, end),
    total: allShops.length,
    pageSize,
    currentPage: page
  };
};

export const mockShopRanking = () => {
  return mockShopList(1, 10).list.sort((a, b) => b.salesAmount - a.salesAmount).slice(0, 10);
};

export const mockShopTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "销售额", data: generateRandomData(30, 4000, 8000) }
    ]
  };
};

export const mockProfitOverview = () => {
  return {
    salesAmount: 1586320.50,
    costAmount: 1160640.15,
    grossProfit: 425680.35,
    grossProfitRate: 26.83
  };
};

export const mockProfitList = (page: number, pageSize: number) => {
  const allProfits = [
    { shopId: 1, shopName: "科技园店", province: "广东省", city: "深圳市", district: "南山区", deviceCount: 12, salesAmount: 142800.00, costAmount: 104256.00, grossProfit: 38544.00, grossProfitRate: 27.00, refundAmount: 0, refundRate: 0, netProfit: 38544.00, netProfitRate: 27.00, deviceProfit: 3212.00, dailyProfit: 1284.80 },
    { shopId: 2, shopName: "地铁商圈店", province: "广东省", city: "深圳市", district: "福田区", deviceCount: 8, salesAmount: 94500.00, costAmount: 69045.00, grossProfit: 25455.00, grossProfitRate: 26.94, refundAmount: 0, refundRate: 0, netProfit: 25455.00, netProfitRate: 26.94, deviceProfit: 3181.88, dailyProfit: 848.50 },
    { shopId: 3, shopName: "大学城店", province: "广东省", city: "深圳市", district: "南山区", deviceCount: 15, salesAmount: 162800.00, costAmount: 118844.00, grossProfit: 43956.00, grossProfitRate: 27.00, refundAmount: 0, refundRate: 0, netProfit: 43956.00, netProfitRate: 27.00, deviceProfit: 2930.40, dailyProfit: 1465.20 },
    { shopId: 4, shopName: "医院店", province: "广东省", city: "深圳市", district: "福田区", deviceCount: 6, salesAmount: 62800.00, costAmount: 45844.00, grossProfit: 16956.00, grossProfitRate: 27.00, refundAmount: 0, refundRate: 0, netProfit: 16956.00, netProfitRate: 27.00, deviceProfit: 2826.00, dailyProfit: 565.20 },
    { shopId: 5, shopName: "体育馆店", province: "广东省", city: "深圳市", district: "龙岗区", deviceCount: 10, salesAmount: 94500.00, costAmount: 69930.00, grossProfit: 24570.00, grossProfitRate: 26.00, refundAmount: 0, refundRate: 0, netProfit: 24570.00, netProfitRate: 26.00, deviceProfit: 2457.00, dailyProfit: 819.00 },
    { shopId: 6, shopName: "公园店", province: "广东省", city: "深圳市", district: "南山区", deviceCount: 5, salesAmount: 42800.00, costAmount: 31458.00, grossProfit: 11342.00, grossProfitRate: 26.50, refundAmount: 0, refundRate: 0, netProfit: 11342.00, netProfitRate: 26.50, deviceProfit: 2268.40, dailyProfit: 378.07 },
    { shopId: 7, shopName: "图书馆店", province: "广东省", city: "深圳市", district: "福田区", deviceCount: 4, salesAmount: 36150.00, costAmount: 26510.00, grossProfit: 9640.00, grossProfitRate: 26.67, refundAmount: 0, refundRate: 0, netProfit: 9640.00, netProfitRate: 26.67, deviceProfit: 2410.00, dailyProfit: 321.33 },
    { shopId: 8, shopName: "火车站店", province: "广东省", city: "深圳市", district: "罗湖区", deviceCount: 18, salesAmount: 226000.00, costAmount: 165180.00, grossProfit: 60820.00, grossProfitRate: 26.91, refundAmount: 0, refundRate: 0, netProfit: 60820.00, netProfitRate: 26.91, deviceProfit: 3378.89, dailyProfit: 2027.33 },
    { shopId: 9, shopName: "机场店", province: "广东省", city: "深圳市", district: "宝安区", deviceCount: 20, salesAmount: 284000.00, costAmount: 207320.00, grossProfit: 76680.00, grossProfitRate: 27.00, refundAmount: 0, refundRate: 0, netProfit: 76680.00, netProfitRate: 27.00, deviceProfit: 3834.00, dailyProfit: 2556.00 },
    { shopId: 10, shopName: "购物中心店", province: "广东省", city: "深圳市", district: "福田区", deviceCount: 14, salesAmount: 178000.00, costAmount: 130094.00, grossProfit: 47906.00, grossProfitRate: 26.91, refundAmount: 0, refundRate: 0, netProfit: 47906.00, netProfitRate: 26.91, deviceProfit: 3421.86, dailyProfit: 1596.87 }
  ];
  
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    list: allProfits.slice(start, end),
    total: allProfits.length,
    pageSize,
    currentPage: page
  };
};

export const mockProfitTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "利润", data: generateRandomData(30, 10000, 20000) }
    ]
  };
};

export const mockProfitWarning = () => {
  return [
    { shopId: 11, shopName: "测试门店A", province: "广东省", city: "深圳市", district: "南山区", deviceCount: 2, salesAmount: 8500.00, costAmount: 7650.00, grossProfit: 850.00, grossProfitRate: 10.00, netProfit: 850.00, netProfitRate: 10.00 },
    { shopId: 12, shopName: "测试门店B", province: "广东省", city: "深圳市", district: "福田区", deviceCount: 1, salesAmount: 3200.00, costAmount: 3040.00, grossProfit: 160.00, grossProfitRate: 5.00, netProfit: 160.00, netProfitRate: 5.00 }
  ];
};

export const mockRepurchaseOverview = () => {
  return {
    totalUsers: 8920,
    newUsers: 3568,
    repurchaseUsers: 5352,
    repurchaseRate: 60.00,
    avgOrderAmount: 126.10,
    avgPurchaseCount: 1.41,
    ltv: 177.80
  };
};

export const mockRepurchaseDistribution = (type: string) => {
  if (type === "interval") {
    return {
      distribution: {
        "1天内": 1256,
        "1-3天": 1890,
        "3-7天": 2340,
        "7-14天": 1560,
        "14-30天": 980,
        "30天以上": 520
      }
    };
  }
  return {
    distribution: {
      "新用户": 3568,
      "活跃用户": 2856,
      "忠诚用户": 1890,
      "流失用户": 606
    }
  };
};

export const mockRepurchaseTrend = () => {
  const dates = generateDates(30);
  return {
    dates,
    series: [
      { name: "复购率(%)", data: generateRandomData(30, 55, 75) }
    ]
  };
};

export const mockRepurchaseUsers = (page: number, pageSize: number) => {
  const allUsers = [
    { userId: 1, nickname: "张三", phone: "138****1234", orderCount: 15, totalAmount: 2250.00, avgOrderAmount: 150.00, firstOrderDate: "2025-01-15", lastOrderDate: "2025-03-24", repurchaseDays: 5, userLayer: "loyal", userLayerLabel: "忠诚用户" },
    { userId: 2, nickname: "李四", phone: "139****5678", orderCount: 8, totalAmount: 960.00, avgOrderAmount: 120.00, firstOrderDate: "2025-02-01", lastOrderDate: "2025-03-23", repurchaseDays: 7, userLayer: "active", userLayerLabel: "活跃用户" },
    { userId: 3, nickname: "王五", phone: "137****9012", orderCount: 12, totalAmount: 1560.00, avgOrderAmount: 130.00, firstOrderDate: "2025-01-20", lastOrderDate: "2025-03-22", repurchaseDays: 6, userLayer: "loyal", userLayerLabel: "忠诚用户" },
    { userId: 4, nickname: "赵六", phone: "136****3456", orderCount: 3, totalAmount: 360.00, avgOrderAmount: 120.00, firstOrderDate: "2025-03-10", lastOrderDate: "2025-03-24", repurchaseDays: 7, userLayer: "active", userLayerLabel: "活跃用户" },
    { userId: 5, nickname: "钱七", phone: "135****7890", orderCount: 1, totalAmount: 85.00, avgOrderAmount: 85.00, firstOrderDate: "2025-03-24", lastOrderDate: "2025-03-24", repurchaseDays: 0, userLayer: "new", userLayerLabel: "新用户" },
    { userId: 6, nickname: "孙八", phone: "134****1234", orderCount: 6, totalAmount: 720.00, avgOrderAmount: 120.00, firstOrderDate: "2024-12-15", lastOrderDate: "2025-01-10", repurchaseDays: 5, userLayer: "churn", userLayerLabel: "流失用户" },
    { userId: 7, nickname: "周九", phone: "133****5678", orderCount: 10, totalAmount: 1250.00, avgOrderAmount: 125.00, firstOrderDate: "2025-02-05", lastOrderDate: "2025-03-21", repurchaseDays: 8, userLayer: "active", userLayerLabel: "活跃用户" },
    { userId: 8, nickname: "吴十", phone: "132****9012", orderCount: 20, totalAmount: 3200.00, avgOrderAmount: 160.00, firstOrderDate: "2025-01-01", lastOrderDate: "2025-03-24", repurchaseDays: 4, userLayer: "loyal", userLayerLabel: "忠诚用户" },
    { userId: 9, nickname: "郑十一", phone: "131****3456", orderCount: 2, totalAmount: 240.00, avgOrderAmount: 120.00, firstOrderDate: "2025-03-20", lastOrderDate: "2025-03-24", repurchaseDays: 4, userLayer: "active", userLayerLabel: "活跃用户" },
    { userId: 10, nickname: "王十二", phone: "130****7890", orderCount: 5, totalAmount: 650.00, avgOrderAmount: 130.00, firstOrderDate: "2025-02-28", lastOrderDate: "2025-03-23", repurchaseDays: 6, userLayer: "active", userLayerLabel: "活跃用户" }
  ];
  
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  
  return {
    list: allUsers.slice(start, end),
    total: allUsers.length,
    pageSize,
    currentPage: page
  };
};

export { USE_MOCK };
