xujing 5 years ago
parent
commit
a2a320e31f

+ 1
- 1
src/pages/project/index.js View File

@@ -688,7 +688,7 @@ export default class Index extends Component {
688 688
               {
689 689
                 helpGroupList && helpGroupList.length &&
690 690
                 (<Activity helpGroupList={helpGroupList} cityId={curCity.id} />)
691
-              }              
691
+              }
692 692
               {/* 推荐楼盘 */}
693 693
               {this.renderProjectList()}
694 694
             </ScrollView>}

+ 18
- 31
src/pages/project/list/filter/index.js View File

@@ -15,29 +15,17 @@ export default class Index extends Component {
15 15
     visible: false,
16 16
     tabIndex: null,
17 17
     priceTypeIndex: 0,
18
-    selectedIndex: new Array(4).fill([0]),
18
+    selectedIndex: new Array(3).fill([0]),
19 19
     tabs: [
20
-      {
21
-        name: '户型',
22
-        id: 'huxing',
23
-        list: ['不限', '一室', '两室', '三室', '四室', '五室以上']
24
-      },
20
+      // {
21
+      //   name: '户型',
22
+      //   id: 'huxing',
23
+      //   list: ['不限', '一室', '两室', '三室', '四室', '五室以上']
24
+      // },
25 25
       {
26 26
         name: '价格',
27 27
         id: 'price',
28 28
         list: ['不限', '10000元/㎡以下', '10000-20000元/㎡', '20000-30000元/㎡', '30000-50000元/㎡', '50000-70000元/㎡', '70000-100000元/㎡', '100000元/㎡以上']
29
-        // list: [
30
-        //   {
31
-        //     name: '总价',
32
-        //     id: 'totalPrice',
33
-        //     list: ['不限', '100万以下', '100-150万', '150-200万', '200-500万', '500-1000万', '1000万以上']
34
-        //   },
35
-        //   {
36
-        //     name: '单价',
37
-        //     id: 'unitPrice ',
38
-        //     list: ['不限', '10000/㎡以下', '10000-20000元/㎡', '20000-30000元/㎡', '30000-50000元/㎡', '50000-70000元/㎡', '70000-100000元/㎡', '100000元/㎡以上']
39
-        //   }
40
-        // ]
41 29
       },
42 30
       {
43 31
         name: '面积',
@@ -59,7 +47,7 @@ export default class Index extends Component {
59 47
     queryItemTypeList().then(res => {
60 48
       let houseTypeList = res.records
61 49
       houseTypeList.unshift('不限')
62
-      tabs[3].list = houseTypeList
50
+      tabs[2].list = houseTypeList
63 51
       this.setState({ tabs })
64 52
     })
65 53
   }
@@ -119,7 +107,6 @@ export default class Index extends Component {
119 107
 
120 108
   handleFilter() {
121 109
 
122
-    console.log("111")
123 110
     const { tabs, keywords, selectedIndex } = this.state
124 111
     console.log(this.state)
125 112
     let values = selectedIndex.map((selectedList, tabIndex) => {
@@ -131,13 +118,13 @@ export default class Index extends Component {
131 118
       }
132 119
 
133 120
       // 类型
134
-      if (tabIndex === 0) {
135
-        let val = selectedList.map(index => curTabList[index])
136
-        return val.join(',')
137
-      }
121
+      // if (tabIndex === 0) {
122
+      //   let val = selectedList.map(index => curTabList[index])
123
+      //   return val.join(',')
124
+      // }
138 125
 
139 126
       // 价格 面积
140
-      if (tabIndex === 1 || tabIndex === 2) {
127
+      if (tabIndex === 0 || tabIndex === 1) {
141 128
         let val = selectedList.map(index => {
142 129
           let value = curTabList[index]
143 130
           let regVal = value.match(/\d*([-\d]*)?/)
@@ -160,7 +147,7 @@ export default class Index extends Component {
160 147
       }
161 148
 
162 149
       // 类型
163
-      if (tabIndex === 3) {
150
+      if (tabIndex === 2) {
164 151
         let val = selectedList.map(index => curTabList[index].buildingTypeId)
165 152
         return val.join(',')
166 153
       }
@@ -168,10 +155,10 @@ export default class Index extends Component {
168 155
     console.log(values)
169 156
     let params = {
170 157
       name: keywords,
171
-      houseType: values[0],
172
-      price: values[1],
173
-      area: values[2],
174
-      buildingType: values[3],
158
+      // houseType: values[0],
159
+      price: values[0],
160
+      area: values[1],
161
+      buildingType: values[2],
175 162
     }
176 163
     console.log(params)
177 164
     this.props.onFilter(params, () => {
@@ -236,7 +223,7 @@ export default class Index extends Component {
236 223
 
237 224
   renderPrice() {
238 225
     const { priceTypeIndex, tabs, tabIndex, selectedIndex } = this.state
239
-    const priceArr = tabs[1].list
226
+    const priceArr = tabs[0].list
240 227
     const list = priceArr[priceTypeIndex].list
241 228
     return (
242 229
       <View className="price">

+ 2
- 2
src/pages/project/list/filter/index.scss View File

@@ -80,8 +80,8 @@
80 80
     background: #F9F9F9;
81 81
 
82 82
     &-item {
83
-      // width: 33.33%;
84
-      width: 25%;
83
+      width: 33.33%;
84
+      // width: 25%;
85 85
       height: 100px;
86 86
       display: flex;
87 87
       justify-content: center;