// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vant from 'vant';
import App from './App'
import router from './router'
import store from './store/index.js'
import axios from 'axios'
import 'babel-polyfill'
import 'core-js/fn/array/flatten'
import { getUrl } from './common/js/methods'
import { resetForm } from './common/js/public'

import 'vant/lib/index.css';
import 'vant/lib/icon/local.css';
import './common/css/font.css'
import Pagination from "./public/Pagination/index.vue";

if (isH5Milieu) {
  import('./common/css/h5style.css')
}

import { mobileFilterAdd } from './common/js/methods'
// import { Popup, NavBar, Icon, AddressEdit, Toast, Tabbar, TabbarItem, Form, Field, Button, Picker, DatetimePicker, Pagination, Overlay, Tab, Tabs, Empty, Dialog, Uploader } from 'vant';

// Vue.use(Popup).use(NavBar).use(Icon).use(AddressEdit).use(Toast).use(Tabbar).use(TabbarItem).use(Form).use(Field).use(Button).use(Picker).use(DatetimePicker).use(Pagination).use(Overlay).use(Tab).use(Tabs).use(Empty).use(Dialog).use(Uploader)


Vue.use(Vant);

Vue.filter('mobileFilterAdd', mobileFilterAdd)

Vue.prototype.resetForm = resetForm

// 全局组件挂载
Vue.component('Pagination', Pagination)

Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.config.devtools = true

if (process.env.NODE_ENV === 'production') {
  console.log('生产环境');
} else if (process.env.NODE_ENV === 'zhejiang') {
  console.log('浙江环境');
} else if (process.env.NODE_ENV === 'henan') {
  console.log('河南环境');
} else if (process.env.NODE_ENV === 'pre-release') {
  console.log('其它地市的环境');
} else if (process.env.NODE_ENV === 'hebei') {
  console.log('河北环境');
}
// 河南用到了 Authorization-Token
sessionStorage.setItem('Authorization-Token', getUrl().token)
sessionStorage.setItem('Authorization-fromSystem', getUrl().fromSystem)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  components: { App },
  template: '<App/>',
})


