import App from './App' import Vue from 'vue' import getOpenId from './apis/utils/init.js' import getALIOpenId from './apis/utils/initALI.js' //import './assets/font/font/font.css' var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent) var IS_ALI = /AlipayClient/.test(window.navigator.userAgent) if (IS_ALI) { getALIOpenId.init() } else { getOpenId.init() } import mixin from './apis/utils/mixin.js' import carhelpStudent from './apis/utils/mixin-student.js' Vue.prototype.carhelp = mixin Vue.prototype.carhelpStudent = carhelpStudent import Vconsole from 'vconsole' //import uView from "uview-ui"; import uView from '@/uni_modules/uview-ui' Vue.use(uView); Vue.mixin({ updated: function() { this.$nextTick(function() { var g = ''; var aaa = this.carhelp.get("getElderModeClass"); if (aaa == "长辈模式") { g = true; } else { g = false; } var body = document.getElementsByTagName('uni-page-body')[0].childNodes; classold(g, body); function classold(g, list) { for (var i = 0; i < list.length; i++) { try { var myclass = list[i].getAttribute("class"); if (myclass) { myclass = myclass.trim().replace("oldTextClassF", ""); } else { myclass = "" } if (g) { myclass = myclass.trim() myclass = " oldTextClassF " + myclass; } else { } list[i].setAttribute("class", myclass); } catch (e) { console.log("---error--classold--") console.log(list[i]) } } } }) }, onReady() { }, onLoad(option) { if (option.test == 'test') { let vConsole = new Vconsole() } }, methods: { recordStatusColor(val){ var retu = "" val=val+'' switch (val) { case '-1': retu = '#f29a38' break; case '0': retu = '#f29a38' break; case '1': retu = '#52b56b' break; case '2': retu = '#3a3bc2' break; case '3': retu = '#c94031' break; case '5': retu = '#c94031' break; case '6': retu = '#c94031' case '9': retu = '#c94031' break; default: retu = '#52b56b' break; } return retu }, substrDate(date){ if(date){ return date.substr(0,11) } return '' }, showNumJP(val){ if(val||val==0){ val=""+val if(val.indexOf(".")>-1){ val= val.substring(0,val.indexOf(".")+3); } try{ val = parseFloat(val).toFixed(2); }catch(e){ console.log("error +++"+e) } } return val }, gotoUrl(url) { uni.navigateTo({ url: "/" + url }) } } }) Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount()