123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- 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+=`<p>上次检验${info.experimentLastTime},检验周期${info.experimentPeriod?info.experimentPeriod+'天':'不定期'}</p><p>`;
- }
- key+=`下次检验${time},距离下次还剩`;
- if(!bl){
- key+=`<span style="color:${color}">`
- }
-
- key+=`${saytime}`
- if(!bl){
- key+=`</span>`
- }
- key+=`天`
- if(!bl){
- key+='</p>'
- }
- }else {
- if(!bl){
- if(info.experimentLastTime){
- key+=`<p>上次检验${info.experimentLastTime},`
- }else{
- key+=`<p>上次检验<span style='color:red'>未录入</span>,`
- }
- if(info.experimentPeriod){
- key+=`检验周期${info.experimentPeriod?info.experimentPeriod+'天':'不定期'}</p>`;
- }else{
- key+=`检验周期<span style='color:red'>未录入</span></p>`;
- }
-
- }
- }
-
- 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()
|