gq 8 年之前
父节点
当前提交
cb5a6ad9aa
共有 36 个文件被更改,包括 318 次插入293 次删除
  1. 二进制
      .vs/miaomiao/v14/.suo
  2. 二进制
      miaomiao/bin/Android/Debug/android-debug-unaligned.apk
  3. 二进制
      miaomiao/bin/Android/Debug/android-debug.apk
  4. 14 8
      miaomiao/platforms/android/build/intermediates/assets/debug/www/css/style.css
  5. 19 8
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/config/router.js
  6. 7 33
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js
  7. 128 18
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/home.js
  8. 40 62
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js
  9. 0 13
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/tabs.js
  10. 1 0
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js
  11. 13 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/homeservice.js
  12. 4 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/httpinterceptor.js
  13. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/msgservice.js
  14. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/myservice.js
  15. 0 19
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/add/index.html
  16. 9 13
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/index.html
  17. 10 9
      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-collect.html
  19. 7 42
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-dream.html
  20. 5 10
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-profile.html
  21. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-recharge.html
  22. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/tabs.html
  23. 二进制
      miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_
  24. 二进制
      miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk
  25. 16 21
      miaomiao/www/js/controllers/add.js
  26. 7 6
      miaomiao/www/js/controllers/home.js
  27. 4 4
      miaomiao/www/js/controllers/my.js
  28. 6 5
      miaomiao/www/js/services/commonservice.js
  29. 2 2
      miaomiao/www/templates/add/index.html
  30. 1 1
      miaomiao/www/templates/my/index.html
  31. 2 2
      miaomiao/www/templates/my/my-profile.html
  32. 1 2
      server/app/Helper/AttachmentHelper.php
  33. 5 3
      server/app/Http/Controllers/Api/V1/AttachmentController.php
  34. 3 2
      server/app/Http/Controllers/Api/V1/AuthController.php
  35. 1 0
      server/app/Services/Base/ErrorCode.php
  36. 5 0
      server/routes/api.php

二进制
.vs/miaomiao/v14/.suo


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


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


+ 14 - 8
miaomiao/platforms/android/build/intermediates/assets/debug/www/css/style.css

xqd xqd xqd
@@ -152,6 +152,7 @@ overflow:auto;
     }
 .mysecond {
     color:#9A9A9A;
+    margin-top:5px;
 }
 .mainitem .iheart {
     width: 1.5rem;
@@ -173,13 +174,15 @@ overflow:auto;
     text-align: center;
     color:#FFF;
 }
-    .user-box .myinfo {
-        padding-top:30px;
-    }
-        .user-box .myinfo img {
-            width:60px;
-            border-radius:100%;
-        }
+.user-box .myinfo {
+    padding-top:30px;
+}
+.user-box .myinfo img {
+    width:60px;
+
+    height: 60px;
+    border-radius:100%;
+}
 .user-row {
     margin-top:10px;
 }
@@ -348,9 +351,12 @@ padding-right:3px;
     .detail-like .send {
         border:1px solid #EAEAEA;
         font-size:1.2rem;
+        height: 3rem;
+        line-height: 3rem;
+        padding-left: 2rem;
     }
     .detail-like .send span{
-        position:relative;
+        /*position:relative;*/
         top:15px;
     }
 .hdcontent {

+ 19 - 8
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/config/router.js

xqd
@@ -12,17 +12,28 @@
               templateUrl: "templates/tabs.html",
               controller: 'tabsCtrl'
           })
-        .state('app.home', {
-            url: '/home',
-            views: {
-                'app-home': {
-                    templateUrl: 'templates/home/index.html',
-                    controller: 'homeCtrl'
+            .state('app.home', {
+                url: '/home',
+                views: {
+                    'app-home': {
+                        templateUrl: 'templates/home/index.html',
+                        controller: 'homeCtrl'
+                    }
                 }
-            }
-        })
+            })
+            .state('app.my_dreamdetail', {
+                url: '/my/dreamdetail',
+                params:{id:null},
+                views: {
+                    'app-my': {
+                        templateUrl: 'templates/home/dream-detail.html',
+                        controller: 'dreamDetailCtrl'
+                    }
+                }
+            })
             .state('app.home_dreamdetail', {
                 url: '/home/dreamdetail',
+                params:{id:null},
                 views: {
                     'app-home': {
                         templateUrl: 'templates/home/dream-detail.html',

+ 7 - 33
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js

xqd xqd xqd xqd
@@ -1,33 +1,9 @@
 (function (app) {
-    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'
-            }).then(function (modal) {
-                $scope.modal = modal;
-            });
-            $scope.openModal = function () {
-                $scope.modal.show();
-            };
-            $scope.closeModal = function () {
-                $scope.modal.hide();
-            };
-            $scope.vm={
-                dream:'',
-                about:'',
-                money:""
-            };
-            $scope.imgServer = config.imgServer;
-            $scope.imgs = [];
-            $scope.video = {
-                isOK: false,
-                path: '',
-                server:''
-            };
-            
+    app.controller('addCtrl', ["$scope", "$state",  "dreamService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate","$ionicHistory", "common", "config"
+        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate, $ionicNavBarDelegate,$ionicHistory, common, config) {
             $scope.addpict = function () {
-                common.chooseImage().then(function (img) {
+                $scope.imgs=new Array();
+                common.chooseImage().then(function (img) { 
                     common.uploadFiles(img,1).then(function (result) {
                         var response = JSON.parse(result.response);
                         var file = response.data.file;
@@ -39,6 +15,7 @@
                     console.log('图片选择失败');
                 });
             };
+            $scope.video = {};
             $scope.addvideo = function () {
                 common.chooseVideo().then(function (file) {
                         $scope.video.path = file;
@@ -51,7 +28,7 @@
                         msg.error('视频上传失败');
                     });
                 }, function (erro) {
-                    msg.error('选择视频失败');
+                    console.log('选择视频失败');
                 });
             };
             $scope.deletefile = function (file) {
@@ -78,10 +55,7 @@
                     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);
             });

+ 128 - 18
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/home.js

xqd xqd xqd xqd xqd xqd xqd
@@ -17,8 +17,8 @@
                 $scope.type = type;
                 $scope.load(true);
             }
-            $scope.todetail = function () {
-                $state.go('app.home_dreamdetail');
+            $scope.toDetail = function (id) {
+                $state.go('app.home_dreamdetail',id);
             };
             $scope.filter = {
                 hasMore: false,
@@ -35,8 +35,10 @@
                     $scope.filter.pageIndex = 1;
                     $scope.index.dreams = [];
                 }
+                msg.loading();
                 homeService.index($scope.type, $scope.filter.pageIndex).then(function (result) {
-                    $scope.index.banner = result.data.data.banner;
+                    msg.hide();
+                    $scope.index.banners = result.data.data.banners;
                     $scope.index.users = result.data.data.users;
                     $scope.filter.pageIndex++;
                     var more = (result.data.data.dreams.data.length >= $scope.filter.pageSize);
@@ -47,8 +49,8 @@
                     } else {
                         $scope.$broadcast('scroll.infiniteScrollComplete');
                     }
-                }, function (erro) {
-                    msg.error(erro.data.Message);
+                }, function (error) {
+                    msg.hide();
                 });
             }
             $scope.data = {};
@@ -58,13 +60,26 @@
           
             //});
         }]);
-    app.controller('dreamDetailCtrl', ["$scope", "$state", "msg", "homeService", "$ionicTabsDelegate"
-        , function ($scope, $state, msg, homeService, $ionicTabsDelegate) {
+    app.controller('dreamDetailCtrl', ["$scope", "$state", "msg","common","config", "homeService", "$ionicTabsDelegate","$stateParams","$ionicModal","$timeout"
+        , function ($scope, $state, msg,common, config, homeService, $ionicTabsDelegate,$stateParams,$ionicModal,$itemout) {
+            var id = $stateParams.id;
+            id=6;
+            $scope.load = function (id) {
+                homeService.dreamDetail(id).then(function (result) {
+                    console.log(result);
+                }, function (error) {
+                    msg.error(error.data.message);
+                });
+            }
+            $scope.load(6);
+
             $scope.type = 1;//tab切换
             $scope.tosupport = false;
             $scope.support = function ($event) {
                 $event.stopPropagation();
                 $scope.tosupport = true;
+                $scope.vm.coin = 0;
+                $scope.index = 0;
             }
             $scope.cancelsupport = function () {
                 $scope.tosupport = false;
@@ -73,9 +88,6 @@
                 $scope.type = type;
             }
             $scope.index = 0;
-            $scope.changeindex = function (index) {
-                $scope.index = index;
-            }
             $scope.$on('$ionicView.beforeEnter', function () {
                 $ionicTabsDelegate.showBar(false);
             });
@@ -84,23 +96,113 @@
             });
 
             $scope.vm = {
-                coin:""
+                coin:"",
+                comment:""
+            }
+
+            $scope.changeindex = function (index) {
+                $scope.index = index;
+                $scope.vm.coin = index*5;
             }
             $scope.supportDream = function(data){
+                if(!$scope.vm.coin){
+                    msg.error("请选择梦想币数量!");
+                    return ;
+                }
                 var data = {
-                    dream_id:"11",
+                    id:id,
                     coin:$scope.vm.coin
                 };
                 homeService.supportDream(data).then(function(result){
-
-                },function(erro){
-
+                    $scope.tosupport = false;
+                    number = result.data.data;
+                    //最新支持乘数
                 })
             };
-            $scope.show = function(){
-                var obj = document.getElementById("box");
-                obj.style = "white-space: normal;";
+            $scope.collectionDream = function(){
+                homeService.collectionDream(id).then(function(result){
+                    //最新支持乘数
+                })
+            }
+            $scope.showText = function(){ 
+                $scope.aboutStyle = {
+                    "white-space" : "normal"
+                  }
+                $scope.ionDownStyle = {
+                    "display" : "none"
+                }
             }
+
+        $scope.placeholder="评论";
+        $scope.replay = function($event){
+            // $event.stopPropagation();
+            $scope.placeholder="回复百川";
+            $scope.addReplay=true;
+            $scope.vm.comment='';
+        }
+        $scope.comment = function(){
+            $event.stopPropagation();
+            $scope.placeholder="评论"; 
+            $scope.addReplay=true; 
+            $scope.vm.comment='';
+        }
+        $scope.addpict = function () {
+            $scope.imgs=new Array();
+            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 (error) {
+                    msg.error('图片上传失败');
+                });
+            }, function (error) {
+                console.log('图片选择失败');
+            });
+        };
+
+          $ionicModal.fromTemplateUrl('recharge-modal.html', {
+            scope: $scope,
+            animation: 'slide-in-up'
+          }).then(function(modal) {
+            $scope.rechagemodal = modal;
+          });
+
+          $scope.openRechargeModal = function() {
+            $scope.rechagemodal.show();
+            $scope.rvm={
+                dream:'',
+                about:'',
+                money:''
+            };
+          };
+          $scope.closeRechargeModal = function() {
+            $scope.rechagemodal.hide();
+          };
+
+          $ionicModal.fromTemplateUrl('interaction-modal.html', {
+            scope: $scope,
+            animation: 'slide-in-up'
+          }).then(function(modal) {
+            $scope.modal = modal;
+          });
+          $scope.openModal = function() {
+            $scope.modal.show();
+            $scope.ivm={
+                dream:'',
+                about:'',
+                money:''
+            };
+            $scope.iimgServer = config.imgServer;
+            $scope.iimgs = [];
+          };
+          $scope.closeModal = function() {
+            $scope.modal.hide();
+          };
+          //当我们用到模型时,清除它!
+          $scope.$on('$destroy', function() {
+            $scope.modal.remove();
+          });
         }]);
     app.controller('searchCtrl', ["$scope","homeService", "$state", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate"
         , function ($scope,homeService, $state, msg, $ionicTabsDelegate, $ionicNavBarDelegate) {
@@ -142,6 +244,14 @@
                 });
             };
         }]);
+    app.controller('interactionAddCtrl', ["$scope","homeService", "$state", "msg","config","common", "$ionicTabsDelegate", "$ionicNavBarDelegate"
+        , function ($scope,homeService, $state, msg,config,common, $ionicTabsDelegate, $ionicNavBarDelegate) {
+            $scope.$on('$ionicView.beforeEnter', function () {
+             
+                
+            }); 
+
+    }]);
    
     
 })(angular.module('app.controllers'));

+ 40 - 62
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js

xqd xqd xqd xqd xqd xqd
@@ -2,74 +2,41 @@
     app.controller('myCtrl', ["$scope", "$state", "$http", "storage", "myService", "common", "config", "msg"
         , function ($scope, $state, $http, storage, myService, common, config, msg) {
         $scope.$on('$ionicView.beforeEnter', function (viewResult) {
-            
+            myService.myIndex().then(function(result){
+              console.log(result.data.data);
+              $scope.user = result.data.data
+            });
         });
 
 
-        $scope.testuploadFile = function(files) {       //单次提交图片的函数
-          console.log(files[0]);
-          var formData = new FormData();
-          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 (error) {
-                console.log("attachment upload error:"+JSON.stringify(error));
-
-            })
+        
+        $scope.setAvator = function () {
+            common.setAvator().then(function (result) {
+                var response = JSON.parse(result.response);
+                $timeout(function () {
+                    $scope.vm.user.avatar = response.data.md5;
+                });
+            });
+        };
+        $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(error){
-
             });
         };
-
-            //我的收藏
-            $scope.collect = function(){
-                myService.collect().then(function(result){
-
-                },function(error){
-
-                });
-            };
-
-            //我的梦想
-            $scope.myDream = function(){
-                myService.myDream().then(function(result){
-
-                },function(error){
-
-                });
-            };
-
+ 
             //修改个人信息
             $scope.myMaterial = function(){
                 myService.myMaterial().then(function(result){
-
-                },function(error){
-
                 })
             }
         }]);
 
-    app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
-      , function ($scope, $state, storage, myService, msg, common) {
+    app.controller('profileCtrl', ["$scope", "$state","$filter", "storage", "myService", "msg", "common"
+      , function ($scope, $state, $filter, storage, myService, msg, common) {
             $scope.setAvator = function () {
                 common.setAvator().then(function (result) {
                     debugger;
@@ -94,8 +61,10 @@
             $scope.$on('$ionicView.beforeEnter', function () {
                 msg.loading();
                 myService.myIndex().then(function(result){
-                  // alert(JSON.stringify(result.data.data.user));
-                  $scope.vm = result.data.data.user;
+                  // alert(JSON.stringify(result.data.data));
+                  $scope.vm = result.data.data;
+                  $scope.vm.sex = $scope.vm.sex+'';
+                  $scope.vm.emotion = $scope.vm.emotion+'';
                   if($scope.vm.birthday){
                       var arr1 = $scope.vm.birthday.split("-");  
                       $scope.vm.birthday1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]); 
@@ -108,7 +77,6 @@
             });
  
             $scope.saveMaterial = function(){
-               
                 var data = {
                     pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg', 
                     sex:$scope.vm.sex,
@@ -126,6 +94,7 @@
                 myService.saveMaterial(data).then(function(result){
                   msg.hide();
                   msg.success("保存成功!");
+                  $state.go('app.my')
                 },function(error){
                   msg.hide();
                   msg.error(error.data.message);
@@ -147,15 +116,16 @@
      }]);
     app.controller('rechargeCtrl', ["$scope", "$state", "myService", "msg"
   , function ($scope, $state, myService, msg) {
-      $scope.$on('$ionicView.beforeEnter', function () {
+       $scope.$on('$ionicView.beforeEnter', function () {
 
+            $scope.vm = {
+                money:"",
+            }
       });
             //充值
-            $scope.recharge = function(){
-                myService.recharge().then(function(result){
-
-                },function(error){
-
+            $scope.recharge = function(money){
+                myService.recharge(money).then(function(result){
+                  $state.go('app.my');
                 });
             }
 
@@ -186,14 +156,22 @@
     app.controller('dreamCtrl', ["$scope", "$state", "myService", "msg"
   , function ($scope, $state, myService, msg) {
       $scope.$on('$ionicView.beforeEnter', function () {
-
+            myService.myDream().then(function(result){
+              console.log(result.data.data);
+              $scope.dreams = result.data.data;
+            });
       });
+          $scope.toDetail = function (id) {
+              $state.go('app.my_dreamdetail',id);
+          };
 
   }]);
     app.controller('collectCtrl', ["$scope", "$state", "myService", "msg"
        , function ($scope, $state, myService, msg) {
       $scope.$on('$ionicView.beforeEnter', function () {
-
+          myService.collect().then(function(result){
+              console.log(result.data.data);
+          });
       });
        }]);
     app.controller('messageSysCtrl', ["$scope", "$state", "myService", "msg"

+ 0 - 13
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/tabs.js

xqd
@@ -5,24 +5,11 @@
             $state.go(target);
         };
 
-        $scope.vm={
-
-        };
         $scope.myMes = function(){
-            myService.myMes().then(function(result){
-
-            },function(error){
-
-            });
             $scope.go("app.my")
         };
 
         $scope.myIndex = function(){
-            myService.myIndex().then(function(result){
-
-            },function(error){
-
-            });
             $scope.go("app.home")
         };
     }]);

+ 1 - 0
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js

xqd
@@ -67,6 +67,7 @@
                         case 1: //拍摄视频
                             var options1 = { limit: 1, duration:20};
                             navigator.device.capture.captureVideo(function (videos) {
+                                debugger;
                                 if (videos[0]) {
                                     deferred.resolve(videos[0].fullPath);
                                 } else {

+ 13 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/homeservice.js

xqd
@@ -9,17 +9,29 @@
             },
             supportDream:function(data){
                 return $http({
-                    url:config.server + "api/user/support",
+                    url:config.server + "api/dream/support",
                     method:"post",
                     data:data
                 })
             },
+            collectionDream:function(id){
+                return $http({
+                    url:config.server + "api/dream/collection?id=" + id,
+                    method:"get",
+                })
+            },
             searchContent:function (data){
                 return $http({
                     url: config.server + 'api/index/search?' + data,
                     method:"get"
                 })
             },
+            dreamDetail: function (id) {
+                return $http({
+                    url: config.server + 'api/dream/show?id=' + id,
+                    method: "get"
+                })
+            },
             index: function (type, page) {
                 var url = util.format('{0}/api/index/index?type={1}&page={2}', config.server,type,page);
                 return $http({

+ 4 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/httpinterceptor.js

xqd
@@ -41,7 +41,10 @@
                     return;
                 }
                 if (rejection.status==400) {
-                    getMsg().error(rejection.data.error_description);
+                    getMsg().error(rejection.data.message);
+                }
+                if (rejection.status==500) {
+                    getMsg().error(rejection.data.message);
                 }
                 return $q.reject(rejection);
             }

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/msgservice.js

xqd
@@ -50,7 +50,7 @@
                     o["template"] = template
                 } else {
                     o["title"] = title;
-                    o["cssClass"] = "pop-alert"
+                    o["cssClass"] = "pop-alert calm"
                 }
                 $ionicPopup.alert(o)
             },

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

xqd
@@ -15,9 +15,9 @@
                     data:data
                 })
             },
-            recharge:function(){
+            recharge:function(money){
                 return $http({
-                    url:config.server + "api/my/recharge",
+                    url:config.server + "api/my/recharge?money="+money,
                     method:"get"
                 })
             },

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

xqd
@@ -43,23 +43,4 @@
             </button>
         </div>
     </ion-content>
-    <script id="my-modal.html" type="text/ng-template">
-        <ion-modal-view>
-            <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>
-            </ion-header-bar>
-            <ion-content>
-                <div class="addmodal" style="border-bottom: 2px solid #EEEEEE">
-                    <textarea placeholder="请输入梦想介绍"></textarea>
-                </div>
-                <a ng-repeat="item in files" 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="addfile()"><i class="ion-image"></i>添加图片</a>
-            </ion-content>
-        
-        </ion-modal-view>
-    </script>
 </ion-view>

+ 9 - 13
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/home/index.html

xqd xqd
@@ -26,30 +26,26 @@
         </div>
         <div class="icontent">
             <ion-slides   options="data.sliderOptions" slider="data.sliderDelegate">
-                <ion-slide-page ng-repeat="img in index.banner">
-                    <div class="box banner"><img ng-src="{{img.value}}" /></div>  
+                <ion-slide-page ng-repeat="banner in index.banners">
+                    <div class="box banner"><img ng-src="{{banner.value}}" /></div>  
                 </ion-slide-page>
             </ion-slides>
              
             <div class="item item-image" style="margin: 20px 0; border: none;">
                 <i class="icon ion-ios-arrow-left" style="font-size: 1.5rem;"></i>
                 <span class="subcontent">
-                    <img ng-src="img/demo/head1.jpg" />
-                    <img ng-src="img/demo/head2.jpg" />
-                    <img ng-src="img/demo/head3.jpg" />
-                    <img ng-src="img/demo/head4.jpg" />
-                    <img ng-src="img/demo/head5.jpg" />
+                    <img ng-src="{{user.dream_user.pic}}" ng-repeat="user in index.users"/>
                 </span>
                 <i class="icon ion-ios-arrow-right" style="font-size: 1.5rem"></i>
             </div>
             <div class="list">
-                <div class="item mainitem" ng-click="todetail()" ng-repeat="item in index.dreams">
+                <div class="item mainitem" ng-click="toDetail(item.id)" ng-repeat="item in index.dreams">
                     <div class="row">
                         <div class="col">
-                            <img ng-src="{{item.dream_find_user.pic}}" />
+                            <img ng-src="{{item.dream_user.pic}}" />
                             <div  class="myblock">
-                               <div>{{item.dream_find_user.nickname}}<span class="calm">20岁</span></div>
-                                <div class="mysecond">{{item.dream_find_user.address}}></div>
+                               <div>{{item.dream_user.nickname}}<span class="calm">{{item.dream_user.birthday | getage}}岁</span></div>
+                                <div class="mysecond">{{item.dream_user.city}}></div>
                             </div>
                         </div>
                         <div class="col" style="text-align:right">
@@ -58,10 +54,10 @@
                                 <span class="calm">{{item.care_num}}</span>
                                 <span>人关注</span>
                             </div>
-                            <div class="mysecond">剩余{{item.time}}天</div>
+                            <div  class="mysecond">剩余{{item.time}}天</div>
                         </div>
                     </div>
-                        <img ng-src="{{item.dream_first_pic.pic}}" />
+                        <img ng-src="{{item.dream_imgs_first.pic}}" />
                     </div>
             </div>
         </div>

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

xqd xqd
@@ -2,23 +2,23 @@
     <ion-content>
         <div class="user-box">
          
-            <div class="myinfo" ng-click="toprofile()">
-                <img ng-src="img/demo/head5.jpg" />
+            <div class="myinfo" ng-click="setAvator()">
+                <img ng-src=" {{user.pic}}" />
                 <div>
-                    喵喵喵喵酱
+                    {{user.nickname}}
                 </div>
-                <div style="font-size:0.7rem">上海市</div>
+                <div style="font-size:0.7rem"> {{user.city}}</div>
             </div>
             
            <div class="row user-row">
-               <div class="col"><i class="icon ion-heart"></i> 关注&nbsp;&nbsp;123456</div>
-               <div class="col"><i class="icon ion-person"></i> 粉丝&nbsp;&nbsp;123456</div>
-               <div class="col"><i class="icon ion-ios-film"></i> 徽章&nbsp;&nbsp;23</div>
+               <div class="col"><i class="icon ion-heart"></i> 关注&nbsp;&nbsp;{{user.care_num}}</div>
+               <div class="col"><i class="icon ion-person"></i> 粉丝&nbsp;&nbsp;{{user.fans_num}}</div>
+               <div class="col"><i class="icon ion-ios-film"></i> 梦想&nbsp;&nbsp;{{user.dream_num}}</div>
            </div>
         </div>
         <div class="row user-dz">
             <div class="col">
-                <div class="num">1231</div>
+                <div class="num">{{user.collection_num}}</div>
                 <div class="mysecond">收藏</div>
             </div>
             <div class="col">
@@ -38,7 +38,8 @@
             <a class="item item-icon-left" ui-sref="app.my_recharge">
                 <i class="icon ion-card"></i>
                 <em class="fl">账户余额</em>
-                <i class="fr">9990</i>
+                <i class="fr">
+                    {{user.coin}}</i>
             </a>
             <a class="item item-icon-left" ui-sref="app.my_message">
                 <i class="icon ion-email"></i>

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

xqd
@@ -3,7 +3,7 @@
         <div class="list list-inset collect-search">
             <div class="item item-input">
                 <i class="icon ion-search placeholder-icon"></i>
-                <input type="text" placeholder="Search">
+                <input type="text" placeholder="搜索" ng-model="vm.keyword">
             </div>
         </div>
         <div class="subcontent">

+ 7 - 42
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-dream.html

xqd
@@ -1,54 +1,19 @@
 <ion-view view-title="我的梦想">
     <ion-content>
        <div class="list">
-           <div class="item reply-item">
+           <div class="item reply-item" ng-repeat="dream in dreams" ng-click="toDetail(dream.id)">
                <div class="item item-thumbnail-left reply-content">
-                   <img ng-src="img/demo/head7.jpg" />
-                   <h2>有人能带我去瑞典吗?</h2>
-                   <p>在斯德哥尔摩,那个只有黑白和灰色的咖啡馆里面坐下,喝一杯地道的北欧咖啡。享受难得的北欧时光!</p>
+                   <img ng-src="{{dream.dream_pic}}" />
+                   <h2>{{dream.dream}}</h2>
+                   <p>{{dream.about}}</p>
                </div>
                <div class="reply-bar">
-                   <div style="width: 30%;">
+                   <div style="width: {{dream.progress}}%;">
                    </div>
                </div>
-               <div class="reply-sx"><span class="calm">30%</span> 目前实现</div>
-           </div>
-           <div class="item reply-item">
-               <div class="item item-thumbnail-left reply-content">
-                   <img ng-src="img/demo/head7.jpg" />
-                   <h2>有人能带我去瑞典吗?</h2>
-                   <p>在斯德哥尔摩,那个只有黑白和灰色的咖啡馆里面坐下,喝一杯地道的北欧咖啡。享受难得的北欧时光!</p>
-               </div>
-               <div class="reply-bar">
-                   <div style="width: 30%;">
-                   </div>
-               </div>
-               <div class="reply-sx"><span class="calm">30%</span> 目前实现</div>
-           </div>
-           <div class="item reply-item">
-               <div class="item item-thumbnail-left reply-content">
-                   <img ng-src="img/demo/head7.jpg" />
-                   <h2>有人能带我去瑞典吗?</h2>
-                   <p>在斯德哥尔摩,那个只有黑白和灰色的咖啡馆里面坐下,喝一杯地道的北欧咖啡。享受难得的北欧时光!</p>
-               </div>
-               <div class="reply-bar">
-                   <div style="width: 30%;">
-                   </div>
-               </div>
-               <div class="reply-sx"><span class="calm">30%</span> 目前实现</div>
-           </div>
-           <div class="item reply-item">
-               <div class="item item-thumbnail-left reply-content">
-                   <img ng-src="img/demo/head7.jpg" />
-                   <h2>有人能带我去瑞典吗?</h2>
-                   <p>在斯德哥尔摩,那个只有黑白和灰色的咖啡馆里面坐下,喝一杯地道的北欧咖啡。享受难得的北欧时光!</p>
-               </div>
-               <div class="reply-bar">
-                   <div style="width: 30%;">
-                   </div>
-               </div>
-               <div class="reply-sx"><span class="calm">30%</span> 目前实现</div>
+               <div class="reply-sx"><span class="calm">{{dream.progress}}%</span> 目前实现</div>
            </div>
+           
        </div>
     </ion-content>
 </ion-view>

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

xqd xqd
@@ -14,19 +14,18 @@
              <i style="float:right" class="ng-binding">{{vm.tel}}</i>
          </div>
 
+         <label class="item item-input ">
+             <span class="input-label">昵称</span>
+             <input name="signture" type="text" placeholder="请输入" ng-model="vm.nickname">
+         </label>
          <label class="item item-input item-select item-select-width">
              <span class="input-label">
                  性别
              </span>
-<<<<<<< HEAD
              <select name="sex" ng-model="vm.sex">
                  <option value="0">男</option>
                  <option value="1">女</option>
-=======
-             <select name="sex" ng-model="vm.sex+''">
-                 <option value="1">男</option>
-                 <option value="2">女</option>
->>>>>>> 3e0c5c4a13e68478596981defab0f2f6b69d648b
+
              </select>
          </label>
          <label class="item item-input ">
@@ -37,11 +36,7 @@
              <span class="input-label">
                  情感状态
              </span>
-<<<<<<< HEAD
              <select name="emotion" ng-model="vm.emotion">
-=======
-             <select name="emotion" ng-model="vm.emotion+''">
->>>>>>> 3e0c5c4a13e68478596981defab0f2f6b69d648b
                  <option value="1">未婚</option>
                  <option value="2">已婚</option>
                  <option value="3">离异</option>

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

xqd xqd
@@ -12,7 +12,7 @@
             </div>
             <div class="item item-input">
                 <span class="input-label">金额</span>
-                <input type="text" placeholder="请输入充值金额">
+                <input type="number" placeholder="请输入充值金额" ng-model="vm.money" >
             </div>
             <div class="item item-divider">
                请选择以下支付方式
@@ -28,7 +28,7 @@
             </ion-list>
         </div>
         <div class="padding">
-            <button  class="button button-full button-calm" ng-click="recharge()">
+            <button  class="button button-full button-calm" ng-click="recharge(vm.money)">
                 支付
             </button>
         </div>

+ 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="myIndex()">
+    <ion-tab title="首页" icon-off="ion-ios-home-outline" icon-on="ion-ios-home" ng-click="go('app.home')">
         <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="myMes()">
+    <ion-tab title="我的" icon-off="ion-ios-person-outline" icon-on="ion-ios-person" ng-click="go('app.my')">
         <ion-nav-view name="app-my"></ion-nav-view>
     </ion-tab>
 </ion-tabs>

二进制
miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_


二进制
miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk


+ 16 - 21
miaomiao/www/js/controllers/add.js

xqd xqd xqd
@@ -1,26 +1,13 @@
 (function (app) {
-    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'
-            }).then(function (modal) {
-                $scope.modal = modal;
-            });
-            $scope.openModal = function () {
-                $scope.modal.show();
-            };
-            $scope.closeModal = function () {
-                $scope.modal.hide();
-            };
-            
+    app.controller('addCtrl', ["$scope", "$state",  "dreamService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate","$ionicHistory", "common", "config"
+        , function ($scope, $state,  dreamService, msg, $ionicTabsDelegate, $ionicNavBarDelegate,$ionicHistory, common, config) {
             $scope.addpict = function () {
                 $scope.imgs=new Array();
                 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);
+                        $scope.imgs.push(config.imgServer+file);
                     }, function (error) {
                         msg.error('图片上传失败');
                     });
@@ -28,14 +15,16 @@
                     console.log('图片选择失败');
                 });
             };
+            $scope.video = {};
             $scope.addvideo = function () {
                 common.chooseVideo().then(function (file) {
-                        $scope.video.path = file;
-                        $scope.video.isOK = true;
-                        common.uploadFiles(file, 2).then(function (result) {
+                    $scope.video.path = file;
+                    common.uploadFiles(file, 2).then(function (result) {
                         var response = JSON.parse(result.response);
                         var file = response.data.file;
-                        $scope.video.server = file;
+                        console.log("file:"+config.imgServer+file);
+                        $scope.video.isOK = true;
+                        $scope.video.server = config.imgServer+file;
                     }, function (error) {
                         msg.error('视频上传失败');
                     });
@@ -67,7 +56,13 @@
                     msg.error(error.data.message);
                 });
             };
-            
+            $scope.$on('$ionicView.beforeEnter', function () {
+                $scope.vm={
+                    dream:'',
+                    about:'',
+                    money:""
+                };
+            });
             $scope.$on('$ionicView.leave', function () {
                 $ionicTabsDelegate.showBar(true);
             });

+ 7 - 6
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd
@@ -60,8 +60,8 @@
           
             //});
         }]);
-    app.controller('dreamDetailCtrl', ["$scope", "$state", "msg","common","config", "homeService", "$ionicTabsDelegate","$stateParams","$ionicModal","$timeout"
-        , function ($scope, $state, msg,common, config, homeService, $ionicTabsDelegate,$stateParams,$ionicModal,$itemout) {
+    app.controller('dreamDetailCtrl', ["$scope", "$state", "msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout","$ionicScrollDelegate"
+        , function ($scope, $state, msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $itemout, $ionicScrollDelegate) {
             var id = $stateParams.id;
             id=6;
             $scope.load = function (id) {
@@ -85,6 +85,7 @@
                 $scope.tosupport = false;
             }
             $scope.changetype = function (type) {
+                $ionicScrollDelegate.scrollTop(true);
                 $scope.type = type;
             }
             $scope.index = 0;
@@ -134,14 +135,14 @@
             }
 
         $scope.placeholder="评论";
-        $scope.replay = function($event){
+        $scope.replay = function($event,name){
             // $event.stopPropagation();
-            $scope.placeholder="回复百川";
+            $scope.placeholder = "回复" + name;
             $scope.addReplay=true;
             $scope.vm.comment='';
         }
         $scope.comment = function(){
-            $event.stopPropagation();
+          //  $event.stopPropagation();
             $scope.placeholder="评论"; 
             $scope.addReplay=true; 
             $scope.vm.comment='';
@@ -152,7 +153,7 @@
                 common.uploadFiles(img,1).then(function (result) {
                     var response = JSON.parse(result.response);
                     var file = response.data.file;
-                    $scope.imgs.push(file);
+                    $scope.imgs.push(config.imgServer+file);
                 }, function (error) {
                     msg.error('图片上传失败');
                 });

+ 4 - 4
miaomiao/www/js/controllers/my.js

xqd xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('myCtrl', ["$scope", "$state", "$http", "storage", "myService", "common", "config", "msg"
-        , function ($scope, $state, $http, storage, myService, common, config, msg) {
+    app.controller('myCtrl', ["$scope", "$state", "$http", "storage", "myService", "common", "config", "msg","$timeout"
+        , function ($scope, $state, $http, storage, myService, common, config, msg, $timeout) {
         $scope.$on('$ionicView.beforeEnter', function (viewResult) {
             myService.myInfo().then(function(result){
               console.log(result.data.data);
@@ -14,7 +14,7 @@
             common.setAvator().then(function (result) {
                 var response = JSON.parse(result.response);
                 $timeout(function () {
-                    $scope.vm.user.avatar = response.data.md5;
+                    $scope.vm.avatar = response.data.file;
                 });
             });
         };
@@ -32,7 +32,7 @@
                 common.setAvator().then(function (result) {
                     var response = JSON.parse(result.response);
                     $timeout(function () {
-                        $scope.vm.user.avatar = response.data.md5;
+                      $scope.vm.avatar = response.data.file;
                     });
                 });
             };

+ 6 - 5
miaomiao/www/js/services/commonservice.js

xqd xqd xqd xqd xqd
@@ -15,7 +15,7 @@
                 var defaultCameraOptions = {
                     quality: 50,
                     sourceType: 1,
-                    allowEdit: false,
+                    allowEdit: true,
                     encodingType: 0,//0为jpg,1为png
                     //targetHeight: 112,
                     //targetWidth: 112
@@ -23,7 +23,7 @@
                 var options = angular.extend(defaultCameraOptions, cameraOptions);
                 var sheetOptions = {
                     title: '选择图片方式',
-                    buttonLabels: ['拍摄照片', '从图库选择'],
+                    buttonLabels: ['拍摄照片', '从相册选择'],
                     addCancelButtonWithLabel: '取消',
                     androidEnableCancelButton: true
                 };
@@ -58,7 +58,7 @@
                 var deferred = $q.defer();
                 var sheetOptions = {
                     title: '选择视频方式',
-                    buttonLabels: ['拍摄视频', '从图库选择'],
+                    buttonLabels: ['拍摄视频', '从相册选择'],
                     addCancelButtonWithLabel: '取消',
                     androidEnableCancelButton: true
                 };
@@ -76,8 +76,9 @@
                                 deferred.reject(error);
                             }, options1);
                             break;
-                        case 2://从图库选择
+                        case 2://从相册选择
                             var options2 = {
+                                quality:100,
                                 sourceType: 0,
                                 mediaType: 1
                             };
@@ -164,7 +165,7 @@
                     }, function (fail) {
                         msg.hide();
                         deferred.reject(fail);
-                        // alert('上传失败' + JSON.stringify(fail));
+                        alert('上传失败' + JSON.stringify(fail));
                     }, uploadOptions);
                 });
                 return deferred.promise;

+ 2 - 2
miaomiao/www/templates/add/index.html

xqd
@@ -25,9 +25,9 @@
                     <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>
-                <video src="{{video.path}}" ng-if="video.isOK"  height="72px" width="72px" controls="controls">
+                <video src="{{video.path}}" ng-show="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>
+                <a class="btn-file-up" ng-click="addvideo()" ng-show="!video.isOK"><i class="icon ion-cash"></i>添加视频</a>
             </div>
             <div class="item">实现梦想所需要的人民币</div>
             <div class="item item-input-inset itemjs">

+ 1 - 1
miaomiao/www/templates/my/index.html

xqd
@@ -3,7 +3,7 @@
         <div class="user-box">
          
             <div class="myinfo" ng-click="setAvator()">
-                <img ng-src=" {{user.pic}}" />
+                <img ng-src=" {{user.avatar}}" />
                 <div>
                     {{user.nickname}}
                 </div>

+ 2 - 2
miaomiao/www/templates/my/my-profile.html

xqd
@@ -2,8 +2,8 @@
     <ion-content>
      <div class="list">
          <a class="item item-avatar-right" ng-click="setAvator()">
-             <img  src="img/demo/head5.jpg"/>
-             <!--<img ng-src="{{ vm.user.avatar | avator }}">-->
+             <!-- <img  src="img/demo/head5.jpg"/> -->
+             <img ng-src="{{ vm.avatar | avator }}">
              <h2>头像</h2>
              <p style="font-size:12px">点击上传</p>
          </a>

+ 1 - 2
server/app/Helper/AttachmentHelper.php

xqd xqd
@@ -51,7 +51,6 @@ trait AttachmentHelper
                 }
 
                 $fileMimeType = $file->getMimeType();
-                \Log::info("fileMimeType:".$fileMimeType);
                 if (!empty($mimeType) && !in_array($fileMimeType, $mimeType)) {
                     $result[$idx] = ErrorCode::ATTACHMENT_MIME_NOT_ALLOWED;
                     continue;
@@ -101,7 +100,7 @@ trait AttachmentHelper
      * @return int 错误码or 0(成功)
      */
     public function deleteAttachment($md5) {
-        $attachment = Attachment::where(['md5' => $md5])->first();
+        $attachment = BaseAttachmentModel::where(['md5' => $md5])->first();
         if (!$attachment) {
             return ErrorCode::ATTACHMENT_NOT_EXIST;
         }

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

xqd xqd xqd
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Api\V1;
 
 use App\Helper\AttachmentHelper;
 use Illuminate\Http\Request;
-use App\Services\Base\Attachment;
+use App\Models\BaseAttachmentModel;
 use App\Services\Base\ErrorCode;
 use Validator, Response;
 
@@ -29,7 +29,7 @@ class AttachmentController extends Controller
      */
     public function download($md5)
     {
-        $attachment = Attachment::where(['md5' => $md5])->first();
+        $attachment = BaseAttachmentModel::where(['md5' => $md5])->first();
         if (!$attachment) {
             return view('errors.404');
         }
@@ -100,13 +100,15 @@ class AttachmentController extends Controller
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '', $validator->messages());
         }
 
-        $result = $this->uploadAttachment($request, $request->get('file'), $request->get('tag'), 10 * 1024 * 1024, [
+        \Log::info($request);
+        $result = $this->uploadAttachment($request, $request->get('file'), $request->get('tag'), 50 * 1024 * 1024, [
             'image/jpeg',
             'image/png',
             'image/gif',
             'video/mp4',
             'video/quicktime',
         ]);
+        \Log::info($result);
         if (is_array($result)) {
             return $this->api($result);
         } elseif (is_string($result)) {

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

xqd xqd xqd
@@ -2,6 +2,7 @@
 
 namespace App\Http\Controllers\Api\V1;
 
+use App\Helper\AttachmentHelper;
 use App\Helper\SmsHelper;
 use Illuminate\Foundation\Auth\AuthenticatesUsers;
 use App\Models\UserInfoModel;
@@ -11,7 +12,7 @@ use Validator, Auth, Cache;
 
 class AuthController extends Controller
 {
-    use SmsHelper,AuthenticatesUsers;
+    use SmsHelper,AuthenticatesUsers,AttachmentHelper;
 
     private $expireTime     = 1;
     private $keySmsCode     = 'auth:sms:';
@@ -280,7 +281,7 @@ class AuthController extends Controller
             $result = array_shift($result);
         }
         if (is_string($result)) {
-            $user->avatar = $result;
+            $user->avatar = config('app.url')."/api/attachment/download/".$result;
             if (!$user->save()) {
                 return $this->error(ErrorCode::SAVE_USER_FAILED);
             }

+ 1 - 0
server/app/Services/Base/ErrorCode.php

xqd
@@ -66,6 +66,7 @@ final class ErrorCode {
     const CLIENT_WRONG_PARAMS = 1000;
     const DREAM_NOT_EXIST = 1308;
     const LOCK_USER = 1309;
+    const MERCHANT_BALANCE_NOT_ENOUGH = 1311;
     const KEY_ERROR = 1310;
 
     //错误常量枚举

+ 5 - 0
server/routes/api.php

xqd
@@ -38,6 +38,11 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'attachment.delete',
         'uses' => 'AttachmentController@delete',
     ]);
+    //上传头像
+    $api->post('auth/avatar', [
+        'as' => 'auth.avatar',
+        'uses' => 'AuthController@avatar',
+    ]);
 
 
     // test