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