Commit 71345a37 by 徐健

首页数据加载问题修复

parent a31b3dac
......@@ -76,6 +76,11 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/
private var scrollListner: HomeConfideRecyleSuspendListener? = null
/**
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/
private var isFromCreate: Boolean = true
override fun layoutResId(): Int {
return R.layout.home_fragment_home_module
}
......@@ -402,9 +407,14 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
super.onResume()
if (userVisibleHint) {
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
if (isFromCreate) {
isFromCreate = false
mPresenter?.loadHomeData()
}else {
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
}
mPresenter?.prepareCoupon(activity)
//走咨询助理浮层展示逻辑,是否展示由内部条件与接口判断
......
......@@ -86,6 +86,11 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private var searchContent: String = "搜索话题、咨询师姓名"
/**
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/
private var isFromCreate: Boolean = true
override fun layoutResId(): Int {
return R.layout.home_fragment
}
......@@ -420,8 +425,14 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
super.onResume()
if (userVisibleHint) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
if (isFromCreate) {
isFromCreate = false
mPresenter?.loadHomeData()
}else {
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
}
showConsultAssistantDialog()
}
......
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