瀏覽代碼

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

gq 8 年之前
父節點
當前提交
bcf4b392bc

二進制
miaomiao/bin/Android/Debug/android-debug-unaligned.apk


二進制
miaomiao/bin/Android/Debug/android-debug.apk


+ 1 - 1
miaomiao/www/chcp.json

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

+ 15 - 15
miaomiao/www/chcp.manifest

xqd xqd xqd xqd xqd xqd
@@ -29,7 +29,7 @@
   },
   {
     "file": "css/style.css",
-    "hash": "8a9dcca109c7aa03152895886b42a509"
+    "hash": "7832cbb107305c5195a0d3ec1085304c"
   },
   {
     "file": "img/alipay.png",
@@ -129,7 +129,7 @@
   },
   {
     "file": "js/config/config.js",
-    "hash": "a735c9d2f9c2333a17d7009c13e7c876"
+    "hash": "5e5c601c0a5cff697355a1eaca1358f2"
   },
   {
     "file": "js/config/router.js",
@@ -137,19 +137,19 @@
   },
   {
     "file": "js/controllers/account.js",
-    "hash": "6acc742fdf7ba350edaad2b1b4d7fb2e"
+    "hash": "083e26f2a92b3bb793f12cff73a7ad24"
   },
   {
     "file": "js/controllers/add.js",
-    "hash": "4be03648c7c85af951504cc96c8fea38"
+    "hash": "497ebc96c4908460118b47f35783029d"
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "f22d2e45c84910eb6c148c5f9192d971"
+    "hash": "923fe50a8313a93d7fc11192907978ba"
   },
   {
     "file": "js/controllers/my.js",
-    "hash": "2a10c504b744d03db472b6eabe3d4a50"
+    "hash": "9f2ae33361da4a34c8be6d9291954af8"
   },
   {
     "file": "js/controllers/tabs.js",
@@ -173,11 +173,11 @@
   },
   {
     "file": "js/services/dreamservice.js",
-    "hash": "535604d5f8a408f3befcf4f9f6d2ac3c"
+    "hash": "94d43087e5c20c3b21795e36edbedf28"
   },
   {
     "file": "js/services/homeservice.js",
-    "hash": "c8afddf15faf22fc6a8d1b3ff08a445a"
+    "hash": "a8ddc748ee6855bf71a53f46d4d2df96"
   },
   {
     "file": "js/services/httpinterceptor.js",
@@ -189,7 +189,7 @@
   },
   {
     "file": "js/services/myservice.js",
-    "hash": "6e2a32990515b4133c001d599fb91335"
+    "hash": "74bf6d59c7470e1b839bc721b3e57df6"
   },
   {
     "file": "js/services/storageservice.js",
@@ -457,27 +457,27 @@
   },
   {
     "file": "templates/add/index.html",
-    "hash": "1dd5fa420850c31ca1b933c39ecfdd97"
+    "hash": "60d4ea439f0d730da51f1e540a9ee8d0"
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "14499eb26a0d35ee2ecd30d4f0d46297"
+    "hash": "d591521d33e1052d2e323069447ebf85"
   },
   {
     "file": "templates/home/index.html",
-    "hash": "8cad183ca3c828ace1f8d0fcd26bb6a5"
+    "hash": "597694367bf5af356bb005e239b21362"
   },
   {
     "file": "templates/home/search.html",
-    "hash": "ea2049422ba08d1bff085cad96e2fbaa"
+    "hash": "cbba9e75990ab80c820003e209d5cd85"
   },
   {
     "file": "templates/my/index.html",
-    "hash": "d7a5a97adf66b92d4607ec13cd7af503"
+    "hash": "604fd31b5a154d169ed50c96ec172dcb"
   },
   {
     "file": "templates/my/my-collect.html",
-    "hash": "da5967951952c40c7a6bd6db898ca81e"
+    "hash": "de2ca5763fb7e62911ae2c540240ce03"
   },
   {
     "file": "templates/my/my-dream.html",

+ 1 - 1
miaomiao/www/js/controllers/add.js

xqd
@@ -44,7 +44,7 @@
                     video:$scope.video.server,
                     name: $scope.vm.name,
                     about: $scope.vm.about,
-                    time: 21, //默认21
+                    days: 21, //默认21
                     coin: $scope.vm.coin
                 };
                 msg.loading('保存中...');

+ 43 - 24
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -55,10 +55,9 @@
         }
         $scope.data = {};
         $scope.load(true);
-        //$scope.$on('$ionicView.enter', function () {
-          
-      
-        //});
+        $scope.$on('$ionicView.leave', function () {
+            $scope.popover.hide();
+        });
     }]);
 
     app.controller('dreamDetailCtrl', ["$scope", "$state", "msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
@@ -73,11 +72,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 +120,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 +155,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,26 +226,26 @@
         }
      
         $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:vm.comment,
+                content:$scope.vm.comment,
             };
             homeService.add_comment(data).then(function(){
-                 $scope.vm.comment = '' ;
+                $scope.vm.comment = '' ;
                 $scope.load(id);
                 $scope.closeModal();
             })
@@ -296,13 +301,16 @@
         }]);
     app.controller('searchCtrl', ["$scope","homeService", "$state", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate"
         , function ($scope,homeService, $state, msg, $ionicTabsDelegate, $ionicNavBarDelegate) {
-        $scope.isResult = false;
-        $scope.index = 0;
-        $scope.vm = {
-            keyword : ""
-        }
+
         $scope.showMore = function (keyword,index) {
+            if(!keyword)return;
             $scope.index = index;
+            // $scope.vm.keyword = keyword;
+            homeService.search(keyword).then(function(result){
+                $scope.isResult = true;
+                $scope.dream_infos = result.data.data.dream_infos;
+                $scope.user_infos = result.data.data.user_infos;
+            });
         }
         $scope.search = function (keyword) {
             $scope.vm.keyword = keyword;
@@ -312,10 +320,21 @@
                 $scope.user_infos = result.data.data.user_infos;
             });
         }
+        $scope.toDetail = function (id) {
+            $state.go('app.home_dreamdetail',{id:id});
+        };
+        $scope.toUser = function (id) {
+            $state.go('app.home_dreamdetail',{id:id});
+        };
    
         $scope.$on('$ionicView.beforeEnter', function () {
+            $scope.isResult = false;
+            $scope.index = 0;
+            $scope.vm = {
+                keyword : ""
+            }
             $ionicTabsDelegate.showBar(false);
-            $ionicNavBarDelegate.showBackButton(false);
+            // $ionicNavBarDelegate.showBackButton(false);
             homeService.search('').then(function(result){
                 $scope.hot_searches = result.data.data.hot_searches;
                 $scope.history_searches = result.data.data.history_searches;
@@ -342,9 +361,9 @@
               $scope.dreams = result.data.data;
             });
       });
-          $scope.toDetail = function (id) {
-            $state.go('app.home_dreamdetail',{id:id});
-          };
+      $scope.toDetail = function (id) {
+        $state.go('app.home_dreamdetail',{id:id});
+      };
 
   }]);
     

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

xqd
@@ -89,19 +89,19 @@
                         发布梦想互动</a>
                     </div>
                     <div class="item" ng-click="comment()" ng-repeat="interaction in dream.interactions"> 
-                        <img class="head" src="{{dream.user.avatar}}" />
+                        <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">
-                            <img class="slt" src="{{interaction.pic1}}" ng-if="interaction.pic1"/>
-                            <img class="slt" src="{{interaction.pic2}}" ng-if="interaction.pic2"/>
-                            <img class="slt" src="{{interaction.pic3}}" ng-if="interaction.pic3"/>
-                            <img class="slt" src="{{interaction.pic4}}" ng-if="interaction.pic4"/>
-                            <img class="slt" src="{{interaction.pic5}}" ng-if="interaction.pic5"/>
-                            <img class="slt" src="{{interaction.pic6}}" ng-if="interaction.pic6"/>
-                            <img class="slt" src="{{interaction.pic7}}" ng-if="interaction.pic7"/>
-                            <img class="slt" src="{{interaction.pic8}}" ng-if="interaction.pic8"/>
+                            <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"/>
+                            <img class="slt" ng-src="{{interaction.pic4}}" ng-if="interaction.pic4"/>
+                            <img class="slt" ng-src="{{interaction.pic5}}" ng-if="interaction.pic5"/>
+                            <img class="slt" ng-src="{{interaction.pic6}}" ng-if="interaction.pic6"/>
+                            <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">

+ 16 - 16
miaomiao/www/templates/home/search.html

xqd xqd xqd xqd
@@ -7,16 +7,16 @@
         <button class="button button-calm" style="width: 30%; padding: 0;" ng-click="$ionicGoBack()">取消</button>
     </ion-nav-buttons>
      <ion-content>
-         <div ng-if="!isResult">
-             <div style="padding:10px;font-size:1.1rem">热门搜索</div>
-             <div class="calm search-hot">
+         <div class="list" ng-if="!isResult">
+             <div class="item" style="padding:10px;font-size:1.1rem">热门搜索</div>
+             <div class="item calm search-hot">
 
                  <div class="box {{keyword==key?'keyword':''}}" ng-click="search(key)" ng-repeat="(key, value) in hot_searches">
                      {{key}}
                  </div>
                
              </div>
-             <div style="padding:10px;font-size:1.1rem;line-height:44px">历史搜索</div>
+             <div class="item" style="padding:10px;font-size:1.1rem;line-height:44px">历史搜索</div>
              <div class="list">
 
                 <div class="item {{keyword==history_search.search?'search-select':''}}" ng-click="search(history_search.search)" ng-repeat="history_search in history_searches">
@@ -30,21 +30,21 @@
                  <div class="item item-divider">
                      用户
                  </div>
-                 <div class="item sarch-item" ng-repeat="user_info in user_infos" ng-if="$index<3">
-                     <img ng-src="{{user_info.avtar}}" />  
+                 <div class="item sarch-item" ng-repeat="user_info in user_infos" ng-if="$index<3" ng-click="toUser(user_info.id)">
+                     <img ng-src="{{user_info.avatar}}" />  
                      <span style="padding:5px;">{{user_info.nickname}}</span>
                      <span class="level">Lv.3</span>
                  </div>
-                 <div class="item" style="text-align:center;color:#FF4B82;font-size:1.1rem;padding:10px;" ng-click="showMore(keyword,1)" ng-if="user_infos.length>=3">更多>></div>
+                 <div class="item" style="text-align:center;color:#FF4B82;font-size:1.1rem;padding:10px;" ng-click="showMore(vm.keyword,1)" ng-if="user_infos.length>=3">更多>></div>
                  <div class="item item-divider">
                      梦想
                  </div>
-                 <div class="item item-thumbnail-left" ng-repeat="dream_info in dream_infos" ng-if="$index<3">
+                 <div class="item item-thumbnail-left" ng-repeat="dream_info in dream_infos" ng-if="$index<3" ng-click="toDetail(dream_info.id)">
                      <img ng-src="{{dream_info.img.pic}}" />
                      <h2>{{dream_info.name}}</h2>
                      <p style="white-space:normal">{{dream_info.about}}</p>
                  </div>
-                 <div class="item" style="text-align:center;color:#FF4B82;font-size:1.1rem;padding:10px;" ng-click="showMore(keyword,2)" ng-if="dream_infos.length>=3">更多>></div>
+                 <div class="item" style="text-align:center;color:#FF4B82;font-size:1.1rem;padding:10px;" ng-click="showMore(vm.keyword,2)" ng-if="dream_infos.length>=3">更多>></div>
                  
                  <div class="item item-divider">
                      标签
@@ -74,17 +74,17 @@
          <div ng-if="index>0">
              <div class="tabs-striped tabs-top">
                  <div class="tabs" style="top:0">
-                     <a ng-class="type==1?'tab-item active':'tab-item'" ng-click="showMore(vm.keyword,1)">
+                     <a ng-class="index==1?'tab-item active':'tab-item'" ng-click="showMore(vm.keyword,1)">
                          用户
                      </a>
-                     <a ng-class="type==2?'tab-item active':'tab-item'" ng-click="showMore(vm.keyword,2)">
+                     <a ng-class="index==2?'tab-item active':'tab-item'" ng-click="showMore(vm.keyword,2)">
                         梦想
                      </a>
                  </div>
              </div>
              <div ng-if="index==1" class="list more-userlist">
-                 <div class="item sarch-item" ng-repeat="user_info in user_infos">
-                     <img ng-src="{{user_info.avtar}}" />
+                 <div class="item sarch-item" ng-repeat="user_info in user_infos"  ng-click="toUser(user_info.id)">
+                     <img ng-src="{{user_info.avatar}}" />
                      <span style="padding:5px;">{{user_info.nickname}}</span>
                      <span class="level">Lv.3</span>
                      <img ng-src="img/king.png" class="imgitem" />
@@ -95,10 +95,10 @@
                  </div>
              </div>
              <div ng-if="index==2" class="list more-userlist">
-                 <div class="item" style="padding:0" ng-repeat="dream_info in dream_infos">
-                     <img class="reply-head" src="../../img/demo/head1.jpg"  style="margin:5px 15px" />
+                 <div class="item" style="padding:0" ng-repeat="dream_info in dream_infos" ng-click="toDetail(dream_info.id)">
+                     <img class="reply-head" ng-src="{{dream_info.user.avatar}}" style="margin:5px 15px" />
                      <span style="position:relative;top:-25px;font-size:1.1rem;">{{ dream_info.name }}</span>
-                     <img style="display:block;width:100%" src="../../img/demo/pict.png" />
+                     <img style="display:block;width:100%" ng-src="{{dream_info.img.pic}}" />
                  </div> 
                 
              </div>

+ 7 - 6
server/app/Http/Controllers/Api/V1/DreamController.php

xqd xqd xqd
@@ -455,7 +455,7 @@ class DreamController extends Controller
         }
         $keyword ='%'.$request->keyword.'%';
         $data = DreamInfoModel::where('name','like',$keyword)->
-        orWhere('sign','like',$keyword)->with('user','imgs')->get();
+        orWhere('sign','like',$keyword)->with(['user','img'])->get();
         $this->insertSearchTable($user->id,$request->keyword);
         return $this->api($data);
     }
@@ -510,15 +510,15 @@ class DreamController extends Controller
                 'name'  => 'required',
                 'about'  => 'required',
                 'coin'  => 'required|integer',
-                'time'  => 'required|integer',
+                'days'  => 'required|integer',
             ],
             [
                 'name.required'  => '梦想标题必填',
                 'about.required'  => '梦想介绍必填',
                 'coin.required'  => '梦想币必填',
                 'coin.integer'  => '梦想币必须是正整数',
-                'time.required'  => '实现时间必填',
-                'time.integer'  => '实现时间必须是正整数',
+                'days.required'  => '实现时间必填',
+                'days.integer'  => '实现时间必须是正整数',
             ]
         );
         if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
@@ -530,9 +530,10 @@ class DreamController extends Controller
         $b = $setting?$setting->value:1;
         $t = 21*3600 / 60;
 
-        $data = $request->except('_token','pics');
+        $days = $request->days;
+        $data = $request->except('_token','pics','days');
         $data['user_id'] = $user->id;
-        $data['time'] = 21*3600;
+        $data['end_time'] = strtotime('+'+$days+' days');
         \Log::debug(' care_num:'.$care_num.' a:'.$a.' b:'.$b.' t:'.$t);
         if ($care_num == 0) {
             $data['score'] = (($a/$t) + $b)*100000000 ;

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

xqd xqd
@@ -152,7 +152,7 @@ class IndexController extends Controller
         ->orWhere(function ($query) use($keyword){
             $query->where('sign','like',$keyword)
                 ->where('end_time','<=',time());
-        })->get();
+        })->with(['user','img'])->get();
         $signs  = BaseSettingsModel::where('category','sign')->where('value','like',$keyword)->get();
         if (empty($request->keyword)) {
 //            历史搜索
@@ -161,7 +161,7 @@ class IndexController extends Controller
                 $data2 = SearchInfoModel::get();
                  $hot_searches = [];
                 foreach ($data2 as $k => $v) {
-                    if (count($hot_searches) == 8) {
+                    if (count($hot_searches) == 6) {
                         break;
                     }
                     if (!array_key_exists($v->search,$hot_searches)) {

+ 1 - 1
server/database/migrations/2017_06_02_044138_create_dream_info_table.php

xqd
@@ -19,7 +19,7 @@ class CreateDreamInfoTable extends Migration
             $table->string('name',20)->comment('梦想名称');
             $table->text('about')->comment('梦想介绍');
             $table->integer('coin')->default(0)->comment('所需梦想币');
-            $table->integer('time')->default(0)->comment('梦想倒计时');
+            $table->timestamp('time')->default(0)->comment('梦想倒计时');
             $table->integer('get_coin')->default(0)->comment('获得梦想币');
             $table->integer('mark')->default(0)->comment('梦想分');
             $table->tinyInteger('status')->default(0)->comment('梦想状态');