Commit e251af6b by 刘鹏

Merge branch 'feature/yk_release' into 'd/v4.4.04'

Feature/yk release

See merge request app_android_lib/YDL-Component!261
parents 423d0747 68e140bb
......@@ -164,7 +164,7 @@ ext {
"systembartint" : "com.readystatesoftware.systembartint:systembartint:1.0.3",
"cube" : "in.srain.cube:cube-sdk:1.0.44@aar",
"support-multidex" : 'androidx.multidex:multidex:2.0.0',
"ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.33",
"ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.35",
"walle" : "com.meituan.android.walle:library:1.1.5",
"jpush" : "cn.jiguang.sdk:jpush:3.3.6",
"jcore" : "cn.jiguang.sdk:jcore:2.1.4",
......
......@@ -308,9 +308,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed) {
startTime = System.currentTimeMillis()
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
if (startTime != 0L) {
endTime = System.currentTimeMillis()
ActionCountUtils.count(
......
......@@ -52,6 +52,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
private val bannerList = ArrayList<String>()
private var lenovoResultSuccess = false // 联想结果 联想前false 联想成功后true
companion object {
private const val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private const val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
......@@ -111,7 +113,14 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
// 搜索的关联词
var relatedWords = ""
var isRecommendWords = false
if (searchSuggestList.isNotEmpty() && searchSuggestList.size > 0) {
if (!lenovoResultSuccess){ // 如果每次输入内容后联想词结果还没返回结果则直接进行搜索
if (etSearch.text.toString().isNullOrEmpty()) {
doSearch(etSearch.hint.toString(), relatedWords, isRecommendWords)
} else {
doSearch(etSearch.text.toString(), relatedWords, isRecommendWords)
}
}else if (searchSuggestList.isNotEmpty() && searchSuggestList.size > 0) {
if (searchSuggestList[0].suggest_relations.size > 0) {
relatedWords = searchSuggestList[0].suggest_relations[0]
isRecommendWords = true
......@@ -120,7 +129,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
relatedWords = searchSuggestList[0].suggest_content
}
if (searchSuggestList?.get(0)?.suggest_types?.contains(JUMP_WORD)) {
if (searchSuggestList[0].suggest_types.contains(JUMP_WORD)) {
NewH5Activity.start(this, H5Params(searchSuggestList[0].jump_url!!, null))
} else {
if (etSearch.text.toString().isNullOrEmpty()) {
......@@ -231,6 +240,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
*/
private fun getSearchWords(searchContent: String, isClickWords: Boolean) {
if (!TextUtils.isEmpty(searchContent)) {
lenovoResultSuccess = false
mSearchContent = searchContent
val map = HashMap<String, Any>()
map["content"] = searchContent
......@@ -245,6 +255,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
searchContent: String,
isClickWords: Boolean
) {
lenovoResultSuccess = true
if (isClickWords) {
//判断 suggest_classify_types 有值则通过 jump_url跳转
// 搜索的关联词
......
......@@ -40,8 +40,9 @@ class ConsultAssistantDialogUtils private constructor() {
var consultAssistantDialogFromHomePage: ConsultAssistantDialog? = null // 首页展示的dialog
var consultAssistantDialogFromMine: ConsultAssistantDialog? = null // 我的展示的dialog
var consultAssistantFragmentDialog: ConsultAssistantDialog? = null //咨询师列表fragment页面展示的dialog
var expertSearchPageHasShown: Boolean = false // 专家咨询列表fragment页面是否已经展示
var consultAssistantActivityDialog: ConsultAssistantDialog? = null //咨询师列表activity页面展示的dialog
var expertSearchPageHasShown: Boolean = false // 专家咨询列表fragment页面是否已经展示
var confideListDialog: ConsultAssistantDialog? = null //倾诉列表activity页面展示的dialog
var expertSearchActivityPageHasShown: Boolean = false // 专家咨询列表activity页面是否已经展示
......@@ -86,22 +87,20 @@ class ConsultAssistantDialogUtils private constructor() {
origin: String,
fromActivity: Boolean = false
) {
// 请求接口判断导医咨询助理按钮是否展示
SearchApi.getSearchApi().getConsultAssistantRequest(origin)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
if (it.data) {
if (origin == "home_index") {
showFromYdlHome(activity)
} else if (origin == "doctor_list") {
show(activity, origin, fromActivity)
} else if (origin == "mine_index") {
showFromMine(activity)
}
}
consultAssistantDialogFromHomePage?.dismiss()
consultAssistantFragmentDialog?.dismiss()
consultAssistantDialogFromMine?.dismiss()
when (origin) {
"home_index" -> {
showFromYdlHome(activity)
}
"doctor_list" -> {
show(activity, origin, fromActivity)
}
"mine_index" -> {
showFromMine(activity)
}
}
}
////////////////////////////////////// 首页的展示隐藏逻辑 代码块start ///////////////////////////////////////////////////
......@@ -109,7 +108,7 @@ class ConsultAssistantDialogUtils private constructor() {
/**
* 首页页展示
*/
fun showFromYdlHome(activity: Activity) {
private fun showFromYdlHome(activity: Activity) {
if (!activity.isFinishing) {
if (consultAssistantDialogFromHomePage == null) {
consultAssistantDialogFromHomePage = ConsultAssistantDialog(
......@@ -268,7 +267,7 @@ class ConsultAssistantDialogUtils private constructor() {
/**
* 咨询师列表页展示浮层
*/
fun showDialog(origin: String, activity: Activity, fromActivity: Boolean = false) {
private fun showDialog(origin: String, activity: Activity, fromActivity: Boolean = false) {
if (!fromActivity) {
if (!activity.isFinishing) {
if (consultAssistantFragmentDialog == null) {
......
......@@ -491,9 +491,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed) {
startTime=System.currentTimeMillis()
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
if (startTime!=0L){
endTime=System.currentTimeMillis()
ActionCountUtils.count(HomeBIConstants.YDL_HOME_DWELL_TIME,(endTime-startTime).toString())
......@@ -506,11 +504,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
}
private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(mActivity)
}
private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener {
......@@ -558,7 +551,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit","1")
showConsultAssistantDialog()
video_view?.setOnInfoListener { mp, what, extra ->
if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START){
......
......@@ -158,7 +158,6 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
endTime = System.currentTimeMillis()
count(UserMyPageEvent.YDL_USER_MY_PAGE_STAY_VISIT, (endTime - startTime).toString())
}
hideConsultAssistantDialog()
}
if (isVisibleToUser && isResumed) {
onResume()
......@@ -175,13 +174,6 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
private fun showConsultAssistantDialog() {
count("daoyi_advertisement_page|daoyi_advertisement_visit", "4")
mActivity?.let { provide(IConsultantService::class.java).showConsultAssistantMineDialog(it) }
}
private fun hideConsultAssistantDialog() {
provide(
IConsultantService::class.java
).hideConsultAssistantMineDialog()
}
/**
......
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