var _host = location.host;
var is_production = !!/www\.shoplooks\.com/g.test(_host) || !!/shoplooks\.com/g.test(_host) && _host.indexOf('test') === -1;

var BASE_HOST_URL = is_production ? '//www.shoplooks.com/' : ('//' + _host+'/');
var BASE_API_URL = is_production ? '//api.shoplooks.com/' : '//api.test.shoplooks.com/';
// var BASE_API_URL = is_production ? '//api.shoplooks.com/' : '//api.shoplooks.com/';
var BASE_COOKIE_URL = is_production ? '.shoplooks.com' : '.' + location.host.split('.').slice(1).join('.');

window.Base = {
  indexUrl: BASE_HOST_URL,
  apiUrl: BASE_API_URL + 'index.php/m/',
  // apiUrl: '//api.shoplooks.com/' + 'index.php/m/',
  cookieDomain: _host === 'shoplooks.com' ? 'shoplooks.com' : '.' + _host.split('.').slice(1).join('.'),
  trackUrl: '//www.linkhaitao.com/',
  prodUrl: BASE_HOST_URL + '/index.php/m/product/a/detail?id=',
  loginUrl: '/login',
  dashboardLoginUrl: '/center/login/dashboard.html',
  sendPwdRqst: '/login/password-reset/',
  resetPwdRqst: '/center/login/resetPwdRqst.html',
  adminIndexUrl: '/overview/',
  adminSubIndexUrl: '/chart/',
  adminFavivateUrl: '/collection/',
  withdrawIndex: '/withdraw',
  withdrawWait: '/center/withdraw/wait.html',
  receiptsAccountIndex: '/settings/receipts-account/',
  passwordUrl: '/settings/password/',
  commonTplPath: '/center/inc/',
  regUrl: {
    regIndex: '/signup',
    fillInfo: '/center/register/fill_info.html',
    regDone: '/center/register/reg_done.html',
    subUserPassword: '/signup/sub-account-password/'
  },
  slogonTxt: ' | Shoplooks',
  cxselectData: {
    cn: 'https://static.shoplooks.com/pcstatic/js/vendors/jquery.cxselect/cityData.min.json',
    en: 'https://static.shoplooks.com/pcstatic/js/vendors/jquery.cxselect/cityData.en.min.json'
  },
  uploadUrl: 'common/a/upload',
  searchWordMinLen: 1,
  requireCfg: {
    baseUrl: 'https://static.shoplooks.com/pcstatic/js/',
    hash: new Date().getTime(),
    waitSeconds: 60
  },
  imgWhite: 'https://static.shoplooks.com/pcstatic/images/white.png',
  imgLoadError: 'https://static.shoplooks.com/pcstatic/images/errorLoading.png',
  resCode: {
    success: '0200'
  },
  resMsg: {
    error: '<div class="loading-txt-error" data-lang-en="Data loading failed, please refresh page retry!">\u6570\u636e\u52a0\u8f7d\u5931\u8d25,\u8bf7\u5237\u65b0\u9875\u9762\u91cd\u8bd5！</div>',
    empty: '<div class="sl-empty-data" data-lang-en="No data...">\u6682\u65f6\u6ca1\u6709\u6570\u636e</div>',
    forbidden: '<span data-lang-en="Operation forbidden!">\u975e\u6cd5\u64cd\u4f5c!</span>'
  },
  loading: '<div class="loading-cnt"><p><img src="https://static.shoplooks.com/pcstatic/images/SLloading.gif" alt="loading" /></p></div>'
}

require.config({
  baseUrl: Base.requireCfg.baseUrl,
  urlArgs: 'v=' + Base.requireCfg.hash,
  map: {
    '*': {
      'css': 'vendors/require/require.css', // 加载样式
      'text': 'vendors/require/require.text' // 备用
    }
  },
  paths: {
    'jquery': 'vendors/jquery',
    'bootstrap': 'vendors/bootstrap',
    'swiper': 'vendors/swiper',
    'swiper4': 'vendors/swiper.4.5.min',
    'typed': 'vendors/typed',
    'aos': 'vendors/aos',
    'layer': 'vendors/layer/layer',
    'laypage': 'vendors/layer/laypage',
    'juicer': 'vendors/juicer',
    'echart': 'vendors/echarts.simple.min',
    'echart4': 'vendors/echarts.4.0.min',
    'cxselect': 'vendors/jquery.cxselect/jquery.cxselect.min',
    'bootstrap_select': 'vendors/bootstrap-select.min',
    "zeroclipboard": 'vendors/zeroclipboard/ZeroClipboard.min',
    "clipboard": 'vendors/zeroclipboard/clipboard.min',
    'moment': 'vendors/moment',
    'daterangepicker': 'vendors/daterangepicker',
    'LazyLoad': 'vendors/lazyload',
    'App': './seed',
    'util': 'common/util',
    'cookie': 'common/cookie',
    'MSG': 'lang/msg',
    'vue': 'vendors/vue.min',
    'g2': 'vendors/g2.min',
    'laydate': 'vendors/laydate/laydate',
    'ELEMENT': 'vendors/element-ui-index',
    
    //'Tpl': 'common/tpl'
  },
  shim: {
    App: {
      deps: ['jquery', 'bootstrap', 'util']
    },
    bootstrap: {
      deps: ['jquery']
    },
    bootstrap_select: {
      deps: ['moment', 'css!../css/vendors/bootstrap-select.min']
    },
    aos: {
      deps: ['css!../css/vendors/aos']
    },
    swiper4: {
      deps: ['css!../css/vendors/swiper4']
    },
    swiper: {
      deps: ['jquery', 'css!../css/vendors/swiper']
    },
    laypage: {
      deps: ['util']
    },
    layer: {
      deps: ['jquery']
    },
    daterangepicker: {
      deps: ['moment', 'css!../css/vendors/daterangepicker']
    }
  },
  waitSeconds: Base.requireCfg.waitSeconds
})