import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'

export default defineUniPages({
  globalStyle: {
    'navigationStyle': 'default',
    'navigationBarTitleText': 'BandhuBuy',
    'navigationBarBackgroundColor': '#f8f8f8',
    'navigationBarTextStyle': 'black',
    'backgroundColor': '#FFFFFF',
    'pageOrientation': 'auto',
    'app-plus': {
      scrollIndicator: 'none',
      screenOrientation: [
        'portrait-primary', // 可选，字符串类型，支持竖屏
        'portrait-secondary', // 可选，字符串类型，支持反向竖屏
        'landscape-primary', // 可选，字符串类型，支持横屏
        'landscape-secondary', // 可选，字符串类型，支持反向横屏
      ],
    },
  },
  easycom: {
    autoscan: true,
    custom: {
      '^fg-(.*)': '@/components/fg-$1/fg-$1.vue',
      '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)': 'z-paging/components/z-paging$1/z-paging$1.vue',
    },
  },
  /**
   * 2025-06-25 v3.3.0版（重新梳理tabbar配置）
   *
   * 1)原生tabbar，不需要关心 `layouts/fg-tabbar` 文件夹里面的内容。(这是默认配置)
   * 2)自定义tabbar（带缓存），保留下面的配置和修改 `/layouts/fg-tabbar/tabbarList.ts` 对应的代码。
   * 3)自定义tabbar（不带缓存），删除下面的配置和修改 `/layouts/fg-tabbar/tabbarList.ts` 对应的代码。
   * 4)无tabbar，直接删除下面的tabBar配置即可。
   *
   * 温馨提示：本文件的任何代码更改了之后，都需要重新运行，否则 pages.json 还是旧的，导致不是预期效果。
   */
  tabBar: {
    color: '#999999',
    selectedColor: '#e61b28',
    backgroundColor: '#ffffff',
    // backgroundColor: 'rgba(255, 255, 255, 0.6)',
    // blurEffect: 'extralight',
    borderStyle: '#c1c1c1',
    height: '50px',
    fontSize: '10px',
    iconWidth: '24px',
    spacing: '3px',
    list: [
      {
        iconPath: 'static/tabbar/home.png',
        selectedIconPath: 'static/tabbar/homeHL.png',
        pagePath: 'pages/index/index',
      },
      {
        iconPath: 'static/tabbar/income.png',
        selectedIconPath: 'static/tabbar/incomeHL.png',
        pagePath: 'pages/income/income',
      },
      {
        iconPath: 'static/tabbar/mine.png',
        selectedIconPath: 'static/tabbar/mineHL.png',
        pagePath: 'pages/mine/mine',
      },
    ],
  },
  pages: [
    {
      path: 'pages/index/index',
      type: 'home',
      layout: 'tabbar',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/bestSellers/bestSellers',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/forgotPassword/forgotPassword',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/income/income',
      type: 'page',
      layout: 'tabbar',
      style: {
        navigationBarTitleText: '%income.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/login/login',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/mine/addressBook',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%addressBook.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/mine/addressBookOperate',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%addressBook.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/mine/mine',
      type: 'page',
      layout: 'tabbar',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/mine/myFavorite',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%mine.pages.myFavorite.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/mine/myProfile',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%myProfile.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/mine/setting',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%setting.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/mine/share',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
        navigationBarTitleText: '%mine.pages.share.title%',
      },
    },
    {
      path: 'pages/missionCenter/missionCenter',
      type: 'page',
      layout: 'default',
      needLogin: true,
      style: {
        navigationBarTitleText: '%missionCenter.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/myOrders/myOrders',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%myOrders.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/myOrders/orderDetail',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%orderDetail.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/notifications/notifications',
      type: 'page',
      layout: 'default',
      needLogin: true,
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/productDetail/checkOut',
      type: 'page',
      layout: 'default',
      needLogin: true,
      style: {
        navigationBarTitleText: '%checkout.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/productDetail/productDetail',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/referEarn/referEarn',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/register/register',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/search/search',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/topChampions/topChampions',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
      },
    },
    {
      path: 'pages/vipMembership/vipMembership',
      type: 'page',
      layout: 'default',
      needLogin: true,
      style: {
        navigationBarTitleText: '%vipMembership.title%',
        navigationBarBackgroundColor: '#FFFFFF',
      },
    },
    {
      path: 'pages/wallet/frozenRecord',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%wallet.frozenRecord.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/wallet/myWallet',
      type: 'page',
      layout: 'default',
      needLogin: true,
      style: {
        navigationBarTitleText: '%wallet.myWallet.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/wallet/recharge',
      type: 'page',
      layout: 'default',
      style: {
        'navigationBarTitleText': '%wallet.recharge.title%',
        'navigationBarBackgroundColor': '#fff',
        'app-plus': {
          titleNView: {
            buttons: [
              {
                text: 'Record',
                fontSize: '28rpx',
                width: '85px',
              },
            ],
          },
        },
      },
    },
    {
      path: 'pages/wallet/rechargeRecord',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%wallet.rechargeRecord.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/wallet/withdraw',
      type: 'page',
      layout: 'default',
      style: {
        navigationStyle: 'custom',
        navigationBarTitleText: '%wallet.withdraw.title%',
      },
    },
    {
      path: 'pages/wallet/withdrawRecord',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '%wallet.withdrawRecord.title%',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'pages/webLink/webLink',
      type: 'page',
      layout: 'default',
      style: {
        navigationBarTitleText: '',
        navigationBarBackgroundColor: '#fff',
      },
    },
    {
      path: 'uni_modules/uni-upgrade-center-app/pages/upgrade-popup',
      style: {
        'disableScroll': true,
        'app-plus': {
          backgroundColorTop: 'transparent',
          background: 'transparent',
          titleNView: false,
          scrollIndicator: false,
          popGesture: 'none',
          animationType: 'fade-in',
          animationDuration: 200,
        },
      },
    },
  ],
})
