Browse Source

Merge branch 'master' of http://git.9026.com/roobe/miao

Mike 7 years ago
parent
commit
4e30e82a2b

+ 1 - 0
miaomiao/www/js/config/router.js

xqd
@@ -21,6 +21,7 @@
           })
             .state('app.home', {
                 url: '/home',
+                cache:false,
                 views: {
                     'app-home': {
                         templateUrl: 'templates/home/index.html',

+ 17 - 11
miaomiao/www/js/controllers/home.js

xqd
@@ -86,29 +86,35 @@
             pageIndex: 1,
             pageSize: 20,
             sex: 0,//1男,2女,0:全部,
-            age: 0,//0:全部,1:18-21,2:22-25,3:26-29,4:30-33,5:34-37,6:>38,7:>18
+            age: '',//0:全部,1:18-21,2:22-25,3:26-29,4:30-33,5:34-37,6:>38,7:>18
             city:''
         };
 
             $scope.ages = [
-                {"id": 0, "age": "所有"},
-                {"id": 1, "age": "<18"},
-                {"id": 2, "age": "18-21"},
-                {"id": 3, "age": "22-25"},
-                {"id": 4, "age": "26-29"},
-                {"id": 5, "age": "30-33"},
-                {"id": 6, "age": "34-37"},
-                {"id": 7, "age": ">37"}
+                {"value": 0, "age": "所有"},
+                {"value": 7, "age": "<18"},
+                {"value": 1, "age": "18-21"},
+                {"value": 2, "age": "22-25"},
+                {"value": 3, "age": "26-29"},
+                {"value": 4, "age": "30-33"},
+                {"value": 5, "age": "34-37"},
+                {"value": 6, "age": ">37"}
             ];
 
             $scope.doFilter = function () {
+                var obj=document.getElementsByName('age');
+                for(var i=0; i<obj.length; i++){
+                    if(obj[i].checked){
+                        $scope.filter.age+=obj[i].value+',';
+                    }
+                };
+                debugger;
                 homeService.doFilter($scope.filter.sex,$scope.filter.age,$scope.filter.city).then(function(result){
                     $scope.index.dreams = result.data.data.dreams.data;
-                    debugger;
                 },function(error){
                     msg.error(data.error.message);
                 });
-                //$ionicSideMenuDelegate.toggleRight();
+                $scope.filter.age="";
             };
         $scope.index = {
             banner: [],

+ 4 - 4
miaomiao/www/templates/home/index.html

xqd xqd
@@ -1,6 +1,6 @@
 <ion-view view-title="瞄瞄">
     <ion-nav-buttons side="left">
-        <i class="icon ion-qr-scanner" style="margin-top: 8px; font-size: 22px" ng-click="qrscan()"></i>
+        <i class="icon ion-qr-scanner" style="margin-top: 8px; font-size: 22px; margin-right: 5px;" ng-click="qrscan()"></i>
         <button class="button button-clear" style="height: 30px; width: 30px;font-size: 25px; margin-top: 0.5px" ng-click="toggleLeftSideMenu()">
             <img src="img/btn_filter.svg" style="height: 63%; width: 100%;">
         </button>
@@ -103,10 +103,10 @@
             <img ng-src="{{filter.sex==1?'img/icon_man_h.svg':'img/icon_man_n.svg'}}" ng-click="changeFilter('1')"  style="width:35%;" />
             <img ng-src="{{filter.sex==2?'img/icon_woman_h.svg':'img/icon_woman_n.svg'}}" ng-click="changeFilter('2')" style="width:35%;margin-left:15px"  />
         </div>
-        <div class="item" style="padding:0">
+        <input class="item" style="padding:0">
            <p style="font-weight:bold;font-size:1.1rem">年龄</p>
-                <ion-checkbox ng-repeat="age in ages" ng-model="filter.age[$index]">{{age.age}}</ion-checkbox>
-           </div>
+           <ion-checkbox type="checkbox" ng-repeat="age in ages" name="age" ng-value="age.value">{{age.age}}</ion-checkbox>
+        </div>
         
    </div>
   <label class="item item-select item-select-width">