YanaDH 7 anni fa
parent
commit
00ba6adb08

BIN
.vs/miaomiao/v14/.suo


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


+ 1 - 0
miaomiao/config.xml

xqd
@@ -22,6 +22,7 @@
   <preference name="SuppressesIncrementalRendering" value="True"/>
   <preference name="windows-target-version" value="10.0"/>
   <preference name="SplashScreen" value="screen"/>
+  <preference name="KeyboardDisplayRequiresUserAction" value="false"/>
   <preference name="SplashScreenDelay" value="3000"/>
   <feature name="StatusBar">
     <param name="ios-package" onload="true" value="CDVStatusBar"/>

+ 1 - 0
miaomiao/package.json

xqd
@@ -5,6 +5,7 @@
     "dependencies": {
         "cordova-android": "^6.2.3",
         "cordova-hot-code-push-plugin": "^1.5.3",
+        "cordova-ios": "^4.4.0",
         "cordova-plugin-actionsheet": "2.3.3",
         "cordova-plugin-camera": "file:node_modules\\cordova-plugin-camera",
         "cordova-plugin-compat": "1.1.0",

+ 54 - 0
miaomiao/plugins/ios.json

xqd
@@ -0,0 +1,54 @@
+{
+    "prepare_queue": {
+        "installed": [],
+        "uninstalled": []
+    },
+    "config_munge": {
+        "files": {}
+    },
+    "installed_plugins": {
+        "cordova-hot-code-push-plugin": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-actionsheet": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-camera": {
+            "CAMERA_USAGE_DESCRIPTION": " ",
+            "PHOTOLIBRARY_USAGE_DESCRIPTION": " ",
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-console": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-device": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-file-transfer": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-media-capture": {
+            "CAMERA_USAGE_DESCRIPTION": " ",
+            "MICROPHONE_USAGE_DESCRIPTION": " ",
+            "PHOTOLIBRARY_USAGE_DESCRIPTION": " ",
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-splashscreen": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-statusbar": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        }
+    },
+    "dependent_plugins": {
+        "cordova-plugin-compat": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-file": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-jcore": {
+            "PACKAGE_NAME": "com.miaomiao.app"
+        }
+    }
+}

+ 1 - 1
miaomiao/www/chcp.json

xqd
@@ -1,5 +1,5 @@
 {
   "update": "now",
   "content_url": "http://i.9026.com/miaomiao",
-  "release": "2017.09.04-20.24.33"
+  "release": "2017.09.06-22.12.54"
 }

+ 14 - 14
miaomiao/www/chcp.manifest

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -13,7 +13,7 @@
   },
   {
     "file": ".idea/workspace.xml",
-    "hash": "679bce57f2f5e8b9723eeba62e95fbd8"
+    "hash": "48ff09cf15bd74be400b11bfa4890dd2"
   },
   {
     "file": ".idea/www.iml",
@@ -29,7 +29,7 @@
   },
   {
     "file": "css/style.css",
-    "hash": "bd07829df14f7db763e988e32c722b60"
+    "hash": "d9e66499943de2a72222c0a7c9451801"
   },
   {
     "file": "img/alipay.png",
@@ -97,7 +97,7 @@
   },
   {
     "file": "img/demo/photo_default_user.png",
-    "hash": "a75889547fdb19055f3ae55ae7049513"
+    "hash": "4f6596f90be587cd0ef96444576c23ec"
   },
   {
     "file": "img/demo/photo_default_user.svg",
@@ -389,7 +389,7 @@
   },
   {
     "file": "js/app.js",
-    "hash": "5411129ea442c6f240ae625312c0359f"
+    "hash": "ba3cebad157bab56b91343951fb356da"
   },
   {
     "file": "js/config/config.js",
@@ -397,23 +397,23 @@
   },
   {
     "file": "js/config/router.js",
-    "hash": "b7a41bc21bfcdc5df31023e157bd39d1"
+    "hash": "352fde367fb21b964bd229584a1aa92b"
   },
   {
     "file": "js/controllers/account.js",
-    "hash": "bfc6325b22920144759977e4b05565c7"
+    "hash": "ef71142cb9f2f470ee59161a288255f1"
   },
   {
     "file": "js/controllers/add.js",
-    "hash": "c71ffcad7e66ca4529b9001f54cb24a8"
+    "hash": "8533f5122772d6eac2abc353f596e53c"
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "ea81f908ccba442716454ee3edbe1aae"
+    "hash": "5a28dd88dfd293d8945f039bb3daa32c"
   },
   {
     "file": "js/controllers/my.js",
-    "hash": "f30b10fcb778c85095e8ad27294d60bd"
+    "hash": "709bb690c3c5f1969a2a97956dcad43f"
   },
   {
     "file": "js/controllers/tabs.js",
@@ -421,7 +421,7 @@
   },
   {
     "file": "js/directives/directive.js",
-    "hash": "d7a3cab12d6df7b0bdd75273b193a702"
+    "hash": "3a356ba25ac541234ab5205266c13824"
   },
   {
     "file": "js/filters/filter.js",
@@ -441,7 +441,7 @@
   },
   {
     "file": "js/services/homeservice.js",
-    "hash": "7cc80dc57709c4e8fc2d5a99502bfe07"
+    "hash": "aa976bb925efad3887e78f07538c2ca7"
   },
   {
     "file": "js/services/httpinterceptor.js",
@@ -449,7 +449,7 @@
   },
   {
     "file": "js/services/jpushservice.js",
-    "hash": "18ba49363595b4e8d366ed944e9cd4cc"
+    "hash": "efd4081418f9940b11c2ef4ec98e6250"
   },
   {
     "file": "js/services/msgservice.js",
@@ -761,7 +761,7 @@
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "a2f58837798e61eadd85e24b78537359"
+    "hash": "b12541e39a09c347d69ab0fdf211f868"
   },
   {
     "file": "templates/home/index.html",
@@ -853,7 +853,7 @@
   },
   {
     "file": "templates/my/withdraw.html",
-    "hash": "ce44c21406cc947aa415669395e95ae8"
+    "hash": "794b42a7abfeec02cab4d6246c435426"
   },
   {
     "file": "templates/tabs.html",

+ 1 - 0
miaomiao/www/js/app.js

xqd
@@ -50,6 +50,7 @@
                   StatusBar.styleLightContent();
                }
                var receiveNotification = function (event) {
+                   $rootScope.$emit('msg-new', { msg: '有新消息' });
                    // alert("receiveMessageIniOSCallback是" + +JSON.stringify(event));
                };
                var setTagsWithAliasCallback = function (event) {

+ 26 - 2
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('homeCtrl', ["$scope", "$ionicTabsDelegate", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService", "$ionicPopup", "$timeout", "$ionicSideMenuDelegate"
-        , function ($scope,$ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate) {
+    app.controller('homeCtrl', ["$scope", "$ionicTabsDelegate", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService", "$ionicPopup", "$timeout", "$ionicSideMenuDelegate", "$rootScope"
+        , function ($scope, $ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate, $rootScope) {
         $scope.$on('$ionicView.beforeEnter', function () {
             $ionicTabsDelegate.showBar(true);
             $scope.load(true);
@@ -16,6 +16,11 @@
 
             });
         });
+        $rootScope.$on('msg-new', function (event, msg) {
+            //收到新消息
+            alert('收到新消息,改变样式');
+            $scope.showMessage = 1;
+        })
         $scope.type = 'hot';//tab切换
 
             //$scope.chosedIndex = 0;
@@ -97,6 +102,7 @@
             users: [],
             dreams:[]
         };
+      
         $scope.next = function (type) {
             //type:1 前一个,type:2 后一个
             if($scope.index.users.length>0){
@@ -461,6 +467,7 @@
                 $scope.dream.interactions[index].showmore = true;
             }
         }
+<<<<<<< HEAD
             $scope.replay = function ($event, name, index) {
                 $event.stopPropagation();
                     $scope.input.focus = true;
@@ -472,6 +479,21 @@
                     $scope.input.placeholder = "评论" + name+":";
                     $scope.vm.title='';
                 };
+=======
+        $scope.replay = function ($event, name, index) {
+            $event.stopPropagation();
+            $scope.input.focus = true;
+            $scope.input.show = true;
+            angular.forEach($scope.dream.interactions, function (item) {
+                item.show = false;
+            })
+            $scope.dream.interactions[index].show = true;
+            $scope.dream.interactions[index].focus = true;
+            $scope.input.placeholder = "评论" + name+":";
+            $scope.vm.title='';
+            $scope.vm.comment='';
+        }
+>>>>>>> f2571e20d6179699190a3d56c9be92ec756fa1ef
         $scope.replayOther = function ($event, name, index,currentindex) {
             $event.stopPropagation();
             if($scope.dream.interactions[index].comments[currentindex].user_id!=$scope.user.id){
@@ -481,8 +503,10 @@
                     item.show = false;
                 });
                 $scope.dream.interactions[index].show = true;
+                $scope.dream.interactions[index].focus = true;
                 $scope.input.placeholder = "评论" + name+":";
                 $scope.vm.title='';
+                $scope.vm.comment='';
             }
             else {
                 msg.confirm("评论","是否删除评论").then(function(result){

+ 16 - 3
miaomiao/www/js/directives/directive.js

xqd
@@ -2,18 +2,31 @@
     module.directive('focusMe', function ($timeout) {
         return {
             scope: { trigger: '=focusMe' },
-            link: function (scope, element) {
+            link: function (scope, element, $attr) {
+                // console.log("focusMe:"+JSON.stringify(element))
                 scope.$watch('trigger', function (value) {
+                    // console.log(value);
                     if (value === true) {
                         $timeout(function() {
-                        element[0].focus();
-                        scope.trigger = false;
+                            element[0].focus();
+                            // cordova.plugins.Keyboard.show();
+                            scope.trigger = false;
                         });
                     }
                 });
             }
         };
     });
+    module.directive('showFocus', function($timeout) {
+      return function(scope, element, attrs) {
+        scope.$watch(attrs.showFocus, 
+          function (newValue) { 
+            $timeout(function() {
+                newValue && element.focus();
+            });
+          },true);
+      };    
+    });
     module.factory('WechatService', [ function () {
         function share(params) {
             if (typeof Wechat === "undefined") {

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

xqd xqd
@@ -19,8 +19,13 @@
             <div ng-if="timer!='已结束'&& 100*dream.get_coin/dream.coin<100" class="col dreamButton">
                 <button class="button button-calm" ng-click="support($event)">支持</button>
             </div>
+<<<<<<< HEAD
             <div ng-if="codeBtn && user.id==dream.top3user[0].id" class="col dreamButton">
                 <button ng-click="openCode($event)" class="button button-calm" style="border: 1px solid #00C3DA">
+=======
+            <div ng-if="timer=='已结束'|| 100*dream.get_coin/dream.coin>=100" class="col dreamButton">
+                <button ng-click="openCode()" class="button button-calm" style="border: 1px solid #00C3DA">
+>>>>>>> f2571e20d6179699190a3d56c9be92ec756fa1ef
                     二维码
                 </button>
             </div>
@@ -196,13 +201,13 @@
                             </div>
                             <div class="row">
                                 <div class="col-offset-20 col-80">
-                                    <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA; margin-top: 10px; margin-bottom: 10px"> {{interaction.showmore?"关闭更多":"查看更多评论"}}</p>
+                                    <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA; margin-top: 10px; margin-bottom: 10px"> {{interaction.showmore?"只看最近评论":"查看更多评论"}}</p>
                                 </div>
                             </div>
                         </div>
                         <!--<p ng-click="replay($event,dream.user.nickname,$index)" style="margin: 10px 0 0 50px; color: #00C3DA">评论</p>-->
                         <div class="item item-input" ng-if="input.show&&interaction.show">
-                            <textarea name="comment"  focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" style="padding: 0 20px;"></textarea>
+                            <textarea name="comment" focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" style="padding: 0 20px;"></textarea>
                             <a class="button button-calm" style="margin-right:5px;line-height:35px;min-width:30px" ng-click="submitComment($index)">
                                 发送
                             </a>

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

xqd
@@ -108,10 +108,10 @@ class AuthController extends Controller
                 'phone'=>$phone,
                 'wechat'=>$openid,
                 'jpush'=>$jpush,
+                'nickname'=>'瞄喵',
+                'status'=>1,
                 'password'=>bcrypt(123456)
             ]);
-            $user->status=1;
-            $user->save();
         }else{
             //用户已经存在,重新绑定
             $user->wechat=$wechat;

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

xqd xqd
@@ -219,7 +219,9 @@ class DreamController extends Controller
             if(count($top3user) <= 2) $top3user[] = $user ;
         }
         if ($type == 'paihang') return $this->api($topuser);
-        $interactions = InteractionInfo::where('dream_id',$id)->with('comments')->orderBy('id','desc')->get();
+        $interactions = InteractionInfo::where('dream_id',$id)->with(['comments' => function ($query) {
+            $query->orderBy('created_at');
+        }])->orderBy('id','desc')->get();
         /*dd($interactions);
         foreach ($interactions as $item) {
             $item->comments;
@@ -258,7 +260,7 @@ class DreamController extends Controller
         $dream->show_button = $show_button;
 //        梦想互动
         $interactions = InteractionInfo::where('dream_id',$id)->with(['comments' => function ($query) {
-            $query->orderBy('created_at','desc');
+            $query->orderBy('created_at');
         }])->orderBy('created_at','desc')->get();
         $dream->interactions = $interactions;
 //        dd($interactions);

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

xqd
@@ -360,6 +360,11 @@ class IndexController extends Controller
                 $select->where('sex',1);
             });
         }
+        if ($age == 7) {
+            $query = $query->whereHas('user', function ($select) use ($age) {
+                $select->where('birthday','<=',date('Y-m-d',strtotime(date('Y')-18)));
+            });
+        }
         if ($age == 1) {
             $query = $query->whereHas('user', function ($select) use ($age) {
                 $select->where('birthday','>=',date('Y-m-d',strtotime(date('Y')-21)))->where('birthday','<=',date('Y-m-d',strtotime(date('Y')-18)));

+ 26 - 8
server/app/Http/Controllers/Api/V1/InteractionController.php

xqd xqd
@@ -122,12 +122,24 @@ class InteractionController extends Controller
         if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
 
         $user = $this->getUser();
-        $user_id = $user->id;
+       /* $user_id = $user->id;
         $user_avatar = $user->avatar;
         $user_nickname = $user->nickname;
         $interaction_id = $request->id;
         $content = $request->content;
-        $data = compact('user_id','user_avatar','user_nickname','interaction_id','content');
+        $is_read = 1;
+        $data = compact('user_id','user_avatar','user_nickname','interaction_id','content','is_read');*/
+
+        $data['to_user_id'] = InteractionInfo::find($request->id)->dream->user_id;
+        $data['to_user_avatar'] = InteractionInfo::find($request->id)->dream->user_avatar;
+        $data['to_user_nickname'] = InteractionInfo::find($request->id)->dream->user_nickname;
+
+        $data['user_id'] = $user->id;
+        $data['user_avatar'] =$user->avatar;
+        $data['user_nickname'] = $user->nickname;
+        $data['interaction_id'] = $request->id;
+        $data['content'] = $request->content;
+        $data['is_read'] = 1;
         $ok = CommentInfoModel::create($data);
         if ($ok) {
             return $this->api('');
@@ -181,14 +193,20 @@ class InteractionController extends Controller
         if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
 
         $user = $this->getUser();
-        $data['to_user_id'] = $user->id;
+      /*  $data['to_user_id'] = $user->id;
         $data['to_user_avatar'] = $user->avatar;
-        $data['to_user_nickname'] = $user->nickname;
-        $data['user_id'] =CommentInfoModel::find($request->id)->user_id;
-        $data['user_avatar'] =CommentInfoModel::find($request->id)->user_avatar;
-        $data['user_nickname'] =CommentInfoModel::find($request->id)->user_nickname;
-        $data['interaction_id'] = $request->interaction_id;
+        $data['to_user_nickname'] = $user->nickname; */
+
+        $data['to_user_id'] = CommentInfoModel::find($request->id)->user_id;
+//        $data['to_user_avatar'] = CommentInfoModel::find($request->id)->user_avatar;
+        $data['to_user_nickname'] = CommentInfoModel::find($request->id)->user_nickname;
+
+        $data['user_id'] = $user->id;
+        $data['user_avatar'] =$user->avatar;
+        $data['user_nickname'] = $user->nickname;
+        $data['interaction_id'] = $request->id;
         $data['content'] = $request->content;
+        $data['is_read'] = 1;
 
         if (!$request->content)
             return $this->error(ErrorCode::CONNET_NOT_EXIST);

+ 4 - 4
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd
@@ -251,10 +251,10 @@ class MyController extends Controller
     public function reply()
     {
         $user = $this->getUser();
-        $data = CommentInfoModel::where('user_id',$user->id)->orderBy('id','desc')->get();
+        $data = CommentInfoModel::where('to_user_id',$user->id)->orderBy('id','desc')->get(); //user_id
 
         foreach ($data as $item){   //访问接口  标记已读
-            $item->update(['is_read'=>1]);
+            $item->update(['is_read'=>0]);
         }
         return $this->api($data);
     } /**
@@ -354,8 +354,8 @@ class MyController extends Controller
         $letter1 =  SystemInfoModel::where('user_id',$user->id)->whereNotNull('to_user_id')->orderBy('id','desc')->get();
         $letter2 =  SystemInfoModel::where('user_id',$user->id)->where('is_read','0')
             ->whereNotNull('to_user_id')->orderBy('id','desc')->get();
-        $comments1 = CommentInfoModel::where('user_id',$user->id)->orderBy('id','desc')->get();
-        $comments2 = CommentInfoModel::where('user_id',$user->id)->where('is_read','0')->orderBy('id','desc')->get();
+        $comments1 = CommentInfoModel::where('to_user_id',$user->id)->orderBy('id','desc')->get();
+        $comments2 = CommentInfoModel::where('to_user_id',$user->id)->where('is_read','1')->orderBy('id','desc')->get();
         $arr = [];
         $arr['systemInfo']['number'] = count($systemInfo1) ;
         $arr['systemInfo']['is_read'] = count($systemInfo2) ;

BIN
server/public/base/img/share/icon_cat_h.png