Ben il y a 8 ans
Parent
commit
eefe12ac9a
31 fichiers modifiés avec 427 ajouts et 172 suppressions
  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. 1 7
      miaomiao/www/js/services/myservice.js
  31. 5 6
      miaomiao/www/templates/add/index.html

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/web/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'));

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

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",

+ 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">