YanaDH 8 سال پیش
والد
کامیت
55e7f403c0
38فایلهای تغییر یافته به همراه794 افزوده شده و 572 حذف شده
  1. BIN
      .vs/miaomiao/v14/.suo
  2. BIN
      miaomiao/bin/Android/Debug/android-debug-unaligned.apk
  3. BIN
      miaomiao/bin/Android/Debug/android-debug.apk
  4. 1 0
      miaomiao/platforms/android/build/intermediates/assets/debug/www/index.html
  5. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/account.js
  6. 51 36
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js
  7. 31 5
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/home.js
  8. 72 38
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js
  9. 25 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/tabs.js
  10. 5 5
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/directives/directive.js
  11. 19 7
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js
  12. 14 0
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/homeservice.js
  13. 39 8
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/myservice.js
  14. 6 8
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/add/index.html
  15. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/search.html
  16. 7 7
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/user-detail.html
  17. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/index.html
  18. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message-reply.html
  19. 75 9
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-profile.html
  20. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-setting.html
  21. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/tabs.html
  22. BIN
      miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_
  23. BIN
      miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk
  24. 1 0
      miaomiao/www/index.html
  25. 2 1
      miaomiao/www/js/config/config.js
  26. 33 19
      miaomiao/www/js/controllers/add.js
  27. 5 5
      miaomiao/www/js/directives/directive.js
  28. 13 1
      miaomiao/www/js/services/commonservice.js
  29. 13 0
      miaomiao/www/js/services/dreamservice.js
  30. 7 0
      miaomiao/www/js/services/myservice.js
  31. 5 6
      miaomiao/www/templates/add/index.html
  32. 1 1
      server/app/Http/Controllers/Api/V1/AttachmentController.php
  33. 2 1
      server/app/Http/Controllers/Api/V1/AuthController.php
  34. 241 44
      server/app/Http/Controllers/Api/V1/IndexController.php
  35. 66 334
      server/app/Http/Controllers/Api/V1/MyController.php
  36. 1 1
      server/app/Models/UserInfoModel.php
  37. 32 0
      server/database/migrations/2017_06_20_135741_add_dream_num_to_user_care_user.php
  38. 18 26
      server/routes/api.php

BIN
.vs/miaomiao/v14/.suo


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


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


+ 1 - 0
miaomiao/platforms/android/build/intermediates/assets/debug/www/index.html

xqd
@@ -30,6 +30,7 @@
       <script src="js/services/storageservice.js"></script>
       <script src="js/services/userservice.js"></script>
       <script src="js/services/utilservice.js"></script>
+      <script src="js/services/dreamservice.js"></script>
       <!--filters-->
       <script src="js/filters/filter.js"></script>
       <!--directives-->

+ 2 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/account.js

xqd
@@ -14,9 +14,9 @@
                 storage.set('token', result.data.data.token);
                 $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
                 $state.go('app.home');
-            }, function (erro) {
+            }, function (error) {
                 msg.hide();
-                msg.error(erro.data.message);
+                msg.error(error.data.message);
             });
         }
         //获取验证码

+ 51 - 36
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js

xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('addCtrl', ["$scope", "$state", "storage", "myService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory", "common"
-        , function ($scope, $state, storage, myService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory, common) {
+    app.controller('addCtrl', ["$scope", "$state",  "dreamService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory", "common", "config"
+        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory, common, config) {
             $ionicModal.fromTemplateUrl('my-modal.html', {
                 scope: $scope,
                 animation: 'slide-in-up'
@@ -18,58 +18,73 @@
                 about:'',
                 money:""
             };
+            $scope.imgServer = config.imgServer;
             $scope.imgs = [];
-            $scope.videos = [];
+            $scope.video = {
+                isOK: false,
+                path: '',
+                server:''
+            }
+            
             $scope.addpict = function () {
                 common.chooseImage().then(function (img) {
                     common.uploadFiles(img,1).then(function (result) {
                         var response = JSON.parse(result.response);
                         var file = response.data.file;
                         $scope.imgs.push(file);
-                    }, function (erro) {
-                        msg.erro('图片上传失败');
+                    }, function (error) {
+                        msg.error('图片上传失败');
                     });
-                }, function (erro) {
-                    msg.erro('图片选择失败');
+                }, function (error) {
+                    msg.error('图片选择失败');
                 });
             }
             $scope.addvideo = function () {
                 var options = { limit: 1, duration:20};
                 navigator.device.capture.captureVideo(function (videos) {
-                    $scope.videos.push(videos[0].fullPath);
+                    $scope.video.path = videos[0].fullPath;
+                    $scope.video.isOK = true;
                     common.uploadFiles(videos[0].fullPath, 2).then(function (result) {
-                        debugger;
                         var response = JSON.parse(result.response);
                         var file = response.data.file;
-                        debugger;
-                    }, function (erro) {
-                        debugger;
-                        msg.erro('视频上传失败');
+                        $scope.video.server = file;
+                    }, function (error) {
+                        msg.error('视频上传失败');
                     });
-                }, function (erro) {
-                    debugger;
+                }, function (error) {
+                    msg.error('视频上传失败');
                 }, options);
             }
-           $scope.add=function ()
-           {
-               var data={
-                   pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
-                   dream:$scope.vm.dream,
-                   about:$scope.vm.about,
-                   money:$scope.vm.money
-               };
-               myService.add(data).then(function(result){
-
-               },function(erro){
-
-               });
-           }
-           $scope.$on('$ionicView.beforeEnter', function (viewResult) {
-               $ionicTabsDelegate.showBar(false);
-               $ionicNavBarDelegate.showBackButton(true);
-           });
-           $scope.$on('$ionicView.leave', function () {
-               $ionicTabsDelegate.showBar(true);
-           });
+            $scope.deletefile = function (file) {
+                var index = $scope.imgs.indexOf(file);
+                $scope.imgs.splice(index, 1);
+                common.deletefile(file).then(function () {
+                })
+            }
+            $scope.add = function () {
+                var data = {
+                    pics: $scope.imgs,
+                    video:$scope.video.server,
+                    dream: $scope.vm.dream,
+                    about: $scope.vm.about,
+                    time: 21, //默认21
+                    money: $scope.vm.money
+                };
+                msg.loading('保存中...');
+                dreamService.addDream(data).then(function (result) {
+                    msg.hide();
+                    $state.go('app.home');
+                }, function (error) {
+                    msg.hide();
+                    msg.error(error.data.message);
+                });
+            }
+            $scope.$on('$ionicView.beforeEnter', function (viewResult) {
+                $ionicTabsDelegate.showBar(false);
+                $ionicNavBarDelegate.showBackButton(true);
+            });
+            $scope.$on('$ionicView.leave', function () {
+                $ionicTabsDelegate.showBar(true);
+            });
         }]);
 })(angular.module('app.controllers'));

+ 31 - 5
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/home.js

xqd xqd xqd
@@ -23,10 +23,10 @@
         });
         $scope.todetail = function () {
             $state.go('app.home_userdetail');
-        }
+        };
         }]);
-    app.controller('userDetailCtrl', ["$scope", "$state", "msg", "$ionicTabsDelegate"
-        , function ($scope, $state, msg, $ionicTabsDelegate) {
+    app.controller('userDetailCtrl', ["$scope", "$state", "msg","homeService", "$ionicTabsDelegate"
+        , function ($scope, $state, msg, homeService, $ionicTabsDelegate) {
             $scope.type = 1;//tab切换
             $scope.tosupport = false;
             $scope.support = function ($event) {
@@ -49,9 +49,24 @@
             $scope.$on('$ionicView.leave', function () {
                 $ionicTabsDelegate.showBar(true);
             });
+
+            $scope.vm = {
+                coin:""
+            }
+            $scope.supportDream = function(data){
+                var data = {
+                    dream_id:"11",
+                    coin:$scope.vm.coin
+                };
+                homeService.supportDream(data).then(function(result){
+
+                },function(erro){
+
+                })
+            }
         }]);
-    app.controller('searchCtrl', ["$scope", "$state", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate"
-        , function ($scope, $state, msg, $ionicTabsDelegate, $ionicNavBarDelegate) {
+    app.controller('searchCtrl', ["$scope","homeService", "$state", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate"
+        , function ($scope,homeService, $state, msg, $ionicTabsDelegate, $ionicNavBarDelegate) {
             $scope.index = 0;
             $scope.index1 = 0;
             $scope.vm = {
@@ -81,6 +96,17 @@
             $scope.$on('$ionicView.leave', function () {
                 $ionicTabsDelegate.showBar(true);
             });
+            $scope.searchContent=function ()
+            {
+                var data={
+                    keyword:$scope.vm.keyword
+                };
+                homeService.searchContent($scope.vm.keyword).then(function(result){
+
+                },function(erro){
+
+                });
+            }
         }]);
    
     

+ 72 - 38
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js

xqd xqd xqd xqd
@@ -12,55 +12,71 @@
           formData.append('file', files[0]);
           formData.append('tag', 'avatar');
 
-          $http({
-              method: 'POST',
-              url: config.server + 'api/attachment/upload',
-              transformRequest: angular.identity,
-              data: formData,
-              // headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }
-              headers: {'Content-Type': undefined}
-          }).then(function (result) {
-              // alert(JSON.stringify(result));
-            console.log("attachment upload result:"+JSON.stringify(result));
-          }, function (erro) {
-            console.log("attachment upload erro:"+JSON.stringify(erro));
-              
-          })
+            $http({
+                method: 'POST',
+                url: config.server + 'api/attachment/upload',
+                transformRequest: angular.identity,
+                data: formData,
+                // headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }
+                headers: {'Content-Type': undefined}
+            }).then(function (result) {
+                // alert(JSON.stringify(result));
+                console.log("attachment upload result:"+JSON.stringify(result));
+            }, function (error) {
+                console.log("attachment upload error:"+JSON.stringify(error));
+
+            })
         }
-        $scope.toprofile = function () {
-            $state.go('app.my_profile');
-        };
+            $scope.toprofile = function () {
+                $state.go('app.my_profile');
+            };
         $scope.setting = function(){
             myService.setting().then(function(result){
 
-            },function(erro){
+            },function(error){
 
             });
-        }
+        };
+            $scope.collect = function(){
+                myService.collect().then(function(result){
+
+                },function(erro){
+
+                });
+            };
+            $scope.myDream = function(){
+                myService.myDream().then(function(result){
+
+                },function(erro){
+
+                });
+            }
+
         }]);
+
     app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
       , function ($scope, $state, storage, myService, msg, common) {
-          $scope.setAvator = function () {
-              common.setAvator().then(function (result) {
-                  debugger;
-                  var response = JSON.parse(result.response);
-                  $timeout(function () {
-                      $scope.vm.user.avatar = response.data.md5;
-                  });
-              }, function (erro) {
-                  msg.erro(JSON.stringify(erro));
-              });
-          };
-          $scope.$on('$ionicView.beforeEnter', function () {
-
-          });
+            $scope.setAvator = function () {
+                common.setAvator().then(function (result) {
+                    debugger;
+                    var response = JSON.parse(result.response);
+                    $timeout(function () {
+                        $scope.vm.user.avatar = response.data.md5;
+                    });
+                }, function (error) {
+                    msg.error(JSON.stringify(error));
+                });
+            };
+            $scope.$on('$ionicView.beforeEnter', function () {
+
+            });
             $scope.reset = function(){
                 var data = {
                     pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
                 };
                 myService.reset(data).then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
             }
@@ -86,7 +102,7 @@
             $scope.recharge = function(){
                 myService.recharge().then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
             }
@@ -100,17 +116,17 @@
             $scope.systemInfo = function(){
                 myService.systemInfo().then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
             };
             $scope.replyMy = function(){
                 myService.replyMy().then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
-            }
+            };
 
   }]);
     app.controller('dreamCtrl', ["$scope", "$state", "myService", "msg"
@@ -144,12 +160,30 @@
             $scope.openModal = function () {
                 $scope.modal.show();
             };
+
             $scope.closeModal = function () {
                 $scope.modal.hide();
+
             };
            $scope.$on('$ionicView.beforeEnter', function () {
 
            });
+
+            $scope.vm={
+                content:""
+            };
+            $scope.myReplay = function(){
+                var data = {
+                    content:$scope.vm.content,
+                    comment_id:'11'
+                };
+                myService.myReplay(data).then(function(result){
+
+                },function(erro){
+
+                })
+                $scope.modal.hide();
+            }
        }]);
    
 })(angular.module('app.controllers'));

+ 25 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/tabs.js

xqd
@@ -1,8 +1,32 @@
 (function (module) {
-    module.controller('tabsCtrl', ["$scope", "$ionicHistory", "$state", function ($scope, $ionicHistory, $state) {
+    module.controller('tabsCtrl', ["$scope","$http", "myService", "$ionicHistory", "$state", function ($scope,$http, myService, $ionicHistory, $state) {
         $scope.go = function(target) {
           //  $ionicHistory.clearHistory();
             $state.go(target);
         };
+
+        $scope.vm={
+
+        };
+        $scope.userMes = function(){
+            /*var data={
+                user_id:"111"
+            };
+            myService.userMes(data).then(function(result){
+
+            },function(erro){
+
+            });*/
+            $scope.go("app.my")
+        };
+
+        $scope.myIndex = function(){
+           /* myService.userMes().then(function(result){
+
+            },function(erro){
+
+            });*/
+            $scope.go("app.home")
+        };
     }]);
 })(angular.module('app.controllers'));

+ 5 - 5
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/directives/directive.js

xqd xqd xqd
@@ -1,5 +1,4 @@
 (function (module) {
-   
     module.directive('focusMe', function ($timeout) {
         return {
             link: function (scope, element, attrs) {
@@ -9,7 +8,11 @@
             }
         };
     });
-   
+    module.filter("trustUrl", ['$sce', function ($sce) {
+        return function (recordingUrl) {
+            return $sce.trustAsResourceUrl(recordingUrl);
+        };
+    }]);
     module.directive('ionAmapPlace', [
     '$ionicTemplateLoader',
     '$ionicBackdrop',
@@ -189,7 +192,4 @@
     }
     ]);
 
- 
-  
-
 })(angular.module('app.directives'));

+ 19 - 7
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js

xqd xqd xqd xqd xqd
@@ -61,7 +61,7 @@
                         uploadOptions.fileKey = "picture";
                         uploadOptions.fileName = "picture.jpg";
                         uploadOptions.mimeType = "image/jpeg";
-                        uploadOptions.params = { tag: "picture" };
+                        uploadOptions.params = { tag: "dream" };
                     }
                     if (type==2) {//视频
                         uploadOptions.fileKey = "video";
@@ -69,6 +69,12 @@
                         uploadOptions.mimeType = "video/mpeg";
                         uploadOptions.params = { tag: "video" };
                     }
+                    if (type == 3) {//头像
+                        uploadOptions.fileKey = "avatar";
+                        uploadOptions.fileName = "avatar.jpg";
+                        uploadOptions.mimeType = "image/jpeg";
+                        uploadOptions.params = { tag: "avatar" };
+                    }
                     uploadOptions.httpMethod = 'post';
                     uploadOptions.chunkedMode = true;
                     var token = 'Bearer ' + localStorage['token'];
@@ -86,6 +92,12 @@
                 }
                 return deferred.promise;
             },
+            deletefile:function (file) {
+                return $http({
+                    url: config.server + 'api/attachment/delete/' + file,
+                    method: "get"
+                })
+            },
             setAvator: function () {//上传头像
                 var deferred = $q.defer();
                 this.chooseImage().then(function (imageUri) {
@@ -156,9 +168,9 @@
                             deferred.reject(e);
                         })
                     }
-                }).error(function (erro) {
-                  //  alert(JSON.stringify(erro));
-                    deferred.reject(erro);
+                }).error(function (error) {
+                  //  alert(JSON.stringify(error));
+                    deferred.reject(error);
                 });
                 return deferred.promise;
             },
@@ -205,9 +217,9 @@
                             deferred.reject(e);
                         })
                     }
-                }).error(function (erro) {
-                  //  alert(JSON.stringify(erro));
-                    deferred.reject(erro);
+                }).error(function (error) {
+                  //  alert(JSON.stringify(error));
+                    deferred.reject(error);
                 });
                 return deferred.promise;
             }

+ 14 - 0
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/homeservice.js

xqd
@@ -7,6 +7,20 @@
                     method: "get"
                 })
             },
+            supportDream:function(data){
+                return $http({
+                    url:config.server + "api/user/support",
+                    method:"post",
+                    data:data
+                })
+            },
+            searchContent:function (data){
+                return $http({
+                    url:config.server + 'api/index/search',
+                    method:"get",
+                    data:data
+                })
+            }
         };
     }]);
 })(angular.module('app.services'));

+ 39 - 8
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/myservice.js

xqd xqd
@@ -8,13 +8,7 @@
                     data: { password: password }
                 })
             },
-            add:function (data){
-                return $http({
-                    url:config.server + 'api/my/add_dream',
-                    method:"post",
-                    data:data
-                })
-            },
+           
             reset:function(data){
                 return $http({
                     url:config.server + "api/auth/avatar",
@@ -46,7 +40,44 @@
                     method:"get"
                 })
             },
-
+            collect:function(){
+                return $http({
+                    url:config.server + "api/my/collection",
+                    method:"get"
+                })
+            },
+            myDream:function(){
+                return $http({
+                    url:config.server + "api/my/dream",
+                    method:"get"
+                })
+            },
+            myReplay:function(data){
+                return $http({
+                    url: config.server + '/api/my/my_reply',
+                    method: "post",
+                    data: data
+                })
+            },
+            userMes:function(data){
+                return $http({
+                    url:config.server + "api/user/index/",
+                    method:"get",
+                    data:data
+                })
+            },
+            myIndex:function(){
+              return $http({
+                  url:config.server + "api/my/index",
+                  method:"get"
+              })
+            },
+            toprofile:function(){
+                return $http({
+                    url:config.server + "api/my/persona",
+                    method:"get"
+                })
+            }
         };
     }]);
 })(angular.module('app.services'));

+ 6 - 8
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/add/index.html

xqd
@@ -21,20 +21,18 @@
                     <i class="icon ion-plus"></i>
                     添加梦想介绍
                 </a>-->
-                <textarea rows="4" cols="50" placeholder="添加梦想介绍" ng-model="vm.about" style="border: 1px solid #FF4B82">
-</textarea>
+                <textarea rows="4" cols="50" placeholder="添加梦想介绍" ng-model="vm.about" style="border: 1px solid #FF4B82;padding: 10px;width: 98%;"></textarea>
 
             </div>
             <div class="item">上传图片和视频,让别人更好的了解你</div>
             <div class="item itemjs">
-                <a ng-repeat="item in imgs" ng-click="showImages(item)" class="img-file-up">
-                    <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
+                <a ng-repeat="item in imgs" ng-click="showImages(imgServer+item)" class="img-file-up">
+                    <b style="background-image:url({{imgServer+item}});"><em ng-click="deletefile(item)" class="ion-ios-close-outline"></em></b>
                 </a>
                 <a class="btn-file-up" ng-click="addpict()"><i class="ion-image"></i>添加图片</a>
-                <a ng-repeat="item in videos" ng-click="showImages(item)" class="img-file-up">
-                    <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
-                </a>
-                <a class="btn-file-up" ng-click="addvideo()"><i class="icon ion-cash"></i>添加视频</a>
+                <video src="{{video.path}}" ng-if="video.isOK"  height="72px" width="72px" controls="controls">
+                </video>
+                <a class="btn-file-up" ng-click="addvideo()" ng-if="!video.isOK"><i class="icon ion-cash"></i>添加视频</a>
             </div>
             <div class="item">实现梦想所需要的人民币</div>
             <div class="item item-input-inset itemjs">

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/search.html

xqd
@@ -1,7 +1,7 @@
 <ion-view view-title="">
     <ion-nav-buttons side="primary">
         <label class="item item-input" style="width:315px">
-            <i class="icon ion-search placeholder-icon"></i>
+            <i class="icon ion-search placeholder-icon" ng-click="searchContent()"></i>
             <input type="text" style="width: 100%" placeholder="搜索内容" ng-change="keychange()" ng-model="vm.keywords">
         </label>
         <button class="button button-calm" style="width: 30%; padding: 0;" ng-click="$ionicGoBack()">取消</button>

+ 7 - 7
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/user-detail.html

xqd xqd
@@ -227,29 +227,29 @@
     <div class="detail-like" ng-if="tosupport">
         <div>
             <div class="row">
-                <div class="col box {{index==1?'selected':''}}" ng-click="changeindex(1)">
+                <div class="col box {{index==1?'selected':''}}" ng-click="changeindex(1)" ng-model="coin">
                     <h2 class="calm">5个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i>虚拟币</p>
                 </div>
-                <div class="col box {{index==2?'selected':''}}" ng-click="changeindex(2)">
+                <div class="col box {{index==2?'selected':''}}" ng-click="changeindex(2)" ng-model="coin">
                     <h2 class="calm">10个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i>虚拟币</p>
                 </div>
-                <div class="col box {{index==3?'selected':''}}" ng-click="changeindex(3)">
+                <div class="col box {{index==3?'selected':''}}" ng-click="changeindex(3)" ng-model="coin">
                     <h2 class="calm">15个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i>虚拟币</p>
                 </div>
             </div>
             <div class="row">
-                <div class="col box {{index==4?'selected':''}}" ng-click="changeindex(4)">
+                <div class="col box {{index==4?'selected':''}}" ng-click="changeindex(4)" ng-model="coin">
                     <h2 class="calm">20个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i>虚拟币</p>
                 </div>
-                <div class="col box {{index==5?'selected':''}}" ng-click="changeindex(5)">
+                <div class="col box {{index==5?'selected':''}}" ng-click="changeindex(5)" ng-model="coin">
                     <h2 class="calm">25个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i>虚拟币</p>
                 </div>
-                <div class="col box {{index==6?'selected':''}}" ng-click="changeindex(6)">
+                <div class="col box {{index==6?'selected':''}}" ng-click="changeindex(6)" ng-model="coin">
                     <h2 class="calm">30个</h2>
                     <p><i class="icon ion-social-codepen-outline calm"></i> 虚拟币</p>
                 </div>
@@ -259,7 +259,7 @@
         <div class="send">
             <span>余额:<i class="calm">20000</i>梦想币</span>
             <span  style="padding:30px" class="calm"><i class="icon ion-card"></i>充值</span>
-            <a class="button button-calm" style="height:100%;border-radius:0;width:80px;font-size:1.2em ">发送</a>
+            <a class="button button-calm" style="height:100%;border-radius:0;width:80px;font-size:1.2em " ng-click="supportDream()">发送</a>
         </div>
     </div>
   

+ 2 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/index.html

xqd
@@ -49,12 +49,12 @@
                 <em class="fl">我的资料</em>
           
             </a>
-            <a class="item item-icon-left" ui-sref="app.my_dream">
+            <a class="item item-icon-left" ui-sref="app.my_dream" ng-click="myDream()">
                 <i class="icon ion-ios-lightbulb-outline"></i>
                 <em class="fl">我的梦想</em>
              
             </a>
-            <a class="item item-icon-left" ui-sref="app.my_collect">
+            <a class="item item-icon-left" ui-sref="app.my_collect" ng-click="collect()">
                 <i class="icon ion-ios-star-outline"></i>
                 <em class="fl">我的收藏</em>
                

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message-reply.html

xqd
@@ -83,7 +83,7 @@
             <ion-header-bar class="bar-calm">
                 <button class="button button-clear icon ion-ios-arrow-back" ng-click="closeModal()">返回</button>
                 <h1 class="title">我的回复</h1>
-                <button class="button button-clear" ng-click="closeModal()">确定</button>
+                <button class="button button-clear" ng-click="myReplay()">确定</button>
             </ion-header-bar>
             <ion-content>
                 <div class="addmodal">

+ 75 - 9
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-profile.html

xqd
@@ -1,32 +1,98 @@
 <ion-view view-title="个人信息" >
     <ion-content>
-     <div class="list">
 <<<<<<< HEAD
-         <a class="item item-avatar-right" ng-click="reset()">
-             <img  src="../../img/demo/head5.jpg" />
+        <div class="list">
+            <a class="item item-avatar-right" ng-click="setAvator()">
+                <img  src="img/demo/head5.jpg" />
+                <h2>头像</h2>
+                <p style="font-size:12px">点击上传</p>
+            </a>
+            <div class="item">
+             <span class="fl">
+                 绑定手机
+             </span>
+                <i style="float:right" class="ng-binding">159****0809</i>
+            </div>
+
+            <label class="item item-input item-select item-select-width">
+             <span class="input-label">
+                 性别
+             </span>
+                <select name="sex">
+                    <option>男</option>
+                    <option>女</option>
+                </select>
+            </label>
+            <label class="item item-input ">
+                <span class="input-label">个性签名</span>
+                <input name="signture" type="text" placeholder="请输入">
+            </label>
+            <label class="item item-input item-select item-select-width">
+             <span class="input-label">
+                 情感状态
+             </span>
+                <select name="emotion">
+                    <option>未婚</option>
+                    <option>已婚</option>
+                </select>
+            </label>
+
+            <label class="item item-input ">
+                <span class="input-label">职业</span>
+                <input name="job" type="text" placeholder="请输入">
+            </label>
+            <label class="item item-input ">
+                <span class="input-label">身高</span>
+                <input name="tail" type="text" placeholder="请输入(单位cm)">
+            </label>
+        </div>
 =======
+     <div class="list">
          <a class="item item-avatar-right" ng-click="setAvator()">
              <img  src="img/demo/head5.jpg" />
->>>>>>> 1d310a3a45c853ca8f205ef89ee51539cd5ccf2a
              <h2>头像</h2>
              <p style="font-size:12px">点击上传</p>
          </a>
+         <div class="item">
+             <span class="fl">
+                 绑定手机 
+             </span>
+             <i style="float:right" class="ng-binding">159****0809</i>
+         </div>
+
          <label class="item item-input item-select item-select-width">
              <span class="input-label">
                  性别
              </span>
-             <select>
+             <select name="sex">
                  <option>男</option>
                  <option>女</option>
              </select>
          </label>
          <label class="item item-input ">
-             <input type="text" placeholder="个性签名">
+             <span class="input-label">个性签名</span>
+             <input name="signture" type="text" placeholder="请输入">
+         </label>
+         <label class="item item-input item-select item-select-width">
+             <span class="input-label">
+                 情感状态
+             </span>
+             <select name="emotion">
+                 <option>未婚</option>
+                 <option>已婚</option>
+             </select>
+         </label>
+
+         <label class="item item-input ">
+             <span class="input-label">职业</span>
+             <input name="job" type="text" placeholder="请输入">
+         </label>
+         <label class="item item-input ">
+             <span class="input-label">身高</span>
+             <input name="tail" type="text" placeholder="请输入(单位cm)">
          </label>
-         <div class="item">
-             159286****0809
-         </div>
      </div>
+>>>>>>> 6206a0f6e0cf3505451a08cfa0521969e3fd9aeb
         <div class="padding">
             <button class="button button-full button-calm">
                 保存

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-setting.html

xqd
@@ -11,7 +11,7 @@
             </a>
             <a class="item item-icon-left" ng-click="logout()">
                 <i class="icon ion-log-out"></i>
-                <em class="fl">出当前账号</em>
+                <em class="fl">退出当前账号</em>
             </a>
             </div>
 </ion-content>

+ 2 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/tabs.html

xqd
@@ -1,11 +1,11 @@
 <ion-tabs class="tabs-icon-top tabs-color-active-calm">
-    <ion-tab title="首页" icon-off="ion-ios-home-outline" icon-on="ion-ios-home" ng-click="go('app.home')">
+    <ion-tab title="首页" icon-off="ion-ios-home-outline" icon-on="ion-ios-home" ng-click="myIndex()">
         <ion-nav-view name="app-home"></ion-nav-view>
     </ion-tab>
     <ion-tab class="tab-item-add" icon="ion-ios-plus"  ui-sref="app.add" >
         <ion-nav-view name="app-add"></ion-nav-view>
     </ion-tab>
-    <ion-tab title="我的" icon-off="ion-ios-person-outline" icon-on="ion-ios-person" ng-click="go('app.my')">
+    <ion-tab title="我的" icon-off="ion-ios-person-outline" icon-on="ion-ios-person" ng-click="userMes()">
         <ion-nav-view name="app-my"></ion-nav-view>
     </ion-tab>
 </ion-tabs>

BIN
miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_


BIN
miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk


+ 1 - 0
miaomiao/www/index.html

xqd
@@ -30,6 +30,7 @@
       <script src="js/services/storageservice.js"></script>
       <script src="js/services/userservice.js"></script>
       <script src="js/services/utilservice.js"></script>
+      <script src="js/services/dreamservice.js"></script>
       <!--filters-->
       <script src="js/filters/filter.js"></script>
       <!--directives-->

+ 2 - 1
miaomiao/www/js/config/config.js

xqd
@@ -1,6 +1,7 @@
 (function (app) {
     //全局配置 
     app.constant("config", {
-        server: 'http://q8.9026.com/'
+        server: 'http://q8.9026.com/',
+        imgServer: 'http://q8.9026.com/attachment/'
     });
 })(angular.module('app'));

+ 33 - 19
miaomiao/www/js/controllers/add.js

xqd xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('addCtrl', ["$scope", "$state", "storage", "myService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory", "common"
-        , function ($scope, $state, storage, myService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory, common) {
+    app.controller('addCtrl', ["$scope", "$state",  "dreamService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory", "common", "config"
+        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory, common, config) {
             $ionicModal.fromTemplateUrl('my-modal.html', {
                 scope: $scope,
                 animation: 'slide-in-up'
@@ -18,8 +18,14 @@
                 about:'',
                 money:""
             };
+            $scope.imgServer = config.imgServer;
             $scope.imgs = [];
-            $scope.videos = [];
+            $scope.video = {
+                isOK: false,
+                path: '',
+                server:''
+            }
+            
             $scope.addpict = function () {
                 common.chooseImage().then(function (img) {
                     common.uploadFiles(img,1).then(function (result) {
@@ -36,32 +42,40 @@
             $scope.addvideo = function () {
                 var options = { limit: 1, duration:20};
                 navigator.device.capture.captureVideo(function (videos) {
-                    $scope.videos.push(videos[0].fullPath);
+                    $scope.video.path = videos[0].fullPath;
+                    $scope.video.isOK = true;
                     common.uploadFiles(videos[0].fullPath, 2).then(function (result) {
-                        debugger;
                         var response = JSON.parse(result.response);
                         var file = response.data.file;
-                        debugger;
+                        $scope.video.server = file;
                     }, function (error) {
-                        debugger;
                         msg.error('视频上传失败');
                     });
                 }, function (error) {
-                    debugger;
+                    msg.error('视频上传失败');
                 }, options);
             }
-            $scope.add=function ()
-            {
-                var data={
-                    pics:['http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg'],
-                    dream:$scope.vm.dream,
-                    about:$scope.vm.about,
-                    time:21, //默认21
-                    money:$scope.vm.money
+            $scope.deletefile = function (file) {
+                var index = $scope.imgs.indexOf(file);
+                $scope.imgs.splice(index, 1);
+                common.deletefile(file).then(function () {
+                })
+            }
+            $scope.add = function () {
+                var data = {
+                    pics: $scope.imgs,
+                    video:$scope.video.server,
+                    dream: $scope.vm.dream,
+                    about: $scope.vm.about,
+                    time: 21, //默认21
+                    money: $scope.vm.money
                 };
-                myService.add(data).then(function(result){
-
-                },function(error){
+                msg.loading('保存中...');
+                dreamService.addDream(data).then(function (result) {
+                    msg.hide();
+                    $state.go('app.home');
+                }, function (error) {
+                    msg.hide();
                     msg.error(error.data.message);
                 });
             }

+ 5 - 5
miaomiao/www/js/directives/directive.js

xqd xqd xqd
@@ -1,5 +1,4 @@
 (function (module) {
-   
     module.directive('focusMe', function ($timeout) {
         return {
             link: function (scope, element, attrs) {
@@ -9,7 +8,11 @@
             }
         };
     });
-   
+    module.filter("trustUrl", ['$sce', function ($sce) {
+        return function (recordingUrl) {
+            return $sce.trustAsResourceUrl(recordingUrl);
+        };
+    }]);
     module.directive('ionAmapPlace', [
     '$ionicTemplateLoader',
     '$ionicBackdrop',
@@ -189,7 +192,4 @@
     }
     ]);
 
- 
-  
-
 })(angular.module('app.directives'));

+ 13 - 1
miaomiao/www/js/services/commonservice.js

xqd xqd xqd
@@ -61,7 +61,7 @@
                         uploadOptions.fileKey = "picture";
                         uploadOptions.fileName = "picture.jpg";
                         uploadOptions.mimeType = "image/jpeg";
-                        uploadOptions.params = { tag: "picture" };
+                        uploadOptions.params = { tag: "dream" };
                     }
                     if (type==2) {//视频
                         uploadOptions.fileKey = "video";
@@ -69,6 +69,12 @@
                         uploadOptions.mimeType = "video/mpeg";
                         uploadOptions.params = { tag: "video" };
                     }
+                    if (type == 3) {//头像
+                        uploadOptions.fileKey = "avatar";
+                        uploadOptions.fileName = "avatar.jpg";
+                        uploadOptions.mimeType = "image/jpeg";
+                        uploadOptions.params = { tag: "avatar" };
+                    }
                     uploadOptions.httpMethod = 'post';
                     uploadOptions.chunkedMode = true;
                     var token = 'Bearer ' + localStorage['token'];
@@ -86,6 +92,12 @@
                 }
                 return deferred.promise;
             },
+            deletefile:function (file) {
+                return $http({
+                    url: config.server + 'api/attachment/delete/' + file,
+                    method: "get"
+                })
+            },
             setAvator: function () {//上传头像
                 var deferred = $q.defer();
                 this.chooseImage().then(function (imageUri) {

+ 13 - 0
miaomiao/www/js/services/dreamservice.js

xqd
@@ -0,0 +1,13 @@
+(function (app) {
+    app.factory('dreamService', ['$http', 'config', "util", function ($http, config, util) {
+        return {
+            addDream: function (data) {
+                return $http({
+                    url: config.server + 'api/my/add_dream',
+                    method: "post",
+                    data: data
+                })
+            } 
+        };
+    }]);
+})(angular.module('app.services'));

+ 7 - 0
miaomiao/www/js/services/myservice.js

xqd
@@ -8,9 +8,16 @@
                     data: { password: password }
                 })
             },
+<<<<<<< HEAD
             add:function (data){
                 return $http({
                     url:config.server + 'api/my/add_dream',
+=======
+           
+            reset:function(data){
+                return $http({
+                    url:config.server + "api/auth/avatar",
+>>>>>>> 257ac8c26b1de045fb0ce6844de33ff94a5763f8
                     method:"post",
                     data:data
                 })

+ 5 - 6
miaomiao/www/templates/add/index.html

xqd
@@ -26,14 +26,13 @@
             </div>
             <div class="item">上传图片和视频,让别人更好的了解你</div>
             <div class="item itemjs">
-                <a ng-repeat="item in imgs" ng-click="showImages(item)" class="img-file-up">
-                    <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
+                <a ng-repeat="item in imgs" ng-click="showImages(imgServer+item)" class="img-file-up">
+                    <b style="background-image:url({{imgServer+item}});"><em ng-click="deletefile(item)" class="ion-ios-close-outline"></em></b>
                 </a>
                 <a class="btn-file-up" ng-click="addpict()"><i class="ion-image"></i>添加图片</a>
-                <a ng-repeat="item in videos" ng-click="showImages(item)" class="img-file-up">
-                    <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
-                </a>
-                <a class="btn-file-up" ng-click="addvideo()"><i class="icon ion-cash"></i>添加视频</a>
+                <video src="{{video.path}}" ng-if="video.isOK"  height="72px" width="72px" controls="controls">
+                </video>
+                <a class="btn-file-up" ng-click="addvideo()" ng-if="!video.isOK"><i class="icon ion-cash"></i>添加视频</a>
             </div>
             <div class="item">实现梦想所需要的人民币</div>
             <div class="item item-input-inset itemjs">

+ 1 - 1
server/app/Http/Controllers/Api/V1/AttachmentController.php

xqd
@@ -57,7 +57,7 @@ class AttachmentController extends Controller
      *     "message": "",
      *     "data": [
      *         "file": "f72e7dad80f597ed6621a009e82243ad",
-     *          //文件访问url http://localhost/web/attachment/f72e7dad80f597ed6621a009e82243ad
+     *          //文件访问url http://localhost/attachment/f72e7dad80f597ed6621a009e82243ad
      *     ]
      * }
      * @apiErrorExample {json} Error-Response:

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

xqd
@@ -134,7 +134,8 @@ class AuthController extends Controller
      *    1104    LOGOUT_FAILED                   退出失败
      */
     public function logout() {
-        if (Auth::user()->token()->delete()) {
+        $user = Auth::user();
+        if ($user->token()->delete()) {
             return $this->api(['result' => true]);
         }
         return $this->error(ErrorCode::LOGOUT_FAILED);

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

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Api\V1;
 use App\Models\BaseSettingsModel;
 use App\Models\DreamInfoModel;
 use App\Models\SearchInfoModel;
+use App\Models\UserCareUser;
+use App\Models\UserDream;
 use App\Models\UserInfoModel;
 use Illuminate\Http\Request;
 use App\Services\Base\ErrorCode;
@@ -12,19 +14,33 @@ class IndexController extends Controller
 {
     /**
      * @api {get} /api/index/hot 热门(hot)
-     * @apiDescription 登陆(hot)
+     * @apiDescription 热门(hot)
      * @apiGroup Index
      * @apiPermission none
      * @apiVersion 0.1.0
-     * @apiParam {string}  phone   手机号码
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-     * {
-     *     "state": true,
-     *     "code": 0,
-     *     "message": "",
-     *     "data": {
-     *         "verify_code": "1234"//该值调试时使用,sms调通后取消
+     *{
+     *"status": true,
+     *"status_code": 0,
+     *"message": "",
+     *"data": {
+     *      "banner": [],  轮播图
+     *      "other_user": [          动态用户
+     *                    'news_num':2    新消息数目
+     * ],
+     *      "dreams": [
+     *         "care_num": 0,   关注人数
+     *         "time": 1222222,   梦想倒计时
+     *         "dream_imgs_first": {
+     *               "pic": "",  梦想封面图片
+     *          }
+     *        "dream_find_user": [
+     *             {
+     *                  ...       发布梦想的用户信息
+     *            }
+     *         ],
+     *    ]
      *     }
      * }
      * @apiErrorExample {json} Error-Response:
@@ -35,8 +51,6 @@ class IndexController extends Controller
      *     "message": "传入参数不正确",
      *     "data": null or []
      * }
-     * 可能出现的错误代码:
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
     public function hot(Request $request)
     {
@@ -44,13 +58,17 @@ class IndexController extends Controller
 //获取轮播图
         $banner = $this->getBanner();
 //        关注的用户
-       $other_user =  $user->UserCareUser;
+        $arr =  $user->UserCareUser;
+        $other_user = [] ;
+        foreach ($arr as $k => $v){
+            if ($v->pivot->dream_num > 0) {
+                $v->news_num = $v->pivot->dream_num;
+                $other_user[] = $v;
+            }
+        }
 //        获取其他用户信息 及梦想
         $dreams = DreamInfoModel::orderBy('score','desc')->limit(20)->get();
-        foreach ($dreams as $k => $dream) {
-            $dream->dream_find_user =  $dream->dreamFindUser;
-            $dream->dream_first_pic =  $dream->dreamImgsFirst;
-        }
+        $this->dreams($dreams);
         return $this->api(compact('banner','other_user','dreams'));
     }
 
@@ -60,15 +78,28 @@ class IndexController extends Controller
      * @apiGroup Index
      * @apiPermission none
      * @apiVersion 0.1.0
-     * @apiParam {string}  phone   手机号码
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-     * {
-     *     "state": true,
-     *     "code": 0,
-     *     "message": "",
-     *     "data": {
-     *         "verify_code": "1234"//该值调试时使用,sms调通后取消
+     *{
+     *"status": true,
+     *"status_code": 0,
+     *"message": "",
+     *"data": {
+     *      "other_user": [   动态用户
+     *               'news_num':2    新消息数目
+     * ],
+     *      "dreams": [
+     *         "care_num": 0,   关注人数
+     *         "time": 1222222,   梦想倒计时
+     *         "dream_imgs_first": {
+     *               "pic": "",  梦想封面图片
+     *          }
+     *        "dream_find_user": [
+     *             {
+     *                  ...       发布梦想的用户信息
+     *            }
+     *         ],
+     *    ]
      *     }
      * }
      * @apiErrorExample {json} Error-Response:
@@ -79,20 +110,22 @@ class IndexController extends Controller
      *     "message": "传入参数不正确",
      *     "data": null or []
      * }
-     * 可能出现的错误代码:
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
     public function trend(Request $request)
     {
         $user = $this->getUser();
 //        关注的用户
-        $other_user =  $user->UserCareUser;
+        $arr =  $user->UserCareUser;
+        $other_user = [] ;
+        foreach ($arr as $k => $v){
+            if ($v->pivot->dream_num > 0) {
+                $v->news_num = $v->pivot->dream_num;
+                $other_user[] = $v;
+            }
+        }
 //        获取其他用户信息 及梦想
         $dreams = DreamInfoModel::orderBy('score','desc')->offset(20)->limit(100)->get();
-        foreach ($dreams as $k => $dream) {
-            $dream->dream_find_user =  $dream->dreamFindUser;
-            $dream->dream_first_pic =  $dream->dreamImgsFirst;
-        }
+        $this->dreams($dreams);
         return $this->api(compact('other_user','dreams'));
     }
 
@@ -102,15 +135,28 @@ class IndexController extends Controller
      * @apiGroup Index
      * @apiPermission none
      * @apiVersion 0.1.0
-     * @apiParam {string}  phone   手机号码
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-     * {
-     *     "state": true,
-     *     "code": 0,
-     *     "message": "",
-     *     "data": {
-     *         "verify_code": "1234"//该值调试时使用,sms调通后取消
+     *{
+     *"status": true,
+     *"status_code": 0,
+     *"message": "",
+     *"data": {
+     *      "other_user": [
+     *          'news_num':2    新消息数目
+     * ],  动态用户
+     *      "dreams": [
+     *         "care_num": 0,   关注人数
+     *         "time": 1222222,   梦想倒计时
+     *         "dream_imgs_first": {
+     *               "pic": "",  梦想封面图片
+     *          }
+     *        "dream_find_user": [
+     *             {
+     *                  ...       发布梦想的用户信息
+     *            }
+     *         ],
+     *    ]
      *     }
      * }
      * @apiErrorExample {json} Error-Response:
@@ -121,20 +167,22 @@ class IndexController extends Controller
      *     "message": "传入参数不正确",
      *     "data": null or []
      * }
-     * 可能出现的错误代码:
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
     public function news(Request $request)
     {
         $user = $this->getUser();
 //        关注的用户
-        $other_user =  $user->UserCareUser;
+        $arr =  $user->UserCareUser;
+        $other_user = [] ;
+        foreach ($arr as $k => $v){
+            if ($v->pivot->dream_num > 0) {
+                $v->news_num = $v->pivot->dream_num;
+                $other_user[] = $v;
+            }
+        }
 //        获取其他用户信息 及梦想
         $dreams = DreamInfoModel::orderBy('score','desc')->offset(100)->limit(500)->get();
-        foreach ($dreams as $k => $dream) {
-            $dream->dream_find_user =  $dream->dreamFindUser;
-            $dream->dream_first_pic =  $dream->dreamImgsFirst;
-        }
+        $this->dreams($dreams);
         return $this->api(compact('other_user','dreams'));
     }
 
@@ -190,7 +238,7 @@ class IndexController extends Controller
         $data1 = UserInfoModel::where('nickname','like',$keyword)->get();
         $data2 = DreamInfoModel::where('dream','like',$keyword)->
             orWhere('dream','like',$keyword)->get();
-        $data3  = BaseSettingsModel::where('category','sign')->get();
+        $data3  = BaseSettingsModel::where('category','sign')->where('value','like',$keyword)->get();
         if (empty($request->keyword)) {
 //            历史搜索
                 $data1  = $user->search()->orderBy('id','desc')->limit(10)->get();
@@ -214,6 +262,85 @@ class IndexController extends Controller
         return $this->api(compact('data1','data2','data3'));
     }
 
+    /**
+     * @api {get}  /api/index/user_search 用户搜索(search)
+     * @apiDescription 用户搜索(search)
+     * @apiGroup Index
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {string}  keyword   关键字
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     *{
+     *    "status": true,
+     *   "status_code": 0,
+     *   "message": "",
+     *  "data": {
+     *       "data1": [
+     *          "nickname": "ha",  昵称
+     *          "pic": "",    头像
+     *             ...
+     *       ]
+     *   }
+     *}
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     */
+    public function userSearch(Request $request)
+    {
+        if (empty($request->keyword)) {
+            return $this->api('');
+        }
+        $keyword ='%'.$request->keyword.'%';
+        $data1 = UserInfoModel::where('nickname','like',$keyword)->get();
+          return $this->api(compact('data1'));
+    }
+
+    /**
+     * @api {get}  /api/index/dream_search 梦想搜索(search)
+     * @apiDescription 梦想搜索(search)
+     * @apiGroup Index
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {string}  keyword   关键字
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+    {
+        "status": true,
+        "status_code": 0,
+        "message": "",
+        "data": {
+            "data": [
+                {
+                    "dream": "haha",  梦想名
+                    "user_pic": [
+                    {
+                        "pic": "",   用户头像
+                    }
+                    ],
+                    "dream_img": "",  梦想图片
+                }
+            ]
+        }
+    }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     */
+    public function dreamSearch(Request $request)
+    {
+        if (empty($request->keyword)) {
+            return $this->api('');
+        }
+        $keyword ='%'.$request->keyword.'%';
+        $data = DreamInfoModel::where('dream','like',$keyword)->
+        orWhere('dream','like',$keyword)->get();
+        foreach ($data as $k => $value) {
+            $value->user_pic = $value->dreamFindUser;
+            $value->dream_img = $value->dreamImgsFirst->pic;
+        }
+        return $this->api(compact('data'));
+    }
+
     //获取轮播图
     public function getBanner()
     {
@@ -221,4 +348,74 @@ class IndexController extends Controller
             ->orderBy('sort')->limit('3')->get()->toArray();
         return $banner;
     }
+
+//    完善梦想信息
+    public function dreams($dreams)
+    {
+        foreach ($dreams as $k => $dream) {
+            $dream->dream_find_user =  $dream->dreamFindUser;
+//            计算被关注总人数
+            $user_id = UserDream::where('dream_id',$dream->id)->first()->user_id;
+            $data = UserCareUser::where('other_user_id',$user_id)->get();
+            $dream->care_num = count($data);
+            $dream->dream_first_pic =  $dream->dreamImgsFirst;
+        }
+    }
+//    查看关注用户的最新动态
+    /**
+     * @api {get}  /api/index/news_info 关注用户动态详情
+     * @apiDescription 关注用户动态详情
+     * @apiGroup Index
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}  id   被点击用户ID
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+    {
+        "status": true,
+        "status_code": 0,
+        "message": "",
+        "data": [
+            {
+                "id": 12,
+                "dream": "123",
+                "about": "124",
+                "sign": null,
+                "videos": "234",
+                "money": 2345,
+                "time": 0,       倒计时 s
+                "get_money": 0,
+                "mark": 0,
+                "status": 0,
+                "score": 3,
+                "created_at": "2017-06-15 08:46:52",
+                "updated_at": "2017-06-15 08:46:52",
+                "deleted_at": null,
+                "imgs": [
+                    {
+                        "id": 8,
+                        "dream_id": 12,
+                        "title": "",
+                        "pic": "....png",   梦想图片
+                    },
+                ],
+            }
+        ]
+    }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     */
+    public function newsInfo(Request $request)
+    {
+//        查看后user_care_user dream_info 更新为零 首页不再显示
+        $user = $this->getUser();
+        $other_id = $request->id;
+        if (empty($other_id))  return $this->error(ErrorCode::MEMBER_NOT_EXIST);
+        UserCareUser::where('user_id',$user->id)->where('other_user_id',$other_id)->update(['dream_num'=>0]);
+        $data = UserInfoModel::find($other_id)->UserDream;
+        foreach ($data as $item) {
+            $item->imgs =  $item->dreamImgs ;
+        }
+        return $this->api($data);
+    }
 }

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

xqd xqd xqd
@@ -7,7 +7,9 @@ use App\Models\BaseSettingsModel;
 use App\Models\DreamImages;
 use App\Models\DreamInfoModel;
 use App\Models\ReplyCommentsInfo;
+use App\Models\UserCareUser;
 use App\Models\UserDream;
+use App\Models\UserInfoModel;
 use Illuminate\Http\Request;
 use App\Services\Base\ErrorCode;
 class MyController extends Controller
@@ -119,376 +121,93 @@ class MyController extends Controller
     }
 
     /**
-     * @api {post} /api/my/nickname 修改昵称(nickname)
-     * @apiDescription 修改昵称(nickname)
+     * @api {get} /api/my/edit_user_info 修改个人信息
+     * @apiDescription 修改个人信息
      * @apiGroup My
-     * @apiParam {string} nickname 昵称
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": ""
-    *}
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
-     *   "data": null
-     *  }
-     */
-    public function nickname(Request $request)
-    {
-        $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'nickname'  => 'required',
-            ],
-            [
-                'nickname.required'  => '昵称不能为空',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $nickname = $request->nickname;
-        $user->nickname = $nickname;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
-    }
-
-    /**
-     * @api {post} /api/my/sex 修改性别(sex get or post)
-     * @apiDescription 修改性别(sex)
-     * @apiGroup My
-     * @apiParam {sex} sex 性别
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     *   get
      *{
-     *   "status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": [
-     *       {
-     *           "value": "0",
-     *           "name": "男"
-     *       },
-     *       {
-     *          "value": "1",
-     *          "name": "女"
-     *       }
-     *    ]
-     *}
-     * post
-     * {
-     *   " status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": ""
-     *}
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
-     *   "data": null
-     *  }
-     */
-    public function sex(Request $request)
-    {
-        if ($request->method() == 'GET') {
-            $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
-                where('dictionary_code','sex')->get();
-            return $this->api($data);
-        }
-        $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'sex'  => 'required',
-            ],
-            [
-                'sex.required'  => '性别不能为空',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $sex = $request->sex;
-        $user->sex = $sex;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
-    }
-
-    /**
-     * @api {post} /api/my/signture 个性签名(signture)
-     * @apiDescription 个性签名(signture)
-     * @apiGroup My
-     * @apiParam {string} signture 个性签名
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": ""
-     *}
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * 保存
-     * {
-     *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
-     *   "data": null
-     *  }
-     * 提交
-     * {
-     *  "status": false,
-     *  "status_code": 1000,
-     *   "message": "个性签名不能为空",
-     *   "data": null
-     *}
-     */
-    public function signture(Request $request)
-    {
-        $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'signture'  => 'required',
-            ],
-            [
-                'signture.required'  => '个性签名不能为空',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $signture = $request->signture;
-        $user->signture = $signture;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
-    }
-
-    /**
-     * @api {post} /api/my/tel 修改手机号(tel)
-     * @apiDescription 修改手机号(tel)
-     * @apiGroup My
-     * @apiParam {int} tel 修改手机号
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
+     *  "status": true,
      *   "status_code": 0,
      *   "message": "",
-     *   "data": ""
-     *}
+     *   "data": {
+     *       "emotion": [
+     *          {
+     *              "value": "1",
+     *              "name": "未婚"
+     *          },
+     *          ...
+     *      ],
+     *      "sex": [
+     *          {
+     *              "value": "0",
+     *              "name": "男"
+     *           },
+     *          ...
+     *      ]
+     *   }
+     * }
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
      * {
      *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
+     *   "status_code": 1500,
+     *   "message": "会员不存在",
      *   "data": null
      *  }
      */
-    public function tel(Request $request)
+    public function  editUserInfo (Request $request)
     {
-        $user = $this->getUser();
+        $sex = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
+             where('dictionary_code','sex')->get();
+        $emotion = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
+             where('dictionary_code','emotion')->get();
 
-        $validator = \Validator::make($request->all(),
-            [
-                'tel'  => 'required|regex:/^1[34578][0-9]{9}$/',
-            ],
-            [
-                'tel.required'  => '手机号不能为空',
-                'tel.regex'  => '手机号格式不正确',
-            ]
-        );
+        return $this->api(compact('emotion','sex'));
 
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $tel = $request->tel;
-        $user->tel = $tel;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
     }
 
     /**
-     * @api {post} /api/my/job 工作类型(job  get or post)
-     * @apiDescription 工作类型(job)
+     * @api {post} /api/my/update_user_info 保存个人信息
+     * @apiDescription   保存个人信息
+     *      @apiParam {string} pic   头像
+     *      @apiParam {int} sex   性别
+     *      @apiParam {string} signture   个性签名
+     *      @apiParam {int} emotion   情感状态
+     *      @apiParam {string} job   职业
+     *      @apiParam {int} tall   身高
      * @apiGroup My
-     * @apiParam {string} job 工作类型
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
-     *   "status_code": 0,
+     *{
+     *    "status": true,
+     *    "status_code": 0,
      *   "message": "",
      *   "data": ""
      *}
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
-     * {
+     *{
      *   "status": false,
      *   "status_code": 600,
      *   "message": "保存用户数据失败",
      *   "data": null
-     *  }
+     * }
      */
-    public function job(Request $request)
+    public function updateUserInfo(Request $request)
     {
-        if ($request->method() == 'GET') {
-            $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
-            where('dictionary_code','job')->get();
-            return $this->api($data);
-        }
-
         $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'job'  => 'required',
-            ],
-            [
-                'job.required'  => '工作类型不能为空',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $job = $request->job;
-        $user->job = $job;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
-    }
-
-    /**
-     * @api {post} /api/my/job 情感状态(emotion  get or post)
-     * @apiDescription 情感状态(job)
-     * @apiGroup My
-     * @apiParam {int} emotion 情感状态
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": ""
-     *}
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
-     *   "data": null
-     *  }
-     */
-    public function emotion(Request $request)
-    {
-        if ($request->method() == 'GET') {
-            $data = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
-            where('dictionary_code','emotion')->get();
-            return $this->api($data);
+        $data = $request->except('_token');
+        $ok =  $user->update($data);
+        if ($ok) {
+            return $this->api('');
+        }else{
+            return $this->error(ErrorCode::SAVE_USER_FAILED);
         }
-
-        $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'emotion'  => 'required',
-            ],
-            [
-                'emotion.required'  => '情感状态不能为空',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $emotion = $request->emotion;
-        $user->emotion = $emotion;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
-    }
-
-    /**
-     * @api {post} /api/my/tall 身高
-     * @apiDescription 身高
-     * @apiGroup My
-     * @apiParam {int} tall 身高
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *   " status": true,
-     *   "status_code": 0,
-     *   "message": "",
-     *   "data": ""
-     *}
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *   "status": false,
-     *   "status_code": 600,
-     *   "message": "保存用户数据失败",
-     *   "data": null
-     *  }
-     */
-    public function tall(Request $request)
-    {
-        $user = $this->getUser();
-
-        $validator = \Validator::make($request->all(),
-            [
-                'tall'  => 'required|integer',
-            ],
-            [
-                'tall.required'  => '身高不能为空',
-                'tall.integer'  => '身高只能填写数字',
-            ]
-        );
-
-        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
-        $tall = $request->tall;
-        $user->tall = $tall;
-        $ok = $user->save();
-
-        if ($ok) return $this->api('');
-        return $this->error(ErrorCode::SAVE_USER_FAILED);
     }
 
     /**
@@ -791,21 +510,34 @@ class MyController extends Controller
         $a = $setting?$setting->key:1;
         $b = $setting?$setting->value:1;
         $t = 21*3600 / 60;
+
         $data = $request->except('_token','pics');
         \Log::debug(' care_num:'.$care_num.' a:'.$a.' b:'.$b.' t:'.$t);
-        $data['score'] = (log($care_num) + ($a/$t) + $b)*100000000 ;
+        if ($care_num == 0) {
+            $data['score'] = (($a/$t) + $b)*100000000 ;
+        }else{
+            $data['score'] = (log($care_num) + ($a/$t) + $b)*100000000 ;
+        }
         $data['created_at'] = date('Y-m-d H:i:s');
         $data['updated_at'] = date('Y-m-d H:i:s');
         $dream_id = DreamInfoModel::insertGetId($data);
 
         if ($dream_id) {
+//            梦想创建成功 关联关系中最新动态+1
+            $info = UserCareUser::where('other_user_id',$user->id)->get();
+            foreach ($info as $item) {
+                $item->dream_num += 1;
+                $item->updated_at = date('Y-m-d H:i:s');
+                $item->save();
+            }
+
             $data1['dream_id'] = $dream_id;
             $data1['user_id'] = $user->id;
             $data1['created_at'] = date('Y-m-d H:i:s');
             $data1['updated_at'] = date('Y-m-d H:i:s');
             $arr = $request->pics;
-            $videos = $request->videos;
-            if (empty($arr) && empty($videos))   return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
+            $video = $request->video;
+//            if (empty($arr) && empty($video))   return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
             $ok = UserDream::create($data1);
             $arr1 = [];
             if ($ok) {

+ 1 - 1
server/app/Models/UserInfoModel.php

xqd
@@ -56,7 +56,7 @@ class UserInfoModel extends Authenticatable
 
     public function UserCareUser()
     {
-        return $this->belongsToMany('App\Models\UserInfoModel','user_care_user','user_id','other_user_id');
+        return $this->belongsToMany('App\Models\UserInfoModel','user_care_user','user_id','other_user_id')->withPivot('dream_num');
     }
 
 //    系统消息

+ 32 - 0
server/database/migrations/2017_06_20_135741_add_dream_num_to_user_care_user.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddDreamNumToUserCareUser extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('user_care_user', function (Blueprint $table) {
+            $table->integer('dream_num')->comment('被关注用户最新梦想数目')->default(0)->after('other_user_id');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('user_care_user', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 18 - 26
server/routes/api.php

xqd xqd
@@ -100,6 +100,18 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'index.search',
         'uses' => 'IndexController@search',
     ]);
+    $api->get('index/user_search', [
+        'as' => 'index.user_search',
+        'uses' => 'IndexController@userSearch',
+    ]);
+    $api->get('index/dream_search', [
+        'as' => 'index.dream_search',
+        'uses' => 'IndexController@dreamSearch',
+    ]);
+    $api->get('index/news_info', [
+        'as' => 'index.news_info',
+        'uses' => 'IndexController@newsInfo',
+    ]);
 
 //我的
     $api->get('my/index', [
@@ -110,33 +122,13 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'my.persona',
         'uses' => 'MyController@persona',
     ]);
-    $api->post('my/nickname', [
-        'as' => 'my.nickname',
-        'uses' => 'MyController@nickname',
-    ]);
-    $api->any('my/sex', [
-        'as' => 'my.sex',
-        'uses' => 'MyController@sex',
-    ]);
-    $api->post('my/signture', [
-        'as' => 'my.signture',
-        'uses' => 'MyController@signture',
-    ]);
-    $api->post('my/tel', [
-        'as' => 'my.tel',
-        'uses' => 'MyController@tel',
-    ]);
-    $api->any('my/job', [
-        'as' => 'my.job',
-        'uses' => 'MyController@job',
-    ]);
-    $api->any('my/emotion', [
-        'as' => 'my.emotion',
-        'uses' => 'MyController@emotion',
+    $api->get('my/edit_user_info', [
+        'as' => 'my.edit_user_info',
+        'uses' => 'MyController@editUserInfo',
     ]);
-    $api->post('my/tall', [
-        'as' => 'my.tall',
-        'uses' => 'MyController@tall',
+    $api->post('my/update_user_info', [
+        'as' => 'my.update_user_info',
+        'uses' => 'MyController@updateUserInfo',
     ]);
 //    充值
     $api->get('my/recharge', [