main.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. import App from './App'
  2. import Vue from 'vue'
  3. import getOpenId from './apis/utils/init.js'
  4. import getALIOpenId from './apis/utils/initALI.js'
  5. //import './assets/font/font/font.css'
  6. var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
  7. var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
  8. if (IS_ALI) {
  9. getALIOpenId.init()
  10. } else {
  11. getOpenId.init()
  12. }
  13. import mixin from './apis/utils/mixin.js'
  14. import carhelpStudent from './apis/utils/mixin-student.js'
  15. Vue.prototype.carhelp = mixin
  16. Vue.prototype.carhelpStudent = carhelpStudent
  17. import Vconsole from 'vconsole'
  18. //import uView from "uview-ui";
  19. import uView from '@/uni_modules/uview-ui'
  20. Vue.use(uView);
  21. Vue.mixin({
  22. updated: function() {
  23. this.$nextTick(function() {
  24. var g = '';
  25. var aaa = this.carhelp.get("getElderModeClass");
  26. if (aaa == "长辈模式") {
  27. g = true;
  28. } else {
  29. g = false;
  30. }
  31. var body = document.getElementsByTagName('uni-page-body')[0].childNodes;
  32. classold(g, body);
  33. function classold(g, list) {
  34. for (var i = 0; i < list.length; i++) {
  35. try {
  36. var myclass = list[i].getAttribute("class");
  37. if (myclass) {
  38. myclass = myclass.trim().replace("oldTextClassF", "");
  39. } else {
  40. myclass = ""
  41. }
  42. if (g) {
  43. myclass = myclass.trim()
  44. myclass = " oldTextClassF " + myclass;
  45. } else {
  46. }
  47. list[i].setAttribute("class", myclass);
  48. } catch (e) {
  49. console.log("---error--classold--")
  50. console.log(list[i])
  51. }
  52. }
  53. }
  54. })
  55. },
  56. onReady() {
  57. },
  58. onLoad(option) {
  59. if (option.test == 'test') {
  60. let vConsole = new Vconsole()
  61. }
  62. },
  63. methods: {
  64. recordStatusColor(val){
  65. var retu = ""
  66. val=val+''
  67. switch (val) {
  68. case '-1':
  69. retu = '#f29a38'
  70. break;
  71. case '0':
  72. retu = '#f29a38'
  73. break;
  74. case '1':
  75. retu = '#52b56b'
  76. break;
  77. case '2':
  78. retu = '#3a3bc2'
  79. break;
  80. case '3':
  81. retu = '#c94031'
  82. break;
  83. case '5':
  84. retu = '#c94031'
  85. break;
  86. case '6':
  87. retu = '#c94031'
  88. case '9':
  89. retu = '#c94031'
  90. break;
  91. default:
  92. retu = '#52b56b'
  93. break;
  94. }
  95. return retu
  96. },
  97. substrDate(date){
  98. if(date){
  99. return date.substr(0,11)
  100. }
  101. return ''
  102. },
  103. showNumJP(val){
  104. if(val||val==0){
  105. val=""+val
  106. if(val.indexOf(".")>-1){
  107. val= val.substring(0,val.indexOf(".")+3);
  108. }
  109. try{
  110. val = parseFloat(val).toFixed(2);
  111. }catch(e){
  112. console.log("error +++"+e)
  113. }
  114. }
  115. return val
  116. },
  117. gotoUrl(url) {
  118. uni.navigateTo({
  119. url: "/" + url
  120. })
  121. }
  122. }
  123. })
  124. Vue.config.productionTip = false
  125. App.mpType = 'app'
  126. const app = new Vue({
  127. ...App
  128. })
  129. app.$mount()