Commit 2b70451f by YKai

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

parent de58693a
......@@ -107,7 +107,7 @@ class FilterPopupWindow(
}
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
}
biEvent(ConsultBIConstants.POSITION_CONSULT_FILTER_CHECKOUT_CLICK)
......@@ -604,7 +604,8 @@ class FilterPopupWindow(
}
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);
etMaxPrice = priceRange.findViewById(R.id.etMaxPrice);
......@@ -669,7 +670,11 @@ class FilterPopupWindow(
0
)
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)
msp.setSpan(
AbsoluteSizeSpan(10, true),
......@@ -703,7 +708,10 @@ class FilterPopupWindow(
etMaxPrice?.setText("")
etMinPrice?.setText("")
} 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.paint.isFakeBoldText = true
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