git vor 6 Jahren
Ursprung
Commit
2287b98b57
4 geänderte Dateien mit 20 neuen und 3 gelöschten Zeilen
  1. 16 2
      pages/amap/amap.js
  2. 1 1
      pages/amap/route/route.js
  3. 1 0
      pages/demo/getpage/getpage.js
  4. 2 0
      pages/my/my.js

+ 16 - 2
pages/amap/amap.js

@@ -223,12 +223,14 @@
                     //在线状态
                     if(mapData.onlineTime){
                         if(parseInt(mapData.onlineTime) < 0 ){
-                            console.log(parseInt(mapData.onlineTime)+'-在线时间');
                             $('#on-off-online').text('未在线过');
                             $('#on-off-online').css({color:"gray"})
+                            var routeTime = new Date(0);
+                            routePageData = {speed: mapData.speed == null ? 0 : mapData.speed, lastTime:routeTime.Format("yyyy-MM-dd hh:mm:ss")}
                         }else{
                             var routeTime = new Date(mapData.onlineTime*1000);
                             routePageData = {speed: mapData.speed == null ? 0 : mapData.speed, lastTime:routeTime.Format("yyyy-MM-dd hh:mm:ss")}
+                            console.log('testtime')
                             var interval = parseInt(new Date().getTime()/1000) - mapData.onlineTime;
                             if(interval < 24*3600){
                                 $('#on-off-online').text('在线中');
@@ -437,7 +439,19 @@
                 infoWindow.open(mainMap, lnglat);
             }
             
-        }
+            console.log(pageinfo);
+            console.log(learun.storage.get('userinfo').baseinfo)
+            console.log(learun.nav.getpage('amap'));
+        },
+
+
+        destroy: function (pageinfo) {
+            console.log('destory page')
+            
+        },
+
+
+        
     };
 
     return page;

+ 1 - 1
pages/amap/route/route.js

@@ -6,7 +6,7 @@
            learun.layer.loading(true, "加载数据中");
            var userinfo = learun.storage.get('userinfo');
             $('#route-devicenumber').text(userinfo.baseinfo.deviceNumber);
-            $('#date-time').text('时间:'+param.lastTime);
+            $('#date-time').text('时间:'+param.lastTime || '0000-00-00 00:00:00');
             $('#vehicle-speed').text('速度:'+param.speed+' km/h')
 			
             //播放控制相关事件清除

+ 1 - 0
pages/demo/getpage/getpage.js

@@ -4,6 +4,7 @@
             $page.find('#getpage1').on('tap', function () {
                 var prepage = learun.nav.getpage('demo');
                 if (prepage) {
+                    console.log(prepage);
                     learun.layer.toast('获取成功');
                 } else {
                     learun.layer.toast('获取失败');

+ 2 - 0
pages/my/my.js

@@ -31,6 +31,8 @@
                         learun.isOutLogin = true;
                         learun.storage.set('logininfo', null);
                         learun.nav.go({ path: 'login', isBack: false, isHead: false });
+
+                        learun.nav.getpage('amap').destroy()
                     }
 
                 }, '', ['取消', '退出']);