main.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import Vue from 'vue'
  2. import App from './App'
  3. //import MyCommon from '@/components/Common.vue'
  4. //import CarLoading from '@/components/Loading.vue'
  5. import getOpenId from './utils/init.js'
  6. getOpenId.init()
  7. import 'remixicon/fonts/remixicon.css'
  8. import mixin from './utils/mixin.js'
  9. Vue.config.ignoredElements.push("wx-open-subscribe") ;
  10. Vue.prototype.carhelp=mixin
  11. import Vconsole from 'vconsole'
  12. //import './router' // 引入路由
  13. import router from './bobo-router'
  14. //1.echarts 引入的时候,会优先判断当前的环境。
  15. //2.由于uni app 中有一个 ‘wx’ 全局变量污染了echarts中的 wx 变量,导致这里的判断直接走第一个,echarts 部分功能无法生效。
  16. window.wx = {}
  17. // main.js
  18. import uView from "uview-ui";
  19. Vue.use(uView);
  20. Vue.config.productionTip = false
  21. App.mpType = 'app'
  22. const app = new Vue({
  23. ...App
  24. })
  25. //Vue.component('my-common',MyCommon)
  26. //Vue.component('car-loading',CarLoading)
  27. //Vue.use(mixin)
  28. Vue.mixin({
  29. onLoad( option){
  30. if (option.test == 'test') {
  31. let vConsole = new Vconsole()
  32. }
  33. } ,methods:{
  34. showNumJP(val){
  35. if(val||val==0){
  36. val=""+val
  37. if(val.indexOf(".")>-1){
  38. val= val.substring(0,val.indexOf(".")+3);
  39. }
  40. try{
  41. val = parseFloat(val).toFixed(2);
  42. }catch(e){
  43. console.log("error +++"+e)
  44. }
  45. }
  46. return val
  47. },
  48. gotoUrl(url){
  49. uni.navigateTo({
  50. url:"/"+url
  51. })
  52. }
  53. }
  54. })
  55. app.$mount()