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.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' Vue.prototype.carhelp = mixin //import Vconsole from 'vconsole' //import uView from "uview-ui"; import uView from '@/uni_modules/uview-ui' Vue.use(uView); import { afterTimeStamp,parseUnixTime,newDate,daysDistance } from '@/apis/utils' Vue.mixin({ updated: function() { }, onReady() { }, onLoad(option) { if (option.test == 'test') { //let vConsole = new Vconsole() } }, methods: { showCode(info){ return info.customCode?info.customCode:'-' }, isNull(k){ if(k){ return k }else{ return '无' } }, gotoInfo(id){ if(id){ uni.navigateTo({ url:'/pages/otherFunctions/equipmentRetrieval/equipmentInfo?id='+id }) } }, descriptionKey(info,bl){ var key='' if(info.experimentPeriod&&info.experimentLastTime){ var time=parseUnixTime(afterTimeStamp(info.experimentPeriod,newDate(info.experimentLastTime)),'{y}-{m}-{d}'); var saytime=daysDistance(new Date(),time); var color="red"; if(saytime>30){ color="#4caf50"; }else if(saytime>10){ color="#ff9800"; } if(!bl){ key+=`
上次检验${info.experimentLastTime},检验周期${info.experimentPeriod?info.experimentPeriod+'天':'不定期'}
`; } key+=`下次检验${time},距离下次还剩`; if(!bl){ key+=`` } key+=`${saytime}` if(!bl){ key+=`` } key+=`天` if(!bl){ key+='
' } }else { if(!bl){ if(info.experimentLastTime){ key+=`上次检验${info.experimentLastTime},` }else{ key+=`
上次检验未录入,` } if(info.experimentPeriod){ key+=`检验周期${info.experimentPeriod?info.experimentPeriod+'天':'不定期'}
`; }else{ key+=`检验周期未录入`; } } } return key }, takeCodeJp(val){ if(val&&val.indexOf("jp=")==0){ val=val.split("jp=")[1] return val }else if(val&&val.indexOf("?jpdeviceid=")>-1){ val=val.split("?jpdeviceid=")[1] if(val.indexOf("&")>-1){ val=val.split("&")[0] } return val }else{ return '0' } }, gotoUrl(url) { uni.navigateTo({ url: "/" + url }) } } }) Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount()