main.js 3.6 KB

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