// 嘉里MALL:KO小程序
//const APPID = 'wx2a1741f02f7bb650';
// 嘉里link:CRM小程序
// const APPID = 'wxd830fe4d1e04988e'
// console.log('uni:::::', uni)
// const APPID = 'wxd830fe4d1e04988e' // uni.getAccountInfoSync().miniProgram.appId;
import uni from '@/utils/uniHooks';

// const APPID = 'wx907c27f16841a919' // uni.getAccountInfoSync().miniProgram.appId;
const APPID = uni.getStorageSync('appid'); // uni.getAccountInfoSync().miniProgram.appId;
// const APPID = 'wx2a1741f02f7bb650';

const APPID_MAP = {
  kerryMall: 'wx2a1741f02f7bb650',
  kerryLink: 'wxd830fe4d1e04988e',
};

const GENDER_ARR = [
  { tag: '♂', label: '男', value: '1' },
  { tag: '♀', label: '女', value: '2' },
  { tag: '不选择', label: '不选择', value: '0' },
];
const BABY_STATUS_ARR = [
  { value: '0', label: '不选择' },
  { value: '1', label: '有' },
  { value: '2', label: '无' },
];
const CERTIFICATE_TYPE_ARR = [
  { value: '1', label: '身份证' },
  { value: '2', label: '驾驶证' },
  { value: '3', label: '护照' },
  { value: '4', label: '其他证件' },
];
const USER_LIST_ITEM_EDIT_OBJ = {
  realName: { label: '姓名', placeholder: '请填写姓名' },
  address: { label: '详细地址', placeholder: '请填写您的详细地址编辑' },
  email: { label: '邮箱', placeholder: '请填写您的邮箱' },
  companyName: { label: '公司', placeholder: '请填写您的公司' },
  certificateNum: { label: '证件号码', placeholder: '请填写您的证件号码' },
};

// const LOGO_DEFAULT = `https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com/images/logo-default.png`;
const LOGO_KO_DEFAULT = `https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com/images/logo-default1.png`;

const LICENSE_PLATE_TYPE_ARR = [
  { value: 'ORDINARY_CAR_NO', label: '燃油车辆' },
  { value: 'NEW_ENERGY_CAR_NO', label: '新能源' },
  { value: 'SPECIAL_CAR_NO', label: '特殊车辆' },
];

// 注册来源
const REG_SOURCE = {
  SCAN_POINTS: { value: 'integral', label: '扫码积分' },
  ACTIVITY: { value: 'activities', label: '活动' },
  PARKING: { value: 'parking', label: '停车场' },
  MINI_APP: { value: 'miniProgram', label: '小程序注册' },
  OFFICIAL_ACCOUNTS: { value: 'officialAccount', label: '公众号' },
  COUPONS: { value: 'coupon', label: '卡券' },
  QUESTION_LIST: { value: 'question', label: '问卷调查' },
  RECEPTION: { value: 'reception', label: '服务台' },
  MERCHANT: { value: 'merchant', label: '商户' },
  THIRD_PARTY: { value: 'thirdParty', label: '第三方' },
};

const LOGO_DEFAULT = `https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com/images/logo-default.png`;
const LOGO_DEFAULT1 = `https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com/images/logo-default1.png`;

const JINGAN_LOGO = `/images/jingan-logo.png`;
const PUDONG_LOGO = `/images/pudong-logo.png`;
const BEIJING_LOGO = `/images/beijing-logo.png`;
const KIP_APP_PATH = '/pages/tabbar/home/home';
const ETCP_APP_PATH = '/pages/pay/order-pay-open/main';
const ETCP_APP_INVOICE_PATH = '/pages/invoice-fun/invoice-home/main';
const HANGZHOU_LOGO = `/images/hangzhou-logo.png`;
const CRM_APP_PATH = '/pages/automatic/automaticIndex';
const SHENYANG_LOGO = `images/logo-shenyang.png`;
const TIANJIN_LOGO = `images/logo-tianjin.png`;
const SHENZHEN_LOGO = `images/logo-shenzhen.png`;
const PROD_CONST = {
  name: 'prod',
  constants: {
    BASE_URL: 'https://crm.kerryplus.com/xcrm-api/',
    BASE_URL_H5: 'https://crm.kerryplus.com/aifengleh5/',
    WS_BASE_URL: 'wss://crm.kerryplus.com/xcrm-api',
    PIC_URL: 'https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com/',
    KIP_PAYMENT_URL: 'https://apim.kerryplus.com/c/api/payment/v1',
    KIP_APPID: 'wx92c3e55fbef6b2af',
    ETCP_APPID: 'wxc07f9d67923d676d',
    KIP_API: 'https://apim.kerryplus.com/c/api',
    PUDONG_LBS_ID: '8a88835c7cd96d31017cda3f77e80003',
    JINGAN_LBS_ID: '8a88835c7cd96d31017cda2fd9910000',
    BEIJING_LBS_ID: '8a8884e77cc9e70a017cca4003590008',
    KERRY_ON_BRAND_ID: '8a8884e77cc9e70a017cca14d07e0002',
    KERRY_HZ_BRAND_ID: '8a8884e77cc9e70a017cca1011970001',
    HANGZHOU_LBS_ID: '8a8883557cca9463017ccb002b360001',
    SHENYANG_BRAND_ID: '8a8884e77cc9e70a017cca1c77e80004',
    SHENYANG_LBS_ID: '8a888aed7d0295e5017d029ff1f40000',
    TIANJIN_BRAND_ID: '8a8884e77cc9e70a017cca188fae0003',
    TIANJIN_LBS_ID: '8a8883557cca9463017ccb0ce0a00002',
    SHENZHEN_BRAND_ID: '8a888a087cc59dc0017cc622f9ad0000',
    SHENZHEN_LBS_ID: '8a88a9fd7f73ffcd017f968739870006',
    TRACKING_API_URL:
      'https://prod-tracking-cip.kerryplus.com/sa?project=kerry_tracking',
    REQ_lOCATION_TIME_LIMIT: 5000, // 请求位置限制时间，单位：毫秒
    LOCATION_DISTANCE_RANGE: 1, // 附近商场的位置范围，单位：千米
  },
};

const QA_CONST = {
  name: 'qa',
  constants: {
    BASE_URL: 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api/',
    BASE_URL_H5: 'https://qa-crm-kpl.kerryprops.com.cn/aifengleh5/',
    WS_BASE_URL: 'wss://qa-crm-kpl.kerryprops.com.cn/xcrm-api',
    PIC_URL: 'https://cnsh-kerry-crm-le.oss-cn-shanghai.aliyuncs.com/',
    KIP_PAYMENT_URL: 'https://qa-apim.kerryplus.com/c/api/payment/v1',
    KIP_APPID: 'wx92c3e55fbef6b2af',
    ETCP_APPID: 'wxc07f9d67923d676d',
    KIP_API: 'https://qa-apim.kerryplus.com/c/api',
    PUDONG_LBS_ID: '8a8481f57cca9442017ce02875b8004a',
    JINGAN_LBS_ID: '8a8481f57cca9442017ce026ddd40049',
    BEIJING_LBS_ID: '8a8485067ce4da2d017ce555e9b20000',
    KERRY_ON_BRAND_ID: '8a8480487c96d58f017c9b7bab7d0020',
    KERRY_HZ_BRAND_ID: '8a84853b7c91ac5b017c962dab55030e',
    HANGZHOU_LBS_ID: '8a84853b7c91ac5b017c961a9b2a030d',
    SHENYANG_BRAND_ID: '8a8485497c9cafbc017c9cb90b9d0000',
    SHENYANG_LBS_ID: '8a84854a7cfd947d017d02861a9d0002',
    TIANJIN_BRAND_ID: '8a84819f7c6e260e017c726b6c8f01c3',
    TIANJIN_LBS_ID: '8a84819f7c6e260e017c72a446c201c4',
    SHENZHEN_BRAND_ID: '8a84819f7c6e260e017c72669bbe01c2',
    SHENZHEN_LBS_ID: '8a8486a37f48f7bd017f4e5bddd10000',
    TRACKING_API_URL:
      'https://qa-tracking-cip.kerryplus.com/sa?project=kerry_tracking',
    REQ_lOCATION_TIME_LIMIT: 5000, // 请求位置限制时间，单位：毫秒
    LOCATION_DISTANCE_RANGE: 5000, // 附近商场的位置范围，单位：千米
  },
};
const DEV_CONST = {
  name: 'dev',
  constants: {
    BASE_URL: 'https://dev-crm-kpl.kerryprops.com.cn/xcrm-api/',
    BASE_URL_H5: 'https://dev-crm-kpl.kerryprops.com.cn/aifengleh5/',
    WS_BASE_URL: 'wss://dev-crm-kpl.kerryprops.com.cn/xcrm-api',
    PIC_URL: 'https://dev-crm-kpl.kerryprops.com.cn/upload',
    KIP_PAYMENT_URL: 'https://qa-payment.kerryplus.com/',
    KIP_APPID: 'wx92c3e55fbef6b2af',
    ETCP_APPID: 'wxc07f9d67923d676d',
    KIP_API: 'https://dev-gateway-kip.kerryonvip.com/api',
    PUDONG_LBS_ID: '8aaa81cb7c836c6b017c83e46b110001',
    JINGAN_LBS_ID: '8aaa81cb7c836c6b017c83e2c76f0000',
    BEIJING_LBS_ID: '8aaa80b47c784020017c78b205ba0023',
    KERRY_ON_BRAND_ID: '8aaa81947c6e1ca0017c7201e82d0001',
    KERRY_HZ_BRAND_ID: '4028e3817c2b3f79017c2b48c54c0000',
    HANGZHOU_LBS_ID: '8aaa80b47c784020017c78b00d060022',
    SHENYANG_BRAND_ID: '8a8485497c9cafbc017c9cb90b9d0000',
    SHENYANG_LBS_ID: '8a84854a7cfd947d017d02861a9d0002',
    TIANJIN_BRAND_ID: '8a84819f7c6e260e017c726b6c8f01c3',
    TIANJIN_LBS_ID: '8a84819f7c6e260e017c72a446c201c4',
    SHENZHEN_BRAND_ID: '8a84819f7c6e260e017c72669bbe01c2',
    SHENZHEN_LBS_ID: '8a8486a37f48f7bd017f4e5bddd10000',
    TRACKING_API_URL:
      'https://dev-tracking-cip.kerryplus.com/sa?project=kerry_tracking',
    REQ_lOCATION_TIME_LIMIT: 5000, // 请求位置限制时间，单位：毫秒
    LOCATION_DISTANCE_RANGE: 5000, // 附近商场的位置范围，单位：千米
  },
};

const ENV_LIST = [PROD_CONST, QA_CONST, DEV_CONST];

// 扫码积分
const BRAND_LBS_CONFIG = {
  // 北京嘉里中心
  1: {
    groupId: 'KERRY_ON_BRAND_ID',
    mallId: 'BEIJING_LBS_ID',
  },
  // 杭州嘉里中心
  2: {
    groupId: 'KERRY_HZ_BRAND_ID',
    mallId: 'HANGZHOU_LBS_ID',
  },
  // 浦东嘉里中心
  3: {
    groupId: 'KERRY_ON_BRAND_ID',
    mallId: 'PUDONG_LBS_ID',
  },
  // 静安嘉里中心
  4: {
    groupId: 'KERRY_ON_BRAND_ID',
    mallId: 'JINGAN_LBS_ID',
  },
  // 沈阳嘉里中心
  5: {
    groupId: 'SHENYANG_BRAND_ID',
    mallId: 'SHENYANG_LBS_ID',
  },
  // 天津嘉里中心
  6: {
    groupId: 'TIANJIN_BRAND_ID',
    mallId: 'TIANJIN_LBS_ID',
  },
  // 深圳嘉里中心
  7: {
    groupId: 'SHENZHEN_BRAND_ID',
    mallId: 'SHENZHEN_LBS_ID',
  },
};

const SOURCE_KEY = [
  'channel',
  'utm_channel',
  'utm_method',
  'utm_source',
  'utm_function',
  'utm_user',
  'utm_lbs',
];

const SOURCE_FUN_PREFIX = {
  activity: 'ev_',
  ticket: 'co_',
  invite: 'rf_',
};

const MINI_APP_VERSION = '1.17.0';

export {
  APPID,
  GENDER_ARR,
  BABY_STATUS_ARR,
  CERTIFICATE_TYPE_ARR,
  USER_LIST_ITEM_EDIT_OBJ,
  LICENSE_PLATE_TYPE_ARR,
  KIP_APP_PATH,
  ETCP_APP_PATH,
  ETCP_APP_INVOICE_PATH,
  REG_SOURCE,
  LOGO_DEFAULT,
  LOGO_DEFAULT1,
  LOGO_KO_DEFAULT,
  JINGAN_LOGO,
  PUDONG_LOGO,
  BEIJING_LOGO,
  HANGZHOU_LOGO,
  ENV_LIST,
  BRAND_LBS_CONFIG,
  APPID_MAP,
  SOURCE_KEY,
  SOURCE_FUN_PREFIX,
  SHENYANG_LOGO,
  TIANJIN_LOGO,
  SHENZHEN_LOGO,
  MINI_APP_VERSION,
};
