Commit 2ed762aa by YKai

feat: 排序中台2.0需求代码提交

parent cea87958
...@@ -6,7 +6,7 @@ ext { ...@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.50", "m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.74", "m-consultant" : "0.0.60.75",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.72", "m-user" : "0.0.62.72",
"m-home" : "0.0.24.00", "m-home" : "0.0.24.00",
...@@ -89,7 +89,7 @@ ext { ...@@ -89,7 +89,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.50", "m-confide" : "0.0.50.50",
"m-consultant" : "0.0.60.74", "m-consultant" : "0.0.60.75",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.72", "m-user" : "0.0.62.72",
"m-home" : "0.0.24.00", "m-home" : "0.0.24.00",
......
...@@ -1061,8 +1061,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1061,8 +1061,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0 || !TextUtils.isEmpty( if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice allFilter.priceRanges?.min_price
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice) ) || !TextUtils.isEmpty(allFilter.priceRanges?.max_price)
) { ) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
......
...@@ -940,8 +940,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -940,8 +940,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size + allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty( if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size + allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice allFilter.priceRanges?.min_price
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice) ) || !TextUtils.isEmpty(allFilter.priceRanges?.max_price)
) { ) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
......
...@@ -87,10 +87,18 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -87,10 +87,18 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
filterMap["tags.tag_id"] = categoriesMap filterMap["tags.tag_id"] = categoriesMap
} }
// 地区 // 地区
if (allFilter.region.value == "海外") { if (allFilter.region.code == "ABROAD") { // 海外
if (allFilter.region.code == allFilter.sub.code){ // 海外不限
val abroadMap = HashMap<String, Any>()
abroadMap["ne"] = "1"
filterMap["country_code"] = abroadMap
}else{
filterMap["country_code"] = allFilter.sub.code!!
}
} else if(allFilter.region.code=="1"&&allFilter.region.code==allFilter.sub.code){ // 全国不限
filterMap["country_code"] = allFilter.sub.code filterMap["country_code"] = allFilter.sub.code
} else{ }else{
if (allFilter.region.code != null&&allFilter.region.code!="1") { if (allFilter.region.code != null) {
filterMap["province_code"] = allFilter.region.code filterMap["province_code"] = allFilter.region.code
} }
if (allFilter.sub.code != null&&allFilter.sub.code!=allFilter.region.code) { if (allFilter.sub.code != null&&allFilter.sub.code!=allFilter.region.code) {
...@@ -110,8 +118,12 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -110,8 +118,12 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
// 服务均价 // 服务均价
if (allFilter.priceRanges != null) { if (allFilter.priceRanges != null) {
val avgPriceMap = HashMap<String, Any?>() val avgPriceMap = HashMap<String, Any?>()
avgPriceMap["gte"] = allFilter.priceRanges?.minPrice if (!TextUtils.isEmpty(allFilter.priceRanges?.min_price)){
avgPriceMap["lte"] = allFilter.priceRanges?.maxPrice avgPriceMap["gte"] = allFilter.priceRanges?.min_price
}
if (!TextUtils.isEmpty(allFilter.priceRanges?.max_price)) {
avgPriceMap["lte"] = allFilter.priceRanges?.max_price
}
filterMap["avg_price"] = avgPriceMap filterMap["avg_price"] = avgPriceMap
} }
// 年龄 // 年龄
......
...@@ -10,6 +10,6 @@ data class EnquiryItem( ...@@ -10,6 +10,6 @@ data class EnquiryItem(
@field:SerializedName("key") @field:SerializedName("key")
val key: Int, val key: Int,
val checkRrl: String?, val check_url: String?,
val unCheckUrl: String? val un_check_url: String?
) )
\ No newline at end of file
...@@ -30,7 +30,7 @@ data class Filters( ...@@ -30,7 +30,7 @@ data class Filters(
/** /**
* 服务均价 * 服务均价
*/ */
@field:SerializedName("priceRanges") @field:SerializedName("price_ranges")
val priceRanges: List<PriceRangesItem> = ArrayList(), val priceRanges: List<PriceRangesItem> = ArrayList(),
/** /**
...@@ -49,6 +49,6 @@ data class Filters( ...@@ -49,6 +49,6 @@ data class Filters(
/** /**
* 擅长人群 * 擅长人群
*/ */
@field:SerializedName("specialityCrowd") @field:SerializedName("speciality_crowd")
val specialityCrowd: ArrayList<SpecialityCrowdBean> = ArrayList() val specialityCrowd: ArrayList<SpecialityCrowdBean> = ArrayList()
) )
\ No newline at end of file
...@@ -4,12 +4,14 @@ import com.google.gson.annotations.SerializedName ...@@ -4,12 +4,14 @@ import com.google.gson.annotations.SerializedName
data class PriceRangesItem( data class PriceRangesItem(
@field:SerializedName("minPrice") @field:SerializedName("min_price")
var minPrice: String? = null, var min_price: String? = null,
@field:SerializedName("maxPrice") @field:SerializedName("max_price")
var maxPrice: String? = null, var max_price: String? = null,
@SerializedName("recommendPercent") @SerializedName("recommend_percent")
var recommendPercent: String? = null var recommend_percent: String? = null,
var display_range:String? = null
) )
\ No newline at end of file
...@@ -43,7 +43,6 @@ class FilterPopupWindow( ...@@ -43,7 +43,6 @@ class FilterPopupWindow(
private val tempFilter: AllFilter private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) { ) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private val mDisposableList = CompositeDisposable()
private val showTypeViews: ArrayList<View> = ArrayList() private val showTypeViews: ArrayList<View> = ArrayList()
private val enquiryViews: ArrayList<View> = ArrayList() private val enquiryViews: ArrayList<View> = ArrayList()
...@@ -168,7 +167,7 @@ class FilterPopupWindow( ...@@ -168,7 +167,7 @@ class FilterPopupWindow(
tempFilter.enquiries.forEach { tempFilter.enquiries.forEach {
if (textView.text.toString() == it.value) { if (textView.text.toString() == it.value) {
Glide.with(context) Glide.with(context)
.load(it.unCheckUrl) .load(it.un_check_url)
.into(ivIcon) .into(ivIcon)
} }
} }
...@@ -269,15 +268,15 @@ class FilterPopupWindow( ...@@ -269,15 +268,15 @@ class FilterPopupWindow(
} }
if (tempFilter.priceRanges != null) { if (tempFilter.priceRanges != null) {
sb.append("&minPrice=").append(tempFilter.priceRanges?.minPrice) sb.append("&minPrice=").append(tempFilter.priceRanges?.min_price)
sb.append("&maxPrice=").append(tempFilter.priceRanges?.maxPrice) sb.append("&maxPrice=").append(tempFilter.priceRanges?.max_price)
if (ConsultBIConstants.POSITION_AVERAGE_SERVICE_INPUT == biEventName) { if (ConsultBIConstants.POSITION_AVERAGE_SERVICE_INPUT == biEventName) {
var account = 0.0 var account = 0.0
if (!TextUtils.isEmpty(tempFilter.priceRanges?.minPrice)) { if (!TextUtils.isEmpty(tempFilter.priceRanges?.min_price)) {
account += tempFilter.priceRanges?.minPrice?.toDouble()!! account += tempFilter.priceRanges?.min_price?.toDouble()!!
} }
if (!TextUtils.isEmpty(tempFilter.priceRanges?.maxPrice)) { if (!TextUtils.isEmpty(tempFilter.priceRanges?.max_price)) {
account += tempFilter.priceRanges?.maxPrice?.toDouble()!! account += tempFilter.priceRanges?.max_price?.toDouble()!!
} }
biEventParams = ((account / 2).roundToInt()).toString() biEventParams = ((account / 2).roundToInt()).toString()
...@@ -334,9 +333,6 @@ class FilterPopupWindow( ...@@ -334,9 +333,6 @@ class FilterPopupWindow(
} }
} }
fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable)
}
/** /**
* 其他选择 * 其他选择
...@@ -573,7 +569,7 @@ class FilterPopupWindow( ...@@ -573,7 +569,7 @@ class FilterPopupWindow(
llLayout.layoutParams = params llLayout.layoutParams = params
textView.text = enquiry.value textView.text = enquiry.value
Glide.with(context) Glide.with(context)
.load(enquiry.unCheckUrl) .load(enquiry.un_check_url)
.into(ivIcon) .into(ivIcon)
enquiryViews.add(llLayout) enquiryViews.add(llLayout)
...@@ -581,7 +577,7 @@ class FilterPopupWindow( ...@@ -581,7 +577,7 @@ class FilterPopupWindow(
llLayout.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context) Glide.with(context)
.load(enquiry.checkRrl) .load(enquiry.check_url)
.into(ivIcon) .into(ivIcon)
} }
llLayout.setOnClickListener { llLayout.setOnClickListener {
...@@ -590,14 +586,14 @@ class FilterPopupWindow( ...@@ -590,14 +586,14 @@ class FilterPopupWindow(
llLayout.isSelected = false llLayout.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
Glide.with(context) Glide.with(context)
.load(enquiry.unCheckUrl) .load(enquiry.un_check_url)
.into(ivIcon) .into(ivIcon)
} else { } else {
tempFilter.enquiries.add(enquiry) tempFilter.enquiries.add(enquiry)
llLayout.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context) Glide.with(context)
.load(enquiry.checkRrl) .load(enquiry.check_url)
.into(ivIcon) .into(ivIcon)
} }
updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK) updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK)
...@@ -607,14 +603,13 @@ class FilterPopupWindow( ...@@ -607,14 +603,13 @@ class FilterPopupWindow(
} }
private fun initPriceViews(view: View) { private fun initPriceViews(view: View) {
val priceRange = val priceRange = View.inflate(context, R.layout.consultant_item_price_range, null) as LinearLayout
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);
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager // context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
var listener: TextView.OnEditorActionListener = val listener: TextView.OnEditorActionListener =
TextView.OnEditorActionListener { _, actionId, event -> TextView.OnEditorActionListener { _, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) { if (actionId == EditorInfo.IME_ACTION_DONE || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) {
updatePriceFilter() updatePriceFilter()
...@@ -625,8 +620,8 @@ class FilterPopupWindow( ...@@ -625,8 +620,8 @@ class FilterPopupWindow(
} }
if (tempFilter.priceRanges != null) { if (tempFilter.priceRanges != null) {
etMinPrice?.setText(tempFilter.priceRanges?.minPrice) etMinPrice?.setText(tempFilter.priceRanges?.min_price)
etMaxPrice?.setText(tempFilter.priceRanges?.maxPrice) etMaxPrice?.setText(tempFilter.priceRanges?.max_price)
} }
etMaxPrice?.setOnEditorActionListener(listener) etMaxPrice?.setOnEditorActionListener(listener)
...@@ -673,16 +668,7 @@ class FilterPopupWindow( ...@@ -673,16 +668,7 @@ class FilterPopupWindow(
0 0
) )
textView.layoutParams = params textView.layoutParams = params
val maxPriceStr = val contentStr = String.format("%s\n%s", priceRangesItem.display_range, priceRangesItem.recommend_percent)
if (TextUtils.isEmpty(priceRangesItem.maxPrice)) "+" else "-" + priceRangesItem.maxPrice
val contentStr = String.format(
"%s%s\n%s",
priceRangesItem.minPrice,
maxPriceStr,
priceRangesItem.recommendPercent
)
val msp = SpannableString(contentStr) val msp = SpannableString(contentStr)
msp.setSpan( msp.setSpan(
AbsoluteSizeSpan(10, true), AbsoluteSizeSpan(10, true),
...@@ -690,8 +676,7 @@ class FilterPopupWindow( ...@@ -690,8 +676,7 @@ class FilterPopupWindow(
contentStr.length, contentStr.length,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
) )
textView.text = msp
textView.text = msp;
textView.setSingleLine(false) textView.setSingleLine(false)
textView.setLineSpacing(1.0f, 1.2f) textView.setLineSpacing(1.0f, 1.2f)
...@@ -717,13 +702,12 @@ class FilterPopupWindow( ...@@ -717,13 +702,12 @@ class FilterPopupWindow(
etMaxPrice?.setText("") etMaxPrice?.setText("")
etMinPrice?.setText("") etMinPrice?.setText("")
} else { } else {
tempFilter.priceRanges = tempFilter.priceRanges = priceRangesItem.copy(min_price = priceRangesItem.min_price, max_price = priceRangesItem.max_price)
priceRangesItem.copy(priceRangesItem.minPrice, priceRangesItem.maxPrice)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
tempFilter.priceRangesView = textView tempFilter.priceRangesView = textView
etMinPrice?.setText(priceRangesItem.minPrice) etMinPrice?.setText(priceRangesItem.min_price)
etMaxPrice?.setText(priceRangesItem.maxPrice) etMaxPrice?.setText(priceRangesItem.max_price)
} }
updateCount(ConsultBIConstants.POSITION_AVERAGE_SERVICE_INPUT) updateCount(ConsultBIConstants.POSITION_AVERAGE_SERVICE_INPUT)
...@@ -743,8 +727,8 @@ class FilterPopupWindow( ...@@ -743,8 +727,8 @@ class FilterPopupWindow(
tempFilter.priceRanges = priceRangesItem; tempFilter.priceRanges = priceRangesItem;
} }
tempFilter.priceRanges!!.maxPrice = etMaxPrice?.text.toString() tempFilter.priceRanges!!.max_price = etMaxPrice?.text.toString()
tempFilter.priceRanges!!.minPrice = etMinPrice?.text.toString() tempFilter.priceRanges!!.min_price = etMinPrice?.text.toString()
tempFilter.priceRangesView?.isSelected = false tempFilter.priceRangesView?.isSelected = false
tempFilter.priceRangesView?.paint?.isFakeBoldText = false tempFilter.priceRangesView?.paint?.isFakeBoldText = false
tempFilter.priceRangesView = null tempFilter.priceRangesView = null
...@@ -794,7 +778,6 @@ class FilterPopupWindow( ...@@ -794,7 +778,6 @@ class FilterPopupWindow(
} }
override fun dismiss() { override fun dismiss() {
mDisposableList.clear()
super.dismiss() super.dismiss()
} }
} }
\ No newline at end of file
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