|
@@ -53,6 +53,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API from '@/apis/index.js'
|
|
|
+ import {
|
|
|
+ newDate,
|
|
|
+ currentTimeStamp,
|
|
|
+ parseUnixTime,
|
|
|
+ secondsDistance,
|
|
|
+ hourDistanceArr
|
|
|
+ } from '@/utils'
|
|
|
+
|
|
|
// 获取系统状态栏的高度
|
|
|
let systemInfo = uni.getSystemInfoSync();
|
|
|
let menuButtonInfo = {};
|
|
@@ -253,73 +262,91 @@
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
- let url=window.location.href.split("#/")[1];
|
|
|
- let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
|
|
- let curRoute = routes[routes.length - 1].route
|
|
|
- var nowtime=new Date().getTime();
|
|
|
- this.descriptionHtml="";
|
|
|
-
|
|
|
- var list =this.carhelp.getConfigMessage()
|
|
|
- if(list&&list.length){
|
|
|
- //var list=JSON.parse(message);
|
|
|
|
|
|
- for(var i in list){
|
|
|
- // if(list[i].name=='*'){
|
|
|
- // this.descriptionShow=true;
|
|
|
- // this.description=list[i].value;
|
|
|
- // }
|
|
|
- if(false){
|
|
|
- console.log(list[i].url)
|
|
|
- console.log(curRoute)
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if(list[i].url==curRoute){
|
|
|
-
|
|
|
- this.descriptionShow=true;
|
|
|
- this.description=list[i].value;
|
|
|
- }
|
|
|
- if(list[i].url==url||url.indexOf(list[i].url)==0){
|
|
|
- this.descriptionShow=true;
|
|
|
- this.description=list[i].value;
|
|
|
+ var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d} {h}')
|
|
|
+ var time=this.carhelp.get("getTips_$");
|
|
|
+ if((time&&nowtime==time)){
|
|
|
+ this.getConfigMessage()
|
|
|
+ }else{
|
|
|
+ API.getTips().then((response) => {
|
|
|
+ this.carhelp.set("getTips_$",nowtime);
|
|
|
+ this.carhelp.setConfigMessage(response.data.tipsList);
|
|
|
+ this.getConfigMessage()
|
|
|
+ }).catch(error => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getConfigMessage(){
|
|
|
+ let url=window.location.href.split("#/")[1];
|
|
|
+ let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
|
|
+ let curRoute = routes[routes.length - 1].route
|
|
|
+ var nowtime=new Date().getTime();
|
|
|
+ this.descriptionHtml="";
|
|
|
|
|
|
- if(list[i].startTime){
|
|
|
- var startTime=new Date(list[i].startTime).getTime()
|
|
|
- if(startTime>nowtime){
|
|
|
- this.descriptionShow=false;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
+ var list =this.carhelp.getConfigMessage()
|
|
|
+ if(list&&list.length){
|
|
|
+ //var list=JSON.parse(message);
|
|
|
+
|
|
|
+ for(var i in list){
|
|
|
+ // if(list[i].name=='*'){
|
|
|
+ // this.descriptionShow=true;
|
|
|
+ // this.description=list[i].value;
|
|
|
+ // }
|
|
|
+ if(false){
|
|
|
+ console.log(list[i].url)
|
|
|
+ console.log(curRoute)
|
|
|
|
|
|
- if(list[i].endTime){
|
|
|
- var endTime=new Date(list[i].endTime).getTime()
|
|
|
- if(endTime<nowtime){
|
|
|
- this.descriptionShow=false;
|
|
|
- continue;
|
|
|
- }
|
|
|
}
|
|
|
- if(this.descriptionShow&&list[i].type!='1'){
|
|
|
-
|
|
|
- var sz=['top','top','modal']
|
|
|
- this.descriptionModel=sz[list[i].type];
|
|
|
- this.descriptionTitle=list[i].title;
|
|
|
+
|
|
|
+ if(list[i].url==curRoute){
|
|
|
|
|
|
- }else{
|
|
|
+ this.descriptionShow=true;
|
|
|
+ this.description=list[i].value;
|
|
|
+ }
|
|
|
+ if(list[i].url==url||url.indexOf(list[i].url)==0){
|
|
|
+ this.descriptionShow=true;
|
|
|
+ this.description=list[i].value;
|
|
|
|
|
|
- if(list[i].remark){
|
|
|
+ if(list[i].startTime){
|
|
|
+ var startTime=new Date(list[i].startTime).getTime()
|
|
|
+ if(startTime>nowtime){
|
|
|
+ this.descriptionShow=false;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(list[i].endTime){
|
|
|
+ var endTime=new Date(list[i].endTime).getTime()
|
|
|
+ if(endTime<nowtime){
|
|
|
+ this.descriptionShow=false;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.descriptionShow&&list[i].type!='1'){
|
|
|
+
|
|
|
+ var sz=['top','top','modal']
|
|
|
+ this.descriptionModel=sz[list[i].type];
|
|
|
this.descriptionTitle=list[i].title;
|
|
|
- this.descriptionHtml=list[i].remark;
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if(list[i].remark){
|
|
|
+ this.descriptionTitle=list[i].title;
|
|
|
+ this.descriptionHtml=list[i].remark;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.descriptionShow){
|
|
|
+ break;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if(this.descriptionShow){
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ },
|
|
|
alerttipsCk(){
|
|
|
if(this.descriptionHtml){
|
|
|
this.descriptionShow2=true;
|