main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. window.wx = {}
  15. // main.js
  16. import uView from "uview-ui";
  17. Vue.use(uView);
  18. Vue.config.productionTip = false
  19. App.mpType = 'app'
  20. const app = new Vue({
  21. ...App
  22. })
  23. //Vue.component('my-common',MyCommon)
  24. //Vue.component('car-loading',CarLoading)
  25. //Vue.use(mixin)
  26. Vue.mixin({
  27. onLoad( option){
  28. if (option.test == 'test') {
  29. let vConsole = new Vconsole()
  30. }
  31. } ,methods:{
  32. showNumJP(val){
  33. if(val||val==0){
  34. val=""+val
  35. if(val.indexOf(".")>-1){
  36. val= val.substring(0,val.indexOf(".")+3);
  37. }
  38. try{
  39. val = parseFloat(val).toFixed(2);
  40. }catch(e){
  41. console.log("error +++"+e)
  42. }
  43. }
  44. return val
  45. },
  46. gotoUrl(url){
  47. uni.navigateTo({
  48. url:"/"+url
  49. })
  50. }
  51. }
  52. })
  53. app.$mount()