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

+ 14 - 11
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd
@@ -78,6 +78,19 @@
                 $scope.multi.b = new Date($scope.dream.created_at.replace(/-/g, "/"));
                 $scope.multi.c  = $scope.dream.c;
                 $scope.multi.promise =  $scope.dream.a;
+                $top3user = storage.getObject('top3user');
+                if($scope.dream.top3user != $top3user&&$top3user != null){
+                    //测试动画切换
+                    if($scope.dream.top3user[0])$scope.sort.first = $scope.dream.top3user[0].avatar;
+                    if($scope.dream.top3user[1])$scope.sort.second = $scope.dream.top3user[1].avatar;
+                    if($scope.dream.top3user[2])$scope.sort.third = $scope.dream.top3user[2].avatar;
+                    $scope.sort.slide1 = 'list-grow-animation';
+                    $scope.sort.slide2 = 'slide-in-both-ways';
+                    $scope.sort.slide3 = 'bounce-animation';
+                    storage.setObject('top3user',$scope.dream.top3user)
+                }
+
+
                 $scope.calcmultiplier();
             }, function (error) {
                 msg.hide();
@@ -109,7 +122,7 @@
         $scope.$on('$ionicView.beforeEnter', function () {
             $scope.load(id);
             $ionicTabsDelegate.showBar(false);
-            $scope.user = storage.getObject('user');
+            $scope.thisUser = storage.getObject('user');
             console.log($scope.user);
         });
         $scope.$on('$ionicView.leave', function () {
@@ -149,9 +162,6 @@
         }
         //实时排行
         $scope.sort = {
-            first: 'img/demo/head5.jpg',
-            second: 'img/demo/head6.jpg',
-            third: 'img/demo/head7.jpg',
             slide: ''
         }
         $scope.vidEnded = function () {
@@ -185,13 +195,6 @@
             homeService.supportDream(data).then(function(result){
                 $scope.tosupport = false;
                 $scope.load(id);
-                //测试动画切换
-                $scope.sort.first = 'img/demo/head7.jpg';
-                $scope.sort.second = 'img/demo/head6.jpg';
-                $scope.sort.third = 'img/demo/head5.jpg';
-                $scope.sort.slide1 = 'list-grow-animation';
-                $scope.sort.slide2 = 'slide-in-both-ways';
-                $scope.sort.slide3 = 'bounce-animation';
                 $interval.cancel($scope.multi.promise);
             })
         };

+ 2 - 2
miaomiao/www/templates/home/dream-detail.html

xqd xqd
@@ -82,7 +82,7 @@
         <div ng-if="type==2" class="hdcontent">
             <div style="border-bottom:5px solid #FAF2F5;">
                 <div class="list">
-                    <div class="item itemjs" style="padding: 10px" ng-if="user.id==dream.user.id">
+                    <div class="item itemjs" style="padding: 10px" ng-if="thisUser.id==dream.user.id">
                     <!-- 梦想发布者可以发布梦想互动 -->
                         <a class="button button-outline button-block button-calm button-icon" ng-click="openModal()">
                         <i class="icon ion-plus"></i>
@@ -239,7 +239,7 @@
             
         </div>
         <div class="send">
-            <span>余额:<i class="calm">{{dream.user.coin}}</i> 梦想币</span> 
+            <span>余额:<i class="calm">{{dream.user_coin}}</i> 梦想币</span> 
             <span class="calm" ng-click="openRechargeModal()"><i class="icon ion-card"></i>充值</span>
             <span style="height:100%;float: right;">
             <a style="border-radius:0;width:80px;font-size:1.2em;" class="button button-calm"  ng-click="supportDream()">发送</a>

+ 3 - 2
server/app/Http/Controllers/Api/V1/DreamController.php

xqd xqd
@@ -162,6 +162,7 @@ class DreamController extends Controller
         $number =round( -$a * $b + $c,1);
         if ($number <= 1) $number = 1;
         $dream = DreamInfoModel::with(['imgs','user'])->find($id);
+        $dream->user_coin = $user->coin;
         $dream->topuser = $topuser;
         $dream->top3user = $top3user;
         $dream->interactions = $interactions;
@@ -533,8 +534,8 @@ class DreamController extends Controller
         $days = $request->days;
         $data = $request->except('_token','pics','days');
         $data['user_id'] = $user->id;
-        $data['end_time'] = strtotime('+'+$days+' days');
-        \Log::debug(' care_num:'.$care_num.' a:'.$a.' b:'.$b.' t:'.$t);
+        $data['end_time'] = date('Y-m-d H:i:s',strtotime('+'.$days.' days'));
+        \Log::debug($data['end_time'].' care_num:'.$care_num.' a:'.$a.' b:'.$b.' t:'.$t);
         if ($care_num == 0) {
             $data['score'] = (($a/$t) + $b)*100000000 ;
         }else{