Commit a676a7e0 by upwork.021

feat: 首问语逻辑修改,代码提交

parent a4de45ff
......@@ -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());
......
......@@ -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.30",
"m-im" : "0.0.21.32",
"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.30",
"m-im" : "0.0.21.32",
"m-dynamic" : "0.0.7.36",
"m-article" : "0.0.0.8",
......
......@@ -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)
......
......@@ -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());
// });
// }
/*
* 用户是否在当前页面
*
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment