Commit cc3b6d32 by upwork.021

feat: 主题弹窗优化,ui验收优化,bug修复

parent 2e5b358b
...@@ -6,7 +6,7 @@ ext { ...@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.72", "m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.45", "m-consultant" : "0.0.60.56",
"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.80", "m-home" : "0.0.23.80",
...@@ -92,7 +92,7 @@ ext { ...@@ -92,7 +92,7 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.72", "m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.44", "m-consultant" : "0.0.60.56",
"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.41", "m-home" : "0.0.23.41",
......
...@@ -98,14 +98,24 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -98,14 +98,24 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
if (actionId == EditorInfo.IME_ACTION_SEARCH) { if (actionId == EditorInfo.IME_ACTION_SEARCH) {
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false
if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){ if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){
searchSuggestList[0].suggest_relations?.let { if (searchSuggestList[0].suggest_relations.size>0){
if (it.size>0){ relatedWords = searchSuggestList[0].suggest_relations[0]
relatedWords = it[0] isRecommendWords = true
} }
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchSuggestList[0].suggest_content)){
relatedWords = searchSuggestList[0].suggest_content
}
doSearch(etSearch.text.toString(),relatedWords,isRecommendWords)
}else{
val searchWords = etSearch.text.toString()
if (TextUtils.isEmpty(searchWords)){
doSearch(searchWords,"",isRecommendWords)
}else{
getSearchWords(etSearch.text.toString(),true)
} }
} }
doSearch(etSearch.text.toString(),relatedWords)
} }
true true
} }
...@@ -138,12 +148,20 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -138,12 +148,20 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
searchWordsAdapter.setOnItemClickListener { adapter, view, position -> searchWordsAdapter.setOnItemClickListener { adapter, view, position ->
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false
if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){ if (searchSuggestList.isNotEmpty()&&searchSuggestList.size>0){
searchSuggestList[position].suggest_relations?.let { if (searchSuggestList[position].suggest_relations.size>0){
relatedWords = it[0] relatedWords = searchSuggestList[position].suggest_relations[0]
isRecommendWords = true
}
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchSuggestList[position].suggest_content)){
relatedWords = searchSuggestList[position].suggest_content
} }
} }
doSearch(searchSuggestList[position].suggest_content,relatedWords) doSearch(searchSuggestList[position].suggest_content,relatedWords,isRecommendWords)
// 埋点
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_CLICK,etSearch.text.toString(),searchSuggestList[position].suggest_content,"app")
} }
etSearch.addTextChangedListener(object : TextWatcher { etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) { override fun afterTextChanged(s: Editable?) {
...@@ -167,6 +185,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -167,6 +185,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}) })
} }
/** /**
* 获取搜索联想词 * 获取搜索联想词
* @param isClickWords 是否是点击历史搜索、热门搜索等进行搜索 * @param isClickWords 是否是点击历史搜索、热门搜索等进行搜索
...@@ -186,20 +205,27 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -186,20 +205,27 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
if (isClickWords){ if (isClickWords){
// 搜索的关联词 // 搜索的关联词
var relatedWords = "" var relatedWords = ""
var isRecommendWords = false
if (!searchWordsBean.search_suggests.isNullOrEmpty()&&searchWordsBean.search_suggests.size>0){ if (!searchWordsBean.search_suggests.isNullOrEmpty()&&searchWordsBean.search_suggests.size>0){
searchWordsBean.search_suggests[0].suggest_relations?.let { if (searchWordsBean.search_suggests[0].suggest_relations.size>0){
if (it.size>0){ relatedWords = searchWordsBean.search_suggests[0].suggest_relations[0]
relatedWords = it[0] isRecommendWords = true
} }
if (TextUtils.isEmpty(relatedWords)&&!TextUtils.isEmpty(searchWordsBean.search_suggests[0].suggest_content)){
relatedWords = searchWordsBean.search_suggests[0].suggest_content
} }
} }
doSearch(searchContent,relatedWords) doSearch(searchContent,relatedWords,isRecommendWords)
}else{ }else{
searchSuggestList.clear() searchSuggestList.clear()
if (!searchWordsBean.search_suggests.isNullOrEmpty()){ if (!searchWordsBean.search_suggests.isNullOrEmpty()){
rv_search_words.visibility = View.VISIBLE rv_search_words.visibility = View.VISIBLE
searchSuggestList.addAll(searchWordsBean.search_suggests) searchSuggestList.addAll(searchWordsBean.search_suggests)
searchWordsAdapter.notifyDataAndSetSearchWord(mSearchContent) searchWordsAdapter.notifyDataAndSetSearchWord(mSearchContent)
// 埋点
val sign2 = searchSuggestList.joinToString(","){it.suggest_content}
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,ConsultBIConstants.POSITION_YDL_USER_ASSOCIATE_WORD_VISIT,searchContent,sign2,"app")
}else{ }else{
rv_search_words.visibility = View.GONE rv_search_words.visibility = View.GONE
} }
...@@ -358,8 +384,9 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -358,8 +384,9 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
/** /**
* 搜索 * 搜索
* @param isRecommendWords 是否是推荐词
*/ */
private fun doSearch(searchWords:String,relatedWords:String) { private fun doSearch(searchWords:String,relatedWords:String,isRecommendWords:Boolean) {
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
...@@ -375,7 +402,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -375,7 +402,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
Gson().toJson(historyList) Gson().toJson(historyList)
) )
} }
ExpertSearchActivity.startSearch(this, searchWords,"14",relatedWords) ExpertSearchActivity.startSearch(this, searchWords,"14",relatedWords,isRecommendWords)
finish() finish()
} }
......
...@@ -29,6 +29,7 @@ import com.yidianling.consultant.constants.ConsultBIConstants ...@@ -29,6 +29,7 @@ import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.bean.ExpertServiceItem import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.modular.utils.TempH5RouteUtils import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn import com.yidianling.consultant.router.ConsultantIn
import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.* import kotlinx.android.synthetic.main.consultant_expert_search_feedbackrate.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.* import kotlinx.android.synthetic.main.consultant_expert_search_header_view.view.*
import kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.* import kotlinx.android.synthetic.main.consultant_expert_search_item_view.view.*
...@@ -71,12 +72,18 @@ class ExpertSearchAdapter( ...@@ -71,12 +72,18 @@ class ExpertSearchAdapter(
var hasMore = true var hasMore = true
var pageIndex: Int = 0 var pageIndex: Int = 0
private var clickCount=0 // 搜索结果提示标签点击次数 var clickCount=0 // 搜索结果提示标签点击次数
var mIsRecommendWords = false // 是否是推荐词
fun setEntrance(pageIndex: Int) { fun setEntrance(pageIndex: Int) {
this.pageIndex = pageIndex this.pageIndex = pageIndex
} }
fun setIsRecommendWords(isRecommend:Boolean){
mIsRecommendWords = isRecommend
}
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is HeaderViewHolder) { // 搜索结果提示头部 if (holder is HeaderViewHolder) { // 搜索结果提示头部
...@@ -87,6 +94,12 @@ class ExpertSearchAdapter( ...@@ -87,6 +94,12 @@ class ExpertSearchAdapter(
var text = "根据匹配,为您推荐“${listData[0].related_word}”相关词" var text = "根据匹配,为您推荐“${listData[0].related_word}”相关词"
holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].related_word) holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].related_word)
holder.tvSearchWord.text = listData[0].search_content holder.tvSearchWord.text = listData[0].search_content
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_word_visit",listData[0].search_content,listData[0].related_word,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_word_visit",listData[0].search_content,listData[0].related_word,"app")
}
holder.tvSearchWord.setOnClickListener { holder.tvSearchWord.setOnClickListener {
mOnClickLister.onClick(holder.tvSearchWord.text.toString()) mOnClickLister.onClick(holder.tvSearchWord.text.toString())
++clickCount ++clickCount
...@@ -95,14 +108,24 @@ class ExpertSearchAdapter( ...@@ -95,14 +108,24 @@ class ExpertSearchAdapter(
holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].search_content) holder.tvSearchRelatedWord.text = setTextBold(text,listData[0].search_content)
holder.tvSearchTips.text = "你要找的是不是" holder.tvSearchTips.text = "你要找的是不是"
holder.tvSearchWord.text = listData[0].related_word holder.tvSearchWord.text = listData[0].related_word
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_inputword_click",listData[0].related_word,listData[0].search_content,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_inputword_click",listData[0].related_word,listData[0].search_content,"app")
}
}else if (clickCount==2){ // 第二次点击搜索标签隐藏搜索匹配结果提示 }else if (clickCount==2){ // 第二次点击搜索标签隐藏搜索匹配结果提示
// 埋点
if (mIsRecommendWords){
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_map_recommendword_click",listData[0].search_content,listData[0].related_word,"app")
}else{
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_YDL_USER_MAIN_PAGE,"ydl_user_correction_recommendword_click",listData[0].search_content,listData[0].related_word,"app")
}
listData.removeAt(0) listData.removeAt(0)
clickCount = 0 // 点击两次后重置为0
} }
} }
} }
}else {
holder.clSearchWords.visibility = View.GONE
// listData.removeAt(0)
} }
} }
} else if (holder is NormalViewHolder) { } else if (holder is NormalViewHolder) {
...@@ -423,10 +446,10 @@ class ExpertSearchAdapter( ...@@ -423,10 +446,10 @@ class ExpertSearchAdapter(
override fun getItemViewType(position: Int): Int = override fun getItemViewType(position: Int): Int =
when { when {
position==0 ->{ position==0&&listData.size>0&&listData[0].is_head_view ->{
HEADER_VIEW HEADER_VIEW
} }
position>0&&position < listData.size -> { position < listData.size -> {
NORMAL_VIEW NORMAL_VIEW
} }
!hasMore && listData.size == 0 -> { !hasMore && listData.size == 0 -> {
......
...@@ -11,7 +11,7 @@ data class SearchSuggestListBean( ...@@ -11,7 +11,7 @@ data class SearchSuggestListBean(
val id:String, val id:String,
val score:String, val score:String,
val suggest_content:String, val suggest_content:String,
val suggest_relations:ArrayList<String>?, val suggest_relations:ArrayList<String>,
val search_count: Int, val search_count: Int,
val suggest_classify_types:ArrayList<String>, val suggest_classify_types:ArrayList<String>,
val mapping_classify_type_exist:Boolean val mapping_classify_type_exist:Boolean
......
...@@ -21,7 +21,10 @@ class ConsultBIConstants { ...@@ -21,7 +21,10 @@ class ConsultBIConstants {
const val POSITION_DAOYI_ADVERTISEMENT_CLICK="daoyi_advertisement_page|daoyi_advertisement_click" const val POSITION_DAOYI_ADVERTISEMENT_CLICK="daoyi_advertisement_page|daoyi_advertisement_click"
const val PART_ID_CONSULT_COUNSELOR_LIST_PAGE="consult_counselor_list_page" // 咨询师列表页面浏览part_id const val PART_ID_CONSULT_COUNSELOR_LIST_PAGE="consult_counselor_list_page" // 咨询师列表页面浏览part_id
const val PART_ID_YDL_USER_MAIN_PAGE="ydl_user_main_page" // 联想词part_id
const val POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT="consult_counselor_list_page_visit" // 咨询师列表页面浏览position const val POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT="consult_counselor_list_page_visit" // 咨询师列表页面浏览position
const val POSITION_YDL_USER_ASSOCIATE_WORD_VISIT="ydl_user_associate_word_visit" // 联想词曝光position
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
} }
//====================APP咨询列表页(app_consult_list_page)==================== //====================APP咨询列表页(app_consult_list_page)====================
...@@ -75,8 +78,7 @@ class ConsultBIConstants { ...@@ -75,8 +78,7 @@ class ConsultBIConstants {
class UserMainEvent { class UserMainEvent {
companion object { companion object {
private const val YDL_USER_MAIN_PAGE: String = private const val YDL_USER_MAIN_PAGE: String = "ydl_user_main_page|"//壹点灵用户版首页 partId
"ydl_user_main_page|"//壹点灵用户版首页 partId
const val YDL_USER_SEARCH_CLICK: String = const val YDL_USER_SEARCH_CLICK: String =
YDL_USER_MAIN_PAGE + "ydl_user_search_click" //搜索栏 YDL_USER_MAIN_PAGE + "ydl_user_search_click" //搜索栏
......
...@@ -403,7 +403,7 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -403,7 +403,7 @@ class ConsultAssistantDialogUtils private constructor() {
.getSecondTaskActivity()?.finish() .getSecondTaskActivity()?.finish()
activity.finish() activity.finish()
} else { } else {
if (null != activity && !activity.isFinishing) { if (!activity.isFinishing) {
activity.finish() activity.finish()
} }
} }
...@@ -417,10 +417,10 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -417,10 +417,10 @@ class ConsultAssistantDialogUtils private constructor() {
ffrom ffrom
) )
} }
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish() if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish() if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
} }
} }
) )
......
...@@ -4,33 +4,29 @@ import android.annotation.SuppressLint ...@@ -4,33 +4,29 @@ import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import android.os.Build
import androidx.core.content.ContextCompat
import android.text.* import android.text.*
import android.text.style.AbsoluteSizeSpan import android.text.style.AbsoluteSizeSpan
import android.util.Log import android.util.Log
import android.view.* import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.* import android.widget.*
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
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.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.consultant.R import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.listener.OnFilterConfirmListener import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.model.bean.AllFilter import com.yidianling.consultant.model.bean.AllFilter
import com.yidianling.consultant.model.bean.Filters import com.yidianling.consultant.model.bean.Filters
import com.yidianling.consultant.model.bean.PriceRangesItem import com.yidianling.consultant.model.bean.PriceRangesItem
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_item_filter.view.* import kotlinx.android.synthetic.main.consultant_item_filter.view.*
import kotlinx.android.synthetic.main.consultant_item_price_range.view.* import kotlinx.android.synthetic.main.consultant_item_price_range.view.*
import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.* import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.*
......
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