main.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. channelNoShow(channelNo,manufacturer ){
  35. console.log(manufacturer)
  36. var text=channelNo;
  37. if(manufacturer=='szwinline'){
  38. switch(channelNo){
  39. case '1':
  40. text="A";
  41. break;
  42. case '2':
  43. text="B";
  44. break;
  45. case '3':
  46. text="C";
  47. break;
  48. case 1:
  49. text="A";
  50. break;
  51. case 2:
  52. text="B";
  53. break;
  54. case 3:
  55. text="C";
  56. break;
  57. }
  58. }
  59. return text
  60. },
  61. showNumJP(val){
  62. if(val||val==0){
  63. val=""+val
  64. if(val.indexOf(".")>-1){
  65. val= val.substring(0,val.indexOf(".")+3);
  66. }
  67. try{
  68. val = parseFloat(val).toFixed(2);
  69. }catch(e){
  70. console.log("error +++"+e)
  71. }
  72. }
  73. return val
  74. },
  75. gotoUrl(url){
  76. uni.navigateTo({
  77. url:"/"+url
  78. })
  79. }
  80. }
  81. })
  82. app.$mount()