|
@@ -19,6 +19,8 @@ class Index extends Component {
|
|
|
curNav: 1,
|
|
|
isDShow: false,
|
|
|
curObj: {},
|
|
|
+ priceRange1: '',
|
|
|
+ priceRange2: '',
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -36,20 +38,37 @@ class Index extends Component {
|
|
|
componentDidHide () { }
|
|
|
|
|
|
|
|
|
+ inputComChange (str, e) {
|
|
|
+ this.setState({
|
|
|
+ [str]: e.detail.value
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
renderSearch () {
|
|
|
- const { searchKey } = this.state
|
|
|
+ const { searchKey, priceRange1, priceRange2 } = this.state
|
|
|
let placeholderText = '模糊搜索楼盘名称'
|
|
|
return (
|
|
|
- <View>
|
|
|
- <AtSearchBar
|
|
|
- fixed={true}
|
|
|
- value={searchKey}
|
|
|
- placeholder={placeholderText}
|
|
|
- onChange={this.onSeachChange.bind(this)}
|
|
|
- onClear={this.onClearHandle.bind(this)}
|
|
|
- onActionClick={this.onSelectActionClick.bind(this)}
|
|
|
- />
|
|
|
+ <View className='scoped-header'>
|
|
|
+ <View className='scoped-input-box'>
|
|
|
+ <View className="sib-content">
|
|
|
+ <View className='t t2'>总价</View>
|
|
|
+ <Input type="number" value={priceRange1} onInput={this.inputComChange.bind(this, 'priceRange1')} className="i" placeholder="__" />
|
|
|
+ <View className='t'>至</View>
|
|
|
+ <Input type="number" value={priceRange2} onInput={this.inputComChange.bind(this, 'priceRange2')} className="i" placeholder="__" />
|
|
|
+ <View className='t'>万</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className="sh-search">
|
|
|
+ <AtSearchBar
|
|
|
+ showActionButton="true"
|
|
|
+ value={searchKey}
|
|
|
+ placeholder={placeholderText}
|
|
|
+ onChange={this.onSeachChange.bind(this)}
|
|
|
+ onClear={this.onClearHandle.bind(this)}
|
|
|
+ onActionClick={this.onSelectActionClick.bind(this)}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
</View>
|
|
|
)
|
|
|
}
|
|
@@ -78,11 +97,16 @@ class Index extends Component {
|
|
|
|
|
|
getDataList () {
|
|
|
let { page_size, page, dataList, isListEmpty, searchKey } = this.state
|
|
|
- Taro.api.other.apiestatehousedynamiclist({
|
|
|
+ const { priceRange1, priceRange2 } = this.state
|
|
|
+ let params = {
|
|
|
page,
|
|
|
page_size,
|
|
|
- estate_name: searchKey
|
|
|
- }).then(res => {
|
|
|
+ estate_name: searchKey,
|
|
|
+ }
|
|
|
+ if (priceRange1 && priceRange2) {
|
|
|
+ params.price_range = `${priceRange1}-${priceRange2}`
|
|
|
+ }
|
|
|
+ Taro.api.other.apiestatehousedynamiclist(params).then(res => {
|
|
|
const curData = res.list || []
|
|
|
let isListEnd = false
|
|
|
if (curData.length > 0) {
|
|
@@ -140,7 +164,7 @@ class Index extends Component {
|
|
|
</View>
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">价格区间:</View>
|
|
|
- <View className="po-r t1">{item.price_min}元-{item.price_max}元
|
|
|
+ <View className="po-r t1">¥{item.price_min}万-{item.price_max > 0 ? item.price_max+'万' : '上限未知'}
|
|
|
<View className="por-more" onClick={this.linkRecord.bind(this, item)}>历史记录</View>
|
|
|
</View>
|
|
|
</View>
|
|
@@ -166,23 +190,23 @@ class Index extends Component {
|
|
|
<View className="more">
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">现场折扣:</View>
|
|
|
- <View className="po-r">{item.scene_discount || '未知'}</View>
|
|
|
+ <View className="po-r">{item.scene_discount && item.scene_discount == 'null' ? '未知' : item.scene_discount}</View>
|
|
|
</View>
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">实际折扣:</View>
|
|
|
- <View className="po-r">{item.actual_discount || '未知'}</View>
|
|
|
+ <View className="po-r">{item.actual_discount && item.actual_discount == 'null' ? '未知' : item.actual_discount}</View>
|
|
|
</View>
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">在售楼栋:</View>
|
|
|
- <View className="po-r">{item.on_sale || '未知'}</View>
|
|
|
+ <View className="po-r">{item.on_sale && item.on_sale == 'null' ? '未知' : item.on_sale}</View>
|
|
|
</View>
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">待售楼栋:</View>
|
|
|
- <View className="po-r">{item.for_sale || '未知'}</View>
|
|
|
+ <View className="po-r">{item.for_sale && item.for_sale == 'null' ? '未知' : item.for_sale}</View>
|
|
|
</View>
|
|
|
<View className="p-one">
|
|
|
<View className="po-l">推荐房源:</View>
|
|
|
- <View className="po-r">{item.recommend || '未知'}</View>
|
|
|
+ <View className="po-r">{item.recommend && item.recommend == 'null' ? '未知' : item.recommend}</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
: ''
|