main.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 mixin from './utils/mixin.js'
  8. Vue.config.ignoredElements.push("wx-open-subscribe");
  9. Vue.prototype.carhelp = mixin
  10. // 先运行yarn 初始化
  11. import Vconsole from 'vconsole'
  12. //import './router' // 引入路由
  13. import router from './bobo-router'
  14. // main.js
  15. // 先运行yarn 初始化
  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. updated: function() {
  28. this.$nextTick(function() {
  29. var g=this.carhelp.get("getElderModeClass");
  30. // 仅在整个视图都被重新渲染之后才会运行的代码
  31. var list = document.getElementsByClassName("oldTextjp")
  32. var list2 = document.getElementsByClassName("oldTextjp2")
  33. for (var i = 0; i < list.length; i++) {
  34. var edit = list[i].getAttribute("oldstyle-edit");
  35. if(!edit){
  36. list[i].setAttribute("oldstyle-edit",list[i].style.cssText);
  37. }else{
  38. edit=""
  39. }
  40. if (g) {
  41. var str = list[i].getAttribute("oldstyle");
  42. if(str){
  43. list[i].style = str+";font-weight:bold !important;"
  44. }
  45. }else{
  46. list[i].style=edit
  47. }
  48. }
  49. for (var i = 0; i < list2.length; i++) {
  50. var edit = list2[i].getAttribute("oldstyle-edit");
  51. if(!edit){
  52. list2[i].setAttribute("oldstyle-edit",list2[i].style.cssText);
  53. }else{
  54. edit=""
  55. }
  56. if (g) {
  57. var str = list2[i].getAttribute("oldstyle");
  58. if(str){
  59. list2[i].style = str+";"
  60. }
  61. }else{
  62. list2[i].style=edit
  63. }
  64. }
  65. // for (var i = 0; i < list.length; i++) {
  66. // var str = ""
  67. // for (var j in relist) {
  68. // var num = list[i].getAttribute(j);
  69. // if (num) {
  70. // var k = relist[j]
  71. // k = k.replaceAll("[num]", num)
  72. // str += k + ";";
  73. // }
  74. // }
  75. // list[i].style = str
  76. // }
  77. })
  78. },
  79. onReady() {
  80. },
  81. onLoad(option) {
  82. if (option.test == 'test') {
  83. let vConsole = new Vconsole()
  84. }
  85. },
  86. methods: {
  87. gotoUrl(url) {
  88. uni.navigateTo({
  89. url: "/" + url
  90. })
  91. }
  92. }
  93. })
  94. app.$mount()