Commit 1d79f603 by upwork.021

feat: 代码提交

parent 0f00af89
...@@ -6,10 +6,10 @@ ext { ...@@ -6,10 +6,10 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.72", "m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.31", "m-consultant" : "0.0.60.39",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04", "m-user" : "0.0.62.04",
"m-home" : "0.0.23.44", "m-home" : "0.0.23.80",
"m-im" : "0.0.21.33", "m-im" : "0.0.21.33",
"m-dynamic" : "0.0.7.37", "m-dynamic" : "0.0.7.37",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -35,7 +35,7 @@ ext { ...@@ -35,7 +35,7 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.22", "ydl-tuicore" : "0.0.22",
//第一步 //第一步
"ydl-platform" : "0.0.40.97", "ydl-platform" : "0.0.41.25",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.62", "ydl-webview" : "0.0.38.62",
...@@ -46,7 +46,7 @@ ext { ...@@ -46,7 +46,7 @@ ext {
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.93", "ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.3", "ydl-utils" : "0.0.3.3",
] ]
ydl_app = [ ydl_app = [
...@@ -130,7 +130,7 @@ ext { ...@@ -130,7 +130,7 @@ ext {
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.93", "ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.3", "ydl-utils" : "0.0.3.3",
] ]
......
...@@ -69,6 +69,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -69,6 +69,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private lateinit var mActivity: FragmentActivity private lateinit var mActivity: FragmentActivity
var startTime =0L var startTime =0L
var endTime =0L var endTime =0L
private var mIdssign1:String="" // 列表埋点咨询师列表id拼接参数
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.consultant_activity_expert_search_list return R.layout.consultant_activity_expert_search_list
...@@ -435,7 +436,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -435,7 +436,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
filterLabelSet() filterLabelSet()
//开始筛选数据 //开始筛选数据
// refresh() refresh()
} }
view.addView(textView) view.addView(textView)
} }
...@@ -753,8 +754,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -753,8 +754,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
srlContainer.isRefreshing = false srlContainer.isRefreshing = false
// 埋点 // 埋点
val sign1 = data.map { it.id }.joinToString { "|" } mIdssign1 = data.joinToString(","){it.id}
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT,sign1,sign2,"app") ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT,mIdssign1,sign2,"app")
} }
override fun fetchListFailed(msg: String?) { override fun fetchListFailed(msg: String?) {
...@@ -936,15 +937,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -936,15 +937,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选确认回调 //筛选确认回调
override fun onFilterConfirmed() { override fun onFilterConfirmed() {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN) 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(
","
)
)
props1.put( props1.put(
"filtrate_second", "filtrate_second",
tempFilter.showType.value + "," tempFilter.showType.value + ","
...@@ -955,6 +948,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -955,6 +948,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
) )
BuryPointUtils.buryPoint("Filtrate", props1) BuryPointUtils.buryPoint("Filtrate", props1)
// 埋点
if (tempFilter.specialityCrowd.size>0){
val sign1 = tempFilter.specialityCrowd.joinToString(","){it.value!!}
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_FILTER_PAGE,ConsultBIConstants.ConsultEvent.POSITION_GOODAT_CROWD_CLICK,sign1,"app","")
}
allFilter.showType = tempFilter.showType allFilter.showType = tempFilter.showType
allFilter.enquiries.clear() allFilter.enquiries.clear()
...@@ -1295,16 +1294,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1295,16 +1294,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
*/ */
override fun onCategoriesSelected(signLit:ArrayList<String>) { override fun onCategoriesSelected(signLit:ArrayList<String>) {
if (signLit.isNotEmpty()){ if (signLit.isNotEmpty()){
val sign1 = signLit.map { it }.joinToString { "," } val sign1 = signLit.joinToString(","){it}
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.ConsultEvent.POSITION_TWO_CATEGORY_CLICK, sign1,"app","") ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.ConsultEvent.POSITION_TWO_CATEGORY_CLICK, sign1,"app","")
} }
if (allFilter.categoryId2List.size>0||allFilter.categoryId3List.size>0){ if (allFilter.categoryId2List.size>0||allFilter.categoryId3List.size>0){
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED)
refresh()
}else{ }else{
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvSubject, FILTER_STATUS_NORMAL)
} }
refresh()
} }
override fun onRefresh() { override fun onRefresh() {
...@@ -1319,8 +1318,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1319,8 +1318,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
*/ */
private var sign2="" private var sign2=""
fun onEvent(event: HomeModuleTabEvent) { fun onEvent(event: HomeModuleTabEvent) {
if (!TextUtils.isEmpty(event.sign)){ if (!TextUtils.isEmpty(event.sign)){
sign2 = event.sign sign2 = event.sign
// 埋点
if (!TextUtils.isEmpty(mIdssign1)){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT,mIdssign1,sign2,"app")
}
} }
} }
......
...@@ -10,6 +10,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager ...@@ -10,6 +10,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.SimplePresenter import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.RxLifecycleUtils import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.consultant.http.ExpertSearchDataManager import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
...@@ -47,7 +48,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -47,7 +48,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun fetchListData(allFilter: AllFilter, extras: Extras?) { fun fetchListData(allFilter: AllFilter, extras: Extras?) {
//是否亲子教育字段 //是否亲子教育字段
ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23" // ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23"
val map = HashMap<String, Any>() val map = HashMap<String, Any>()
// filter // filter
...@@ -58,15 +59,15 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -58,15 +59,15 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
} }
val categoryList = ArrayList<Any>() val categoryList = ArrayList<Any>()
// 八大类一级标签 // 八大类一级标签
if (allFilter.categoryId2List.isNotEmpty()){ if (allFilter.categoryId2List.size>0){
val categoryMap2 = HashMap<String, Any>() val categoryMap2 = HashMap<String, Any>()
val categoryIdMap2 = HashMap<String, Any>() val categoryIdMap2 = HashMap<String, Any>()
categoryIdMap2["in"] = allFilter.categoryId2List categoryIdMap2["in"] = allFilter.categoryId2List
categoryMap2["product_cates.category_id3"] = categoryIdMap2 categoryMap2["product_cates.category_id2"] = categoryIdMap2
categoryList.add(categoryMap2) categoryList.add(categoryMap2)
} }
// 八大类二级标签 // 八大类二级标签
if (allFilter.categoryId3List.isNotEmpty()){ if (allFilter.categoryId3List.size>0){
val categoryMap3 = HashMap<String, Any>() val categoryMap3 = HashMap<String, Any>()
val categoryIdMap3 = HashMap<String, Any>() val categoryIdMap3 = HashMap<String, Any>()
categoryIdMap3["in"] = allFilter.categoryId3List categoryIdMap3["in"] = allFilter.categoryId3List
...@@ -77,7 +78,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -77,7 +78,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
filterMap["__or"] = categoryList filterMap["__or"] = categoryList
} }
// 主题 // 主题
if (allFilter.categories.isNotEmpty()) { if (allFilter.categories.size>0) {
val categories = ArrayList<String?>() val categories = ArrayList<String?>()
allFilter.categories.forEach { allFilter.categories.forEach {
categories.add(it.cateId) categories.add(it.cateId)
...@@ -157,18 +158,31 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -157,18 +158,31 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
// 其它 // 其它
if (allFilter.others.isNotEmpty()) { if (allFilter.others.isNotEmpty()) {
val gender = ArrayList<String?>() val gender = ArrayList<String?>()
val bookIngStatusList = ArrayList<String>()
allFilter.others.forEach { allFilter.others.forEach {
if (it.key1=="gender"){ when (it.key1) {
gender.add(it.value1) "gender" -> {
}else{ gender.add(it.value1)
filterMap[it.key1] = it.value1 }
"booking_status" -> {
bookIngStatusList.add("1")
bookIngStatusList.add("2")
}
else -> {
filterMap[it.key1] = it.value1
}
} }
} }
val genderMap = HashMap<String, Any>()
if (gender.size>0){ if (gender.size>0){
val genderMap = HashMap<String, Any>()
genderMap["in"] = gender genderMap["in"] = gender
filterMap["gender"] = genderMap filterMap["gender"] = genderMap
} }
if (bookIngStatusList.size>0){
val bookStatusMap = HashMap<String, Any>()
bookStatusMap["in"] = bookIngStatusList
filterMap["booking_status"] = bookStatusMap
}
} }
map["filter"] = filterMap map["filter"] = filterMap
......
...@@ -11,43 +11,42 @@ import android.view.WindowManager ...@@ -11,43 +11,42 @@ import android.view.WindowManager
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.FixSizeLinkedList import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.banner.GlideImageLoader import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.adapter.SearchWordsAdapter
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.*
import com.yidianling.consultant.bean.HotSearchFocusItemBean
import com.yidianling.consultant.bean.HotSearchKeyWordDataBean
import com.yidianling.consultant.bean.HotSearchPopularDoctorBean
import com.yidianling.consultant.constants.ConsultBIConstants import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.contract.IHotSearchContract import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import com.yidianling.consultant.modular.utils.TempH5RouteUtils import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.presenter.HotSearchPresenterImpl import com.yidianling.consultant.presenter.HotSearchPresenterImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_activity_hot_search.* import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.* import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route(path = "/consult/hot_search") @Route(path = "/consult/hot_search")
class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(), class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(), IHotSearchContract.View {
IHotSearchContract.View { private lateinit var searchWordsAdapter:SearchWordsAdapter
private val searchSuggestList: ArrayList<SearchSuggestListBean> = ArrayList()
private var mSearchContent:String = ""
private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data" private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name" private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15) private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
...@@ -84,7 +83,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -84,7 +83,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
private fun getDataFromIntent() { private fun getDataFromIntent() {
var doctorName = intent.getStringExtra(HOT_SEARCH_DOCTOR_NAME) val doctorName = intent.getStringExtra(HOT_SEARCH_DOCTOR_NAME)
if (!TextUtils.isEmpty(doctorName)) { if (!TextUtils.isEmpty(doctorName)) {
etSearch.setText(doctorName) etSearch.setText(doctorName)
iv_delete_icon.visibility = View.VISIBLE iv_delete_icon.visibility = View.VISIBLE
...@@ -92,6 +91,10 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -92,6 +91,10 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
private fun initViews() { private fun initViews() {
StatusBarUtils.statusBarLightMode(this)
maxWidth = (2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f)
dp42 = RxImageTool.dip2px(60f)
iv_delete_icon.setOnClickListener { iv_delete_icon.setOnClickListener {
etSearch.setText("") etSearch.setText("")
} }
...@@ -101,12 +104,6 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -101,12 +104,6 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
true true
} }
etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
doSearch()
}
true
}
tv_search_cancle.setOnClickListener { tv_search_cancle.setOnClickListener {
finish() finish()
} }
...@@ -126,18 +123,27 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -126,18 +123,27 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
iv_daoyi_image.setOnClickListener { iv_daoyi_image.setOnClickListener {
LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}") LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}")
ConsultAssistantEntryUtils.jumpConsultAssistant(this,data?.get(0)!!.location.toInt(),"learning") ConsultAssistantEntryUtils.jumpConsultAssistant(this, data[0].location.toInt(),"learning")
} }
} }
searchWordsAdapter = SearchWordsAdapter(searchSuggestList)
rv_search_words.layoutManager = LinearLayoutManager(this)
rv_search_words.adapter = searchWordsAdapter
searchWordsAdapter.setOnItemClickListener { adapter, view, position ->
}
etSearch.addTextChangedListener(object : TextWatcher { etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) { override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) { if (TextUtils.isEmpty(s)) {
iv_delete_icon.visibility = View.INVISIBLE iv_delete_icon.visibility = View.INVISIBLE
rv_search_words.visibility = View.GONE
getSearchWords("")
} else { } else {
iv_delete_icon.visibility = View.VISIBLE iv_delete_icon.visibility = View.VISIBLE
getSearchWords(s.toString())
} }
} }
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
...@@ -147,10 +153,31 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -147,10 +153,31 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
}) })
StatusBarUtils.statusBarLightMode(this) }
maxWidth =
(2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f) /**
dp42 = RxImageTool.dip2px(60f) * 获取搜索联想词
*/
private fun getSearchWords(searchContent:String){
if (!TextUtils.isEmpty(searchContent)){
mSearchContent = searchContent
val map = HashMap<String, Any>()
map["content"] = searchContent
mPresenter.getSearchWords(map)
}else{
rv_search_words.visibility = View.GONE
}
}
override fun getSearchWordsSuccess(searchWordsBean: SearchWordsBean) {
searchSuggestList.clear()
if (!searchWordsBean.search_suggests.isNullOrEmpty()){
rv_search_words.visibility = View.VISIBLE
searchSuggestList.addAll(searchWordsBean.search_suggests)
searchWordsAdapter.notifyDataAndSetSearchWord(mSearchContent)
}else{
rv_search_words.visibility = View.GONE
}
} }
private fun initData() { private fun initData() {
...@@ -179,6 +206,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -179,6 +206,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
refreshBanner(null) refreshBanner(null)
} }
//刷新 热门搜索 //刷新 热门搜索
private fun refreshHotSearchData(keywordData: MutableList<HotSearchKeyWordDataBean>?) { private fun refreshHotSearchData(keywordData: MutableList<HotSearchKeyWordDataBean>?) {
if (null == keywordData || keywordData.isEmpty()) { if (null == keywordData || keywordData.isEmpty()) {
...@@ -308,32 +336,34 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -308,32 +336,34 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
return rect.width()//文字宽 return rect.width()//文字宽
} }
//执行搜索 /**
* 搜索
*/
private fun doSearch() { private fun doSearch() {
val view = this.currentFocus val view = this.currentFocus
if (view != null) { if (view != null) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0) imm.hideSoftInputFromWindow(view.windowToken, 0)
} }
val keyWord = etSearch.text.toString() val searchWords = etSearch.text.toString()
// if (TextUtils.isEmpty(keyWord.trim())) { ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK,searchWords)
// ToastUtil.toastShort("请输入搜索内容") if (!TextUtils.isEmpty(searchWords)) {
// return historyList.remove(searchWords)
// } historyList.add(searchWords)
ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK,keyWord)
if (!TextUtils.isEmpty(keyWord)) {
historyList.remove(keyWord)
historyList.add(keyWord)
SharedPreferencesEditor.putString( SharedPreferencesEditor.putString(
CACHE_CONSULT_SEARCH_HISTORY_DATA, CACHE_CONSULT_SEARCH_HISTORY_DATA,
Gson().toJson(historyList) Gson().toJson(historyList)
) )
} }
// 搜索的关联词
var relatedWords = ""
ExpertSearchActivity.startSearch(this, keyWord,"14") if (searchSuggestList.isNotEmpty()){
searchSuggestList[0].suggest_relations?.let {
this.finish() relatedWords = it[0]
}
}
ExpertSearchActivity.startSearch(this, searchWords,"14",relatedWords)
finish()
} }
override fun onDestroy() { override fun onDestroy() {
......
package com.yidianling.consultant.adapter
import android.text.SpannableString
import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.SearchSuggestListBean
/**
* Created by Ykai on 2022/5/30.
*/
class SearchWordsAdapter(data: List<SearchSuggestListBean>) : BaseQuickAdapter<SearchSuggestListBean, BaseViewHolder>(R.layout.consultant_item_search_words,data) {
private var mSearchWord:String = ""
override fun convert(holder: BaseViewHolder, item: SearchSuggestListBean) {
val tvSearchWords = holder.getView<TextView>(R.id.tv_search_words)
tvSearchWords.text = setWordsStyle(item.suggest_content,mSearchWord)
}
fun notifyDataAndSetSearchWord(searchWord: String){
mSearchWord = searchWord
notifyDataSetChanged()
}
private fun setWordsStyle(words:String,searchWord:String):SpannableString{
val spannableString = SpannableString(words)
if (words.contains(searchWord)){
val startIndex = words.indexOf(searchWord)
val endIndex = startIndex+searchWord.length
spannableString.setSpan(ForegroundColorSpan(ContextCompat.getColor(mContext,R.color.platform_main_theme)), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
return spannableString
}
}
\ No newline at end of file
package com.yidianling.consultant.bean
/**
* Created by Ykai on 2022/5/30.
*/
data class SearchWordsBean(
val search_suggests:ArrayList<SearchSuggestListBean>?
)
data class SearchSuggestListBean(
val id:String,
val score:String,
val suggest_content:String,
val suggest_relations:ArrayList<String>?,
val search_count: Int,
val suggest_classify_types:ArrayList<String>,
val mapping_classify_type_exist:Boolean
)
\ No newline at end of file
...@@ -56,6 +56,7 @@ class ConsultBIConstants { ...@@ -56,6 +56,7 @@ class ConsultBIConstants {
const val POSITION_CONSULT_COUNSELOR_CARD_CLICK="consult_counselor_card_click" // 咨询师列表点击position const val POSITION_CONSULT_COUNSELOR_CARD_CLICK="consult_counselor_card_click" // 咨询师列表点击position
const val POSITION_CHOICE_FILTER_CLICK="choice_filter_click" // 热门点击项position const val POSITION_CHOICE_FILTER_CLICK="choice_filter_click" // 热门点击项position
const val POSITION_TWO_CATEGORY_CLICK="two_category_click" // 八大类标签选择埋点 const val POSITION_TWO_CATEGORY_CLICK="two_category_click" // 八大类标签选择埋点
const val POSITION_GOODAT_CROWD_CLICK="goodat_crowd_click" // 擅长人群埋点
} }
} }
class ConsultSearchListEvent { class ConsultSearchListEvent {
......
...@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel ...@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable import io.reactivex.Observable
/** /**
...@@ -26,6 +27,11 @@ class IHotSearchContract { ...@@ -26,6 +27,11 @@ class IHotSearchContract {
* 请求失败 * 请求失败
*/ */
fun requestFail() fun requestFail()
/**
* 联想词请求成功结果
*/
fun getSearchWordsSuccess(searchWordsBean: SearchWordsBean)
} }
interface Presenter : IPresenter<View> { interface Presenter : IPresenter<View> {
...@@ -38,6 +44,11 @@ class IHotSearchContract { ...@@ -38,6 +44,11 @@ class IHotSearchContract {
* 搜索页接口请求 * 搜索页接口请求
*/ */
fun searchData() fun searchData()
/**
* 获取联想词
*/
fun getSearchWords(map:HashMap<String,Any>)
} }
interface Model : IModel { interface Model : IModel {
...@@ -45,5 +56,10 @@ class IHotSearchContract { ...@@ -45,5 +56,10 @@ class IHotSearchContract {
* 搜索页接口 * 搜索页接口
*/ */
fun searchData(): Observable<HotSearchBean> fun searchData(): Observable<HotSearchBean>
/**
* 获取到联想词
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean>
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.consultant.http ...@@ -2,6 +2,7 @@ package com.yidianling.consultant.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.ExpertSearchTopShowBean import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean import com.yidianling.consultant.model.bean.ExpertBean
import io.reactivex.Observable import io.reactivex.Observable
...@@ -19,6 +20,11 @@ interface IExpertSearchHttp{ ...@@ -19,6 +20,11 @@ interface IExpertSearchHttp{
// fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>> // fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
/** /**
* 获取搜索联想词
*/
// fun getSearchWords(map:Map<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
/**
* 获取专家列表 * 获取专家列表
*/ */
fun getExpertList(map:Map<String,Any>): Observable<BaseAPIResponse<ExpertBean>> fun getExpertList(map:Map<String,Any>): Observable<BaseAPIResponse<ExpertBean>>
......
...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.http.ExpertSearchParam import com.yidianling.consultant.http.ExpertSearchParam
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import io.reactivex.Observable import io.reactivex.Observable
...@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp { ...@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp {
getSearchApi().searchPage() getSearchApi().searchPage()
} }
} }
override fun getSearchWords(map: HashMap<String, Any>): Observable<BaseAPIResponse<SearchWordsBean>> {
return getSearchApi().getSearchWords(map)
}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch ...@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable import io.reactivex.Observable
/** /**
...@@ -13,7 +14,12 @@ import io.reactivex.Observable ...@@ -13,7 +14,12 @@ import io.reactivex.Observable
*/ */
interface IHotSearchHttp{ interface IHotSearchHttp{
/** /**
* 测评首页请求 * 搜索页请求
*/ */
fun searchData(): Observable<BaseAPIResponse<HotSearchBean>> fun searchData(): Observable<BaseAPIResponse<HotSearchBean>>
/**
* 搜索联想词请求
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.consultant.model ...@@ -2,6 +2,7 @@ package com.yidianling.consultant.model
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.contract.IHotSearchContract import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.http.hotsearch.HotSearchDataManager import com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import io.reactivex.Observable import io.reactivex.Observable
...@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{ ...@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{
override fun searchData(): Observable<HotSearchBean> { override fun searchData(): Observable<HotSearchBean> {
return HotSearchDataManager.getHttp().searchData().compose(RxUtils.resultJavaData()) return HotSearchDataManager.getHttp().searchData().compose(RxUtils.resultJavaData())
} }
override fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean> {
return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData())
}
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ import com.ydl.ydlnet.YDLHttpUtils ...@@ -9,6 +9,7 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.HeadData import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable import io.reactivex.Observable
...@@ -42,11 +43,6 @@ interface SearchApi { ...@@ -42,11 +43,6 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>> fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//专家服务搜索
// @retrofit2.http.Headers("Content-Type:application/json")
// @GET
// fun searchDoctorService(@Url url: String): Observable<BaseAPIResponse<ExpertSearchBean>>
/** /**
* 新咨询师列表接口(包含搜索、筛选咨询师) * 新咨询师列表接口(包含搜索、筛选咨询师)
...@@ -55,6 +51,13 @@ interface SearchApi { ...@@ -55,6 +51,13 @@ interface SearchApi {
@POST("smart-rank/v1/search") @POST("smart-rank/v1/search")
fun getExpertList(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<ExpertBean>> fun getExpertList(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<ExpertBean>>
/**
* 获取搜索联想词
*/
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@POST("dmp/v1/searchsuggest")
fun getSearchWords(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<SearchWordsBean>>
//搜索页面接口 //搜索页面接口
@retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json") @retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
...@@ -14,7 +14,7 @@ data class ExpertServiceItem( ...@@ -14,7 +14,7 @@ data class ExpertServiceItem(
/** /**
* 专家ID * 专家ID
*/ */
val id: String?, val id: String,
/** /**
* 专家uid * 专家uid
*/ */
...@@ -135,7 +135,7 @@ data class ExpertServiceItem( ...@@ -135,7 +135,7 @@ data class ExpertServiceItem(
) )
data class FeatureTag( data class FeatureTag(
val tag_id:Int, val tag_id:String,
val tag_name:String, val tag_name:String,
val is_highlight:Boolean, // 是否高亮 val is_highlight:Boolean, // 是否高亮
val type:String // 标签类型 val type:String // 标签类型
......
package com.yidianling.consultant.presenter package com.yidianling.consultant.presenter
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.text.TextUtils import android.text.TextUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.RxLifecycleUtils import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.contract.IHotSearchContract import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.model.HotSearchModelImpl import com.yidianling.consultant.model.HotSearchModelImpl
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.TimeUnit
/** /**
* @author yuanwai * @author yuanwai
* @描述:搜索页面逻辑实现类 * @描述:搜索页面逻辑实现类
...@@ -20,8 +26,7 @@ import io.reactivex.functions.Consumer ...@@ -20,8 +26,7 @@ import io.reactivex.functions.Consumer
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/3/19 * @date 2019/3/19
*/ */
class HotSearchPresenterImpl () : class HotSearchPresenterImpl : BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
/** /**
* 实例化数据模型 * 实例化数据模型
...@@ -71,4 +76,20 @@ class HotSearchPresenterImpl () : ...@@ -71,4 +76,20 @@ class HotSearchPresenterImpl () :
} }
}) })
} }
@SuppressLint("CheckResult")
override fun getSearchWords(map:HashMap<String,Any>) {
mModel.getSearchWords(map)
.debounce(500L, TimeUnit.MILLISECONDS)
.compose(RxLifecycleUtils.bindToLifecycle(mView))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.getSearchWordsSuccess(it)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
ToastUtil.toastShort(msg)
}
})
}
} }
\ No newline at end of file
...@@ -124,6 +124,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -124,6 +124,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
} }
mAllFilter.categoryId2List.clear() mAllFilter.categoryId2List.clear()
mAllFilter.categoryId3List.clear() mAllFilter.categoryId3List.clear()
signList.clear()
} }
// 确定 // 确定
view.btnConfirm.setOnClickListener { view.btnConfirm.setOnClickListener {
...@@ -160,6 +161,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -160,6 +161,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!childList[position].isSelected&&childList[0].isSelected){ if (!childList[position].isSelected&&childList[0].isSelected){
childList[0].isSelected = false childList[0].isSelected = false
mAllFilter.categoryId2List.remove(childList[0].cate_id) mAllFilter.categoryId2List.remove(childList[0].cate_id)
signList.remove("亲子教育")
} }
childList[position].isSelected = !childList[position].isSelected childList[position].isSelected = !childList[position].isSelected
if (childList[position].isSelected){ if (childList[position].isSelected){
...@@ -204,6 +206,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -204,6 +206,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!stressList[position].isSelected&&stressList[0].isSelected){ if (!stressList[position].isSelected&&stressList[0].isSelected){
stressList[0].isSelected = false stressList[0].isSelected = false
mAllFilter.categoryId2List.remove(stressList[0].cate_id) mAllFilter.categoryId2List.remove(stressList[0].cate_id)
signList.remove("情绪压力")
} }
stressList[position].isSelected = !stressList[position].isSelected stressList[position].isSelected = !stressList[position].isSelected
if (stressList[position].isSelected){ if (stressList[position].isSelected){
...@@ -248,6 +251,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -248,6 +251,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!loveEmotionList[position].isSelected&&loveEmotionList[0].isSelected){ if (!loveEmotionList[position].isSelected&&loveEmotionList[0].isSelected){
loveEmotionList[0].isSelected = false loveEmotionList[0].isSelected = false
mAllFilter.categoryId2List.remove(loveEmotionList[0].cate_id) mAllFilter.categoryId2List.remove(loveEmotionList[0].cate_id)
signList.remove("恋爱情感")
} }
loveEmotionList[position].isSelected = !loveEmotionList[position].isSelected loveEmotionList[position].isSelected = !loveEmotionList[position].isSelected
if (loveEmotionList[position].isSelected){ if (loveEmotionList[position].isSelected){
...@@ -292,6 +296,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -292,6 +296,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!marriedFamilyList[position].isSelected&&marriedFamilyList[0].isSelected){ if (!marriedFamilyList[position].isSelected&&marriedFamilyList[0].isSelected){
marriedFamilyList[0].isSelected = false marriedFamilyList[0].isSelected = false
mAllFilter.categoryId2List.remove(marriedFamilyList[0].cate_id) mAllFilter.categoryId2List.remove(marriedFamilyList[0].cate_id)
signList.remove("婚姻家庭")
} }
marriedFamilyList[position].isSelected = !marriedFamilyList[position].isSelected marriedFamilyList[position].isSelected = !marriedFamilyList[position].isSelected
if (marriedFamilyList[position].isSelected){ if (marriedFamilyList[position].isSelected){
...@@ -336,6 +341,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -336,6 +341,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!personalGrowthList[position].isSelected&&personalGrowthList[0].isSelected){ if (!personalGrowthList[position].isSelected&&personalGrowthList[0].isSelected){
personalGrowthList[0].isSelected = false personalGrowthList[0].isSelected = false
mAllFilter.categoryId2List.remove(childList[0].cate_id) mAllFilter.categoryId2List.remove(childList[0].cate_id)
signList.remove("个人成长")
} }
personalGrowthList[position].isSelected = !personalGrowthList[position].isSelected personalGrowthList[position].isSelected = !personalGrowthList[position].isSelected
if (personalGrowthList[position].isSelected){ if (personalGrowthList[position].isSelected){
...@@ -380,6 +386,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -380,6 +386,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if (!interpersonalRelationshipList[position].isSelected&&interpersonalRelationshipList[0].isSelected){ if (!interpersonalRelationshipList[position].isSelected&&interpersonalRelationshipList[0].isSelected){
interpersonalRelationshipList[0].isSelected = false interpersonalRelationshipList[0].isSelected = false
mAllFilter.categoryId2List.remove(interpersonalRelationshipList[0].cate_id) mAllFilter.categoryId2List.remove(interpersonalRelationshipList[0].cate_id)
signList.remove("人际关系")
} }
interpersonalRelationshipList[position].isSelected = !interpersonalRelationshipList[position].isSelected interpersonalRelationshipList[position].isSelected = !interpersonalRelationshipList[position].isSelected
if (interpersonalRelationshipList[position].isSelected){ if (interpersonalRelationshipList[position].isSelected){
...@@ -423,6 +430,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -423,6 +430,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
}else{ }else{
if (!careerDevelopmentList[position].isSelected&&careerDevelopmentList[0].isSelected){ if (!careerDevelopmentList[position].isSelected&&careerDevelopmentList[0].isSelected){
careerDevelopmentList[0].isSelected = false careerDevelopmentList[0].isSelected = false
mAllFilter.categoryId2List.remove(careerDevelopmentList[0].cate_id)
signList.remove("职场发展")
} }
careerDevelopmentList[position].isSelected = !careerDevelopmentList[position].isSelected careerDevelopmentList[position].isSelected = !careerDevelopmentList[position].isSelected
if (careerDevelopmentList[position].isSelected){ if (careerDevelopmentList[position].isSelected){
...@@ -466,6 +475,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi ...@@ -466,6 +475,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
}else{ }else{
if (!mentalHealthList[position].isSelected&&mentalHealthList[0].isSelected){ if (!mentalHealthList[position].isSelected&&mentalHealthList[0].isSelected){
mentalHealthList[0].isSelected = false mentalHealthList[0].isSelected = false
mAllFilter.categoryId2List.remove(mentalHealthList[0].cate_id)
signList.remove("心理健康")
} }
mentalHealthList[position].isSelected = !mentalHealthList[position].isSelected mentalHealthList[position].isSelected = !mentalHealthList[position].isSelected
if (mentalHealthList[position].isSelected){ if (mentalHealthList[position].isSelected){
......
...@@ -243,13 +243,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -243,13 +243,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
biEventParams = tempFilter.doctorEdu.map { it.value }.joinToString(",") biEventParams = tempFilter.doctorEdu.map { it.value }.joinToString(",")
} }
} }
// 擅长人群拼接
if (tempFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(tempFilter.specialityCrowd.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_GOOD_AT_CLICK==biEventName){
biEventParams = tempFilter.specialityCrowd.map { it.key }.joinToString(",")
}
}
if (tempFilter.others.isNotEmpty()) { if (tempFilter.others.isNotEmpty()) {
sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(",")) sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) { if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) {
...@@ -461,7 +454,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -461,7 +454,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
updateCount(ConsultBIConstants.POSITION_GOOD_AT_CLICK)
} }
if (index>19){ if (index>19){
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<stroke
android:width="0.5dp"
android:color="@color/platform_color_EBEBEB" />
<solid android:color="#f9f9f9" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:src="http://schemas.android.com/tools"
android:paddingTop="12dp"
android:paddingBottom="12dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:src="@drawable/consultant_icon_input_search"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="@+id/tv_search_words"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
src:text="李哈哈"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/platform_color_242424"
android:layout_marginStart="38dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/platform_white" android:background="@color/platform_white"
android:orientation="vertical" android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
...@@ -81,6 +82,65 @@ ...@@ -81,6 +82,65 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="6dp" android:layout_height="6dp"
android:background="@drawable/consult_fillter_bg" /> android:background="@drawable/consult_fillter_bg" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_search_words"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="19dp"
android:paddingEnd="19dp"
android:visibility="gone"
>
<TextView
android:id="@+id/tv_search_related_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textSize="15sp"
android:fontFamily="sans-serif"
android:layout_marginTop="14dp"
android:includeFontPadding="false"
tools:text="根据匹配,为您推荐恋爱情感相关词" />
<TextView
android:id="@+id/tv_search_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_search_word"
app:layout_constraintBottom_toBottomOf="@id/tv_search_word"
android:textSize="15sp"
android:textColor="@color/platform_color_666666"
android:fontFamily="sans-serif"
android:includeFontPadding="false"
android:text="仍搜索" />
<TextView
android:id="@+id/tv_search_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/tv_search_tips"
app:layout_constraintTop_toBottomOf="@id/tv_search_related_word"
android:layout_marginTop="9dp"
android:layout_marginStart="6dp"
android:textSize="14sp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:textColor="@color/platform_color_242424"
android:includeFontPadding="false"
android:background="@drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4"
tools:text="恋爱情感"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:background="@color/platform_color_EBEBEB" />-->
</LinearLayout> </LinearLayout>
......
...@@ -23,7 +23,6 @@ import com.ydl.ydlcommon.base.config.HttpConfig ...@@ -23,7 +23,6 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
......
...@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log; ...@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import com.ydl.ydlnet.utils.CharacterHandler; import com.ydl.ydlnet.utils.CharacterHandler;
import com.ydl.ydlnet.utils.NetLogUtils; import com.ydl.ydlnet.utils.NetLogUtils;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.Request; import okhttp3.Request;
...@@ -48,17 +51,17 @@ public class DefaultFormatPrinter { ...@@ -48,17 +51,17 @@ public class DefaultFormatPrinter {
* @param request * @param request
* @param bodyString * @param bodyString
*/ */
public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) { public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) {
final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString; final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(true); final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){ // if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE); NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false); logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true); logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true); logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} // }
} }
...@@ -67,16 +70,16 @@ public class DefaultFormatPrinter { ...@@ -67,16 +70,16 @@ public class DefaultFormatPrinter {
* *
* @param request * @param request
*/ */
public void printFileRequest(@NonNull Request request) { public void printFileRequest(@NonNull Request request) {
final String tag = getTag(true); final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){ // if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE); NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false); logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true); logLines(tag, getRequest(request), true);
logLines(tag, OMITTED_REQUEST, true); logLines(tag, OMITTED_REQUEST, true);
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} // }
} }
...@@ -93,7 +96,7 @@ public class DefaultFormatPrinter { ...@@ -93,7 +96,7 @@ public class DefaultFormatPrinter {
* @param message 响应信息 * @param message 响应信息
* @param responseUrl 请求地址 * @param responseUrl 请求地址
*/ */
public void printJsonResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers, @Nullable MediaType contentType, public void printJsonResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers, @Nullable MediaType contentType,
@Nullable String bodyString, @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) { @Nullable String bodyString, @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
bodyString = RequestLogInterceptor.isJson(contentType) ? CharacterHandler.jsonFormat(bodyString) bodyString = RequestLogInterceptor.isJson(contentType) ? CharacterHandler.jsonFormat(bodyString)
...@@ -102,13 +105,13 @@ public class DefaultFormatPrinter { ...@@ -102,13 +105,13 @@ public class DefaultFormatPrinter {
final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString; final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(false); final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N}; final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){ // if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE); NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true); logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true); logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, responseBody.split(LINE_SEPARATOR), true); logLines(tag, responseBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} // }
} }
/** /**
...@@ -122,18 +125,18 @@ public class DefaultFormatPrinter { ...@@ -122,18 +125,18 @@ public class DefaultFormatPrinter {
* @param message 响应信息 * @param message 响应信息
* @param responseUrl 请求地址 * @param responseUrl 请求地址
*/ */
public void printFileResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers, public void printFileResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers,
@NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) { @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
final String tag = getTag(false); final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N}; final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){ // if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE); NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true); logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true); logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, OMITTED_RESPONSE, true); logLines(tag, OMITTED_RESPONSE, true);
NetLogUtils.debugInfo(tag, END_LINE); NetLogUtils.debugInfo(tag, END_LINE);
} // }
} }
/** /**
...@@ -157,7 +160,7 @@ public class DefaultFormatPrinter { ...@@ -157,7 +160,7 @@ public class DefaultFormatPrinter {
} }
private static ThreadLocal<Integer> last = new ThreadLocal<Integer>() { private static ThreadLocal<Integer> last = new ThreadLocal<Integer>() {
protected Integer initialValue() { protected Integer initialValue() {
return 0; return 0;
} }
......
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