Commit 4297cd9a by YKai

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

parent 6eeadfb6
......@@ -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(
......
......@@ -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