Commit 2b70451f by YKai

feat: 筛选框手动输入价格也取后端返回的key1字段的值

parent de58693a
...@@ -107,7 +107,7 @@ class FilterPopupWindow( ...@@ -107,7 +107,7 @@ class FilterPopupWindow(
} }
view.btnConfirm.setOnClickListener { view.btnConfirm.setOnClickListener {
if (tempFilter.priceRanges!=null&&tempFilter.priceRanges!!.key1=="avg_price"&&filterData.priceRanges.isNotEmpty()){ if (tempFilter.priceRanges != null && tempFilter.priceRanges!!.key1 == "avg_price" && filterData.priceRanges.isNotEmpty()) {
tempFilter.priceRanges!!.key1 = filterData.priceRanges[0].key1 tempFilter.priceRanges!!.key1 = filterData.priceRanges[0].key1
} }
biEvent(ConsultBIConstants.POSITION_CONSULT_FILTER_CHECKOUT_CLICK) biEvent(ConsultBIConstants.POSITION_CONSULT_FILTER_CHECKOUT_CLICK)
...@@ -604,7 +604,8 @@ class FilterPopupWindow( ...@@ -604,7 +604,8 @@ class FilterPopupWindow(
} }
private fun initPriceViews(view: View) { private fun initPriceViews(view: View) {
val priceRange = View.inflate(context, R.layout.consultant_item_price_range, null) as LinearLayout val priceRange =
View.inflate(context, R.layout.consultant_item_price_range, null) as LinearLayout
etMinPrice = priceRange.findViewById(R.id.etMinPrice); etMinPrice = priceRange.findViewById(R.id.etMinPrice);
etMaxPrice = priceRange.findViewById(R.id.etMaxPrice); etMaxPrice = priceRange.findViewById(R.id.etMaxPrice);
...@@ -669,7 +670,11 @@ class FilterPopupWindow( ...@@ -669,7 +670,11 @@ class FilterPopupWindow(
0 0
) )
textView.layoutParams = params textView.layoutParams = params
val contentStr = String.format("%s\n%s", priceRangesItem.display_range, priceRangesItem.recommend_percent) val contentStr = String.format(
"%s\n%s",
priceRangesItem.display_range,
priceRangesItem.recommend_percent
)
val msp = SpannableString(contentStr) val msp = SpannableString(contentStr)
msp.setSpan( msp.setSpan(
AbsoluteSizeSpan(10, true), AbsoluteSizeSpan(10, true),
...@@ -703,7 +708,10 @@ class FilterPopupWindow( ...@@ -703,7 +708,10 @@ class FilterPopupWindow(
etMaxPrice?.setText("") etMaxPrice?.setText("")
etMinPrice?.setText("") etMinPrice?.setText("")
} else { } else {
tempFilter.priceRanges = priceRangesItem.copy(min_price = priceRangesItem.min_price, max_price = priceRangesItem.max_price) tempFilter.priceRanges = priceRangesItem.copy(
min_price = priceRangesItem.min_price,
max_price = priceRangesItem.max_price
)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
tempFilter.priceRangesView = textView tempFilter.priceRangesView = textView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment