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