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
a676a7e0
Commit
a676a7e0
authored
May 07, 2022
by
upwork.021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 首问语逻辑修改,代码提交
parent
a4de45ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
71 deletions
+31
-71
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+2
-2
IMChatUtil.kt
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
+3
-12
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+23
-50
InputPanel.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
+1
-5
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
a676a7e0
...
...
@@ -21,9 +21,9 @@ 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_TEST
;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
//
public static String appEnv = YDLConstants.ENV_PROD;
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
lifecycles
.
add
(
new
DemoAppLifecycles
());
...
...
config.gradle
View file @
a676a7e0
...
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.04"
,
"m-home"
:
"0.0.23.37"
,
"m-im"
:
"0.0.21.3
0
"
,
"m-im"
:
"0.0.21.3
2
"
,
"m-dynamic"
:
"0.0.7.36"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -96,7 +96,7 @@ ext {
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.04"
,
"m-home"
:
"0.0.23.37"
,
"m-im"
:
"0.0.21.3
0
"
,
"m-im"
:
"0.0.21.3
2
"
,
"m-dynamic"
:
"0.0.7.36"
,
"m-article"
:
"0.0.0.8"
,
...
...
m-im/src/main/java/com/yidianling/im/helper/IMChatUtil.kt
View file @
a676a7e0
...
...
@@ -184,9 +184,7 @@ object IMChatUtil {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
res
:
BaseResponse
<
UserTypeBean
>
->
if
(
res
.
code
==
200
&&
res
.
data
!=
null
)
{
if
(
res
.
data
!!
.
chatEvent
)
{
//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
}
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
if
(
TextUtils
.
equals
(
res
.
data
!!
.
userType
,
USER_TYPE_EXPERT
.
toString
())
)
{
//专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
...
...
@@ -259,12 +257,7 @@ object IMChatUtil {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
res
:
BaseResponse
<
UserTypeBean
>
->
if
(
res
.
code
==
200
&&
res
.
data
!=
null
)
{
if
(
res
.
data
!!
.
chatEvent
)
{
//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
}
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
if
(
TextUtils
.
equals
(
res
.
data
!!
.
userType
,
USER_TYPE_EXPERT
.
toString
()))
{
//专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
getImJavaApi
().
getChatUid
(
toUid
)
...
...
@@ -374,9 +367,7 @@ object IMChatUtil {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
res
:
BaseResponse
<
UserTypeBean
>
->
if
(
res
.
code
==
200
&&
res
.
data
!=
null
)
{
if
(
res
.
data
!!
.
chatEvent
)
{
//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
}
ChatStatusCacheHelper
.
setStatusCache
(
"chatEvent"
,
res
.
data
!!
.
chatEvent
)
if
(
TextUtils
.
equals
(
res
.
data
!!
.
userType
,
"2"
))
{
//接口返回值是专家,java接口
prepareExpertChatData
(
context
,
toUid
,
listener
)
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
a676a7e0
...
...
@@ -321,10 +321,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rela_zixun
.
setVisibility
(
View
.
GONE
);
titleBar
.
setTitleRightDraw
(
null
);
}
}
// 判断最近一次发送消息的时间是否大于24小时
long
time
=
System
.
currentTimeMillis
()-
SPUtils
.
getInstance
().
getLong
(
ModularServiceManager
.
INSTANCE
.
provide
(
IUserService
.
class
).
getUserInfo
().
getUid
(),
0L
);
if
(
time
==
0L
||
time
>
24
*
60
*
60
*
1000
){
//如果等于0或者大于则请求首问语接口
@SuppressLint
(
"CheckResult"
)
private
void
initView
()
{
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"chatEvent"
)&&
SessionTypeEnum
.
Team
!=
sessionType
)
{
// 获取首问语数据
ServiceImpl
.
Companion
.
getInstance
().
getFirstQuestion
()
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -339,34 +340,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ToastUtil
.
toastShort
(
throwable
.
getMessage
());
});
}
}
@SuppressLint
(
"CheckResult"
)
private
void
initView
()
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
)
{
//助理
/*rl_common_question_enter.setOnClickListener(v -> {
rl_common_question_enter.setOnClickListener(v -> {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
openOrCloseCommonQuestionLayout(true);
} else {
getCommonQuestionListData();
}
});*/
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"chatEvent"
))
{
if
(
commonQuestionBeanList
!=
null
&&
commonQuestionBeanList
.
size
()
>
0
)
{
// rl_common_question_enter.postDelayed(() -> openOrCloseCommonQuestionLayout(true), 300);
}
else
{
try
{
YdlBuryPointUtil
.
sendPv
(
"common_question_pager"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
getCommonQuestionListData
();
}
ChatStatusCacheHelper
.
clearDataByKey
(
"chatEvent"
);
}
}
//有未完成订单或者有未评价订单时,显示订单布局
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
()
!=
null
)
{
...
...
@@ -1517,26 +1490,26 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
@SuppressLint
(
"CheckResult"
)
private
void
getCommonQuestionListData
()
{
ServiceImpl
.
Companion
.
getInstance
().
getCommonQuestionList
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
res
.
data
!=
null
&&
res
.
data
.
size
()
>
0
)
{
if
(
commonQuestionBeanList
==
null
)
{
commonQuestionBeanList
=
new
ArrayList
<>();
}
else
{
commonQuestionBeanList
.
clear
();
}
commonQuestionBeanList
.
addAll
(
res
.
data
);
//
@SuppressLint("CheckResult")
//
private void getCommonQuestionListData() {
//
ServiceImpl.Companion.getInstance().getCommonQuestionList()
//
.subscribeOn(Schedulers.io())
//
.observeOn(AndroidSchedulers.mainThread())
//
.subscribe(res -> {
//
if (res.data != null && res.data.size() > 0) {
//
if (commonQuestionBeanList == null) {
//
commonQuestionBeanList = new ArrayList<>();
//
} else {
//
commonQuestionBeanList.clear();
//
}
//
commonQuestionBeanList.addAll(res.data);
// initCommonQuestionLayout();
}
},
throwable
->
{
ToastUtil
.
toastShort
(
throwable
.
toString
());
});
}
//
}
//
//
}, throwable -> {
//
ToastUtil.toastShort(throwable.toString());
//
});
//
}
/*
* 用户是否在当前页面
*
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
View file @
a676a7e0
...
...
@@ -68,6 +68,7 @@ import com.yidianling.nimbase.common.util.string.StringUtil;
import
com.yidianling.uikit.api.NimUIKit
;
import
com.yidianling.uikit.api.NimUIKitImpl
;
import
com.yidianling.uikit.business.ait.AitTextChangeListener
;
import
com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper
;
import
com.yidianling.uikit.custom.widget.SafeHelpRemindDialog
;
import
com.yidianling.user.api.service.IUserService
;
...
...
@@ -313,8 +314,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
String
content
=
firstQuestionAdapter
.
getData
().
get
(
position
).
getContent
();
// 埋点
ActionCountUtils
.
Companion
.
baiDuCountSign3
(
"counselor_consult_page"
,
"quick_language_click"
,
content
,
""
,
""
);
// 根据uid记录每次发消息的时间戳
SPUtils
.
getInstance
().
put
(
uid
,
System
.
currentTimeMillis
());
onTextMessageSendButtonPressed
(
content
);
clFirstQuestion
.
setVisibility
(
View
.
GONE
);
});
...
...
@@ -553,9 +552,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
* 替换之后最终发送的字符串
*/
private
void
onTextMessageSendButtonClick
()
{
// 根据uid记录每次发消息的时间戳
SPUtils
.
getInstance
().
put
(
uid
,
System
.
currentTimeMillis
());
IMMessage
textMessage
=
createTextMessage
(
sendText
);
if
(
container
.
proxy
.
sendMessage
(
textMessage
))
{
restoreText
(
true
);
...
...
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