main.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. chargeUserPhoneXDT(phone,userType){
  35. if(phone&&phone.indexOf('XDT')==0){
  36. return '哪吒用户'
  37. }
  38. if(userType==1){
  39. return '游客'
  40. }else if(userType==2){
  41. return '会员'
  42. }else{
  43. return ''
  44. }
  45. },
  46. channelNoShow(channelNo,manufacturer,customNo ){
  47. if(customNo){
  48. return customNo
  49. }
  50. console.log(manufacturer)
  51. var text=channelNo;
  52. if(manufacturer=='szwinline'){
  53. switch(channelNo){
  54. case '1':
  55. text="A";
  56. break;
  57. case '2':
  58. text="B";
  59. break;
  60. case '3':
  61. text="C";
  62. break;
  63. case 1:
  64. text="A";
  65. break;
  66. case 2:
  67. text="B";
  68. break;
  69. case 3:
  70. text="C";
  71. break;
  72. }
  73. }
  74. return text
  75. },
  76. showNumJP(val){
  77. if(val||val==0){
  78. val=""+val
  79. if(val.indexOf(".")>-1){
  80. val= val.substring(0,val.indexOf(".")+3);
  81. }
  82. try{
  83. val = parseFloat(val).toFixed(2);
  84. }catch(e){
  85. console.log("error +++"+e)
  86. }
  87. }
  88. return val
  89. },
  90. gotoUrl(url){
  91. uni.navigateTo({
  92. url:"/"+url
  93. })
  94. }
  95. }
  96. })
  97. app.$mount()