|
@@ -1,4 +1,5 @@
|
1
|
1
|
import { useState } from 'react'
|
|
2
|
+import { ScrollView } from '@tarojs/components'
|
2
|
3
|
import './index.scss'
|
3
|
4
|
|
4
|
5
|
export default function FilterForPrice (props) {
|
|
@@ -11,23 +12,38 @@ export default function FilterForPrice (props) {
|
11
|
12
|
const [CurrentTypeId, setCurrentTypeId] = useState(priceType || 'average')
|
12
|
13
|
const [AverageList] = useState([
|
13
|
14
|
{ name: '不限', id: '-' },
|
14
|
|
- { name: '10000/㎡以下', id: '0-10000' },
|
15
|
|
- { name: '10000-20000元/㎡', id: '10000-20000' },
|
16
|
|
- { name: '20000-30000元/㎡', id: '20000-30000' },
|
17
|
|
- { name: '30000-50000元/㎡', id: '30000-50000' },
|
18
|
|
- { name: '50000-70000元/㎡', id: '50000-70000' },
|
19
|
|
- { name: '70000-100000元/㎡', id: '70000-100000' },
|
|
15
|
+ { name: '5000/㎡以下', id: '0-5000' },
|
|
16
|
+ { name: '5000-10000元/㎡', id: '5000-10000' },
|
|
17
|
+ { name: '10000-15000元/㎡', id: '10000-15000' },
|
|
18
|
+ { name: '15000-20000元/㎡', id: '15000-20000' },
|
|
19
|
+ { name: '20000-25000元/㎡', id: '20000-25000' },
|
|
20
|
+ { name: '25000-30000元/㎡', id: '25000-30000' },
|
|
21
|
+ { name: '30000-35000元/㎡', id: '30000-35000' },
|
|
22
|
+ { name: '35000-40000元/㎡', id: '35000-40000' },
|
|
23
|
+ { name: '40000-50000元/㎡', id: '40000-50000' },
|
|
24
|
+ { name: '50000-60000元/㎡', id: '50000-60000' },
|
|
25
|
+ { name: '60000-80000元/㎡', id: '60000-80000' },
|
|
26
|
+ { name: '80000-100000元/㎡', id: '80000-100000' },
|
20
|
27
|
{ name: '100000元/㎡以上', id: '100000-' },
|
21
|
28
|
])
|
22
|
29
|
const [TotalList] = useState([
|
23
|
30
|
{ name: '不限', id: '-' },
|
24
|
|
- { name: '100万以下', id: '0-100' },
|
|
31
|
+ { name: '50万以下', id: '0-50' },
|
|
32
|
+ { name: '50-100万', id: '50-100' },
|
25
|
33
|
{ name: '100-150万', id: '100-150' },
|
26
|
34
|
{ name: '150-200万', id: '150-200' },
|
27
|
35
|
{ name: '200-250万', id: '200-250' },
|
28
|
|
- { name: '250-500万', id: '250-500' },
|
29
|
|
- { name: '500-1000万', id: '500-1000' },
|
30
|
|
- { name: '1000万以上', id: '1000-' },
|
|
36
|
+ { name: '250-300万', id: '250-300' },
|
|
37
|
+ { name: '300-400万', id: '300-400' },
|
|
38
|
+ { name: '400-500万', id: '400-500' },
|
|
39
|
+ { name: '500-600万', id: '500-600' },
|
|
40
|
+ { name: '600-700万', id: '600-700' },
|
|
41
|
+ { name: '700-800万', id: '700-800' },
|
|
42
|
+ { name: '800-900万', id: '800-900' },
|
|
43
|
+ { name: '900-1000万', id: '900-1000' },
|
|
44
|
+ { name: '1000-1200万', id: '1000-1200' },
|
|
45
|
+ { name: '1200-1500万', id: '1200-1500' },
|
|
46
|
+ { name: '1500万以上', id: '1500-' },
|
31
|
47
|
])
|
32
|
48
|
const [CurrentId, setCurrentId] = useState(price || '-')
|
33
|
49
|
|
|
@@ -54,45 +70,48 @@ export default function FilterForPrice (props) {
|
54
|
70
|
}
|
55
|
71
|
</view>
|
56
|
72
|
<view className='flex-item'>
|
|
73
|
+ <ScrollView scroll-y>
|
57
|
74
|
|
58
|
|
- {/* 单价 */}
|
59
|
|
- {
|
60
|
|
- CurrentTypeId === 'average' &&
|
61
|
|
- <view>
|
62
|
|
- {
|
63
|
|
- AverageList.map((item, index) => (
|
64
|
|
- <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutPrice(item.id)}>
|
65
|
|
- <text>{item.name}</text>
|
66
|
|
- <view className='flex-item'></view>
|
67
|
|
- {
|
68
|
|
- CurrentId === item.id &&
|
69
|
|
- <text className='iconfont icon-gou1'></text>
|
70
|
|
- }
|
71
|
|
- </view>
|
72
|
|
- ))
|
73
|
|
- }
|
74
|
|
- </view>
|
75
|
|
- }
|
76
|
75
|
|
77
|
|
- {/* 总价 */}
|
78
|
|
- {
|
79
|
|
- CurrentTypeId === 'total' &&
|
80
|
|
- <view>
|
81
|
|
- {
|
82
|
|
- TotalList.map((item, index) => (
|
83
|
|
- <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutPrice(item.id)}>
|
84
|
|
- <text>{item.name}</text>
|
85
|
|
- <view className='flex-item'></view>
|
86
|
|
- {
|
87
|
|
- CurrentId === item.id &&
|
88
|
|
- <text className='iconfont icon-gou1'></text>
|
89
|
|
- }
|
90
|
|
- </view>
|
91
|
|
- ))
|
92
|
|
- }
|
93
|
|
- </view>
|
94
|
|
- }
|
|
76
|
+ {/* 单价 */}
|
|
77
|
+ {
|
|
78
|
+ CurrentTypeId === 'average' &&
|
|
79
|
+ <view className='ListContent'>
|
|
80
|
+ {
|
|
81
|
+ AverageList.map((item, index) => (
|
|
82
|
+ <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutPrice(item.id)}>
|
|
83
|
+ <text>{item.name}</text>
|
|
84
|
+ <view className='flex-item'></view>
|
|
85
|
+ {
|
|
86
|
+ CurrentId === item.id &&
|
|
87
|
+ <text className='iconfont icon-gou1'></text>
|
|
88
|
+ }
|
|
89
|
+ </view>
|
|
90
|
+ ))
|
|
91
|
+ }
|
|
92
|
+ </view>
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+ {/* 总价 */}
|
|
96
|
+ {
|
|
97
|
+ CurrentTypeId === 'total' &&
|
|
98
|
+ <view className='ListContent'>
|
|
99
|
+ {
|
|
100
|
+ TotalList.map((item, index) => (
|
|
101
|
+ <view key={`ListItem${index}`} className={CurrentId === item.id ? 'flex-h active' : 'flex-h'} onClick={CutPrice(item.id)}>
|
|
102
|
+ <text>{item.name}</text>
|
|
103
|
+ <view className='flex-item'></view>
|
|
104
|
+ {
|
|
105
|
+ CurrentId === item.id &&
|
|
106
|
+ <text className='iconfont icon-gou1'></text>
|
|
107
|
+ }
|
|
108
|
+ </view>
|
|
109
|
+ ))
|
|
110
|
+ }
|
|
111
|
+ </view>
|
|
112
|
+ }
|
95
|
113
|
|
|
114
|
+ </ScrollView>
|
96
|
115
|
</view>
|
97
|
116
|
</view>
|
98
|
117
|
)
|