Przeglądaj źródła

Merge branch 'gq' of ssh://git.9026.com:2212/roobe/miao into gq

gq 8 lat temu
rodzic
commit
45f13b277c

+ 3 - 3
miaomiao/plugins/ios.json

xqd xqd
@@ -7,6 +7,9 @@
         "files": {}
     },
     "installed_plugins": {
+        "cordova-hot-code-push-plugin": {
+            "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
+        },
         "cordova-plugin-actionsheet": {
             "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
         },
@@ -47,9 +50,6 @@
         },
         "ionic-plugin-keyboard": {
             "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
-        },
-        "cordova-hot-code-push-plugin": {
-            "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
         }
     },
     "dependent_plugins": {}

+ 1 - 1
miaomiao/www/chcp.json

xqd
@@ -1,5 +1,5 @@
 {
   "update": "now",
   "content_url": "http://i.9026.com/miaomiao/",
-  "release": "2017.06.29-13.02.54"
+  "release": "2017.06.29-15.35.19"
 }

+ 2 - 2
miaomiao/www/chcp.manifest

xqd xqd
@@ -145,7 +145,7 @@
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "923fe50a8313a93d7fc11192907978ba"
+    "hash": "e6eab7933164bf536e89e48c31719a44"
   },
   {
     "file": "js/controllers/my.js",
@@ -461,7 +461,7 @@
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "d591521d33e1052d2e323069447ebf85"
+    "hash": "f18862ee66df64f91e79df6a8b97a75f"
   },
   {
     "file": "templates/home/index.html",

+ 36 - 31
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd xqd xqd xqd
@@ -55,13 +55,13 @@
         }
         $scope.data = {};
         $scope.load(true);
-        $scope.$on('$ionicView.leave', function () {
+        $scope.$on('$ionicView.beforeLeave', function () {
             $scope.popover.hide();
         });
     }]);
 
-    app.controller('dreamDetailCtrl', ["$scope", "$state", "msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
-        , function ($scope, $state, msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
+    app.controller('dreamDetailCtrl', ["$scope", "$state", "storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
+        , function ($scope, $state, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
         var id = $stateParams.id;
         id=5;
         $scope.load = function (id) {
@@ -70,24 +70,39 @@
                 msg.hide();
                 console.log(result);
                 $scope.dream = result.data.data
-                console.log();
+                var end_time = new Date($scope.dream.end_time);
                 var date = new Date();
-                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.replace(/-/g, "/")),
-                    c: $scope.dream.c,
-                    result: 1,
-                    promise:null,
+                var inter = (end_time.getTime() - date.getTime()) / 1000
+                leftTimer(inter);
+                $scope.multi.a =  $scope.dream.a;
+                $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();
             });
         }
-
+        $scope.multi = {
+            a: '',
+            b: '',
+            c: '',
+            result: 1,
+            promise:null,
+        }
         $scope.type = 1;//tab切换
         $scope.tosupport = false;
         $scope.support = function ($event) { 
@@ -107,6 +122,8 @@
         $scope.$on('$ionicView.beforeEnter', function () {
             $scope.load(id);
             $ionicTabsDelegate.showBar(false);
+            $scope.thisUser = storage.getObject('user');
+            console.log($scope.user);
         });
         $scope.$on('$ionicView.leave', function () {
             $ionicTabsDelegate.showBar(true);
@@ -145,9 +162,6 @@
         }
         //实时排行
         $scope.sort = {
-            first: 'img/demo/head5.jpg',
-            second: 'img/demo/head6.jpg',
-            third: 'img/demo/head7.jpg',
             slide: ''
         }
         $scope.vidEnded = function () {
@@ -180,16 +194,7 @@
 
             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);
             })
         };
@@ -226,8 +231,7 @@
         }
      
         $scope.replay = function ($event, name) {
-            
-            //$event.stopPropagation();
+            $event.stopPropagation();
             $scope.input.focus = true;
             $scope.input.placeholder = "回复" + name;
             $scope.vm.title='';
@@ -238,12 +242,13 @@
             $scope.input.focus = true;
             $scope.vm.title='';
         }
-        $scope.submitComment = function(id){
-           // $scope.input.placeholder = "评论";
+        $scope.submitComment = function(iid){
+            if($scope.vm.comment&&$scope.vm.comment==''||!iid)return;
             var data = {
-                id:id,
+                id:iid,
                 content:$scope.vm.comment,
             };
+            console.log($scope.vm.comment+" "+iid)
             homeService.add_comment(data).then(function(){
                 $scope.vm.comment = '' ;
                 $scope.load(id);

+ 5 - 13
miaomiao/www/templates/home/dream-detail.html

xqd xqd xqd
@@ -82,18 +82,18 @@
         <div ng-if="type==2" class="hdcontent">
             <div style="border-bottom:5px solid #FAF2F5;">
                 <div class="list">
-                    <div class="item itemjs" style="padding: 10px">
+                    <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>
-                        发布梦想互动</a>
+                        发布梦想互动 </a>
                     </div>
                     <div class="item" ng-click="comment()" ng-repeat="interaction in dream.interactions"> 
                         <img class="head" ng-src="{{dream.user.avatar}}" />
                         <span class="utitle">{{dream.user.nickname}}</span>
                         <span class="utitle kz">{{interaction.created_at}}</span>
                         <p class="subtile" style="white-space:normal">{{interaction.title}}</p>
-                        <div class="picts">
+                        <div class="picts item">
                             <img class="slt" ng-src="{{interaction.pic1}}" ng-if="interaction.pic1"/>
                             <img class="slt" ng-src="{{interaction.pic2}}" ng-if="interaction.pic2"/>
                             <img class="slt" ng-src="{{interaction.pic3}}" ng-if="interaction.pic3"/>
@@ -103,23 +103,15 @@
                             <img class="slt" ng-src="{{interaction.pic7}}" ng-if="interaction.pic7"/>
                             <img class="slt" ng-src="{{interaction.pic8}}" ng-if="interaction.pic8"/>
                         </div>
-                    </div>
-                    <div class="item">
                         <div class="list" ng-click="showForm=true; focusInput=true">
                             <div class="item subitem" ng-click="replay($event,'百川1')">
                                 <img ng-src="img/demo/head4.jpg" />
                                 <span>百川1</span>
                                 <span class="kz">2016-08-08 11:11</span>
                                 <div>你确定是去哪里了吗?你确定是去哪里了吗?</div>
-                            </div>
-                            <div class="item subitem" ng-click="replay($event,'百川2')">
-                                <img ng-src="img/demo/head4.jpg" />
-                                <span>百川2</span>
-                                <span class="kz">2016-08-08 11:11</span>
-                                <div>你确定是去哪里了吗?你确定是去哪里了吗?</div>
                             </div>
                              <div class="item item-input">
-                                 <input name="comment" type="text" focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" ng-blur="submitComment(interaction.id)" style="padding: 0 20px;">
+                                 <input name="comment" type="text" focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" ng-change="submitComment(interaction.id)" style="padding: 0 20px;">
                              </div>
                         </div>
                     </div>
@@ -247,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{

+ 4 - 3
server/database/migrations/2017_06_29_095155_create_comment_info_table.php

xqd
@@ -16,13 +16,14 @@ class CreateCommentInfoTable extends Migration
         Schema::create('comments_info', function (Blueprint $table) {
             $table->increments('id');
             $table->integer('interaction_id')->comment('梦想动态ID');
-            $table->integer('user_id')->comment('评用户id');
-            $table->string('user_avatar')->default('')->comment('评用户头像');
-            $table->string('user_nickname')->default('')->comment('评用户昵称');
+            $table->integer('user_id')->comment('评用户id');
+            $table->string('user_avatar')->default('')->comment('评用户头像');
+            $table->string('user_nickname')->default('')->comment('评用户昵称');
             $table->integer('to_user_id')->nullable()->comment('回复用户id');
             $table->string('to_user_avatar')->default('')->comment('回复用户头像');
             $table->string('to_user_nickname')->default('')->comment('回复用户昵称');
             $table->tinyInteger('level')->default(0)->comment('评论星级');
+            $table->tinyInteger('is_read')->default(0)->comment('是否阅读');
             $table->text('content')->comment('评论内容');
             $table->timestamps();
             $table->date('reply_time')->nullable()->comment('回复时间');