YanaDH пре 8 година
родитељ
комит
c27e7ccc4a

+ 37 - 10
miaomiao/www/js/controllers/home.js

xqd xqd xqd
@@ -1,11 +1,40 @@
 (function (app) {
-    app.controller('homeCtrl', ["$scope", "$state", "msg", "$ionicPopover"
-        , function ($scope, $state, msg, $ionicPopover) {
+    app.controller('homeCtrl', ["$scope","$http", 'config', "$state", "msg", "$ionicPopover"
+        , function ($scope, $http, config, $state, msg, $ionicPopover) {
             $scope.type = 1;//tab切换
             $scope.changetype = function (type) {
                 $scope.type = type;
+                if(type == 1){
+                    $http({
+                        method:"get",
+                        url:config.server + "api/index/hot"
+                    }).then(function (result){
+
+                    },function(error){
+
+                    })
+                }
+                else if(type == 2){
+                    $http({
+                        method:"get",
+                        url:config.server + "api/index/trend"
+                    }).then(function (result){
+
+                    },function(error){
+
+                    })
+                }
+                else if(type == 3){
+                    $http({
+                        method:"get",
+                        url:config.server + "api/index/new"
+                    }).then(function (result){
+
+                    },function(error){
+
+                    })
+                }
             }
-          
            
             $ionicPopover.fromTemplateUrl('my-popover.html', {
                 scope: $scope
@@ -24,6 +53,7 @@
         $scope.todetail = function () {
             $state.go('app.home_userdetail');
         };
+
         }]);
     app.controller('userDetailCtrl', ["$scope", "$state", "msg","homeService", "$ionicTabsDelegate"
         , function ($scope, $state, msg, homeService, $ionicTabsDelegate) {
@@ -96,17 +126,14 @@
             $scope.$on('$ionicView.leave', function () {
                 $ionicTabsDelegate.showBar(true);
             });
-            $scope.searchContent=function ()
+            $scope.searchContent = function ()
             {
-                var data={
-                    keyword:$scope.vm.keyword
-                };
-                homeService.searchContent($scope.vm.keyword).then(function(result){
+                homeService.searchContent($scope.vm.keywords).then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
-            }
+            };
         }]);
    
     

+ 28 - 10
miaomiao/www/js/controllers/my.js

xqd xqd xqd
@@ -40,18 +40,24 @@
             $scope.collect = function(){
                 myService.collect().then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
             };
             $scope.myDream = function(){
                 myService.myDream().then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 });
             }
+            $scope.myMaterial = function(){
+                myService.myMaterial().then(function(result){
+
+                },function(error){
 
+                })
+            }
         }]);
 
     app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
@@ -70,18 +76,30 @@
             $scope.$on('$ionicView.beforeEnter', function () {
 
             });
-            $scope.reset = function(){
+            $scope.vm={
+                //pic:"",
+                sex:"",
+                signture:"",
+                emotion:"",
+                job:"",
+                tall:""
+            };
+            $scope.saveMaterial = function(){
                 var data = {
-                    pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
-                };
-                myService.reset(data).then(function(result){
+                    pic:['http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg'],
+                    sex:$scope.vm.sex,
+                    signture:$scope.vm.signture,
+                    emotion:$scope.vm.emotion,
+                    job:$scope.vm.job,
+                    tall:$scope.vm.tall
+                }
+                myService.saveMaterial(data).then(function(result){
 
                 },function(error){
 
-                });
+                })
             }
-
-      }]);
+        }]);
     app.controller('settingCtrl', ["$scope", "$state", "myService", "msg","storage"
      , function ($scope, $state,myService, msg, storage) {
          $scope.$on('$ionicView.beforeEnter', function () {
@@ -179,7 +197,7 @@
                 };
                 myService.myReplay(data).then(function(result){
 
-                },function(erro){
+                },function(error){
 
                 })
                 $scope.modal.hide();

+ 7 - 10
miaomiao/www/js/controllers/tabs.js

xqd
@@ -8,24 +8,21 @@
         $scope.vm={
 
         };
-        $scope.userMes = function(){
-            /*var data={
-                user_id:"111"
-            };
-            myService.userMes(data).then(function(result){
+        $scope.myMes = function(){
+            myService.myMes().then(function(result){
 
-            },function(erro){
+            },function(error){
 
-            });*/
+            });
             $scope.go("app.my")
         };
 
         $scope.myIndex = function(){
-           /* myService.userMes().then(function(result){
+            myService.myIndex().then(function(result){
 
-            },function(erro){
+            },function(error){
 
-            });*/
+            });
             $scope.go("app.home")
         };
     }]);

+ 2 - 3
miaomiao/www/js/services/homeservice.js

xqd
@@ -16,9 +16,8 @@
             },
             searchContent:function (data){
                 return $http({
-                    url:config.server + 'api/index/search',
-                    method:"get",
-                    data:data
+                    url: config.server + 'api/index/search?' + data,
+                    method:"get"
                 })
             }
         };

+ 16 - 11
miaomiao/www/js/services/myservice.js

xqd xqd xqd
@@ -15,13 +15,6 @@
                     data:data
                 })
             },
-            reset:function(data){
-                return $http({
-                    url:config.server + "api/auth/avatar",
-                    method:"post",
-                    data:data
-                })
-            },
             recharge:function(){
                 return $http({
                     url:config.server + "api/my/recharge",
@@ -65,11 +58,10 @@
                     data: data
                 })
             },
-            userMes:function(data){
+            myMes:function(){
                 return $http({
-                    url:config.server + "api/user/index/",
-                    method:"get",
-                    data:data
+                    url:config.server + "api/my/persona",
+                    method:"get"
                 })
             },
             myIndex:function(){
@@ -83,6 +75,19 @@
                     url:config.server + "api/my/persona",
                     method:"get"
                 })
+            },
+            myMaterial:function(){
+                return $http({
+                    url:config.server + "api/my/edit_user_info",
+                    method:"get"
+                })
+            },
+            saveMaterial:function(data){
+                return $http({
+                    url:config.server + "api/my/update_user_info",
+                    method:"post",
+                    data:data
+                })
             }
         };
     }]);

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

xqd
@@ -1,9 +1,9 @@
 <ion-view view-title="">
     <ion-nav-buttons side="primary">
-        <label class="item item-input" style="width:315px">
+        <lable class="item item-input" style="width:315px">
             <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>
+        </lable>
         <button class="button button-calm" style="width: 30%; padding: 0;" ng-click="$ionicGoBack()">取消</button>
     </ion-nav-buttons>
      <ion-content>

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

xqd
@@ -44,7 +44,7 @@
                 <i class="icon ion-email"></i>
                 <em class="fl">我的消息</em>
             </a>
-            <a class="item item-icon-left" ui-sref="app.my_profile">
+            <a class="item item-icon-left" ui-sref="app.my_profile" ng-click="myMaterial()">
                 <i class="icon ion-document"></i>
                 <em class="fl">我的资料</em>
           

+ 1 - 1
miaomiao/www/templates/my/my-message-reply.html

xqd
@@ -87,7 +87,7 @@
             </ion-header-bar>
             <ion-content>
                 <div class="addmodal">
-                    <textarea placeholder="回复内容" ng-model="content"></textarea>
+                    <textarea placeholder="回复内容" ng-model="vm.content"></textarea>
                 </div>
                 <div class="addfoot">
                     <img ng-src="img/图片.png" />

+ 7 - 55
miaomiao/www/templates/my/my-profile.html

xqd xqd xqd
@@ -1,55 +1,8 @@
 <ion-view view-title="个人信息" >
     <ion-content>
-<<<<<<< HEAD
-        <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" />
+             <img  src="img/demo/head5.jpg"  ng-model="vm.pic"/>
              <h2>头像</h2>
              <p style="font-size:12px">点击上传</p>
          </a>
@@ -64,20 +17,20 @@
              <span class="input-label">
                  性别
              </span>
-             <select name="sex">
+             <select name="sex" ng-model="vm.sex">
                  <option>男</option>
                  <option>女</option>
              </select>
          </label>
          <label class="item item-input ">
              <span class="input-label">个性签名</span>
-             <input name="signture" type="text" placeholder="请输入">
+             <input name="signture" type="text" placeholder="请输入" ng-model="vm.signture">
          </label>
          <label class="item item-input item-select item-select-width">
              <span class="input-label">
                  情感状态
              </span>
-             <select name="emotion">
+             <select name="emotion" ng-model="vm.emotion">
                  <option>未婚</option>
                  <option>已婚</option>
              </select>
@@ -85,16 +38,15 @@
 
          <label class="item item-input ">
              <span class="input-label">职业</span>
-             <input name="job" type="text" placeholder="请输入">
+             <input name="job" type="text" placeholder="请输入" ng-model="vm.job">
          </label>
          <label class="item item-input ">
              <span class="input-label">身高</span>
-             <input name="tail" type="text" placeholder="请输入(单位cm)">
+             <input name="tail" type="text" placeholder="请输入(单位cm)" ng-model="vm.tall">
          </label>
      </div>
->>>>>>> 6206a0f6e0cf3505451a08cfa0521969e3fd9aeb
         <div class="padding">
-            <button class="button button-full button-calm">
+            <button class="button button-full button-calm" ng-click="saveMaterial()">
                 保存
             </button>
         </div>

+ 1 - 1
miaomiao/www/templates/tabs.html

xqd
@@ -5,7 +5,7 @@
     <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="userMes()">
+    <ion-tab title="我的" icon-off="ion-ios-person-outline" icon-on="ion-ios-person" ng-click="myMes()">
         <ion-nav-view name="app-my"></ion-nav-view>
     </ion-tab>
 </ion-tabs>