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
74e60255
Commit
74e60255
authored
Mar 10, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 系统消息完成
parent
df5a43dd
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
510 additions
and
189 deletions
+510
-189
config.gradle
config.gradle
+2
-2
HomeConsultItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+0
-2
build.gradle
m-im/build.gradle
+0
-1
ImApi.kt
m-im/src/main/java/com/yidianling/im/http/ImApi.kt
+27
-8
ImHttp.kt
m-im/src/main/java/com/yidianling/im/http/ImHttp.kt
+6
-0
ImHttpImpl.kt
m-im/src/main/java/com/yidianling/im/http/ImHttpImpl.kt
+14
-0
MsgViewHolderRecipel.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderRecipel.kt
+1
-1
CmsExamQuestionPaperActivity.kt
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
+10
-9
ChatItemBean.kt
m-im/src/main/java/com/yidianling/im/ui/page/fragment/bean/ChatItemBean.kt
+1
-1
MedicalSystemListActivity.kt
m-im/src/main/java/com/yidianling/medical/im/MedicalSystemListActivity.kt
+63
-21
MeidicalChatFragment.kt
m-im/src/main/java/com/yidianling/medical/im/MeidicalChatFragment.kt
+65
-60
MedicalChatAdapter.kt
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalChatAdapter.kt
+61
-31
MedicalSystemListAdapter.kt
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalSystemListAdapter.kt
+3
-3
SystemItemBean.kt
m-im/src/main/java/com/yidianling/medical/im/bean/SystemItemBean.kt
+7
-3
SystemUnReadRespose.kt
m-im/src/main/java/com/yidianling/medical/im/bean/SystemUnReadRespose.kt
+9
-0
MedicalSystemItemView.kt
m-im/src/main/java/com/yidianling/medical/im/view/MedicalSystemItemView.kt
+48
-0
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+6
-0
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+7
-0
medical_system_item_icon.png
m-im/src/main/res/drawable-xhdpi/medical_system_item_icon.png
+0
-0
list_empty_view.xml
m-im/src/main/res/layout/list_empty_view.xml
+49
-0
medical_im_chat_fragment_layout.xml
m-im/src/main/res/layout/medical_im_chat_fragment_layout.xml
+0
-43
medical_im_system_item_view.xml
m-im/src/main/res/layout/medical_im_system_item_view.xml
+111
-0
medical_item_system_list.xml
m-im/src/main/res/layout/medical_item_system_list.xml
+15
-0
medical_system_list_activity.xml
m-im/src/main/res/layout/medical_system_list_activity.xml
+4
-4
strings.xml
m-im/src/main/res/values/strings.xml
+1
-0
No files found.
config.gradle
View file @
74e60255
...
...
@@ -11,7 +11,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.2
0.94
"
,
"m-im-medical"
:
"0.0.2
1.13
"
,
"m-im"
:
"0.0.20.76"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -97,7 +97,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.2
0.94
"
,
"m-im-medical"
:
"0.0.2
1.13
"
,
"m-im"
:
"0.0.20.76"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.8"
,
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
74e60255
...
...
@@ -9,7 +9,6 @@ import android.widget.FrameLayout
import
androidx.core.content.ContextCompat
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydlcommon.utils.URLUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.home.R
import
com.yidianling.home.constants.HomeBIConstants
...
...
@@ -124,7 +123,6 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
tv_consult_chat
.
setOnClickListener
{
homeEvent
!!
.
consultChatClick
(
bodyBean
.
uid
.
toString
())
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_PRIVATE_CHAT_CLICK
)
}
}
}
m-im/build.gradle
View file @
74e60255
...
...
@@ -104,7 +104,6 @@ dependencies {
implementation
modularPublication
(
'com.ydl:m-confide-api'
)
}
else
{
//发布时使用
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-medical-pay"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-im-api"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
...
...
m-im/src/main/java/com/yidianling/im/http/ImApi.kt
View file @
74e60255
...
...
@@ -3,14 +3,20 @@ package com.yidianling.im.http
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA_URL
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.yidianling.im.api.bean.*
import
com.yidianling.im.bean.*
import
com.yidianling.im.api.bean.IMExpertBuild
import
com.yidianling.im.api.bean.MsgDetail
import
com.yidianling.im.api.bean.UpdateStatusBean
import
com.yidianling.im.bean.MsgData
import
com.yidianling.im.bean.MsgHome
import
com.yidianling.im.bean.SystemMsgBean
import
com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import
com.yidianling.im.ui.page.fragment.bean.InteractBean
import
com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
import
com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import
com.yidianling.medical.im.bean.SystemUnReadRespose
import
io.reactivex.Observable
import
retrofit2.http.*
...
...
@@ -73,26 +79,38 @@ interface ImApi {
//以下接口为消息改版后新加
//私聊 获取各消息未读数
@GET
(
"chat/getNotifyCountMessage"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getUnreadMessage
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
UnreadMessageBean
>>
//私聊 获取私聊消息
@GET
(
"chat/getPrivateMessageList"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getAllChatMessage
(
@QueryMap
params
:
Map
<
String
,
String
>)
:
Observable
<
BaseAPIResponse
<
ChatModelBean
>>
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getAllChatMessage
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
ChatModelBean
>>
//私聊 获取通知消息
@GET
(
"chat/getNotifyMessageList"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getNoticeMessage
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
List
<
NoticeItemBean
>>>
//私聊 已读或清除消息
@GET
(
"chat/allMessageReadOrDel"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
clearMessage
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
Boolean
>>
//私聊 获取互动消息
@GET
(
"chat/getInteractiveMessageList"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getInteractMessage
(
@QueryMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
InteractBean
>>
//获取系统消息未读数
@GET
(
"api/client/message/v1/unReadCount"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA_URL
)
fun
systemUnReadCount
():
Observable
<
BaseAPIResponse
<
SystemUnReadRespose
>>
//获取系统消息 全部设置已读
@GET
(
"api/client/message/v1/readAll"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA_URL
)
fun
systemReadAll
():
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/http/ImHttp.kt
View file @
74e60255
...
...
@@ -13,6 +13,7 @@ import com.yidianling.im.api.bean.*
import
com.yidianling.im.api.param.RmHistoryParam
import
com.yidianling.im.api.param.RmTalkParam
import
com.yidianling.im.api.param.TopMessageParam
import
com.yidianling.medical.im.bean.SystemUnReadRespose
import
io.reactivex.Observable
/**
...
...
@@ -50,4 +51,8 @@ interface ImHttp {
fun
getInteractMessage
(
param
:
InteractMessageParam
):
Observable
<
BaseAPIResponse
<
InteractBean
>>
fun
getUnreadMessage
(
param
:
UnreadParam
):
Observable
<
BaseAPIResponse
<
UnreadMessageBean
>>
//系统消息
fun
systemUnReadCount
():
Observable
<
BaseAPIResponse
<
SystemUnReadRespose
>>
//系统消息 全部设置已读
fun
systemReadAll
():
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/http/ImHttpImpl.kt
View file @
74e60255
...
...
@@ -18,6 +18,7 @@ import com.yidianling.im.ui.page.fragment.bean.InteractBean
import
com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
import
com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import
com.yidianling.im.ui.param.*
import
com.yidianling.medical.im.bean.SystemUnReadRespose
import
io.reactivex.Observable
/**
...
...
@@ -130,6 +131,19 @@ class ImHttpImpl private constructor() : ImHttp {
.
flatMap
{
getImJavaApi
().
getInteractMessage
(
it
)
}
}
/**
* 系统消息
* */
override
fun
systemUnReadCount
():
Observable
<
BaseAPIResponse
<
SystemUnReadRespose
>>
{
return
getImJavaApi
().
systemUnReadCount
()
}
/**
* 系统消息 全部设置已读
* */
override
fun
systemReadAll
():
Observable
<
BaseAPIResponse
<
Any
>>
{
return
getImJavaApi
().
systemReadAll
()
}
object
Holder
{
val
INSTANCE
=
ImHttpImpl
()
}
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderRecipel.kt
View file @
74e60255
...
...
@@ -38,7 +38,7 @@ class MsgViewHolderRecipel(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
item
?.
setOnClickListener
{
NewH5Activity
.
start
(
view
?.
context
,
H5Params
(
"${HttpConfig.MEDICAL_H5URL}/ct/prescription/details?recipeId=${itemBean?.fromRecipelId}
&hideNavBar=1
"
,
"${HttpConfig.MEDICAL_H5URL}/ct/prescription/details?recipeId=${itemBean?.fromRecipelId}"
,
"处方详情"
)
)
...
...
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
View file @
74e60255
...
...
@@ -134,14 +134,14 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
mQuestionAdapter
.
setOneCheckListener
(
object
:
QuestionOneCheckListener
{
override
fun
itemClick
(
list
:
List
<
OptionsBean
>,
question
:
QuestionsBean
)
{
override
fun
itemClick
(
bean
:
List
<
OptionsBean
>,
question
:
QuestionsBean
)
{
var
otherInput
=
""
list
.
forEachIndexed
{
index
,
optionsBean
->
bean
.
forEachIndexed
{
_
,
optionsBean
->
if
(
"其他"
==
optionsBean
.
name
)
{
otherInput
=
et_input_problem
.
text
.
toString
()
}
}
answerItemClick
(
list
,
question
,
otherInput
)
answerItemClick
(
bean
,
question
,
otherInput
)
hideInputAndKeyboark
()
}
...
...
@@ -184,7 +184,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
postion
:
Int
)
{
var
otherInput
=
""
list
.
forEachIndexed
{
index
,
optionsBean
->
list
.
forEachIndexed
{
_
,
optionsBean
->
if
(
"其他"
==
optionsBean
.
name
)
{
otherInput
=
et_input_problem
.
text
.
toString
()
}
...
...
@@ -201,6 +201,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
/**添加view事件*/
@SuppressLint
(
"ClickableViewAccessibility"
)
private
fun
addVIewListener
()
{
left_back_btn
.
setOnClickListener
{
finish
()
}
tv_skip
.
setOnClickListener
{
...
...
@@ -499,7 +500,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
/***问候语之后 灵犀第一道题*/
private
fun
setSecondQuestionByLx
()
{
val
questionMultiItem2
=
QuestionMultiItem
()
mQuestionBean
!!
.
questionPaper
.
questionChains
.
forEach
{
(
k
,
v
)
->
mQuestionBean
!!
.
questionPaper
.
questionChains
.
forEach
{
(
_
,
v
)
->
if
(
v
.
head
)
{
// 代表第一题 ,使用questionId 去questions取到对应的提
makeType3OrType4
(
v
,
questionMultiItem2
)
...
...
@@ -630,9 +631,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
answerQuestionRequestBean
.
questionPaperId
=
question
.
questionPaperId
answerQuestionRequestBean
.
uid
=
ImIn
.
getUserInfo
()
?.
uid
va
r
answersBeanList
=
ArrayList
<
AnswersBean
>()
va
l
answersBeanList
=
ArrayList
<
AnswersBean
>()
for
(
optionsBean
in
list
)
{
va
r
answersBean
=
AnswersBean
()
va
l
answersBean
=
AnswersBean
()
answersBean
.
name
=
optionsBean
.
name
answersBean
.
optionId
=
optionsBean
.
id
...
...
@@ -745,7 +746,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
uidBean
->
if
(
uidBean
.
code
==
"200"
&&
uidBean
.
data
!=
0
.
toLong
())
{
mType70RequestList
.
forEachIndexed
{
index
,
answerQuestionType70RequestBean
->
mType70RequestList
.
forEachIndexed
{
index
,
_
->
mType70RequestList
[
index
].
toUid
=
uidBean
.
data
.
toString
()
}
...
...
@@ -754,7 +755,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
.
observeOn
(
Schedulers
.
io
())
.
subscribe
()
mType71RequestList
.
forEachIndexed
{
index
,
answerQuestionType71RequestBean
->
mType71RequestList
.
forEachIndexed
{
index
,
_
->
mType71RequestList
[
index
].
toUid
=
uidBean
.
data
.
toString
()
}
...
...
m-im/src/main/java/com/yidianling/im/ui/page/fragment/bean/ChatItemBean.kt
View file @
74e60255
...
...
@@ -21,7 +21,7 @@ class ChatItemBean(
var
title
:
String
=
""
,
var
toName
:
String
=
""
,
var
toUid
:
Int
=
0
,
var
type
:
Int
=
0
,
//私聊群聊type=3
var
type
:
Int
=
0
,
//私聊群聊type=3
1:系统消息
var
utype
:
Int
=
0
,
var
timeStr
:
String
=
""
,
var
isBusy
:
Int
=
1
,
// 1服务中 0不在服务中,但是不一定是服务过
...
...
m-im/src/main/java/com/yidianling/medical/im/MedicalSystemListActivity.kt
View file @
74e60255
...
...
@@ -10,7 +10,10 @@ import androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.yidianling.im.R
...
...
@@ -49,18 +52,53 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
override
fun
initDataAndEvent
()
{
initStatus
()
mEmptyView
=
LayoutInflater
.
from
(
this
@MedicalSystemListActivity
)
.
inflate
(
R
.
layout
.
platform_
list_empty_view
,
null
,
false
)
iv_back
.
setOnClickListener
{
finish
()
}
mEmptyView
=
LayoutInflater
.
from
(
this
@MedicalSystemListActivity
).
inflate
(
R
.
layout
.
list_empty_view
,
null
,
false
)
mAdapter
=
MedicalSystemListAdapter
()
system_list
.
layoutManager
=
LinearLayoutManager
(
this
@MedicalSystemListActivity
,
LinearLayoutManager
.
VERTICAL
,
false
)
system_list
.
adapter
=
mAdapter
mAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
mAdapter
.
setOnItemClickListener
{
_
,
view
,
position
->
if
(
Utils
.
isFastClick
())
{
//防止连击
return
@setOnItemClickListener
}
val
itemBean
=
mAdapter
.
data
[
position
]
when
(
itemBean
.
bizType
)
{
"1"
->
{
//1-问诊订单
NewH5Activity
.
start
(
view
!!
.
context
,
H5Params
(
"${HttpConfig.MEDICAL_H5URL}ct/inquiry/order/details?orderId=${itemBean?.bizId}&hideNavBar=1"
,
null
)
)
}
"2"
->
{
//2-处方单
NewH5Activity
.
start
(
view
!!
.
context
,
H5Params
(
"${HttpConfig.MEDICAL_H5URL}ct/prescription/details?recipeId=${itemBean?.bizId}"
,
null
)
)
}
"3"
->
{
// 3-药品订单
NewH5Activity
.
start
(
view
!!
.
context
,
H5Params
(
"${HttpConfig.MEDICAL_H5URL}ct/drug/order/details?drugOrderId=${itemBean?.bizId}&hideNavBar=1"
,
null
)
)
}
}
mAdapter
.
data
[
position
].
read
=
true
mAdapter
.
notifyDataSetChanged
()
itemBean
?.
msgId
?.
let
{
setSystemRead
(
it
)
}
}
mAdapter
.
setLoadMoreView
(
LoadMoreView
())
mAdapter
.
setOnLoadMoreListener
(
this
@MedicalSystemListActivity
,
system_list
)
...
...
@@ -75,6 +113,16 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
}
/**
* 系统消息阅读
* */
private
fun
setSystemRead
(
msgId
:
Int
)
{
ServiceImpl
.
instance
.
systemRead
(
msgId
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
()
}
@SuppressLint
(
"CheckResult"
)
private
fun
getSystemList
()
{
ServiceImpl
.
instance
.
getSystemPageList
(
currPage
,
pageSize
,
null
)
...
...
@@ -84,10 +132,10 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
if
(
"200"
==
response
.
code
)
{
system_swipe_refresh_layout
.
isRefreshing
=
false
va
r
list
=
response
.
data
.
rows
va
l
list
=
response
.
data
.
rows
if
(
currPage
==
1
)
{
//第一页数据
if
(
list
!=
null
&&
list
.
isNotEmpty
())
{
if
(
list
.
isNotEmpty
())
{
if
(
list
.
size
<
pageSize
)
{
mAdapter
.
setNewData
(
list
)
mAdapter
.
removeAllFooterView
()
...
...
@@ -100,15 +148,13 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
}
}
else
{
mAdapter
.
loadMoreEnd
(
false
)
mAdapter
.
setNewData
(
list
)
var
net_error
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
net_error
)
net_error
.
text
=
"暂无系统消息~"
mAdapter
.
emptyView
=
mEmptyView
val
netError
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
im_net_error
)
netError
.
text
=
"暂无系统消息~"
mAdapter
.
emptyView
=
mEmptyView
}
}
else
{
//非第一页数据
if
(
list
!=
null
&&
list
.
isEmpty
())
{
if
(
list
.
isEmpty
())
{
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
if
(
list
.
size
<
pageSize
)
{
...
...
@@ -116,7 +162,6 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
mAdapter
.
addData
(
list
)
if
(
currPage
==
response
.
data
.
totalPage
)
{
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
...
...
@@ -129,20 +174,17 @@ class MedicalSystemListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
}
else
{
system_swipe_refresh_layout
.
isRefreshing
=
false
mAdapter
.
loadMoreFail
()
mAdapter
.
emptyView
=
mEmptyView
mAdapter
.
emptyView
=
mEmptyView
}
},
{
e
->
e
.
printStackTrace
()
system_swipe_refresh_layout
.
isRefreshing
=
false
mAdapter
.
loadMoreFail
()
va
r
net_error
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
net_error
)
va
r
reLoad
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
reLoad
)
net
_e
rror
.
text
=
"网络异常,请稍后再试"
va
l
netError
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
im_
net_error
)
va
l
reLoad
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
im_
reLoad
)
net
E
rror
.
text
=
"网络异常,请稍后再试"
reLoad
.
visibility
=
View
.
VISIBLE
mAdapter
.
emptyView
=
mEmptyView
mAdapter
.
emptyView
=
mEmptyView
})
}
...
...
m-im/src/main/java/com/yidianling/medical/im/MeidicalChatFragment.kt
View file @
74e60255
package
com.yidianling.medical.im
import
android.annotation.SuppressLint
import
android.content.Context
import
android.os.Build
import
android.view.View
import
android.view.WindowManager
import
androidx.recyclerview.widget.LinearLayoutManager
...
...
@@ -29,7 +29,6 @@ import com.yidianling.im.ui.page.widget.ChatUnusualView
import
com.yidianling.im.ui.param.ChatParam
import
com.yidianling.im.ui.param.ClearMessageParam
import
com.yidianling.im.ui.param.UnreadParam
import
com.yidianling.medical.NotificationsUtils
import
com.yidianling.medical.im.adapter.MedicalChatAdapter
import
com.yidianling.medical.popwindow.MedicalChatSettingPopupWindow
import
de.greenrobot.event.EventBus
...
...
@@ -70,12 +69,10 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
mContext
=
requireContext
()
EventBus
.
getDefault
().
register
(
this
)
se
lectModel
()
se
tShowData
()
resetPageShow
()
initListData
()
notifiVisible
()
ll_more
.
setOnClickListener
{
if
(!
ImIn
.
isLogin
())
{
ToastUtil
.
toastShort
(
"请登录后再试"
)
...
...
@@ -108,11 +105,12 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
})
chatSettingPopupWindow
?.
contentView
!!
.
measure
(
chatSettingPopupWindow
?.
contentView
?
.
measure
(
View
.
MeasureSpec
.
UNSPECIFIED
,
View
.
MeasureSpec
.
UNSPECIFIED
)
;
//这句代码必须要才能获得正确的popupwindow的宽度
)
//这句代码必须要才能获得正确的popupwindow的宽度
val
popupWindowWidth
=
chatSettingPopupWindow
?.
contentView
!!
.
measuredWidth
setWindowBg
(
0.4f
)
chatSettingPopupWindow
?.
showAsDropDown
(
...
...
@@ -123,40 +121,23 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
EventBus
.
getDefault
().
unregister
(
this
)
}
/**
* 系统通知开关
* */
private
fun
notifiVisible
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
NotificationsUtils
.
isNotificationOpen
(
mContext
))
{
top_hide
.
visibility
=
View
.
GONE
}
else
{
top_hide
.
visibility
=
View
.
VISIBLE
top_hide
.
setOnClickListener
{
NotificationsUtils
.
getAppDetailSettingIntent
(
mContext
)
}
close_hide
.
setOnClickListener
{
top_hide
.
visibility
=
View
.
GONE
}
}
}
}
override
fun
initDataAndEventLazy
()
{
}
@SuppressLint
(
"CheckResult"
)
fun
getChatMessageData
()
{
if
(
ImIn
.
getUserInfo
()
?.
uid
!=
"0"
)
{
var
dis
=
ImHttpImpl
.
getInstance
()
ImHttpImpl
.
getInstance
()
.
getAllChatMessage
(
ChatParam
(
"${ImIn.getUserInfo()?.uid}"
,
"${0}"
))
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
compose
<
ChatModelBean
>(
RxUtils
.
resultJavaData
())
.
subscribe
({
it
->
.
subscribe
({
if
(
it
.
before
.
data
.
size
!=
0
||
it
.
nomal
.
data
.
size
!=
0
)
{
setData
(
it
)
}
...
...
@@ -164,6 +145,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
chat_recyclerview
.
refreshComplete
()
}
},
{
t
->
t
.
printStackTrace
()
ToastUtil
.
toastShort
(
"您的网络出现了问题"
)
chat_recyclerview
?.
let
{
chat_recyclerview
.
refreshComplete
()
...
...
@@ -201,13 +183,23 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
chatAdapter
?.
notifyDataSetChanged
()
selectTopData
()
// 全部
val
item
=
ChatItemBean
(
type
=
1
,
title
=
"暂无新消息"
,
timeStr
=
""
,
unReadNum
=
0
)
showData
.
add
(
item
)
showData
.
addAll
(
allChatData
.
topData
.
data
.
sortedWith
(
mCompare
))
showData
.
addAll
(
allChatData
.
nomal
.
data
.
filter
{
it
.
is_top
==
0
}.
sortedWith
(
mCompare
))
if
(
allChatData
.
before
.
data
.
any
{
it
.
is_top
==
0
})
{
showData
.
add
(
threeWeekItem
)
showData
.
addAll
(
allChatData
.
before
.
data
.
filter
{
it
.
is_top
==
0
}.
sortedWith
(
mCompare
))
}
systemUnReadCount
()
// 重置消息未读数
MsgReceiveHelper
.
reQueryUnreadNumber
{
...
...
@@ -263,11 +255,37 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
super
.
setUserVisibleHint
(
isVisibleToUser
)
if
(
isVisibleToUser
&&
getIsViewCreated
())
{
notifiVisible
()
systemUnReadCount
()
resetPageShow
()
}
}
/**
* 获取系统消息
* */
@SuppressLint
(
"CheckResult"
)
private
fun
systemUnReadCount
()
{
ImHttpImpl
.
getInstance
().
systemUnReadCount
()
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
compose
(
RxUtils
.
resultJavaData
())
.
subscribe
({
bean
->
if
(
showData
.
size
>
0
&&
showData
[
0
].
type
==
1
)
{
showData
[
0
].
title
=
bean
.
title
showData
[
0
].
timeStr
=
bean
.
createTime
showData
[
0
].
unReadNum
=
bean
.
unReadTotalCount
}
chatAdapter
?.
notifyDataSetChanged
()
},
{
t
->
t
.
printStackTrace
()
})
ImHttpImpl
.
getInstance
().
systemReadAll
()
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
compose
(
RxUtils
.
resultJavaData
())
.
subscribe
{
systemUnReadCount
()
}
}
fun
clearData
()
{
showData
.
clear
()
chatAdapter
?.
notifyDataSetChanged
()
...
...
@@ -314,26 +332,13 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
/**
* 选择私聊列表展示模式
*/
private
fun
selectModel
()
{
setShowData
()
resetPageShow
()
}
/**
* 全部已读(私聊是单独处理的)
*/
@SuppressLint
(
"CheckResult"
)
fun
markAllMessageRead
()
{
var
dis
=
ImHttpImpl
.
getInstance
().
clearMessage
(
ClearMessageParam
(
"${ImIn.getUserInfo()?.uid}"
,
"1"
)
)
ImHttpImpl
.
getInstance
().
clearMessage
(
ClearMessageParam
(
"${ImIn.getUserInfo()?.uid}"
,
"1"
))
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
subscribe
({
it
->
.
subscribe
({
if
(
it
.
data
)
{
//清除私聊群聊未读数
MsgReceiveHelper
.
markAllRead
()
...
...
@@ -343,38 +348,40 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
ToastUtil
.
toastShort
(
"标记失败"
)
}
},
{
t
->
t
.
printStackTrace
()
ToastUtil
.
toastShort
(
"您的网络出现了问题"
)
})
}
/**
* 刷新当前展示的消息列表的数据,刷新顶部三个消息未读数,刷新底部消息未读数
*/
fun
getMsgData
()
{
private
fun
getMsgData
()
{
/**
* 登录状态
*/
if
(
ImIn
.
isLogin
())
{
getChatMessageData
()
}
requestTopUnReadNumber
()
}
/**
* 刷新顶部未读数量(接口返回成功后调用的方法中会触发事件刷新底部导航栏的角标)
*/
@SuppressLint
(
"CheckResult"
)
fun
requestTopUnReadNumber
()
{
if
(
ImIn
.
getUserInfo
()
?.
uid
!=
"0"
)
{
var
dis
=
ImHttpImpl
.
getInstance
().
getUnreadMessage
(
UnreadParam
(
"${ImIn.getUserInfo()?.uid}"
))
.
compose
<
UnreadMessageBean
>(
RxUtils
.
resultJavaData
(
))
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
subscribe
({
it
->
resetTopUnReadNumber
(
it
)
},
{
t
->
ToastUtil
.
toastShort
(
"您的网络出现了问题"
)
})
ImHttpImpl
.
getInstance
().
getUnreadMessage
(
UnreadParam
(
"${ImIn.getUserInfo()?.uid}"
))
.
compose
<
UnreadMessageBean
>(
RxUtils
.
resultJavaData
(
))
.
compose
(
RxUtils
.
applySchedulers
(
this
))
.
subscribe
({
resetTopUnReadNumber
()
},
{
t
->
t
.
printStackTrace
()
ToastUtil
.
toastShort
(
"您的网络出现了问题"
)
})
}
else
{
//退出登录情况下,全部不显示
EventBus
.
getDefault
().
post
(
UpdateBottomBarUnreadNumEvent
(
0
))
...
...
@@ -384,11 +391,9 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
/**
* 重置顶部未读数量
*/
fun
resetTopUnReadNumber
(
bean
:
UnreadMessageBean
)
{
private
fun
resetTopUnReadNumber
()
{
val
chatUnreadNum
=
ImIn
.
getInUnreadNum
()
//私聊未读数移动端自己读取云信
MsgReceiveHelper
.
isHasUnread
=
chatUnreadNum
>
0
// 同步底部导航栏的角标数量
EventBus
.
getDefault
().
post
(
...
...
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalChatAdapter.kt
View file @
74e60255
package
com.yidianling.medical.im.adapter
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.content.Context
import
android.text.TextUtils
...
...
@@ -26,7 +27,9 @@ import com.yidianling.im.http.ImHttpImpl
import
com.yidianling.im.session.SessionHelper
import
com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import
com.yidianling.im.ui.page.fragment.view.ChatTimeItemView
import
com.yidianling.medical.im.MedicalSystemListActivity
import
com.yidianling.medical.im.view.MedicalChatItemView
import
com.yidianling.medical.im.view.MedicalSystemItemView
import
de.greenrobot.event.EventBus
/**
...
...
@@ -43,6 +46,7 @@ class MedicalChatAdapter(
companion
object
{
const
val
TYPE_NORMAL_ITEM
=
1001
// 正常item
const
val
TYPE_TIME_ITEM
=
1002
// 三周前item
const
val
TYPE_SYSTEM_ITEM
=
1003
// 三周前item
}
fun
setData
(
data
:
ArrayList
<
ChatItemBean
>)
{
...
...
@@ -52,40 +56,53 @@ class MedicalChatAdapter(
}
override
fun
getItemViewType
(
position
:
Int
):
Int
{
if
(
position
<
mList
.
size
&&
!
mList
[
position
].
isThreeItem
)
return
TYPE_NORMAL_ITEM
if
(
mList
[
position
].
type
==
1
)
{
return
TYPE_SYSTEM_ITEM
}
if
(
position
<
mList
.
size
&&
!
mList
[
position
].
isThreeItem
)
{
return
TYPE_NORMAL_ITEM
}
return
TYPE_TIME_ITEM
}
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
val
itemBean
=
mList
[
position
]
when
(
holder
)
{
is
SystemItemHolder
->
{
holder
.
view
.
initData
(
itemBean
)
holder
.
view
.
setOnClickListener
{
MedicalSystemListActivity
.
start
(
context
)
}
}
is
ChatItemHolder
->
{
holder
.
view
.
initData
(
mList
[
position
]
)
holder
.
view
.
initData
(
itemBean
)
holder
.
view
.
setOnClickListener
{
//点击去私聊
if
(
TextUtils
.
equals
(
mList
[
position
].
toUid
.
toString
(),
"4108805"
))
{
SessionHelper
.
startP2PSession
(
context
,
-
1
,
"4108805"
,
null
,
P2PCustomActionHandlerImpl
(
"4108805"
,
"课程小助手-壹壹"
,
"4108805"
)
)
}
else
{
IMChatUtil
.
startChat
(
context
as
AppCompatActivity
,
mList
[
position
])
// IMChatUtil.startCms(context as AppCompatActivity, 18, "main_xinliyisheng")
when
{
TextUtils
.
equals
(
itemBean
.
toUid
.
toString
(),
"4108805"
)
->
{
SessionHelper
.
startP2PSession
(
context
,
-
1
,
"4108805"
,
null
,
P2PCustomActionHandlerImpl
(
"4108805"
,
"课程小助手-壹壹"
,
"4108805"
)
)
}
else
->
{
IMChatUtil
.
startChat
(
context
as
AppCompatActivity
,
itemBean
)
}
}
}
holder
.
view
.
setOnLongClickListener
{
var
nowBean
=
mList
[
position
]
val
name
=
java
.
util
.
ArrayList
<
String
>()
name
.
add
(
"删除"
)
if
(
now
Bean
.
is_top
==
1
)
{
if
(
item
Bean
.
is_top
==
1
)
{
name
.
add
(
"取消置顶"
)
}
else
if
(
now
Bean
.
is_top
==
0
)
{
}
else
if
(
item
Bean
.
is_top
==
0
)
{
name
.
add
(
"置顶该聊天"
)
}
val
unread
=
MsgReceiveHelper
.
getUnNum
(
now
Bean
.
toUid
.
toString
())
//获取未读消息数量
val
unread
=
MsgReceiveHelper
.
getUnNum
(
item
Bean
.
toUid
.
toString
())
//获取未读消息数量
if
(
unread
>
0
)
{
name
.
add
(
"标记为已读"
)
}
...
...
@@ -93,22 +110,21 @@ class MedicalChatAdapter(
builder
.
SetOnItemClickLister
(
object
:
ListNoCancelDialog
.
Builder
.
OnItemClickLister
{
override
fun
onItemClick
(
dialog
:
Dialog
,
view
:
View
,
position1
:
Int
)
{
val
tag
=
name
[
position1
]
when
(
tag
)
{
when
(
name
[
position1
])
{
"删除"
->
{
delete
(
now
Bean
)
delete
(
item
Bean
)
dialog
.
dismiss
()
}
"置顶该聊天"
->
{
toTop
(
now
Bean
,
1
)
toTop
(
item
Bean
,
1
)
dialog
.
dismiss
()
}
"取消置顶"
->
{
toTop
(
now
Bean
,
0
)
toTop
(
item
Bean
,
0
)
dialog
.
dismiss
()
}
"标记为已读"
->
{
mark
(
now
Bean
)
mark
(
item
Bean
)
dialog
.
dismiss
()
}
}
...
...
@@ -123,8 +139,9 @@ class MedicalChatAdapter(
}
}
is
ChatTimeItemHolder
->
{
holder
.
view
.
initData
(
mList
[
position
]
)
holder
.
view
.
initData
(
itemBean
)
}
else
->
{
}
}
...
...
@@ -135,6 +152,9 @@ class MedicalChatAdapter(
TYPE_NORMAL_ITEM
->
{
ChatItemHolder
(
MedicalChatItemView
(
context
))
}
TYPE_SYSTEM_ITEM
->
{
SystemItemHolder
(
MedicalSystemItemView
(
context
))
}
else
->
{
ChatTimeItemHolder
(
ChatTimeItemView
(
context
))
}
...
...
@@ -146,9 +166,10 @@ class MedicalChatAdapter(
return
mList
.
size
}
@SuppressLint
(
"CheckResult"
)
private
fun
delete
(
bean
:
ChatItemBean
)
{
LogHelper
.
getInstance
().
writeLogSync
(
"删除聊天:uid = "
+
bean
.
toUid
)
var
dis
=
ImHttpImpl
.
getInstance
().
rmHistory
(
ImHttpImpl
.
getInstance
().
rmHistory
(
RmHistoryParam
(
bean
.
toUid
.
toString
(),
1
...
...
@@ -156,7 +177,7 @@ class MedicalChatAdapter(
)
.
compose
(
RxUtils
.
applySchedulers
(
lifecycleable
))
.
compose
(
RxUtils
.
resultData
())
.
subscribe
({
o
->
.
subscribe
({
LogHelper
.
getInstance
().
writeLogSync
(
"删除聊天成功:uid = "
+
bean
.
toUid
)
NIMClient
.
getService
(
MsgService
::
class
.
java
)
.
clearChattingHistory
(
bean
.
toUid
.
toString
(),
SessionTypeEnum
.
P2P
)
...
...
@@ -167,12 +188,13 @@ class MedicalChatAdapter(
})
}
@SuppressLint
(
"CheckResult"
)
private
fun
deleteItem
(
bean
:
ChatItemBean
)
{
var
dis
=
ImHttpImpl
.
getInstance
().
rmTalk
(
RmTalkParam
(
bean
.
toUid
.
toString
()))
ImHttpImpl
.
getInstance
().
rmTalk
(
RmTalkParam
(
bean
.
toUid
.
toString
()))
.
compose
(
RxUtils
.
applySchedulers
(
lifecycleable
))
.
compose
(
RxUtils
.
resultData
())
.
subscribe
({
o
->
.
subscribe
({
NIMClient
.
getService
(
MsgService
::
class
.
java
)
.
clearUnreadCount
(
bean
.
toUid
.
toString
(),
SessionTypeEnum
.
P2P
)
NIMClient
.
getService
(
MsgService
::
class
.
java
)
...
...
@@ -185,12 +207,13 @@ class MedicalChatAdapter(
}
@SuppressLint
(
"CheckResult"
)
private
fun
toTop
(
bean
:
ChatItemBean
,
istop
:
Int
)
{
LogHelper
.
getInstance
().
writeLogSync
(
"置顶聊天:uid = "
+
bean
.
toUid
.
toString
()
+
"取消置顶 = "
+
(
istop
==
0
)
)
var
dis
=
ImHttpImpl
.
getInstance
().
topMessage
(
ImHttpImpl
.
getInstance
().
topMessage
(
TopMessageParam
(
bean
.
toUid
.
toString
(),
1
,
...
...
@@ -199,13 +222,14 @@ class MedicalChatAdapter(
)
.
compose
(
RxUtils
.
applySchedulers
(
lifecycleable
))
.
compose
(
RxUtils
.
resultData
())
.
subscribe
({
o
->
.
subscribe
({
LogHelper
.
getInstance
().
writeLogSync
(
"置顶聊天成功:uid = "
+
bean
.
toUid
.
toString
()
+
"取消置顶 = "
+
(
istop
==
0
)
)
mListener
?.
onRefresh
()
},
{
t
->
},
{
e
->
e
.
printStackTrace
()
LogHelper
.
getInstance
().
writeLogSync
(
"置顶聊天失败:uid = "
+
bean
.
toUid
.
toString
()
+
"取消置顶 = "
+
(
istop
==
0
)
...
...
@@ -234,13 +258,18 @@ class MedicalChatAdapter(
}
/**
*
互动
列表正常item的holder
*
消息
列表正常item的holder
*/
inner
class
ChatItemHolder
(
val
view
:
MedicalChatItemView
)
:
RecyclerView
.
ViewHolder
(
view
)
/**
*
互动
列表正常item的holder
*
消息
列表正常item的holder
*/
inner
class
ChatTimeItemHolder
(
val
view
:
ChatTimeItemView
)
:
RecyclerView
.
ViewHolder
(
view
)
/**
* 消息列表系统消息 item的holder
*/
inner
class
SystemItemHolder
(
val
view
:
MedicalSystemItemView
)
:
RecyclerView
.
ViewHolder
(
view
)
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalSystemListAdapter.kt
View file @
74e60255
...
...
@@ -14,7 +14,7 @@ class MedicalSystemListAdapter :
override
fun
convert
(
helper
:
BaseViewHolder
,
item
:
SystemItemBean
)
{
//时间
helper
.
setText
(
R
.
id
.
time_text
,
TimeUtil
.
getTimeStringForDate
(
item
.
createTime
)
)
helper
.
setText
(
R
.
id
.
time_text
,
item
.
createTime
)
//标题
item
.
title
?.
let
{
title
->
helper
.
setText
(
R
.
id
.
system_title
,
title
)
...
...
@@ -23,7 +23,6 @@ class MedicalSystemListAdapter :
item
.
content
?.
let
{
content
->
helper
.
setText
(
R
.
id
.
system_dec
,
content
)
}
helper
.
setVisible
(
R
.
id
.
chat_message_unread_num
,!
item
.
read
)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/medical/im/bean/SystemItemBean.kt
View file @
74e60255
...
...
@@ -5,9 +5,13 @@ package com.yidianling.medical.im.bean
* */
data class
SystemItemBean
(
var
content
:
String
,
var
createTime
:
Lo
ng
,
var
msgId
:
String
,
var
createTime
:
Stri
ng
,
var
msgId
:
Int
,
var
read
:
Boolean
,
var
readTime
:
String
,
var
title
:
String
var
title
:
String
,
//业务类型 1-问诊订单 2-处方单 3-药品订单 4-电子签名
var
bizType
:
String
,
//业务数据ID
var
bizId
:
String
)
m-im/src/main/java/com/yidianling/medical/im/bean/SystemUnReadRespose.kt
0 → 100644
View file @
74e60255
package
com.yidianling.medical.im.bean
data class
SystemUnReadRespose
(
var
bizData
:
String
,
var
createTime
:
String
,
var
msgId
:
String
,
var
title
:
String
,
var
unReadTotalCount
:
Int
)
m-im/src/main/java/com/yidianling/medical/im/view/MedicalSystemItemView.kt
0 → 100644
View file @
74e60255
package
com.yidianling.medical.im.view
import
android.content.Context
import
android.view.View
import
android.widget.LinearLayout
import
com.ydl.ydl_image.module.GlideApp
import
com.yidianling.avchatkit.common.util.TimeUtil
import
com.yidianling.im.R
import
com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import
kotlinx.android.synthetic.main.medical_im_system_item_view.view.*
/**
* 互动列表系统消息itemView
*/
class
MedicalSystemItemView
(
mContext
:
Context
)
:
LinearLayout
(
mContext
)
{
init
{
val
params
=
LinearLayout
.
LayoutParams
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
medical_im_system_item_view
,
this
)
}
fun
initData
(
bean
:
ChatItemBean
?)
{
bean
?.
let
{
if
(
bean
.
timeStr
.
isNotEmpty
())
{
chat_message_time
.
text
=
bean
.
timeStr
}
if
(
bean
.
title
.
isNotEmpty
())
{
chat_message_content
.
text
=
bean
.
title
}
else
{
chat_message_content
.
text
=
"暂无新消息"
}
if
(
bean
.
unReadNum
>
0
)
{
chat_message_unread_num
.
visibility
=
View
.
VISIBLE
}
else
{
chat_message_unread_num
.
visibility
=
View
.
GONE
}
}
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
74e60255
...
...
@@ -172,4 +172,9 @@ interface ServiceApi {
@Query
(
"pageSize"
)
pageSize
:
Int
,
@Query
(
"read"
)
read
:
String
?
):
Observable
<
BaseAPIResponse
<
SystemListRespose
>>
//医疗 系统消息 设为已读
@GET
(
"api/client/message/v1/read"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA_URL
)
fun
systemRead
(
@Query
(
"msgId"
)
msgId
:
Int
):
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
74e60255
...
...
@@ -283,6 +283,13 @@ class ServiceImpl private constructor() {
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getSystemPageList
(
pageNum
,
pageSize
,
read
)
}
/**
* 医疗 系统消息 设为已读
* */
fun
systemRead
(
msgId
:
Int
):
Observable
<
BaseAPIResponse
<
Any
>>{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
systemRead
(
msgId
)
}
fun
uploadBatch
(
map
:
TreeMap
<
String
,
RequestBody
>):
Observable
<
BaseAPIResponse
<
List
<
MedicalFileBeanRespose
>>>
{
...
...
m-im/src/main/res/drawable-xhdpi/medical_system_item_icon.png
0 → 100644
View file @
74e60255
2.96 KB
m-im/src/main/res/layout/list_empty_view.xml
0 → 100644
View file @
74e60255
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/im_empty_img"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/platform_list_empty_icon"
app:layout_constraintBottom_toTopOf=
"@id/im_net_error"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/im_net_error"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"网络异常,请稍后再试"
android:textColor=
"#8595a9"
android:textSize=
"14sp"
app:layout_constraintBottom_toTopOf=
"@id/im_reLoad"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/im_empty_img"
/>
<TextView
android:id=
"@+id/im_reLoad"
android:layout_width=
"120dp"
android:layout_height=
"62dp"
android:background=
"@drawable/platform_medical_login_bg"
android:gravity=
"center"
android:text=
"重新加载"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/im_net_error"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
m-im/src/main/res/layout/medical_im_chat_fragment_layout.xml
View file @
74e60255
...
...
@@ -53,49 +53,6 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/top_hide"
android:visibility=
"gone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"#0d3464EC"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingLeft=
"10dp"
android:paddingTop=
"10dp"
android:paddingRight=
"16dp"
android:paddingBottom=
"10dp"
>
<ImageView
android:id=
"@+id/close_hide"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"6dp"
android:paddingRight=
"6dp"
android:src=
"@mipmap/medical_close_ovel"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"开启推送通知,及时查看消息~"
android:textColor=
"#ff3464ec"
android:textSize=
"14sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/medical_bg_3464ec_4dp_fill"
android:gravity=
"center"
android:paddingLeft=
"12dp"
android:paddingTop=
"5dp"
android:paddingRight=
"12dp"
android:paddingBottom=
"6dp"
android:text=
"立即开启"
android:textColor=
"#ffffffff"
android:textSize=
"12sp"
/>
</LinearLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
m-im/src/main/res/layout/medical_im_system_item_view.xml
0 → 100644
View file @
74e60255
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingStart=
"16dp"
android:paddingTop=
"15dp"
android:paddingEnd=
"15dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_img"
android:layout_width=
"52dp"
android:layout_height=
"52dp"
android:layout_marginTop=
"5dp"
app:cardCornerRadius=
"26dp"
app:cardElevation=
"0dp"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:id=
"@+id/chat_message_img"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
android:src=
"@drawable/medical_system_item_icon"
/>
</androidx.cardview.widget.CardView>
<View
android:id=
"@+id/chat_message_unread_num"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"4dp"
android:background=
"@drawable/im_chat_message_unread_num_bg"
android:gravity=
"center"
android:minWidth=
"12dp"
android:paddingLeft=
"5dp"
android:paddingRight=
"5dp"
android:textColor=
"@color/im_white"
android:visibility=
"gone"
app:layout_constraintRight_toRightOf=
"@id/card_img"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
""
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/chat_message_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
"系统消息"
android:textColor=
"@color/medical_color_0c1d31"
android:textSize=
"16sp"
android:textStyle=
"bold"
app:layout_constraintLeft_toRightOf=
"@id/card_img"
app:layout_constraintTop_toTopOf=
"@id/card_img"
/>
<TextView
android:id=
"@+id/chat_message_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:maxLines=
"1"
android:textColor=
"#8595A9"
android:textSize=
"13sp"
app:layout_constraintBaseline_toBaselineOf=
"@id/chat_message_name"
app:layout_constraintRight_toRightOf=
"parent"
tools:text=
"09-04"
/>
<TextView
android:id=
"@+id/chat_message_content"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:layout_marginRight=
"35dp"
android:layout_marginBottom=
"18dp"
android:ellipsize=
"end"
android:gravity=
"left"
android:maxLines=
"1"
android:text=
"暂无消息"
android:textColor=
"#495C72"
android:textSize=
"14sp"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toLeftOf=
"@id/chat_message_name"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/chat_message_name"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"0.5dp"
android:layout_marginTop=
"20dp"
android:background=
"#E7ECF0"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toLeftOf=
"@id/chat_message_name"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/chat_message_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
m-im/src/main/res/layout/medical_item_system_list.xml
View file @
74e60255
...
...
@@ -46,6 +46,21 @@
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:id=
"@+id/chat_message_unread_num"
android:layout_width=
"8dp"
android:layout_height=
"8dp"
android:background=
"@drawable/im_chat_message_unread_num_bg"
android:gravity=
"center"
android:minWidth=
"18dp"
android:paddingLeft=
"5dp"
android:paddingRight=
"5dp"
android:textColor=
"@color/im_white"
android:visibility=
"gone"
app:layout_constraintRight_toRightOf=
"@id/system_icon"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
""
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/system_title"
android:layout_width=
"wrap_content"
...
...
m-im/src/main/res/layout/medical_system_list_activity.xml
View file @
74e60255
...
...
@@ -6,9 +6,9 @@
android:background=
"@color/white"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
android:id=
"@+id/
system_
toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"
5
6dp"
android:layout_height=
"
9
6dp"
android:background=
"@color/white"
android:elevation=
"0dp"
android:gravity=
"bottom"
...
...
@@ -28,7 +28,7 @@
android:gravity=
"center"
android:maxEms=
"10"
android:maxLines=
"1"
android:text=
"
系统消息
"
android:text=
"
@string/medical_system_message
"
android:textColor=
"@color/medical_color_10233a"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
...
...
@@ -50,7 +50,7 @@
android:layout_height=
"0dp"
android:background=
"#f6f7f9"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/toolbar"
app:layout_constraintTop_toBottomOf=
"@id/
system_
toolbar"
app:layout_constraintVertical_weight=
"1"
>
...
...
m-im/src/main/res/values/strings.xml
View file @
74e60255
...
...
@@ -271,5 +271,6 @@
f、用户确认从未得到服务结果会百分之百成功的许诺。
<br/>
g、用户同意您的诊疗内容在去除姓名、头像、出生日期等信息后将设置为默认展示,医生给您的指导建议同时也会帮助其他相似情况的用户。
<br/>
如您对本同意书有任何疑问,可联系客服进行联系。
</string>
<string
name=
"medical_system_message"
>
系统消息
</string>
</resources>
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