main.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import 'babel-polyfill'
  2. import Vue from 'vue'
  3. import App from './App'
  4. import vuex from 'vuex'
  5. import Toast from '@/components/toast/toast'
  6. import 'lib-flexible/flexible.js'
  7. import VueAwesomeSwiper from 'vue-awesome-swiper'
  8. import 'swiper/dist/css/swiper.css'
  9. import './register-components'
  10. import { i18n } from './lang'
  11. Vue.use(VueAwesomeSwiper)
  12. // import axios from './util/http.js'
  13. // import router from './router'
  14. Vue.prototype.$cdn = process.env.IS_INTERNATIONAL ? 'https://eurs3.4dkankan.com/website/mobile/' : 'https://4dscene.4dage.com/new4dkk/mobile/'
  15. Vue.prototype.$rootCdn = 'https://4dscene.4dage.com/new4dkk/'
  16. // Vue.prototype.$cdn = 'https://4dscene.oss-cn-shenzhen.aliyuncs.com/new4dkk/mobile/'
  17. Vue.use(vuex)
  18. Vue.use(Toast)
  19. Vue.prototype.$bus = new Vue()
  20. let axios = require('./util/http.js').default
  21. let router = require('./router').default
  22. Vue.prototype.$http = axios
  23. Vue.prototype.$serverName = 'https://www.4dkankan.com/'
  24. // Vue.prototype.$serverName = ''
  25. Vue.config.productionTip = false
  26. function dateFtt (fmt) {
  27. let date = this
  28. let o = {
  29. 'M+': date.getMonth() + 1,
  30. 'd+': date.getDate(),
  31. 'h+': date.getHours(),
  32. 'm+': date.getMinutes(),
  33. 's+': date.getSeconds(),
  34. 'q+': Math.floor((date.getMonth() + 3) / 3),
  35. 'S': date.getMilliseconds()
  36. }
  37. if (/(y+)/.test(fmt)) {
  38. fmt = fmt.replace(
  39. RegExp.$1,
  40. (date.getFullYear() + '').substr(4 - RegExp.$1.length)
  41. )
  42. }
  43. for (let k in o) {
  44. if (new RegExp('(' + k + ')').test(fmt)) {
  45. fmt = fmt.replace(
  46. RegExp.$1,
  47. RegExp.$1.length === 1
  48. ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
  49. )
  50. }
  51. }
  52. return fmt
  53. }
  54. /* eslint-disable */
  55. Date.prototype.format = dateFtt
  56. /* eslint-enable */
  57. /* eslint-disable no-new */
  58. window.$app = new Vue({
  59. el: '#app',
  60. router,
  61. i18n,
  62. store: require('./store').default,
  63. components: { App },
  64. template: '<App/>'
  65. })