/**
 * @flow
 */

import React from 'react';

export const MOCK = true;

export type ENV_TYPE = 'SIT' | 'UAT' | 'PRO'

export const ENV = 'SIT';
//export const ENV = 'UAT'
//export const ENV = 'PRO'

//默认路由
export const initialRouteName = 'TabPage';
export const RootPageInitialName = 'HomePage';

// 最后更新日期,用于在‘关于’页面显示
export const ppkVersion = '1';

export const baseCoreURLMapping = {
  SIT: 'https://ecustomer.tp95589.com/sit',
  UAT: 'https://ecustomer.tp95589.com',
  PRO: 'https://ecustomer.cntaiping.com',
};

export const htmlURLMapping = {
  SIT: 'https://smarket.tp95589.com',
  UAT: 'https://smarket.tp95589.com',
  PRO: 'https://mall.itaiping.com',
};

export const staticResourceMapping = {
  SIT: 'https://ecustomer.tp95589.com/sit',
  UAT: 'https://ecustomer.tp95589.com',
  PRO: 'https://ecustomer.cntaiping.com',
};


export const resourceURLMapping = {
  SIT: `${staticResourceMapping.UAT}/static/rn/src/img/`,
  UAT: `${staticResourceMapping.UAT}/static/rn/src/img/`,
  PRO: `${staticResourceMapping.PRO}/static/rn/src/img/`,
};

export const wxUserNameMapping = {
  SIT: 'gh_b0cac',
  UAT: 'gh_b0cac',
  PRO: 'gh_104e',
};

export function updateInfoURL(env?: ENV_TYPE = ENV) {
  return `${staticResourceMapping[String(env)]}/rn/updateIXX.json?ver=${Math.random()}`;
}

export const StoreContext = React.createContext({});

export const appFileDir = () => 'com.basic';

export default {
  baseCoreURLMapping,
};
