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. var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
  6. var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
  7. if (IS_ALI) {
  8. getALIOpenId.init()
  9. } else {
  10. getOpenId.init()
  11. }
  12. import mixin from './apis/utils/mixin.js'
  13. import carhelpStudent from './apis/utils/mixin-student.js'
  14. Vue.prototype.carhelp = mixin
  15. Vue.prototype.carhelpStudent = carhelpStudent
  16. import Vconsole from 'vconsole'
  17. //import uView from "uview-ui";
  18. import uView from '@/uni_modules/uview-ui'
  19. Vue.use(uView);
  20. Vue.mixin({
  21. updated: function() {
  22. this.$nextTick(function() {
  23. var g = '';
  24. var aaa = this.carhelp.get("getElderModeClass");
  25. if (aaa == "长辈模式") {
  26. g = true;
  27. } else {
  28. g = false;
  29. }
  30. var body = document.getElementsByTagName('uni-page-body')[0].childNodes;
  31. classold(g, body);
  32. function classold(g, list) {
  33. for (var i = 0; i < list.length; i++) {
  34. try {
  35. var myclass = list[i].getAttribute("class");
  36. if (myclass) {
  37. myclass = myclass.trim().replace("oldTextClassF", "");
  38. } else {
  39. myclass = ""
  40. }
  41. if (g) {
  42. myclass = myclass.trim()
  43. myclass = " oldTextClassF " + myclass;
  44. } else {
  45. }
  46. list[i].setAttribute("class", myclass);
  47. } catch (e) {
  48. console.log("---error--classold--")
  49. console.log(list[i])
  50. }
  51. }
  52. }
  53. })
  54. },
  55. onReady() {
  56. },
  57. onLoad(option) {
  58. if (option.test == 'test') {
  59. let vConsole = new Vconsole()
  60. }
  61. },
  62. methods: {
  63. substrDate(date){
  64. if(date){
  65. return date.substr(0,11)
  66. }
  67. return ''
  68. },
  69. showNumJP(val){
  70. if(val||val==0){
  71. val=""+val
  72. if(val.indexOf(".")>-1){
  73. val= val.substring(0,val.indexOf(".")+3);
  74. }
  75. try{
  76. val = parseFloat(val).toFixed(2);
  77. }catch(e){
  78. console.log("error +++"+e)
  79. }
  80. }
  81. return val
  82. },
  83. gotoUrl(url) {
  84. uni.navigateTo({
  85. url: "/" + url
  86. })
  87. }
  88. }
  89. })
  90. Vue.config.productionTip = false
  91. App.mpType = 'app'
  92. const app = new Vue({
  93. ...App
  94. })
  95. app.$mount()