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
14134f56
Commit
14134f56
authored
Dec 20, 2019
by
严久程
Browse files
Options
Browse Files
Download
Plain Diff
动态bug修复
im模块4.0.20内容增加 basecommand字段修改
parents
ca3a5007
c0d6d99e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
134 additions
and
96 deletions
+134
-96
DemoModel.kt
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
+3
-1
DemoPresenter.kt
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
+5
-0
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
+7
-4
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
+30
-28
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
UserBIConstants.kt
m-user/src/main/java/com/yidianling/user/constants/UserBIConstants.kt
+2
-2
InputPassWordPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
+2
-5
LoginPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
+3
-4
VerificationCodePresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
+1
-1
OkHttpConfig.java
ydl-net/src/main/java/com/ydl/ydlnet/builder/config/OkHttpConfig.java
+3
-1
BaseObserver.java
ydl-net/src/main/java/com/ydl/ydlnet/client/observer/BaseObserver.java
+4
-0
ToastHelper.kt
ydl-pay/src/main/java/com/yidianling/ydl_pay/toast/ToastHelper.kt
+10
-8
YdlRepository.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
+19
-0
ThrowableConsumer.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/ThrowableConsumer.kt
+1
-1
ToastHelper.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/remind/ToastHelper.kt
+9
-11
ToastUtil.java
ydl-utils/src/main/java/com/yidianling/common/tools/ToastUtil.java
+1
-1
No files found.
app/src/main/java/com/ydl/component/mvp/DemoModel.kt
View file @
14134f56
...
...
@@ -20,7 +20,9 @@ class DemoModel : BaseModel(), DemoContract.Model {
return
YDLHttpUtils
.
obtainApi
(
DemoService
::
class
.
java
)
.
getFMData
()
.
compose
(
RxUtils
.
resultJavaData
())
.
map
{
throw
RuntimeException
(
"runtime exception"
)
}
}
override
fun
getHome
():
Observable
<
JsonObject
>
{
...
...
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
View file @
14134f56
...
...
@@ -7,6 +7,7 @@ import com.ydl.media.audio.AudioPlayer
import
com.ydl.media.audio.model.Music
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlnet.client.observer.CommonObserver
/**
...
...
@@ -21,15 +22,18 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
.
subscribe
(
object
:
CommonObserver
<
HomeFMBean
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
LogUtil
.
d
(
"RxJava loadUsers ---->: $errorMsg"
)
}
override
fun
onSuccess
(
homeFMBean
:
HomeFMBean
)
{
throw
RuntimeException
(
"runtime exception"
)
homeFMBean
.
list
?.
let
{
AudioPlayer
.
get
().
addPlayList
(
stringToMusicPlayerList
(
it
))
mView
.
setData
(
""
)
}
}
})
}
override
fun
loadHome
()
=
mModel
.
getHome
()
...
...
@@ -52,6 +56,7 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
.
compose
(
RxUtils
.
applySchedulers
(
mView
))
//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.
subscribe
(
object
:
CommonObserver
<
JsonArray
>()
{
override
fun
onError
(
errorMsg
:
String
)
{
LogUtil
.
d
(
"RxJava loadUsers ---->: $errorMsg"
)
}
override
fun
onSuccess
(
users
:
JsonArray
)
{
...
...
config.gradle
View file @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
This diff is collapsed.
Click to expand it.
m-home/src/main/java/com/yidianling/home/constants/IHomeBaseContract.kt
View file @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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
()
if
(
isCancelHome
)
{
disposeHome
()
}
mConsultType
=
type
...
...
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -9,11 +9,11 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.LinearLayout
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.home.adapter.YdlHomeAdapter
import
com.yidianling.home.constract.IHomeContract
import
com.yidianling.home.constract.YdlHomeViewHolderConstract
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
/**
* @author yuanwai
...
...
@@ -24,7 +24,7 @@ import com.yidianling.common.tools.RxImageTool
*/
class
HomeConfideRecyleSuspendListener
:
RecyclerView
.
OnScrollListener
()
{
private
var
mContext
:
Context
?
=
null
private
var
mContext
:
Context
?
=
null
private
var
mCurrentPosition
=
0
...
...
@@ -32,25 +32,25 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
//倾诉筛选layout
private
var
confideFilterView
:
LinearLayout
?
=
null
//咨询筛选layout
private
var
consultFilterView
:
LinearLayout
?
=
null
private
var
consultFilterView
:
LinearLayout
?
=
null
//首页界面View接口
private
var
mHomeView
:
IHomeContract
.
View
?
=
null
private
var
mHomeView
:
IHomeContract
.
View
?
=
null
private
var
adapter
:
YdlHomeAdapter
?
=
null
private
var
mPhoneCallView
:
ImageView
?
=
null
private
var
mPhoneCallView
:
ImageView
?
=
null
//是否执行收缩动画
private
var
excuteStartAnim
:
Boolean
=
true
private
var
excuteStartAnim
:
Boolean
=
true
//是否执行展开动画
private
var
excuteEndAnim
:
Boolean
=
true
private
var
excuteEndAnim
:
Boolean
=
true
private
var
dp5
:
Int
=
0
private
var
dp14
:
Int
=
0
private
var
dp15
:
Int
=
0
private
var
dp34
:
Int
=
0
private
var
cvWidth
:
Int
=
0
private
var
maxCVWidth
:
Int
=
0
private
var
minCVWidth
:
Int
=
0
private
var
dp5
:
Int
=
0
private
var
dp14
:
Int
=
0
private
var
dp15
:
Int
=
0
private
var
dp34
:
Int
=
0
private
var
cvWidth
:
Int
=
0
private
var
maxCVWidth
:
Int
=
0
private
var
minCVWidth
:
Int
=
0
init
{
dp5
=
RxImageTool
.
dip2px
(
5f
)
...
...
@@ -59,14 +59,14 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
dp34
=
RxImageTool
.
dip2px
(
34f
)
}
fun
setContext
(
context
:
Context
){
fun
setContext
(
context
:
Context
)
{
mContext
=
context
cvWidth
=
RxDeviceTool
.
getScreenWidth
(
context
)
-
RxImageTool
.
dip2px
(
73f
)
minCVWidth
=
RxImageTool
.
dip2px
(
105f
)
maxCVWidth
=
cvWidth
}
fun
setHomeView
(
homeView
:
IHomeContract
.
View
)
{
fun
setHomeView
(
homeView
:
IHomeContract
.
View
)
{
this
.
mHomeView
=
homeView
}
...
...
@@ -74,7 +74,7 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
this
.
confideFilterView
=
filterView
}
fun
setConsultFilterView
(
filterView
:
LinearLayout
){
fun
setConsultFilterView
(
filterView
:
LinearLayout
)
{
this
.
consultFilterView
=
filterView
}
...
...
@@ -82,7 +82,7 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
this
.
adapter
=
adapter
}
fun
setPhoneCallImageView
(
callView
:
ImageView
)
{
fun
setPhoneCallImageView
(
callView
:
ImageView
)
{
this
.
mPhoneCallView
=
callView
}
...
...
@@ -101,14 +101,15 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
Log
.
e
(
"Tag"
,
"-------dy=$dy"
)
// moveSearchView(dy)
val
manager
=
recyclerView
!!
.
layoutManager
as
LinearLayoutManager
if
(
mCurrentPosition
!=
manager
.
findFirstVisibleItemPosition
())
{
if
(
mCurrentPosition
!=
manager
.
findFirstVisibleItemPosition
()
&&
manager
.
findFirstVisibleItemPosition
()
!=
-
1
)
{
mCurrentPosition
=
manager
.
findFirstVisibleItemPosition
()
}
if
(
adapter
!!
.
itemCount
>
mCurrentPosition
&&
mCurrentPosition
!=
0
)
{
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
CONFIDE_VIEW
)
{
val
view
=
manager
.
findViewByPosition
(
mCurrentPosition
)
if
(
view
!=
null
)
{
if
(
view
is
ViewGroup
)
{
if
(
view
.
getChildAt
(
1
)
is
TabLayout
)
{
if
(
view
.
childCount
>
1
&&
view
.
getChildAt
(
1
)
is
TabLayout
)
{
val
tabLayout
=
view
.
getChildAt
(
1
)
val
location
=
IntArray
(
2
)
tabLayout
.
getLocationOnScreen
(
location
)
...
...
@@ -127,7 +128,7 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
confideFilterView
!!
.
visibility
=
View
.
INVISIBLE
}
}
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
CONSULT_VIEW
)
{
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
CONSULT_VIEW
)
{
val
view
=
manager
.
findViewByPosition
(
mCurrentPosition
)
if
(
view
!=
null
)
{
if
(
view
is
ViewGroup
)
{
...
...
@@ -150,32 +151,33 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
consultFilterView
!!
.
visibility
=
View
.
INVISIBLE
}
}
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
BUTTON_BANNER_VIEW
)
{
if
(
excuteStartAnim
)
{
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
BUTTON_BANNER_VIEW
)
{
if
(
excuteStartAnim
)
{
mHomeView
?.
startAnim
()
excuteStartAnim
=
false
excuteEndAnim
=
true
}
confideFilterView
?.
visibility
=
View
.
INVISIBLE
consultFilterView
?.
visibility
=
View
.
INVISIBLE
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
PAGER_BANNER_VIEW
)
{
if
(
excuteEndAnim
)
{
}
else
if
(
adapter
!!
.
getItemViewType
(
mCurrentPosition
)
==
YdlHomeViewHolderConstract
.
PAGER_BANNER_VIEW
)
{
if
(
excuteEndAnim
)
{
mHomeView
?.
endAnim
()
excuteEndAnim
=
false
excuteStartAnim
=
true
}
confideFilterView
?.
visibility
=
View
.
INVISIBLE
consultFilterView
?.
visibility
=
View
.
INVISIBLE
}
else
{
}
else
{
confideFilterView
?.
visibility
=
View
.
INVISIBLE
consultFilterView
?.
visibility
=
View
.
INVISIBLE
}
}
}
/**
* 移动搜索View
*/
private
fun
moveSearchView
(
dy
:
Int
)
{
private
fun
moveSearchView
(
dy
:
Int
)
{
// if (null != mCardView){
// cvWidth -= dy
// if (cvWidth < minCVWidth){
...
...
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
14134f56
...
...
@@ -20,8 +20,10 @@ 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
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
...
...
@@ -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 @
14134f56
...
...
@@ -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 @
14134f56
...
...
@@ -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
()
}
...
...
m-user/src/main/java/com/yidianling/user/constants/UserBIConstants.kt
View file @
14134f56
...
...
@@ -19,8 +19,8 @@ class UserBIConstants {
//百度监测 用户注册行为
const
val
APP_REGISTER_PAGE
=
"app_register_page"
const
val
POSITION_LOGIN_CLICK
=
"login_main|
login_click"
//登录点击
const
val
POSITION_LOGIN_SUCCESS_CLICK
=
"login_main|
login_success_click"
//登录成功点击
const
val
POSITION_LOGIN_CLICK
=
PART_ID_LOGIN_MAIN_PREFIX
+
"
login_click"
//登录点击
const
val
POSITION_LOGIN_SUCCESS_CLICK
=
PART_ID_LOGIN_MAIN_PREFIX
+
"
login_success_click"
//登录成功点击
//百度监测 应用启动
const
val
POSITION_APP_START_UP_CLICK
=
"app_start_up_click"
//应用启动
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
View file @
14134f56
...
...
@@ -57,7 +57,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
}
else
{
ToastUtil
.
toastShort
(
"修改密码成功"
)
saveUserData
(
it
.
data
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
...
...
@@ -78,10 +78,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
*/
@SuppressLint
(
"CheckResult"
)
override
fun
userLoginByPassword
(
inputPassword
:
String
,
phone
:
String
,
phoneCountryCode
:
String
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_PWD_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_RESET_PWD
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_PWD_LOGIN
)
var
param
=
PhoneLoginPwdParam
(
StringUtils
.
md5
(
inputPassword
),
phoneCountryCode
,
phone
)
mModel
.
userLoginByPassword
(
param
)
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
View file @
14134f56
...
...
@@ -59,7 +59,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
@SuppressLint
(
"CheckResult"
)
override
fun
autoLogin
(
bean
:
PhoneLoginAutoParam
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_DIRECT_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_DIRECT_LOGIN
)
mModel
.
autoLogin
(
bean
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -177,7 +177,6 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
val
sign1
=
if
(
media
==
SHARE_MEDIA
.
QQ
)
UserBIConstants
.
ACTION_TYPE_QQ_THIRD_LOGIN
else
UserBIConstants
.
ACTION_TYPE_WX_THIRD_LOGIN
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
sign1
)
UserHttpImpl
.
getInstance
()
.
umLogin
(
activity
,
media
)
.
doOnSubscribe
{
mView
.
showProgressView
()
}
...
...
@@ -202,14 +201,14 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_QQ_REGISTER_CLICK
)
}
else
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
sign1
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
sign1
)
}
}
else
{
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
ModularServiceManager
.
provide
(
IHomeService
::
class
.
java
).
setDouble11ShowType
(
true
)
mView
.
baiduActionBury
(
it
.
data
.
uid
,
UserBIConstants
.
POSITION_WX_REGISTER_CLICK
)
}
else
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
sign1
)
ActionCountUtils
.
count
Uid
(
UserBIConstants
.
POSITION_LOGIN_SUCCESS_CLICK
,
it
.
data
.
uid
!!
,
sign1
)
}
}
},
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
View file @
14134f56
...
...
@@ -130,7 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
* 验证码验证码登录
*/
override
fun
loginByMsgCode
(
phone
:
String
,
phoneCountryCode
:
String
,
msgCode
:
String
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
ACTION_TYPE_CODE_LOGIN
)
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_CODE_LOGIN
)
var
param
=
PhoneLoginCodeParam
(
msgCode
,
phoneCountryCode
,
phone
)
mModel
.
loginByMsgCode
(
param
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
ydl-net/src/main/java/com/ydl/ydlnet/builder/config/OkHttpConfig.java
View file @
14134f56
...
...
@@ -17,6 +17,7 @@ import com.ydl.ydlnet.client.interfaces.BuildHeadersListener;
import
java.io.File
;
import
java.io.InputStream
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -25,6 +26,7 @@ import javax.net.ssl.HostnameVerifier;
import
okhttp3.Cache
;
import
okhttp3.Interceptor
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Protocol
;
/**
* Created by haorui on 2019-09-02 .
...
...
@@ -45,7 +47,7 @@ public class OkHttpConfig {
private
static
OkHttpClient
okHttpClient
;
public
OkHttpConfig
()
{
okHttpClientBuilder
=
new
OkHttpClient
.
Builder
();
okHttpClientBuilder
=
new
OkHttpClient
.
Builder
()
.
protocols
(
Collections
.
singletonList
(
Protocol
.
HTTP_1_1
))
;
}
public
static
OkHttpConfig
getInstance
()
{
...
...
ydl-net/src/main/java/com/ydl/ydlnet/client/observer/BaseObserver.java
View file @
14134f56
...
...
@@ -29,7 +29,11 @@ public abstract class BaseObserver<T> implements Observer<T>, ISubscriber<T> {
@Override
public
void
onNext
(
@NonNull
T
t
)
{
try
{
doOnNext
(
t
);
}
catch
(
Exception
e
)
{
onError
(
e
);
}
}
@Override
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/toast/ToastHelper.kt
View file @
14134f56
...
...
@@ -2,8 +2,10 @@ package com.yidianling.ydl_pay.toast
import
android.content.Context
import
android.support.annotation.StringRes
import
android.text.TextUtils
import
android.widget.Toast
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.utils.LogUtil
import
com.yidianling.common.tools.ToastUtil
/**
* author : Zhangwenchao
...
...
@@ -31,16 +33,16 @@ class ToastHelper private constructor() {
}
private
fun
show
(
context
:
Context
,
text
:
CharSequence
)
{
if
(
TextUtils
.
isEmpty
(
text
))
return
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
context
,
text
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
text
)
toast
?.
show
()
ToastUtil
.
toastShort
(
text
.
toString
())
}
private
fun
show
(
context
:
Context
,
@StringRes
resId
:
Int
)
{
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
context
,
resId
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
resId
)
toast
?.
show
()
try
{
val
text
=
BaseApp
.
getApp
().
resources
.
getString
(
resId
)
ToastUtil
.
toastShort
(
text
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
e
(
e
.
message
)
}
}
private
object
Holder
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/app/YdlRepository.kt
View file @
14134f56
...
...
@@ -8,10 +8,13 @@ import com.lzy.imagepicker.view.CropImageView
import
com.ydl.devicesidlib.DeviceIDHelper
import
com.ydl.ydlcommon.actions.imagepicker.YdlImageLoader
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.UpLoadLogUtils
import
com.ydl.ydlcommon.utils.BuryPointUtils
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.log.LogHelper
import
com.ydl.ydlnet.client.exception.ApiException
import
com.yidianling.common.tools.RxTool
import
io.reactivex.plugins.RxJavaPlugins
/**
...
...
@@ -41,6 +44,22 @@ object YdlRepository {
// }
// refWatcher = LeakCanary.install(app)
initARouter
(
app
,
isDebug
)
initRxPlugin
()
}
private
fun
initRxPlugin
()
{
//保障RxJava调用链流程不会崩溃
RxJavaPlugins
.
setErrorHandler
{
LogUtil
.
e
(
"RxJava ErrorHandler ---->: $it"
)
try
{
val
apiException
=
ApiException
.
handleException
(
it
)
UpLoadLogUtils
.
upLoadLog
(
"RxJava Error Handler "
,
apiException
.
code
,
apiException
.
message
?:
""
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
d
(
"RxJava ErrorHandler UpLoad Log Error ---->: $it"
)
}
}
}
/**
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/ThrowableConsumer.kt
View file @
14134f56
package
com.ydl.ydlcommon.data.http
import
android.text.TextUtils
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseApp
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxNetTool
import
com.ydl.ydlcommon.R
import
io.reactivex.functions.Consumer
/**
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/remind/ToastHelper.kt
View file @
14134f56
package
com.ydl.ydlcommon.utils.remind
import
android.support.annotation.StringRes
import
android.text.TextUtils
import
android.widget.Toast
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.utils.LogUtil
import
com.yidianling.common.tools.ToastUtil
/**
* author : Zhangwenchao
...
...
@@ -14,8 +14,6 @@ import com.ydl.ydlcommon.base.BaseApp
*/
class
ToastHelper
private
constructor
()
{
private
var
toast
:
Toast
?
=
null
companion
object
{
private
fun
getInstance
():
ToastHelper
{
return
Holder
.
INSTANCE
...
...
@@ -31,16 +29,16 @@ class ToastHelper private constructor() {
}
private
fun
show
(
text
:
CharSequence
)
{
if
(
TextUtils
.
isEmpty
(
text
))
return
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
BaseApp
.
getApp
(),
text
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
text
)
toast
?.
show
()
ToastUtil
.
toastShort
(
text
.
toString
())
}
private
fun
show
(
@StringRes
resId
:
Int
)
{
if
(
toast
==
null
)
toast
=
Toast
.
makeText
(
BaseApp
.
getApp
(),
resId
,
Toast
.
LENGTH_SHORT
)
else
toast
?.
setText
(
resId
)
toast
?.
show
()
try
{
val
text
=
BaseApp
.
getApp
().
resources
.
getString
(
resId
)
ToastUtil
.
toastShort
(
text
)
}
catch
(
e
:
Exception
)
{
LogUtil
.
e
(
e
.
message
)
}
}
private
object
Holder
{
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/ToastUtil.java
View file @
14134f56
package
com
.
yidianling
.
common
.
tools
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.text.TextUtils
;
...
...
@@ -42,6 +41,7 @@ public class ToastUtil {
handler
.
post
(()
->
toastShort
(
RxTool
.
getContext
(),
msg
));
}
}
private
static
void
showShortToast
(
Context
mContext
,
String
msg
)
{
if
(
toast
==
null
)
{
toast
=
Toast
.
makeText
(
mContext
.
getApplicationContext
(),
msg
,
Toast
.
LENGTH_SHORT
);
...
...
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