Commit 4297cd9a by YKai

feat: 首页导医入口叠加,不显示问题修复

parent 6eeadfb6
...@@ -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(
......
...@@ -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,22 +87,20 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -86,22 +87,20 @@ 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 { showFromYdlHome(activity)
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)
}
}
} }
"doctor_list" -> {
show(activity, origin, fromActivity)
}
"mine_index" -> {
showFromMine(activity)
}
}
} }
////////////////////////////////////// 首页的展示隐藏逻辑 代码块start /////////////////////////////////////////////////// ////////////////////////////////////// 首页的展示隐藏逻辑 代码块start ///////////////////////////////////////////////////
...@@ -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