main.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. //支付宝的
  7. import getALIOpenId from './utils/initALI.js'
  8. var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
  9. var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
  10. // if(IS_WEIXIN){
  11. // }
  12. if(IS_ALI){
  13. getALIOpenId.init()
  14. }else{
  15. getOpenId.init()
  16. }
  17. import mixin from './utils/mixin.js'
  18. Vue.config.ignoredElements.push("wx-open-subscribe");
  19. Vue.prototype.carhelp = mixin
  20. // 先运行yarn 初始化
  21. import Vconsole from 'vconsole'
  22. //import './router' // 引入路由
  23. import router from './bobo-router'
  24. // main.js
  25. // 先运行yarn 初始化
  26. import uView from "uview-ui";
  27. Vue.use(uView);
  28. Vue.config.productionTip = false
  29. App.mpType = 'app'
  30. const app = new Vue({
  31. ...App
  32. })
  33. //Vue.component('my-common',MyCommon)
  34. //Vue.component('car-loading',CarLoading)
  35. //Vue.use(mixin)
  36. Vue.mixin({
  37. updated: function() {
  38. this.$nextTick(function() {
  39. var g = '';
  40. var aaa=this.carhelp.get("getElderModeClass");
  41. if(aaa == "长辈模式") {
  42. g = true;
  43. } else {
  44. g = false;
  45. }
  46. // 仅在整个视图都被重新渲染之后才会运行的代码
  47. var list = document.getElementsByClassName("oldTextjp")
  48. var list2 = document.getElementsByClassName("oldTextjp2")
  49. for (var i = 0; i < list.length; i++) {
  50. var edit = list[i].getAttribute("oldstyle-edit");
  51. if(!edit){
  52. list[i].setAttribute("oldstyle-edit",list[i].style.cssText);
  53. }else{
  54. edit=""
  55. }
  56. if (g) {
  57. var str = list[i].getAttribute("oldstyle");
  58. if(str){
  59. list[i].style = str+";font-weight:bold !important;"
  60. }
  61. }else{
  62. list[i].style=edit
  63. }
  64. }
  65. for (var j = 0; j < list2.length; j++) {
  66. var edit = list2[j].getAttribute("oldstyle-edit");
  67. if(!edit){
  68. list2[j].setAttribute("oldstyle-edit",list2[j].style.cssText);
  69. }else{
  70. edit=""
  71. }
  72. if (g) {
  73. var str = list2[j].getAttribute("oldstyle");
  74. if(str){
  75. list2[j].style = str+";"
  76. }
  77. }else{
  78. if(edit){
  79. list2[j].style=edit
  80. }
  81. }
  82. }
  83. // for (var i = 0; i < list.length; i++) {
  84. // var str = ""
  85. // for (var j in relist) {
  86. // var num = list[i].getAttribute(j);
  87. // if (num) {
  88. // var k = relist[j]
  89. // k = k.replaceAll("[num]", num)
  90. // str += k + ";";
  91. // }
  92. // }
  93. // list[i].style = str
  94. // }
  95. var list_u_title = document.getElementsByClassName("u-title")
  96. for (var i = 0; i < list_u_title.length; i++) {
  97. if (g) {
  98. list_u_title[i].style ="line-height: 26px;color: rgb(96, 98, 102); font-size: 20px; overflow: unset;"
  99. }else{
  100. list_u_title[i].style ="color: rgb(96, 98, 102); font-size: 13px; font-weight: normal;"
  101. }
  102. }
  103. })
  104. },
  105. onReady() {
  106. },
  107. onLoad(option) {
  108. if (option.test == 'test') {
  109. let vConsole = new Vconsole()
  110. }
  111. },
  112. methods: {
  113. gotoUrl(url) {
  114. uni.navigateTo({
  115. url: "/" + url
  116. })
  117. }
  118. }
  119. })
  120. app.$mount()