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
31508559
Commit
31508559
authored
Dec 02, 2020
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:m-im 修复私聊列表--通知--预约提醒列表--已读红点并未消失功能
parent
12b79209
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
121 deletions
+126
-121
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
MsgListAdapter.java
m-im/src/main/java/com/yidianling/im/ui/adapter/MsgListAdapter.java
+124
-119
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
31508559
...
...
@@ -20,8 +20,8 @@ import java.util.List;
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
//
public static String appEnv = YDLConstants.ENV_PROD;
//
public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
...
...
m-im/src/main/java/com/yidianling/im/ui/adapter/MsgListAdapter.java
View file @
31508559
...
...
@@ -13,6 +13,7 @@ import com.ydl.ydlcommon.base.BaseActivity;
import
com.ydl.ydlcommon.base.lifecycle.ILifecycleable
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
;
import
com.ydl.ydlcommon.utils.LogUtil
;
import
com.ydl.ydlcommon.utils.StringUtils
;
import
com.ydl.ydlcommon.utils.remind.ToastHelper
;
import
com.yidianling.im.bean.MsgData
;
...
...
@@ -29,7 +30,9 @@ import org.jetbrains.annotations.NotNull;
import
java.util.Map
;
import
de.greenrobot.event.EventBus
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.schedulers.Schedulers
;
/**
* 消息adapter
...
...
@@ -60,130 +63,132 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
convertView
=
new
MsgListItemView
(
context
,
type
);
}
((
MsgListItemView
)
convertView
).
setData
(
mDataList
.
get
(
position
));
convertView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
//动态消息暂时不需要访问以下接口
boolean
fla
=
false
;
//判断是否是跳转专家主页
boolean
boo
=
jumpForUrl
(
mDataList
.
get
(
position
).
link
);
if
(!
boo
)
{
//事件未消费
switch
(
mDataList
.
get
(
position
).
type
)
{
case
1108
:
case
1111
:
context
.
startActivity
(
ImIn
.
INSTANCE
.
membersIntent
(
context
,
mDataList
.
get
(
position
).
relation_id
));
fla
=
true
;
break
;
case
1109
:
//跳转到回复详情
case
1113
:
// 跳转到回复详情(有回复动态)
MsgData
msgData
=
mDataList
.
get
(
position
);
context
.
startActivity
(
ImIn
.
INSTANCE
.
replayInfoIntent
(
context
,
msgData
.
relation_id
,
msgData
.
relation_id2
));
fla
=
true
;
break
;
case
1110
:
context
.
startActivity
(
ImIn
.
INSTANCE
.
trendsDetailIntent
(
context
,
Integer
.
valueOf
(
mDataList
.
get
(
position
).
relation_id
),
true
));
fla
=
true
;
break
;
case
1112
:
String
lastid
=
mDataList
.
get
(
position
).
relation_id2
;
int
trendId
=
Integer
.
valueOf
(
mDataList
.
get
(
position
).
relation_id
.
trim
());
int
lastId
=
TextUtils
.
isEmpty
(
lastid
)
?
0
:
Integer
.
valueOf
(
lastid
.
trim
());
context
.
startActivity
(
ImIn
.
INSTANCE
.
trendsDetailIntent
(
context
,
trendId
,
true
,
lastId
));
fla
=
true
;
break
;
case
600
:
//跳转H5页面--课程详情
case
1116
:
//课程评论回复
H5Params
h5Params
=
new
H5Params
(
mDataList
.
get
(
position
).
link
,
null
);
h5Params
.
setShareData
(
mDataList
.
get
(
position
).
share
);
NewH5Activity
.
start
(
context
,
h5Params
);
break
;
case
1400
:
//投诉反馈
ARouter
.
getInstance
().
build
(
"/mine/MyFeedBackActivity"
).
withString
(
"intent_id"
,
mDataList
.
get
(
position
).
relation_id
).
navigation
();
fla
=
true
;
break
;
}
convertView
.
setOnClickListener
(
v
->
{
//动态消息暂时不需要访问以下接口
boolean
fla
=
false
;
//判断是否是跳转专家主页
boolean
boo
=
jumpForUrl
(
mDataList
.
get
(
position
).
link
);
if
(!
boo
)
{
//事件未消费
switch
(
mDataList
.
get
(
position
).
type
)
{
case
1108
:
case
1111
:
context
.
startActivity
(
ImIn
.
INSTANCE
.
membersIntent
(
context
,
mDataList
.
get
(
position
).
relation_id
));
fla
=
true
;
break
;
case
1109
:
//跳转到回复详情
case
1113
:
// 跳转到回复详情(有回复动态)
MsgData
msgData
=
mDataList
.
get
(
position
);
context
.
startActivity
(
ImIn
.
INSTANCE
.
replayInfoIntent
(
context
,
msgData
.
relation_id
,
msgData
.
relation_id2
));
fla
=
true
;
break
;
case
1110
:
context
.
startActivity
(
ImIn
.
INSTANCE
.
trendsDetailIntent
(
context
,
Integer
.
valueOf
(
mDataList
.
get
(
position
).
relation_id
),
true
));
fla
=
true
;
break
;
case
1112
:
String
lastid
=
mDataList
.
get
(
position
).
relation_id2
;
int
trendId
=
Integer
.
valueOf
(
mDataList
.
get
(
position
).
relation_id
.
trim
());
int
lastId
=
TextUtils
.
isEmpty
(
lastid
)
?
0
:
Integer
.
valueOf
(
lastid
.
trim
());
context
.
startActivity
(
ImIn
.
INSTANCE
.
trendsDetailIntent
(
context
,
trendId
,
true
,
lastId
));
fla
=
true
;
break
;
case
600
:
//跳转H5页面--课程详情
case
1116
:
//课程评论回复
H5Params
h5Params
=
new
H5Params
(
mDataList
.
get
(
position
).
link
,
null
);
h5Params
.
setShareData
(
mDataList
.
get
(
position
).
share
);
NewH5Activity
.
start
(
context
,
h5Params
);
break
;
case
1400
:
//投诉反馈
ARouter
.
getInstance
().
build
(
"/mine/MyFeedBackActivity"
).
withString
(
"intent_id"
,
mDataList
.
get
(
position
).
relation_id
).
navigation
();
fla
=
true
;
break
;
}
}
if
(
fla
||
boo
)
{
//跟新未读
Disposable
dis
=
httpHelper
.
getMsgDetail
(
new
MsgDetailParam
(
mDataList
.
get
(
position
).
id
))
.
compose
(
RxUtils
.
applySchedulers
(
lifecycleable
))
.
compose
(
RxUtils
.
resultData
())
.
subscribe
(
msgDetail
->
{
mDataList
.
get
(
position
).
is_read
=
2
;
notifyDataSetChanged
();
EventBus
.
getDefault
().
post
(
new
UpdateTabUnreadNumEvent
());
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
ToastHelper
.
Companion
.
show
(
msg
);
}
});
//如果是动态消息则到此结束,其它消息类型走下面流程
}
else
{
Disposable
di
=
httpHelper
.
getMsgDetail
(
new
MsgDetailParam
(
mDataList
.
get
(
position
).
id
))
.
compose
(
RxUtils
.
applySchedulers
(
lifecycleable
))
.
compose
(
RxUtils
.
resultData
())
.
subscribe
(
msgDetail
->
{
mDataList
.
get
(
position
).
is_read
=
2
;
EventBus
.
getDefault
().
post
(
new
UpdateTabUnreadNumEvent
());
switch
(
msgDetail
.
type
)
{
case
1
:
case
2
:
case
501
:
case
502
:
case
506
:
//预约详情
H5Params
h5Params
=
new
H5Params
(
ImIn
.
INSTANCE
.
getReserveHost
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Params
);
break
;
case
504
:
case
505
:
//微问诊列表
H5Params
h5Paramswe
=
new
H5Params
(
ImConstants
.
Companion
.
getMY_CHAT
(),
null
);
NewH5Activity
.
start
(
context
,
h5Paramswe
);
break
;
case
507
:
case
508
:
case
509
:
//预约评价 微问诊评价 倾诉评价
H5Params
h5Paramspi
=
new
H5Params
(
ImConstants
.
Companion
.
getYYPJ
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Paramspi
);
break
;
case
510
:
//免费体验详情
H5Params
h5Paramsmi
=
new
H5Params
(
ImConstants
.
Companion
.
getFREEDTAIL
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Paramsmi
);
break
;
case
503
:
case
1001
:
case
1002
:
case
1004
:
//老板心事心事详情
break
;
case
1003
:
if
(
fla
||
boo
)
{
//跟新未读
Disposable
dis
=
httpHelper
.
getMsgDetail
(
new
MsgDetailParam
(
mDataList
.
get
(
position
).
id
))
// .compose(RxUtils.applySchedulers(lifecycleable))
.
subscribeOn
(
Schedulers
.
io
())
.
compose
(
RxUtils
.
resultData
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
msgDetail
->
{
mDataList
.
get
(
position
).
is_read
=
2
;
notifyDataSetChanged
();
EventBus
.
getDefault
().
post
(
new
UpdateTabUnreadNumEvent
());
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
ToastHelper
.
Companion
.
show
(
msg
);
}
});
//如果是动态消息则到此结束,其它消息类型走下面流程
}
else
{
Disposable
di
=
httpHelper
.
getMsgDetail
(
new
MsgDetailParam
(
mDataList
.
get
(
position
).
id
))
// .compose(RxUtils.applySchedulers(lifecycleable))
.
subscribeOn
(
Schedulers
.
io
())
.
compose
(
RxUtils
.
resultData
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
msgDetail
->
{
mDataList
.
get
(
position
).
is_read
=
2
;
notifyDataSetChanged
();
EventBus
.
getDefault
().
post
(
new
UpdateTabUnreadNumEvent
());
switch
(
msgDetail
.
type
)
{
case
1
:
case
2
:
case
501
:
case
502
:
case
506
:
//预约详情
H5Params
h5Params
=
new
H5Params
(
ImIn
.
INSTANCE
.
getReserveHost
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Params
);
break
;
case
504
:
case
505
:
//微问诊列表
H5Params
h5Paramswe
=
new
H5Params
(
ImConstants
.
Companion
.
getMY_CHAT
(),
null
);
NewH5Activity
.
start
(
context
,
h5Paramswe
);
break
;
case
507
:
case
508
:
case
509
:
//预约评价 微问诊评价 倾诉评价
H5Params
h5Paramspi
=
new
H5Params
(
ImConstants
.
Companion
.
getYYPJ
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Paramspi
);
break
;
case
510
:
//免费体验详情
H5Params
h5Paramsmi
=
new
H5Params
(
ImConstants
.
Companion
.
getFREEDTAIL
()
+
msgDetail
.
relation_id1
,
null
);
NewH5Activity
.
start
(
context
,
h5Paramsmi
);
break
;
case
503
:
case
1001
:
case
1002
:
case
1004
:
//老板心事心事详情
break
;
case
1003
:
// ImIn.INSTANCE.MyRedPackActivity(context,null);
ImIn
.
INSTANCE
.
myRedPockIntent
(
context
);
break
;
}
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
((
BaseActivity
)
context
).
dismissProgressDialog
();
ToastHelper
.
Companion
.
show
(
msg
);
}
});
}
ImIn
.
INSTANCE
.
myRedPockIntent
(
context
);
break
;
}
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
((
BaseActivity
)
context
).
dismissProgressDialog
();
ToastHelper
.
Companion
.
show
(
msg
);
}
});
}
});
return
convertView
;
}
...
...
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