Просмотр исходного кода

Merge branch 'master' of http://git.9026.com/roobe/miao

Mike 8 лет назад
Родитель
Сommit
732d68366a

BIN
miaomiao/bin/Android/Debug/android-debug-unaligned.apk


BIN
miaomiao/bin/Android/Debug/android-debug.apk


+ 15 - 9
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd
@@ -73,11 +73,12 @@
                 $scope.dream = result.data.data
                 console.log();
                 var date = new Date();
-                var inter = (date.getTime() - new Date($scope.dream.created_at).getTime())/1000
+                var inter = (date.getTime() - new Date($scope.dream.created_at.replace(/-/g, "/")).getTime()) / 1000
+                
                 leftTimer($scope.dream.time-inter);
                 $scope.multi = {
                     a: $scope.dream.a,
-                    b: new Date($scope.dream.created_at),
+                    b: new Date($scope.dream.created_at.replace(/-/g, "/")),
                     c: $scope.dream.c,
                     result: 1,
                     promise:null,
@@ -120,6 +121,10 @@
         }
         $scope.timer = '';
         var leftTimer = function (countDown) {
+            if (isNaN(countDown)) {
+                $scope.timer = '结束';
+                return;
+            }
             var day=parseInt(countDown/(24*60*60));
             var h=parseInt(countDown/(60*60)%24);
             var m=parseInt(countDown/60%60);
@@ -151,7 +156,8 @@
         }
         //实时计算支持乘数
         $scope.calcmultiplier = function () {
-            $scope.multi.promise=$interval(function () {
+            $scope.multi.promise = $interval(function () {
+                
                 var date = new Date();
                 var inter = date.getTime() - $scope.multi.b.getTime();
                 var minutes = Math.floor(inter / (60 * 1000));
@@ -221,20 +227,20 @@
         }
      
         $scope.replay = function ($event, name) {
+            
+            //$event.stopPropagation();
             $scope.input.focus = true;
-        //$event.stopPropagation();
-        $scope.input.placeholder = "回复" + name;
-        
-        $scope.vm.title='';
+            $scope.input.placeholder = "回复" + name;
+            $scope.vm.title='';
         }
         $scope.comment = function(){
           //  $event.stopPropagation();
-            $scope.input.placeholder = "评论";
+            //$scope.input.placeholder = "评论";
             $scope.input.focus = true;
             $scope.vm.title='';
         }
         $scope.submitComment = function(id){
-            $scope.input.placeholder = "评论";
+           // $scope.input.placeholder = "评论";
             var data = {
                 id:id,
                 content:$scope.vm.comment,