main.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 = '';
  30. var aaa=this.carhelp.get("getElderModeClass");
  31. if(aaa == "长辈模式") {
  32. g = true;
  33. } else {
  34. g = false;
  35. }
  36. // 仅在整个视图都被重新渲染之后才会运行的代码
  37. var list = document.getElementsByClassName("oldTextjp")
  38. var list2 = document.getElementsByClassName("oldTextjp2")
  39. for (var i = 0; i < list.length; i++) {
  40. var edit = list[i].getAttribute("oldstyle-edit");
  41. if(!edit){
  42. list[i].setAttribute("oldstyle-edit",list[i].style.cssText);
  43. }else{
  44. edit=""
  45. }
  46. if (g) {
  47. var str = list[i].getAttribute("oldstyle");
  48. if(str){
  49. list[i].style = str+";font-weight:bold !important;"
  50. }
  51. }else{
  52. list[i].style=edit
  53. }
  54. }
  55. for (var j = 0; j < list2.length; j++) {
  56. var edit = list2[j].getAttribute("oldstyle-edit");
  57. if(!edit){
  58. list2[j].setAttribute("oldstyle-edit",list2[j].style.cssText);
  59. }else{
  60. edit=""
  61. }
  62. if (g) {
  63. var str = list2[j].getAttribute("oldstyle");
  64. if(str){
  65. list2[j].style = str+";"
  66. }
  67. }else{
  68. if(edit){
  69. list2[j].style=edit
  70. }
  71. }
  72. }
  73. // for (var i = 0; i < list.length; i++) {
  74. // var str = ""
  75. // for (var j in relist) {
  76. // var num = list[i].getAttribute(j);
  77. // if (num) {
  78. // var k = relist[j]
  79. // k = k.replaceAll("[num]", num)
  80. // str += k + ";";
  81. // }
  82. // }
  83. // list[i].style = str
  84. // }
  85. var list_u_title = document.getElementsByClassName("u-title")
  86. for (var i = 0; i < list_u_title.length; i++) {
  87. if (g) {
  88. list_u_title[i].style ="line-height: 26px;color: rgb(96, 98, 102); font-size: 20px;"
  89. }else{
  90. list_u_title[i].style ="color: rgb(96, 98, 102); font-size: 13px; font-weight: normal;"
  91. }
  92. }
  93. })
  94. },
  95. onReady() {
  96. },
  97. onLoad(option) {
  98. if (option.test == 'test') {
  99. let vConsole = new Vconsole()
  100. }
  101. },
  102. methods: {
  103. gotoUrl(url) {
  104. uni.navigateTo({
  105. url: "/" + url
  106. })
  107. }
  108. }
  109. })
  110. app.$mount()