/**
 * 管理后台本地数据
 */

// 系统初始化数据
const initData = {
  error: 0,
  msg: '获取成功',
  data: {
    name: 'bandhuBuy',
    logo: '/static/img/logo.png',
    domainurl: 'https://mall-oss.trust-will.com',
    filesystem: 'aliyun',
    version: '1.0.0',
    sheep_version: 'v1.4.1',
    is_pro: true,
  },
};

// 登录配置数据
const loginConfigData = {
  error: 0,
  msg: '获取成功',
  data: {
    background: '/storage/default/20250227/8fdd538e05f5ad15402f5a66fe595621.jpg',
    mode: 'none',
  },
};

// 菜单权限数据 - 二级菜单结构
const menuRulesData = {
  error: 0,
  msg: '获取成功',
  data: {
    menu: [
      {
        type_text: '菜单',
        status_text: '显示',
        id: 1,
        parent_id: 0,
        name: 'shop.admin',
        title: '商城管理',
        type: 'menu',
        icon: '/static/img/shop/logo.png',
        params: '',
        weigh: 0,
        status: 'show',
        children: [
          // 首页
          {
            type_text: '菜单',
            status_text: '显示',
            id: 90,
            parent_id: 1,
            name: 'shop.admin.dashboard',
            title: '首页',
            type: 'menu',
            icon: 'sa-home_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 901,
                parent_id: 90,
                name: 'shop.admin.dashboard',
                title: '数据概览',
                type: 'page',
                icon: 'sa-home_line',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 商品
          {
            type_text: '菜单',
            status_text: '显示',
            id: 300,
            parent_id: 1,
            name: 'shop.admin.goods',
            title: '商品',
            type: 'menu',
            icon: 'sa-bag_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 113,
                parent_id: 300,
                name: 'shop.admin.goods.goods',
                title: '商品库',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 125,
                parent_id: 300,
                name: 'shop.admin.goods.category',
                title: '商品分类',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 订单
          {
            type_text: '菜单',
            status_text: '显示',
            id: 400,
            parent_id: 1,
            name: 'shop.admin.order',
            title: '订单',
            type: 'menu',
            icon: 'sa-order_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 154,
                parent_id: 400,
                name: 'shop.admin.order.list',
                title: '订单管理',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 171,
                parent_id: 400,
                name: 'shop.admin.order.aftersale',
                title: '售后管理',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 172,
                parent_id: 400,
                name: 'shop.admin.order.setting',
                title: '订单设置',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },

          // 用户
          {
            type_text: '菜单',
            status_text: '显示',
            id: 500,
            parent_id: 1,
            name: 'shop.admin.user',
            title: '用户',
            type: 'menu',
            icon: 'sa-user',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 501,
                parent_id: 500,
                name: 'shop.admin.user.list',
                title: '用户列表',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 502,
                parent_id: 500,
                name: 'shop.admin.user.tag',
                title: '标签管理',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 503,
                parent_id: 500,
                name: 'shop.admin.user.level',
                title: '会员等级',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 营销
          {
            type_text: '菜单',
            status_text: '显示',
            id: 600,
            parent_id: 1,
            name: 'shop.admin.marketing',
            title: '营销',
            type: 'menu',
            icon: 'sa-marketing_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 601,
                parent_id: 600,
                name: 'shop.admin.marketing.group',
                title: '拼团',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 内容
          {
            type_text: '菜单',
            status_text: '显示',
            id: 700,
            parent_id: 1,
            name: 'shop.admin.content',
            title: '内容',
            type: 'menu',
            icon: 'sa-message_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 701,
                parent_id: 700,
                name: 'shop.admin.content.notification',
                title: '消息推送',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 702,
                parent_id: 700,
                name: 'shop.admin.content.sms',
                title: '短信',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 703,
                parent_id: 700,
                name: 'shop.admin.content.banner',
                title: '广告位',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 数据
          {
            type_text: '菜单',
            status_text: '显示',
            id: 800,
            parent_id: 1,
            name: 'shop.admin.data',
            title: '数据',
            type: 'menu',
            icon: 'sa-graph_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 801,
                parent_id: 800,
                name: 'shop.admin.data.report',
                title: '数据报表',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 财务
          {
            type_text: '菜单',
            status_text: '显示',
            id: 900,
            parent_id: 1,
            name: 'shop.admin.finance',
            title: '财务',
            type: 'menu',
            icon: 'sa-cny_line',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 901,
                parent_id: 900,
                name: 'shop.admin.finance.recharge',
                title: '充值',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 902,
                parent_id: 900,
                name: 'shop.admin.finance.withdraw',
                title: '提款',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 903,
                parent_id: 900,
                name: 'shop.admin.finance.commission',
                title: '佣金',
                type: 'page',
                icon: '',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
          // 设置
          {
            type_text: '菜单',
            status_text: '显示',
            id: 1000,
            parent_id: 1,
            name: 'admin.config',
            title: '设置',
            type: 'menu',
            icon: 'sa-config',
            params: '',
            weigh: 0,
            status: 'show',
            children: [
              {
                type_text: '页面',
                status_text: '显示',
                id: 1001,
                parent_id: 1000,
                name: 'admin.auth.role',
                title: '角色管理',
                type: 'page',
                icon: 'sa-auth-role',
                params: '',
                weigh: 0,
                status: 'show',
              },
              {
                type_text: '页面',
                status_text: '显示',
                id: 1002,
                parent_id: 1000,
                name: 'admin.auth.admin',
                title: '人员管理',
                type: 'page',
                params: '',
                weigh: 0,
                status: 'show',
              },
            ],
          },
        ],
      },
    ],
    permission: ['*'],
  },
};

// 商品列表mock数据
const goodsListData = {
  error: 0,
  msg: 'success',
  data: {
    current_page: 1,
    per_page: 20,
    total: 100,
    data: [
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'up',
        status_text: '已上架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'up',
        status_text: '已上架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'up',
        status_text: '已上架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'down',
        status_text: '已下架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'down',
        status_text: '已下架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'down',
        status_text: '已下架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'hidden',
        status_text: '已隐藏',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'down',
        status_text: '已下架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
      {
        id: 'BZ6542',
        image: 'https://via.placeholder.com/60x60/333/FFF?text=👓',
        title: 'BOLON Classic Aviator Polarized Sunglasses, Exclusive Eyewear Brand...',
        original_price: '¥1,999',
        current_price: '¥1,000',
        sales: 2000,
        views: 392,
        stock: 2455,
        status: 'down',
        status_text: '已下架',
        sku_id: 'BS55666665',
        supplier: '商家科技有限公司',
        create_time: '2024-01-15 10:30:00',
      },
    ],
  },
};

// 商品类型数据
const goodsTypeData = {
  error: 0,
  msg: 'success',
  data: {
    status: [
      { name: '全部商品(200)', type: 'all' },
      { name: '已上架(150)', type: 'up' },
      { name: '已下架(40)', type: 'down' },
      { name: '已隐藏(10)', type: 'hidden' },
    ],
    activity_type: [],
  },
};

export default {
  /**
   * 系统初始化接口
   */
  init: () => initData,

  /**
   * 登录配置接口
   */
  loginConfig: () => loginConfigData,
  /**
   * 菜单权限接口
   */
  account: {
    rules: () => menuRulesData,
  },
  /**
   * 商品相关接口
   */
  goods: {
    list: () => goodsListData,
    getType: () => goodsTypeData,
  },
};
