main.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. substrDate(date){
  65. if(date){
  66. return date.substr(0,11)
  67. }
  68. return ''
  69. },
  70. showNumJP(val){
  71. if(val||val==0){
  72. val=""+val
  73. if(val.indexOf(".")>-1){
  74. val= val.substring(0,val.indexOf(".")+3);
  75. }
  76. try{
  77. val = parseFloat(val).toFixed(2);
  78. }catch(e){
  79. console.log("error +++"+e)
  80. }
  81. }
  82. return val
  83. },
  84. gotoUrl(url) {
  85. uni.navigateTo({
  86. url: "/" + url
  87. })
  88. }
  89. }
  90. })
  91. Vue.config.productionTip = false
  92. App.mpType = 'app'
  93. const app = new Vue({
  94. ...App
  95. })
  96. app.$mount()