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
2a2d953c
Commit
2a2d953c
authored
May 30, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 私聊消息跳转倾诉列表问题修复
parent
bc030ef6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
169 additions
and
139 deletions
+169
-139
config.gradle
config.gradle
+6
-6
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+17
-0
CustomAttachmentShareMsg.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentShareMsg.java
+17
-6
MsgViewHolderReceivedMoney.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderReceivedMoney.java
+3
-1
MsgViewHolderShareMsg.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderShareMsg.kt
+124
-126
IYDLRouterConstant.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/router/IYDLRouterConstant.kt
+2
-0
No files found.
config.gradle
View file @
2a2d953c
...
...
@@ -5,12 +5,12 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.9
4
"
,
"m-confide"
:
"0.0.49.9
5
"
,
"m-consultant"
:
"0.0.60.27"
,
"m-fm"
:
"0.0.30.09"
,
"m-user"
:
"0.0.62.18"
,
"m-home"
:
"0.0.23.74"
,
"m-im"
:
"0.0.21.4
6
"
,
"m-im"
:
"0.0.21.4
7
"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -35,7 +35,7 @@ ext {
//mdt 组件
"ydl-tuicore"
:
"0.0.23"
,
//第一步
"ydl-platform"
:
"0.0.41.
18
"
,
"ydl-platform"
:
"0.0.41.
21
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.80"
,
...
...
@@ -90,12 +90,12 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.9
4
"
,
"m-confide"
:
"0.0.49.9
5
"
,
"m-consultant"
:
"0.0.60.27"
,
"m-fm"
:
"0.0.30.09"
,
"m-user"
:
"0.0.62.18"
,
"m-home"
:
"0.0.23.74"
,
"m-im"
:
"0.0.21.4
6
"
,
"m-im"
:
"0.0.21.4
7
"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -118,7 +118,7 @@ ext {
//mdt组件
"ydl-tuicore"
:
"0.0.23"
,
//第一步
"ydl-platform"
:
"0.0.41.
18
"
,
"ydl-platform"
:
"0.0.41.
21
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.80"
,
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
2a2d953c
package
com.ydl.confide.home
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.graphics.Color
import
android.os.Build
...
...
@@ -25,9 +26,11 @@ import com.ydl.confide.home.event.ConfideHomeEventImpl
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import
com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import
com.ydl.confide.home.modular.service.ConfideWebServiceImpl
import
com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import
com.ydl.confide.home.util.ConfideHomeUtils
import
com.ydl.confide.home.widget.FilterItemDecoration
import
com.ydl.confide.intro.VideoViewModel
import
com.ydl.confide.router.PhoneCallIn
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
...
...
@@ -182,6 +185,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override
fun
initDataAndEvent
()
{
//来自首页倾诉红包入口
val
isFromRed
=
intent
.
getBooleanExtra
(
IYDLRouterConstant
.
EXTRA_RED_PACKET
,
false
)
val
confidedId
=
intent
.
getStringExtra
(
IYDLRouterConstant
.
EXTRA_CONFIDEDID
)
val
doctorId
=
intent
.
getStringExtra
(
IYDLRouterConstant
.
EXTRA_DOCTORID
)
isSplash
=
intent
.
getBooleanExtra
(
"isSplash"
,
false
)
//初始化View
...
...
@@ -206,6 +211,18 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
if
(
isFromRed
){
ToastUtil
.
toastLong
(
this
@ConfideHomeActivity
,
"红包已领取成功 可立即点击拨打"
)
}
if
(!
confidedId
.
isNullOrBlank
()
&&
!
doctorId
.
isNullOrBlank
()){
ConfideWebServiceImpl
().
connectionJava
(
confidedId
.
toInt
(),
3
,
this
@ConfideHomeActivity
,
null
)
{
showDoctorDetail
(
confidedId
,
doctorId
)
}
}
}
private
fun
showDoctorDetail
(
confideId
:
String
,
doctorId
:
String
)
{
val
url
=
HttpConfig
.
MH5_URL
+
ConfideRoute
.
h5ConfideIntro
(
confideId
)
ConfideBottomSheetDialogFragment
()
.
showBottomSheetDialog
(
this
@ConfideHomeActivity
,
url
,
doctorId
)
}
override
fun
onResume
()
{
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentShareMsg.java
View file @
2a2d953c
...
...
@@ -21,27 +21,29 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
private
final
String
KEY_SHAREPOPULAR
=
"sharePopular"
;
// 分享的人气
private
final
String
KEY_SHARE_JUMP_URL
=
"url"
;
// 分享的跳转链接
private
final
String
KEY_CONFIDEDID
=
"confidedId"
;
//倾诉id
private
final
String
KEY_DOCTORID
=
"doctorId"
;
private
String
shareUrl
;
private
String
sharePrice
;
//分享类型,0:测试;1,课程;2,文章;3:倾诉
private
int
shareType
;
private
String
confidedId
;
private
String
doctorId
;
public
CustomAttachmentShareMsg
()
{
super
(
CustomAttachmentType
.
TYPE_PUSH_SHARE
);
}
public
CustomAttachmentShareMsg
(
String
url
,
String
money
,
ShareMsgTypeEnum
typeEnum
)
{
super
(
CustomAttachmentType
.
TYPE_PUSH_SHARE
);
this
.
shareUrl
=
url
;
this
.
sharePrice
=
money
;
this
.
shareType
=
typeEnum
.
value
();
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
this
.
shareUrl
=
data
.
getString
(
KEY_SHARE_JUMP_URL
);
this
.
sharePrice
=
data
.
getString
(
KEY_PRICE
);
this
.
shareType
=
data
.
getInteger
(
KEY_SHARETYPE
);
this
.
confidedId
=
data
.
getString
(
KEY_CONFIDEDID
);
this
.
doctorId
=
data
.
getString
(
KEY_DOCTORID
);
}
@Override
...
...
@@ -50,6 +52,8 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
data
.
put
(
KEY_SHARE_JUMP_URL
,
shareUrl
);
data
.
put
(
KEY_PRICE
,
sharePrice
);
data
.
put
(
KEY_SHARETYPE
,
shareType
);
data
.
put
(
KEY_CONFIDEDID
,
confidedId
);
data
.
put
(
KEY_DOCTORID
,
doctorId
);
return
data
;
}
...
...
@@ -64,4 +68,11 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
public
int
getShareType
()
{
return
shareType
;
}
public
String
getConfidedId
()
{
return
confidedId
;
}
public
String
getDoctorId
()
{
return
doctorId
;
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderReceivedMoney.java
View file @
2a2d953c
...
...
@@ -59,7 +59,9 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
num
=
customAttachReceivedMoney
.
getNum
();
isNewOrder
=
customAttachReceivedMoney
.
getNewOrder
();
if
(
title
!=
null
)
tit
.
setText
(
title
);
if
(
title
!=
null
)
{
tit
.
setText
(
title
);
}
if
(
orPay
==
1
)
{
//支付成功
if
(
num
!=
null
)
{
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderShareMsg.kt
View file @
2a2d953c
package
com.yidianling.im.session.viewholder
;
import
android.annotation.SuppressLint
;
import
android.widget.TextView
;
import
com.
netease.nimlib.sdk.msg.attachment.MsgAttachment;
import
com.ydl.webview.
H5Params;
import
com.ydl.
webview.NewH5Activity;
import
com.ydl.ydlcommon.
utils.Utils;
import
com.ydl.ydlcommon.
utils.remind.HttpErrorUtils;
import
com.y
idianling.common.tools.ToastUtil;
import
com.y
idianling.im.R;
import
com.yidianling.
im.bean.PushConfideStatusBean;
import
com.yidianling.im.
http.ImRetrofitApi;
import
com.yidianling.im.
router.ImIn;
import
com.yidianling.im.
session.extension.CustomAttachmentShareMsg;
import
com.yidianling.
nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import
com.yidianling.
user.api.bean.UserResponseBean;
import
com.yidianling.
uikit.business.session.viewholder.MsgViewHolderBase;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.schedulers.Schedulers
;
package
com.yidianling.im.session.viewholder
import
android.annotation.SuppressLint
import
android.widget.TextView
import
com.ydl.confide.api.ConfideRoute.R_CONFIDE_HOME
import
com.
ydl.webview.H5Params
import
com.ydl.webview.
NewH5Activity
import
com.ydl.
ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.
modular.route
import
com.ydl.ydlcommon.
router.IYDLRouterConstant
import
com.y
dl.ydlcommon.utils.Utils
import
com.y
dl.ydlcommon.utils.remind.HttpErrorUtils.Companion.handleError
import
com.yidianling.
common.tools.ToastUtil
import
com.yidianling.im.
R
import
com.yidianling.im.
bean.PushConfideStatusBean
import
com.yidianling.im.
http.ImRetrofitApi.Companion.getImJavaApi
import
com.yidianling.
im.router.ImIn.getUserResponse
import
com.yidianling.
im.session.extension.CustomAttachmentShareMsg
import
com.yidianling.
nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
/**
* Created by haorui on 2019-11-06 .
* Des: 分享 消息
* 分享的类型,0:测试;1,课程;2,文章;3:倾诉
* 消息由咨询师端触发
*/
public
class
MsgViewHolderShareMsg
extends
MsgViewHolderBase
{
private
TextView
tv_confide_money
;
private
TextView
tv_confide
;
public
String
mShareUrl
;
public
String
mPrice
;
private
int
mShareType
;
private
Disposable
mSubscribe
;
public
MsgViewHolderShareMsg
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
@Override
protected
int
getContentResId
()
{
MsgAttachment
attachment
=
message
.
getAttachment
();
if
(
attachment
instanceof
CustomAttachmentShareMsg
)
{
CustomAttachmentShareMsg
customMsg
=
(
CustomAttachmentShareMsg
)
attachment
;
switch
(
customMsg
.
getShareType
())
{
//0:测试;
case
0
:
return
R
.
layout
.
im_ui_message_custom_confide
;
//1,课程;
case
1
:
return
R
.
layout
.
im_ui_message_custom_confide
;
//2,文章;
case
2
:
return
R
.
layout
.
im_ui_message_custom_confide
;
//3:倾诉
case
3
:
return
R
.
layout
.
im_ui_message_custom_confide
;
class
MsgViewHolderShareMsg
(
adapter
:
BaseMultiItemFetchLoadAdapter
<*,
*>?)
:
MsgViewHolderBase
(
adapter
)
{
private
var
tv_confide_money
:
TextView
?
=
null
private
var
tv_confide
:
TextView
?
=
null
var
mShareUrl
:
String
?
=
null
var
mPrice
:
String
?
=
null
private
var
mShareType
=
0
private
var
mSubscribe
:
Disposable
?
=
null
private
var
mConfidedId
:
String
?
=
null
private
var
mDoctorId
:
String
?
=
null
//测试
val
Type0
=
0
//课程
private
val
Type1
=
1
//文章
private
val
Type2
=
2
//倾诉
private
val
Type3
=
3
private
val
SUCCESS_CODE
=
"200"
override
fun
getContentResId
():
Int
{
val
attachment
=
message
.
attachment
if
(
attachment
is
CustomAttachmentShareMsg
)
{
return
when
(
attachment
.
shareType
)
{
Type0
->
R
.
layout
.
im_ui_message_custom_confide
Type1
->
R
.
layout
.
im_ui_message_custom_confide
Type2
->
R
.
layout
.
im_ui_message_custom_confide
Type3
->
R
.
layout
.
im_ui_message_custom_confide
else
->
R
.
layout
.
im_ui_message_custom_confide
}
}
return
R
.
layout
.
im_ui_message_custom_confide
;
return
R
.
layout
.
im_ui_message_custom_confide
}
@Override
protected
void
inflateContentView
()
{
tv_confide_money
=
view
.
findViewById
(
R
.
id
.
tv_confide_money
);
tv_confide
=
view
.
findViewById
(
R
.
id
.
tv_confide
);
override
fun
inflateContentView
()
{
tv_confide_money
=
view
.
findViewById
(
R
.
id
.
tv_confide_money
)
tv_confide
=
view
.
findViewById
(
R
.
id
.
tv_confide
)
}
@Override
protected
void
bindContentView
()
{
MsgAttachment
attachment
=
message
.
getAttachment
();
if
(
attachment
instanceof
CustomAttachmentShareMsg
)
{
mShareUrl
=
((
CustomAttachmentShareMsg
)
attachment
).
getShareUrl
();
mPrice
=
((
CustomAttachmentShareMsg
)
attachment
).
getSharePrice
();
mShareType
=
((
CustomAttachmentShareMsg
)
attachment
).
getShareType
();
override
fun
bindContentView
()
{
val
attachment
=
message
.
attachment
if
(
attachment
is
CustomAttachmentShareMsg
)
{
mShareUrl
=
attachment
.
shareUrl
mPrice
=
attachment
.
sharePrice
mShareType
=
attachment
.
shareType
mConfidedId
=
attachment
.
confidedId
mDoctorId
=
attachment
.
doctorId
}
if
(
isReceivedMessage
())
{
setAvatarRightInVisibity
();
if
(
isReceivedMessage
)
{
setAvatarRightInVisibity
()
}
else
{
setAvatarLeftInVisibity
()
;
setAvatarLeftInVisibity
()
}
switch
(
mShareType
)
{
//0:测试;
case
0
:
break
;
//1,课程;
case
1
:
break
;
//2,文章;
case
2
:
break
;
//3:倾诉
case
3
:
tv_confide_money
.
setText
(
mPrice
);
break
;
when
(
mShareType
)
{
Type0
->
{
}
Type1
->
{
}
Type2
->
{
}
Type3
->
tv_confide_money
!!
.
text
=
mPrice
else
->
{
}
}
}
@Override
protected
void
onItemClick
()
{
super
.
onItemClick
();
override
fun
onItemClick
()
{
super
.
onItemClick
()
if
(
Utils
.
isFastClick
())
{
//防止连击
return
;
return
}
requestConfideStatus
()
;
requestConfideStatus
()
}
@SuppressLint
(
"CheckResult"
)
private
void
requestConfideStatus
()
{
if
(
mSubscribe
!=
null
&&
!
mSubscribe
.
isDisposed
())
{
mSubscribe
.
dispose
();
private
fun
requestConfideStatus
()
{
if
(
mSubscribe
!=
null
&&
!
mSubscribe
!!
.
isDisposed
)
{
mSubscribe
!!
.
dispose
()
}
UserResponseBean
userInfo
=
ImIn
.
INSTANCE
.
getUserResponse
();
mSubscribe
=
ImRetrofitApi
.
Companion
.
getImJavaApi
().
getPushConfideStatus
(
userInfo
.
getUid
(),
message
.
getFromAccount
()).
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
(
it
->
{
if
(
"200"
.
equals
(
it
.
code
))
{
PushConfideStatusBean
data
=
it
.
data
;
if
(
data
.
getIsOpen
()
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
getContext
().
getString
(
R
.
string
.
im_push_confide_msg_unopened
));
return
;
}
if
(
data
.
getIsOnline
()
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
getContext
().
getString
(
R
.
string
.
im_push_confide_msg_offline
));
return
;
}
if
(
data
.
getIsReducible
()
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
getContext
().
getString
(
R
.
string
.
im_push_confide_msg_busy
));
return
;
}
if
(
data
.
getIsStatus
()
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
getContext
().
getString
(
R
.
string
.
im_push_confide_msg_calling
));
return
;
val
userInfo
=
getUserResponse
()
mSubscribe
=
getImJavaApi
().
getPushConfideStatus
(
userInfo
!!
.
uid
!!
,
message
.
fromAccount
)
.
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
(
{
it
:
BaseAPIResponse
<
PushConfideStatusBean
>
->
if
(
SUCCESS_CODE
==
it
.
code
)
{
val
data
=
it
.
data
if
(
data
.
isOpen
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
context
.
getString
(
R
.
string
.
im_push_confide_msg_unopened
))
return
@subscribe
}
if
(
data
.
isOnline
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
context
.
getString
(
R
.
string
.
im_push_confide_msg_offline
))
return
@subscribe
}
if
(
data
.
isReducible
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
context
.
getString
(
R
.
string
.
im_push_confide_msg_busy
))
return
@subscribe
}
if
(
data
.
isStatus
!=
1
)
{
ToastUtil
.
toastShort
(
view
.
context
.
getString
(
R
.
string
.
im_push_confide_msg_calling
))
return
@subscribe
}
if
(
mShareType
==
Type3
&&
mConfidedId
!=
null
&&
mDoctorId
!=
null
)
{
//新版本走倾诉列表逻辑
route
(
view
.
context
,
R_CONFIDE_HOME
,
IYDLRouterConstant
.
EXTRA_CONFIDEDID
to
mConfidedId
,
IYDLRouterConstant
.
EXTRA_DOCTORID
to
mDoctorId
)
}
else
{
//老版本去专家主页
NewH5Activity
.
start
(
view
.
context
,
H5Params
(
mShareUrl
!!
,
null
))
}
}
NewH5Activity
.
start
(
view
.
getContext
(),
new
H5Params
(
mShareUrl
,
null
));
}
},
t
->
{
HttpErrorUtils
.
Companion
.
handleError
(
context
,
t
);
});
})
{
t
:
Throwable
?
->
handleError
(
context
,
t
!!
)
}
}
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/router/IYDLRouterConstant.kt
View file @
2a2d953c
...
...
@@ -78,6 +78,8 @@ interface IYDLRouterConstant{
const
val
EXTRA_SHOWTYPE
=
"showType"
const
val
EXTRA_KEYWORD
=
"keyword"
const
val
EXTRA_RED_PACKET
=
"by_red_packet"
const
val
EXTRA_CONFIDEDID
=
"confidedId"
const
val
EXTRA_DOCTORID
=
"doctorId"
/**
* 冥想模块额外参数
...
...
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