// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
import 'core-js/stable';
import 'regenerator-runtime/runtime';

import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store/index';
import request from './config/request';
import dayjs from 'dayjs';
import own from '@/common/own.js';
// 引入echarts
import * as echarts from 'echarts';
// 全局引入按需引入UI库 vant
import '@/plugins/vant';
// 引入全局样式
import '@/assets/css/index.scss';
// 移动端适配
import 'amfe-flexible';
import VConsole from 'vconsole';
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$echarts = echarts;
Vue.prototype.$store = store;
Vue.prototype.$own = own;
Vue.prototype.$axios = request;
Vue.prototype.$green = '#189b3b';
// 判断是否是pc设备
const isPc = () => {
  const userAgentInfo = navigator.userAgent;
  const Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
  let flag = true;
  for (let v = 0; v < Agents.length; v++) {
    if (userAgentInfo.indexOf(Agents[v]) > 0) {
      flag = false;
      break;
    }
  }
  return flag;
};
//如果不是生产环境并且不是pc设备那么就显示调试
if (process.env.NODE_ENV == 'test' && !isPc()) {
  // eslint-disable-next-line no-unused-vars
  const vConsole = new VConsole();
}
// filters
import './filters';
Vue.config.productionTip = false;

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
});
