张延森 3 年之前
父節點
當前提交
3c515c008c
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8
    2
      src/pages/index/helpToFindHouse/index.jsx

+ 8
- 2
src/pages/index/helpToFindHouse/index.jsx 查看文件

@@ -51,8 +51,14 @@ export default withLayout((props) => {
51 51
     let areaResultId;
52 52
     data.map((item) => {
53 53
       if (item.key === 'budget') {
54
-        params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? item.options[0] : item.options[0] * 10000 })
55
-        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? (item.result === '' ? 1000 : item.result) : (item.result === '' ? 10000000 : item.result * 10000) })
54
+        // 用户选择 200, 则区间为 [100, 300]
55
+        // 用户选择 300, 则区间为 [200, 400]
56
+        const price = item.result === '' ? 300 : item.result - 0;
57
+        const min = price < 100 ? 100 : price - 100;
58
+        const max = price + 100;
59
+
60
+        params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
61
+        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? max : max * 10000 })
56 62
       } else {
57 63
         if (CurrentDemandId === 1) {
58 64
           if (item.key === 'area') {