/*
 * @Description:
 * @Author: Fugang
 * @Date: 2019-07-23 15:58:50
 * @LastEditors: 许宏杰
 * @LastEditTime: 2022-06-21 14:11:57
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

function rewirteLog() {
  //生产环境 重写console.log 禁用
  console.log = (function (log) {
    return process.env.NODE_ENV == 'production' ? function () {} : log
  })(console.log)
}

import './assets/css/all-style.css'

import Vant from 'vant'
import 'vant/lib/index.css'
import './assets/css/vant-ui.scss'

import { Icon } from 'vant' // Icon 图标
import { Loading } from 'vant'

Vue.use(Loading)

import { installApk } from './util/sbIf.js'

Vue.prototype.$installApk = installApk

import moment from 'moment'
import 'moment/locale/zh-cn'

// 引入Leaflet对象 挂载到Vue上，便于全局使用，也可以单独页面中单独引用
import 'leaflet/dist/leaflet.css'
import * as L from 'leaflet'

/* leaflet icon */
delete L.Icon.Default.prototype._getIconUrl
L.Icon.Default.mergeOptions({
  iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
  iconUrl: require('leaflet/dist/images/marker-icon.png'),
  shadowUrl: require('leaflet/dist/images/marker-shadow.png'),
})

//引入字体
import '../src/assets/css/font.css'

Vue.use(Icon)
Vue.use(Vant)

Vue.L = Vue.prototype.$L = L

Vue.config.productionTip = false

moment.locale('zh-cn')
Vue.prototype.$moment = moment

Vue.prototype.config = {
  barHeight: 20,
  setBarHeight(h) {
    this.barHeight = h
  },
}

// PC调式版本
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')

// 手机打包版本
// document.addEventListener(
//   'plusready',
//   function () {
//     new Vue({
//       router,
//       store,
//       render: (h) => h(App),
//     }).$mount('#app')
//   },
//   false
// )
