Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
9c71c8be
Commit
9c71c8be
authored
Dec 20, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复快速切换首页和其他页面导致得首页数据加载异常问题
parent
79079b9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
119 additions
and
110 deletions
+119
-110
DemoAppLifecycles.java
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
+0
-1
config.gradle
config.gradle
+2
-2
ExpertSearchBigShotBean.java
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchBigShotBean.java
+5
-5
ExpertSearchRecommandBean.java
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchRecommandBean.java
+5
-5
ExpertSearchTopShowBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTopShowBean.kt
+1
-1
RecommendListView.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
+1
-1
home_data.json
m-home/src/main/assets/home_data.json
+0
-0
IHomeBaseContract.kt
m-home/src/main/java/com/yidianling/home/constants/IHomeBaseContract.kt
+1
-1
BaseHomePresenterImpl.kt
m-home/src/main/java/com/yidianling/home/presenter/BaseHomePresenterImpl.kt
+8
-5
HomePresenterImpl.kt
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+2
-2
HomeConsultItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+1
-1
HomeConfideRecyleSuspendListener.kt
m-home/src/ydl/java/com/yidianling/home/listener/HomeConfideRecyleSuspendListener.kt
+77
-75
HomePresenterImpl.kt
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+5
-2
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+7
-5
HomeConsultItemView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+4
-4
No files found.
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
View file @
9c71c8be
...
...
@@ -15,7 +15,6 @@ import com.umeng.analytics.MobclickAgent;
import
com.umeng.commonsdk.UMConfigure
;
import
com.umeng.socialize.PlatformConfig
;
import
com.umeng.socialize.UMShareAPI
;
import
com.ydl.audioim.YDLavManager
;
import
com.ydl.component.BuildConfig
;
import
com.ydl.component.MainActivity
;
import
com.ydl.media.audio.PlayService
;
...
...
config.gradle
View file @
9c71c8be
...
...
@@ -44,10 +44,10 @@ ext {
//第三步 若干
"m-confide"
:
"0.0.41.1"
,
"m-consultant"
:
"0.0.51.
1
"
,
"m-consultant"
:
"0.0.51.
3
"
,
"m-fm"
:
"0.0.23.3"
,
"m-user"
:
"0.0.40.3"
,
"m-home"
:
"0.0.6.
6
"
,
"m-home"
:
"0.0.6.
18
"
,
"m-muse"
:
"0.0.20.3"
,
"m-tests"
:
"0.0.15.2"
,
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchBigShotBean.java
View file @
9c71c8be
...
...
@@ -151,7 +151,7 @@ public class ExpertSearchBigShotBean {
private
int
id
;
private
int
parentId
;
private
int
i
am
geType
;
private
int
i
ma
geType
;
private
int
isShow
;
private
String
createTime
;
private
String
updateTime
;
...
...
@@ -174,12 +174,12 @@ public class ExpertSearchBigShotBean {
this
.
parentId
=
parentId
;
}
public
int
getI
am
geType
()
{
return
i
am
geType
;
public
int
getI
ma
geType
()
{
return
i
ma
geType
;
}
public
void
setI
am
geType
(
int
iamgeType
)
{
this
.
i
am
geType
=
iamgeType
;
public
void
setI
ma
geType
(
int
iamgeType
)
{
this
.
i
ma
geType
=
iamgeType
;
}
public
int
getIsShow
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchRecommandBean.java
View file @
9c71c8be
...
...
@@ -152,7 +152,7 @@ public class ExpertSearchRecommandBean {
private
int
id
;
private
int
parentId
;
private
int
i
am
geType
;
private
int
i
ma
geType
;
private
int
isShow
;
private
String
createTime
;
private
String
updateTime
;
...
...
@@ -175,12 +175,12 @@ public class ExpertSearchRecommandBean {
this
.
parentId
=
parentId
;
}
public
int
getI
am
geType
()
{
return
i
am
geType
;
public
int
getI
ma
geType
()
{
return
i
ma
geType
;
}
public
void
setI
am
geType
(
int
iamgeType
)
{
this
.
i
am
geType
=
iamgeType
;
public
void
setI
ma
geType
(
int
iamgeType
)
{
this
.
i
ma
geType
=
iamgeType
;
}
public
int
getIsShow
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/bean/ExpertSearchTopShowBean.kt
View file @
9c71c8be
...
...
@@ -3,5 +3,5 @@ package com.yidianling.consultant.bean
class
ExpertSearchTopShowBean
(
var
doctorSpecialTopics
:
ArrayList
<
ExpertSearchBigShotBean
>,
var
sceneSpecialTopic
:
ArrayList
<
ExpertSearchRecommandBean
>
var
sceneSpecialTopic
s
:
ArrayList
<
ExpertSearchRecommandBean
>
)
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
View file @
9c71c8be
...
...
@@ -79,7 +79,7 @@ class RecommendListView : LinearLayout {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
if
(
null
!=
mContext
)
{
mSceneSpecialTopicList
.
addAll
(
it
.
sceneSpecialTopic
)
mSceneSpecialTopicList
.
addAll
(
it
.
sceneSpecialTopic
s
)
mDoctorSpecialTopicsList
.
addAll
(
it
.
doctorSpecialTopics
)
setData
()
}
...
...
m-home/src/main/assets/home_data.json
View file @
9c71c8be
This diff is collapsed.
Click to expand it.
m-home/src/main/java/com/yidianling/home/constants/IHomeBaseContract.kt
View file @
9c71c8be
...
...
@@ -105,7 +105,7 @@ class IHomeBaseContract {
/**
*获取咨询列表
*/
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
,
isCancelHome
:
Boolean
=
true
)
/**
* 首页问答 - 点赞
...
...
m-home/src/main/java/com/yidianling/home/presenter/BaseHomePresenterImpl.kt
View file @
9c71c8be
...
...
@@ -58,9 +58,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
//首页缓存版本号
var
HOME_PAGER_DATA_CACHE_VERISON
=
"HOME_PAGER_DATA_CACHE_VERISON"
private
var
mConsultDisposable
:
Disposable
?
=
null
private
var
mConfideDisposable
:
Disposable
?
=
null
private
var
mHomeDisposable
:
Disposable
?
=
null
var
mConsultDisposable
:
Disposable
?
=
null
var
mConfideDisposable
:
Disposable
?
=
null
var
mHomeDisposable
:
Disposable
?
=
null
var
mConfideType
:
String
=
""
var
mConsultType
:
String
=
""
...
...
@@ -151,10 +151,13 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
/**
*获取咨询列表
*/
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
{
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
,
isCancelHome
:
Boolean
)
{
disposeConsult
()
disposeHome
()
if
(
isCancelHome
)
{
disposeHome
()
}
mConsultType
=
type
...
...
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
9c71c8be
...
...
@@ -161,7 +161,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
disposeHome
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
Observable
.
mergeArray
(
mHomeDisposable
=
Observable
.
mergeArray
(
mModel
.
headerRequest
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
map
{
it
->
...
...
@@ -183,7 +183,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
//咨询分类和缓存分类不一致,重新加载咨询列表数据
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
)
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
,
false
)
}
}
// homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW))
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
9c71c8be
...
...
@@ -61,7 +61,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置红包、原价
setPrice
(
bean
)
this
.
setOnClickListener
{
val
url
=
URLUtils
.
appendParmas
(
bean
.
h
Url
,
"cateId"
,
cateId
)
val
url
=
URLUtils
.
appendParmas
(
bean
.
link
Url
,
"cateId"
,
cateId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/listener/HomeConfideRecyleSuspendListener.kt
View file @
9c71c8be
This diff is collapsed.
Click to expand it.
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
9c71c8be
...
...
@@ -20,6 +20,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Action
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
import
java.util.*
import
java.util.concurrent.TimeUnit
/**
...
...
@@ -42,7 +44,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
disposeHome
()
val
homeList
:
MutableList
<
HomePagerDataBean
>
=
mutableListOf
()
LogUtil
.
d
(
"mConsultType-loadHomeData:$mConsultType"
)
Observable
.
mergeArray
(
mHomeDisposable
=
Observable
.
mergeArray
(
mModel
.
headerRequest
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
it
->
//首页头部数据 分类 & Banner
...
...
@@ -57,7 +59,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
if
(
it
.
consultCategoryData
!=
null
&&
it
.
consultCategoryData
!!
.
isNotEmpty
())
{
//咨询分类和缓存分类不一致,重新加载咨询列表数据
if
(
it
.
consultCategoryData
!!
[
0
].
id
.
toString
()
!=
mConsultType
)
{
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
)
getConsultData
(
"${it.consultCategoryData!![0].id}"
,
0
,
false
)
}
}
homeList
.
add
(
HomePagerDataBean
(
YdlHomeViewHolderConstract
.
BUTTON_BANNER_VIEW
))
...
...
@@ -130,6 +132,7 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
.
subscribe
(
Consumer
{},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
mView
.
homeDataFail
(
msg
)
mHomeDisposable
?.
dispose
()
}
},
Action
{
homeList
.
sortWith
(
compareBy
{
it
.
type
})
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
9c71c8be
...
...
@@ -66,6 +66,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* tablayou上次选中的tab下标
*/
private
var
confideLastSelectPosition
=
0
private
var
confideLastSelectType
=
""
/**
* TabLayout.OnTabSelectedListener
*/
...
...
@@ -75,6 +76,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* 咨询tablayout上次选中的下标
*/
private
var
consultLastSelectPosition
=
0
private
var
consultLastSelectType
=
""
/**
* 悬浮tablayout监听事件
*/
...
...
@@ -207,7 +209,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/
override
fun
getConfideData
(
type
:
String
,
selectPosition
:
Int
)
{
confideLastSelectPosition
=
selectPosition
// tab_layout.getTabAt(confideLastSelectPosition)!!.select()
confideLastSelectType
=
type
mPresenter
?.
getConfideData
(
type
,
selectPosition
)
}
...
...
@@ -216,7 +218,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/
override
fun
getConsultData
(
type
:
String
,
selectPosition
:
Int
)
{
consultLastSelectPosition
=
selectPosition
// tab_consultLayout.getTabAt(consultLastSelectPosition)
consultLastSelectType
=
type
mPresenter
?.
getConsultData
(
type
,
selectPosition
)
}
...
...
@@ -296,10 +298,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
if
(
bean
.
type
==
YdlHomeViewHolderConstract
.
PAGER_BANNER_VIEW
)
{
initTabLayout
(
bean
.
headerBean
!!
.
listenCategoryDate
)
initConsultTabLayout
(
bean
.
headerBean
!!
.
consultCategoryData
)
consultLastSelectType
=
bean
.
headerBean
!!
.
consultCategoryData
!!
[
0
].
id
.
toString
()
}
}
//每次全局更新后重置下标位
consultLastSelectPosition
=
0
}
/**
...
...
@@ -419,7 +420,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
super
.
onResume
()
if
(
userVisibleHint
)
{
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_USER_MAIN_PAGE_VISIT
)
mPresenter
?.
loadHomeData
()
mPresenter
?.
getConsultData
(
consultLastSelectType
,
consultLastSelectPosition
)
mPresenter
?.
getConfideData
(
confideLastSelectType
,
confideLastSelectPosition
)
showConsultAssistantDialog
()
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
9c71c8be
...
...
@@ -46,7 +46,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置头像
setHead
(
bean
)
//设置名称
tv_consult_name
.
text
=
bean
.
doctorN
ame
tv_consult_name
.
text
=
bean
.
n
ame
//咨询师标签
tag_view
.
initData
(
StringUtils
.
strToList
(
bean
.
tags
))
//设置向TA倾诉人数
...
...
@@ -58,7 +58,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置红包、原价
setPrice
(
bean
)
this
.
setOnClickListener
{
val
url
=
URLUtils
.
appendParmas
(
bean
.
h
Url
,
"cateId"
,
cateId
)
val
url
=
URLUtils
.
appendParmas
(
bean
.
link
Url
,
"cateId"
,
cateId
)
homeEvent
!!
.
consultItemClick
(
url
,
bean
.
doctorId
)
}
}
...
...
@@ -71,7 +71,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
op
.
errorPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
loadingPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
transform
=
0
YDLImageCacheManager
.
showImage
(
mContext
,
bean
.
doctorH
ead
,
img_consult_head
,
op
)
YDLImageCacheManager
.
showImage
(
mContext
,
bean
.
h
ead
,
img_consult_head
,
op
)
}
/**
...
...
@@ -118,7 +118,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
private
fun
setPrice
(
bodyBean
:
HomeConsultBean
.
ListBean
)
{
val
confideFee
=
bodyBean
.
serviceFe
e
val
confideFee
=
bodyBean
.
minBookingPric
e
val
sb
=
StringBuffer
()
tv_price
.
text
=
sb
.
append
(
"¥"
).
append
(
confideFee
).
toString
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment