Commit a294e1eb by 刘鹏

feat : 筛选增加学历选项

parent e4cf5a0b
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -91,7 +91,7 @@ class AudioApiRequestUtil {
return YDLHttpUtils.obtainApi(AudioNetAPi::class.java).noticeServerPush(body)
}
/**
/**confide_connect
* 获取声网登录token
*/
fun getAgoraToken(): Observable<BaseAPIResponse<AgoraTokenResponse>> {
......
......@@ -7,13 +7,8 @@ import android.animation.PropertyValuesHolder
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.drm.DrmStore
import android.graphics.Typeface
import android.os.Build
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.Gravity
import android.view.View
......@@ -22,6 +17,10 @@ import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout
......@@ -391,7 +390,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private fun initData(mIntent: Intent) {
fromPageType = mIntent.getIntExtra(EXTRA_FROM_PAGE, -1)
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY)?:""
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: ""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
tv_search_content.text = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
keyWord = mIntent.getStringExtra(EXTRA_CATEGORY_NAME) ?: ""
......@@ -485,7 +484,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
val popWidth = RxDeviceTool.getScreenWidth(mContext)
val mWidth = (popWidth - RxImageTool.dp2px(10f)) / hotData.size
for ((index, hot) in hotData!!.withIndex()) {
val tv = View.inflate(mContext, R.layout.consultant_item_filter_online, null) as TextView
val tv =
View.inflate(mContext, R.layout.consultant_item_filter_online, null) as TextView
val textView = tv.tvFree
val params = LinearLayout.LayoutParams(0, RxImageTool.dp2px(22f))
params.weight = 1f
......@@ -644,7 +644,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -664,7 +664,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -684,7 +684,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -704,7 +704,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.title.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -1011,6 +1011,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
......@@ -1026,7 +1029,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
// viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.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
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
......@@ -1052,14 +1055,18 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选确认回调
override fun onFilterConfirmed() {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
LogUtil.d("filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(","))
LogUtil.d("filter: " + tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",") + ","
+ tempFilter.ages.map { it.value }.joinToString(",") + ","
+ tempFilter.others.map { it.value }.joinToString(",")
+ tempFilter.doctorEdu.map { it.value }.joinToString(","))
props1.put(
"filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(",")
tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",")
+ "," + tempFilter.ages.map { it.value }.joinToString(",")
+ "," + tempFilter.others.map { it.value }.joinToString(",")
+ tempFilter.doctorEdu.map { it.value }.joinToString(",")
)
BuryPointUtils.buryPoint("Filtrate", props1)
......@@ -1069,6 +1076,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
//学历
allFilter.doctorEdu.clear()
allFilter.doctorEdu.addAll(tempFilter.doctorEdu)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
......@@ -1176,7 +1186,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理
private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
if ((allFilter.others.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.enquiries.size + allFilter.title.size + allFilter.specialityCrowd.size) == 1) {
var text: String? = ""
if (allFilter.others.size == 1) {
text = allFilter.others[0].value
......@@ -1186,8 +1196,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
text = allFilter.enquiries[0].value
} else if (allFilter.title.size == 1) {
text = allFilter.title[0].value
}else if (allFilter.specialityCrowd.size==1){
} else if (allFilter.specialityCrowd.size == 1) {
text = allFilter.specialityCrowd[0].value
}else if(allFilter.doctorEdu.size == 1){
//学历
text = allFilter.doctorEdu[0].value
} else {
text = "筛选"
}
......@@ -1488,6 +1501,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.sub = SubItem()
allFilter.enquiries.clear()
allFilter.ages.clear()
allFilter.doctorEdu.clear()
allFilter.others.clear()
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
......
......@@ -608,7 +608,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
}
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size+allFilter.doctorEdu.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
......@@ -973,6 +973,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.showType = allFilter.showType
tempFilter.ages.clear()
tempFilter.ages.addAll(allFilter.ages)
//学历
tempFilter.doctorEdu.clear()
tempFilter.doctorEdu.addAll(allFilter.doctorEdu)
tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
......@@ -988,7 +991,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener {
viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.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
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
......@@ -1024,10 +1027,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
)
props1.put(
"filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString(
","
) + "," + tempFilter.others.map { it.value }.joinToString(",")
tempFilter.showType.value + ","
+ tempFilter.enquiries.map { it.value }.joinToString(",") + ","
+ tempFilter.ages.map { it.value }.joinToString(",") + ","
+ tempFilter.doctorEdu.map { it.value }.joinToString(",") + ","
+ tempFilter.others.map { it.value }.joinToString(",")
)
BuryPointUtils.buryPoint("Filtrate", props1)
......@@ -1037,6 +1041,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages)
allFilter.doctorEdu.clear()
allFilter.doctorEdu.addAll(tempFilter.doctorEdu)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
......@@ -1145,7 +1151,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理
private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
if ((allFilter.others.size + allFilter.ages.size + allFilter.doctorEdu.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = ""
when {
allFilter.others.size == 1 -> {
......@@ -1163,6 +1169,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.specialityCrowd.size==1 -> {
text = allFilter.specialityCrowd[0].value
}
allFilter.doctorEdu.size==1 -> {
text = allFilter.doctorEdu[0].value
}
else -> {
text = "筛选"
}
......
......@@ -12,6 +12,7 @@ class ConsultBIConstants {
const val POSITION_CONSULT_TYPE_CLICK = "consult_type_click" //咨询方式
const val POSITION_AVERAGE_SERVICE_INPUT = "average_service_input" //服务均价
const val POSITION_AGE_CHOICE_CLICK = "age_choice_click" //年龄选择
const val POSITION_EDU_CHOICE_CLICK = "education_background_click" //学历选择
const val POSITION_QUALIFICATION_CHOICE_CLICK = "qualification_choice_click" //资质选择
const val POSITION_GOOD_AT_CLICK = "good_at_click" // 擅长人群
const val POSITION_OTHER_CHOICE_CLICK = "other_choice_click" //其他选择
......
......@@ -19,6 +19,7 @@ data class AllFilter(
var priceRanges: PriceRangesItem ?= null, //服务均价
var priceRangesView: TextView ?= null, //服务均价
val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val doctorEdu: ArrayList<DoctorEduItem> = ArrayList(), //学历
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList(), //资质
......
package com.yidianling.consultant.model.bean
import com.google.gson.annotations.SerializedName
/**
* 搜索条件 学历返回数据
* */
data class DoctorEduItem(
@field:SerializedName("key")
var key: Int? = null,
@field:SerializedName("value")
var value: String? = null
)
\ No newline at end of file
......@@ -4,6 +4,12 @@ import com.google.gson.annotations.SerializedName
data class Filters(
/**
* 学历
*/
@field:SerializedName("doctor_edu")
val doctorEdu: List<DoctorEduItem> = ArrayList(),
/**
* 按服务或者按专家
*/
@field:SerializedName("show_type")
......
......@@ -90,14 +90,22 @@ class FilterPopupWindow(
// this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style
initShowTypeViews(view)
//咨询方式
initEnquiryViews(view)
//服务均价
initPriceViews(view)
//年龄选择
initAgeViews(view)
//其他选择
initOtherViews(view)
//擅长人群
initGoodAtCrowd(view)
//资质
initZiZhiViews(view)
initKeyboardListener(view)
//学历选择
initEduViews(view)
initKeyboardListener(view)
updateCount()
view.btnReset.setOnClickListener {
......@@ -137,6 +145,7 @@ class FilterPopupWindow(
private fun reset() {
tempFilter.showType = filterData.showType[0]
tempFilter.ages.clear()
tempFilter.doctorEdu.clear()
tempFilter.enquiries.clear()
// 擅长人群
tempFilter.specialityCrowd.clear()
......@@ -230,6 +239,13 @@ class FilterPopupWindow(
biEventParams = tempFilter.ages.map { it.key }.joinToString(",")
}
}
//学历
if (tempFilter.doctorEdu.isNotEmpty()) {
sb.append("&doctorEdu=").append(tempFilter.doctorEdu.map { it.value }.joinToString(","))
if (ConsultBIConstants.POSITION_EDU_CHOICE_CLICK == biEventName) {
biEventParams = tempFilter.doctorEdu.map { it.value }.joinToString(",")
}
}
// 擅长人群拼接
if (tempFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(tempFilter.specialityCrowd.map { it.key }.joinToString(","))
......@@ -324,7 +340,9 @@ class FilterPopupWindow(
fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable)
}
/**
* 其他选择
* */
private fun initOtherViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, other) in filterData.other.withIndex()) {
......@@ -363,6 +381,9 @@ class FilterPopupWindow(
}
}
/**
* 资质
* */
private fun initZiZhiViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(40f)) / 2
for (other in filterData.title) {
......@@ -455,7 +476,9 @@ class FilterPopupWindow(
}
}
/**
* 年龄
* */
private fun initAgeViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, age) in filterData.age.withIndex()) {
......@@ -493,6 +516,46 @@ class FilterPopupWindow(
view.flAge.addView(textView)
}
}
/**
* 学历
* */
private fun initEduViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, edu) in filterData.doctorEdu.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f)
params.setMargins(
marginNum + (dp10 + mWidth) * (index % enquirySize),
dp46 * (index / enquirySize),
marginNum,
0
)
textView.layoutParams = params
textView.text = edu.value
ageViews.add(textView)
if (tempFilter.doctorEdu.contains(edu)) {
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
textView.text = " " + edu.value + " "
textView.setOnClickListener {
if (textView.isSelected) {
tempFilter.doctorEdu.remove(edu)
textView.isSelected = false
textView.paint.isFakeBoldText = false
} else {
tempFilter.doctorEdu.add(edu)
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
updateCount(ConsultBIConstants.POSITION_EDU_CHOICE_CLICK)
}
view.fl_edu.addView(textView)
}
}
private fun initEnquiryViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
......
......@@ -119,6 +119,21 @@
android:paddingLeft="5dp"
app:lineSpacing="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="学历选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/fl_edu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
<LinearLayout
android:id="@+id/ll_crowd_more"
android:layout_width="match_parent"
......
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