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
482512f5
Commit
482512f5
authored
Sep 10, 2020
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reactor:抽离变量
parent
b88f7457
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
IMChatUtil.kt
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
+11
-9
No files found.
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
View file @
482512f5
...
...
@@ -53,7 +53,9 @@ import java.net.URLEncoder
*/
object
IMChatUtil
{
private
var
loadingDialog
:
LoadingDialogFragment
?
=
null
private
const
val
USER_TYPE_EXPERT
=
2
//专家
private
const
val
USER_TYPE_ASSISTANT
=
3
//助理
private
const
val
USER_TYPE_USER
=
1
//用户
/**
* 接口数据请求完成回调
*/
...
...
@@ -125,7 +127,7 @@ object IMChatUtil {
res
.
data
!!
.
collectEvent
)
}
if
(
TextUtils
.
equals
(
res
.
data
!!
.
userType
,
"2"
))
{
//专家
if
(
TextUtils
.
equals
(
res
.
data
!!
.
userType
,
USER_TYPE_EXPERT
.
toString
()
))
{
//专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
getImJavaApi
().
getChatUid
(
toUid
)
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -320,7 +322,7 @@ object IMChatUtil {
expert
.
shareData
.
doctorName
,
expert
.
shareData
.
cover
)
listener
?
.
onSuccess
(
expert
)
listener
.
onSuccess
(
expert
)
}
else
{
upLoadLog
(
"consult/get-expert"
,
resp
.
code
,
resp
.
msg
)
if
(
resp
.
code
==
ImConstants
.
HTTP_CODE_UNLOGIN
)
{
...
...
@@ -365,14 +367,14 @@ object IMChatUtil {
tb
.
setmMinTitleVisiable
(
View
.
GONE
)
}
else
{
//对方是用户,自己是助理
if
(
actionHandler
.
userType
==
1
&&
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
)
.
getUserInfo
()
?.
user_type
==
3
if
(
actionHandler
.
userType
==
USER_TYPE_USER
&&
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
)
.
getUserInfo
()
?.
user_type
==
USER_TYPE_ASSISTANT
)
{
tb
.
setTitleTextRightIcon
(
R
.
drawable
.
user_info_icon
)
{
messageFragment
.
showUserInfoDialog
()
}
}
if
(
actionHandler
.
userType
==
2
)
{
// 专家
if
(
actionHandler
.
userType
==
USER_TYPE_EXPERT
)
{
// 专家
tb
.
setmMinTitleVisiable
(
View
.
VISIBLE
)
// 调取接口获取专家状态
val
dis
=
instance
...
...
@@ -439,7 +441,7 @@ object IMChatUtil {
)
{
throwable
:
Throwable
->
LogUtil
.
i
(
"getDoctorChatStatus throwable:$throwable"
)
}
}
else
if
(
actionHandler
.
userType
==
3
)
{
// 助理
}
else
if
(
actionHandler
.
userType
==
USER_TYPE_ASSISTANT
)
{
// 助理
tb
.
setmMinTitleVisiable
(
View
.
GONE
)
// 调取接口获取助理状态
instance
.
getAssistantChatStatus
(
...
...
@@ -478,9 +480,9 @@ object IMChatUtil {
)
{
if
(!(
promptRule
==
4
||
promptRule
==
5
))
{
val
showExpertList
=
!(
promptRule
==
1
||
promptRule
==
3
)
if
(
actionHandler
.
userType
==
2
&&
status
==
2
)
{
//当该专家离线时
if
(
actionHandler
.
userType
==
USER_TYPE_EXPERT
&&
status
==
2
)
{
//当该专家离线时
sendRecommendExpertListMessage
(
1
,
showExpertList
,
toUid
,
actionHandler
)
}
else
if
(
actionHandler
.
userType
==
2
&&
status
>=
3
)
{
//当该专家忙碌时
}
else
if
(
actionHandler
.
userType
==
USER_TYPE_EXPERT
&&
status
>=
3
)
{
//当该专家忙碌时
sendRecommendExpertListMessage
(
2
,
showExpertList
,
toUid
,
actionHandler
)
}
}
...
...
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