1007395918@qq.com 5 år sedan
förälder
incheckning
aee847bd98

+ 1
- 0
src/app.js Visa fil

@@ -123,6 +123,7 @@ class App extends Component {
123 123
           'pages/detail/index',
124 124
           'pages/detail/resultPage',
125 125
           'pages/selectionRecord/index',
126
+          'pages/screenHouse/index',
126 127
         ],
127 128
       }
128 129
     ],

+ 3
- 1
src/onlineSelling/pages/houseList/index.js Visa fil

@@ -200,7 +200,9 @@ export default class HouseList extends Component {
200 200
     this.goto('/onlineSelling/pages/help/index')
201 201
   }
202 202
 
203
-  handleSearchClick = e => {}
203
+  handleSearchClick = e => {
204
+    this.goto('/onlineSelling/pages/screenHouse/index')
205
+  }
204 206
 
205 207
   renderBar () {
206 208
     const summary = {

+ 136
- 0
src/onlineSelling/pages/screenHouse/index.js Visa fil

@@ -0,0 +1,136 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import './index.scss'
3
+import { connect } from '@tarojs/redux'
4
+import ready from '@/utils/ready'
5
+
6
+@connect(
7
+  ({ user }) => ({ ...user })
8
+)
9
+
10
+export default class Index extends Component {
11
+  config = {
12
+    navigationBarTitleText: '筛选房源',
13
+  }
14
+
15
+  state = {
16
+    current: 0,
17
+    priceCurrent: 0,
18
+    startPrice: '100',
19
+    endPrice: null,
20
+  }
21
+
22
+  componentWillMount() {
23
+
24
+    ready.queue(() => {
25
+
26
+
27
+    })
28
+  }
29
+  handleCondition(value) {
30
+    this.setState({
31
+      current: value,
32
+    })
33
+  }
34
+  handlePriceItem(item) {
35
+    this.setState({
36
+      priceCurrent: item.value,
37
+      startPrice: item.startPrice,
38
+      endPrice: item.endPrice,
39
+    })
40
+  }
41
+
42
+  render() {
43
+    const { current, priceCurrent, startPrice, endPrice } = this.state
44
+    const condition = [{ title: '按价格', value: 0 }, { title: '按户型', value: 1 }]
45
+    const priceList = [
46
+      { startPrice: null, endPrice: '100', value: 0 },
47
+      { startPrice: '100', endPrice: '150', value: 1 },
48
+      { startPrice: '150', endPrice: '200', value: 2 },
49
+      { startPrice: '200', endPrice: '250', value: 3 },
50
+      { startPrice: '250', endPrice: '300', value: 4 },
51
+      { startPrice: '300', endPrice: '400', value: 5 },
52
+      { startPrice: '400', endPrice: '500', value: 6 },
53
+      { startPrice: '500', endPrice: '600', value: 7 },
54
+      { startPrice: '600', endPrice: null, value: 8 },
55
+    ]
56
+    const apartmentList = [
57
+      { name: 'A 户型', area1: '149', area2: '131' },
58
+      { name: 'B 户型', area1: '95', area2: '84.7' },
59
+      { name: 'C 户型', area1: '95', area2: '84.7' },
60
+    ]
61
+    return (
62
+      <View className="screen-page">
63
+        <View className="screen-top">
64
+          筛选房源
65
+            {condition.map(item => (
66
+            <View key={item.value} onClick={() => this.handleCondition(item.value)} className={current == item.value ? 'top-item active' : 'top-item'}>
67
+              {item.title}
68
+            </View>
69
+          ))}
70
+        </View>
71
+        {current == 0 &&
72
+          <View>
73
+            <View className="price-con">
74
+              {priceList.map(priceItem => (
75
+                <View key={priceItem.value} className={priceCurrent == priceItem.value ? 'active-item' : 'price-item'} onClick={() => { this.handlePriceItem(priceItem) }}>
76
+                  {!priceItem.startPrice && <View className="item-con">{priceItem.endPrice}万以下</View>}
77
+                  {priceItem.startPrice && priceItem.endPrice && <View className="item-con">{priceItem.startPrice}万-{priceItem.endPrice}万</View>}
78
+                  {!priceItem.endPrice && <View className="item-con">{priceItem.startPrice}万以上</View>}
79
+                </View>
80
+              ))}
81
+            </View>
82
+            <View style="color:#666;font-size:28rpx;margin-left:40rpx">
83
+              填写价格(万元)
84
+        </View>
85
+            <View className="search">
86
+              <Input
87
+                type="number"
88
+                placeholder="最低价"
89
+                class="search-input"
90
+                placeholder-style="color:#dcdcdc;font-size:28rpx"
91
+                maxlength="6"
92
+                value={startPrice}
93
+                onInput={() => this.handleInput}
94
+              />
95
+              <Text style="margin:0 8rpx;color:#999;font-size:28rpx">-</Text>
96
+              <Input
97
+                type="number"
98
+                placeholder="最低价"
99
+                class="search-input"
100
+                placeholder-style="color:#dcdcdc;font-size:28rpx"
101
+                maxlength="6"
102
+                value={endPrice}
103
+                onInput={() => this.handleInput}
104
+              />
105
+              <View className="sure-btn">
106
+                确定
107
+              </View>
108
+            </View>
109
+          </View>}
110
+        {
111
+          current == 1 &&
112
+          <View style="padding:40rpx 20rpx">
113
+            {apartmentList.map((apartmentItem, index) => (
114
+              <View className='item' key={index + 'apartment'}>
115
+                <View className='house__img-info'>
116
+                  <Image className='house__img' src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1581369637322&di=6065c2aee90f790b00d0c815f465ebc5&imgtype=0&src=http%3A%2F%2Fcyzs97.com%2FUploads%2FEditor%2FPicture%2F2018-10-18%2F5bc8330f2d06f.jpg" mode="widthFix"></Image>
117
+                </View>
118
+                <View className="rest-info">
119
+                  <View className='house-type__name'>{apartmentItem.name || ''}</View>
120
+                  <View className='construction__area'>
121
+                    <Text>{apartmentItem.area1 ? '建筑面积约' + apartmentItem.area1 + 'm²' : '建筑面积待定'}</Text>
122
+                    {
123
+                      apartmentItem.area2 ? <Text>使用面积约{apartmentItem.area2}m²</Text> : <Text>使用面积待定</Text>
124
+                    }
125
+                  </View>
126
+                </View>
127
+              </View>
128
+            ))}
129
+          </View>
130
+        }
131
+
132
+      </View>
133
+
134
+    );
135
+  }
136
+}

+ 125
- 0
src/onlineSelling/pages/screenHouse/index.scss Visa fil

@@ -0,0 +1,125 @@
1
+@import "@/styles/mixins.scss";
2
+@import "@/styles/theme.scss";
3
+.screen-page{
4
+  .screen-top{
5
+    display: flex;
6
+    align-items: center;
7
+    height:100px;
8
+    background:rgba(248,248,248,1);
9
+    font-size: 34px;
10
+    color: #666;
11
+    padding: 0 30px;
12
+    font-size: 400;
13
+    .top-item{
14
+      font-size: 28px;
15
+      color: #999;
16
+      padding: 0 18px;
17
+      border-radius: 32px;
18
+      line-height: 60px;
19
+      background-color: #EEEEEE;
20
+      margin-left: 22px;
21
+
22
+    }
23
+    .active{
24
+      background-color: #fff;
25
+      box-shadow:0px 4px 12px 0px rgba(0, 0, 0, 0.08);
26
+    }
27
+  }
28
+  .price-con{
29
+    padding: 20px;
30
+    display: flex;
31
+    flex-wrap: wrap;
32
+    align-content: center;
33
+    .price-item{
34
+      flex: 0 0 33.3%;
35
+      .item-con{
36
+        text-align: center;
37
+        margin: 18px;
38
+        line-height:60px;
39
+        background:rgba(248,248,248,1);
40
+        border-radius:6px;
41
+        font-size: 28px;
42
+        color: #999;
43
+      }
44
+    }
45
+    .active-item{
46
+      flex: 0 0 33.3%;
47
+      .item-con{
48
+        text-align: center;
49
+        margin: 18px;
50
+        line-height:60px;
51
+        background-color: #fff;
52
+        box-shadow:0px 4px 12px 0px rgba(0, 0, 0, 0.08);
53
+        border-radius:6px;
54
+        font-size: 28px;
55
+        color: #999;
56
+      }
57
+    }
58
+  }
59
+  .search{
60
+    padding: 20px 40px;
61
+    display: flex;
62
+    align-items: center;
63
+    .search-input{
64
+      width:209px;
65
+      line-height:60px;
66
+      height:60px;
67
+      background:rgba(250,250,250,1);
68
+      border-radius:30px;
69
+      text-align: center;
70
+    }
71
+    .sure-btn{
72
+      width:120px;
73
+      line-height:60px;
74
+      background:rgba(187,156,121,1);
75
+      border-radius:10px;
76
+      text-align: center;
77
+      color: #fff;
78
+      font-size: 28px;
79
+      margin-left: 60px;
80
+    }
81
+  }
82
+  .item {
83
+    position: relative;
84
+    width: 340px;
85
+    margin: 2px 7.5px 20px 7.5px;
86
+    box-shadow: 0 0 16px rgba(0, 0, 0, 0.15);
87
+    border: 1px solid rgba(232, 232, 232, 1);
88
+    border-radius: 12px;
89
+    display: inline-block;
90
+
91
+    .house__img-info {
92
+      position: relative;
93
+      padding: 30px;
94
+      border-bottom: 1px solid #eee;
95
+
96
+      .house__img {
97
+        width: 100%;
98
+        border-radius: 10px;
99
+        height: 200px !important;
100
+      }
101
+    }
102
+    .rest-info {
103
+      padding: 10px  20px;
104
+
105
+      .house-type__name {
106
+        font-weight: bold;
107
+        margin: 10px 0;
108
+        font-size: 32px;
109
+        color: #333;
110
+      }
111
+      .construction__area {
112
+        color: rgba(0, 0, 0, 0.54);
113
+        font-size: 25px;
114
+        height: 80px;
115
+        display: flex;
116
+        flex-direction: column;
117
+        font-size: 28px;
118
+        text-align: left;
119
+
120
+      }
121
+    }
122
+
123
+  
124
+  }
125
+}