Commit 95a9c853 by YKai

feat: 代码优化,组件升级

parent 092150e0
...@@ -10,7 +10,7 @@ ext { ...@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user-medical" : "0.0.62.00", "m-user-medical" : "0.0.62.00",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.21.39", "m-im-medical" : "0.0.21.41",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -94,7 +94,7 @@ ext { ...@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user-medical" : "0.0.62.00", "m-user-medical" : "0.0.62.00",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.21.39", "m-im-medical" : "0.0.21.40",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
......
...@@ -39,8 +39,7 @@ import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler; ...@@ -39,8 +39,7 @@ import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.List; import java.util.List;
import java.util.Objects;
import static com.yidianling.medical.extension.ImActionCountConstantsKt.YDL_MEDICAL_GET_CONSULTATION_PAGE;
/** /**
...@@ -51,11 +50,8 @@ import static com.yidianling.medical.extension.ImActionCountConstantsKt.YDL_MEDI ...@@ -51,11 +50,8 @@ import static com.yidianling.medical.extension.ImActionCountConstantsKt.YDL_MEDI
public class YDLP2PMessageActivity extends YDLBaseMessageActivity { public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
private boolean isResume = false; private boolean isResume = false;
private int screenWidth;
private int screenHeight;
protected YDLMessageFragment messageFragment; protected YDLMessageFragment messageFragment;
private boolean isChangeDoctor = false; private boolean isChangeDoctor = false;
String oldName = "";
private final int MESSAGE_TYPE_END_INQUIRY = 91; // 结束问诊 private final int MESSAGE_TYPE_END_INQUIRY = 91; // 结束问诊
private final int MESSAGE_TYPE_END_TALK = 92; // 结束对话 private final int MESSAGE_TYPE_END_TALK = 92; // 结束对话
...@@ -118,11 +114,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -118,11 +114,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics displayMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(displayMetrics);
screenWidth = displayMetrics.widthPixels;
screenHeight = displayMetrics.heightPixels;
if (ActionHandlerStorage.getL(sessionId) != null) { if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).clear(sessionId); ActionHandlerStorage.getL(sessionId).clear(sessionId);
} }
...@@ -132,23 +123,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -132,23 +123,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers(true); registerObservers(true);
NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P); NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P);
// 转客服通知监听
ImObserversHelper.Companion.getInstance().setImCustomNotificationCallBack(new IMRegisterObserverCustomNotificationCallBack() {
@Override
public void onObserverCustomNotification(@NotNull String fromUid, @NotNull String toUid, @NotNull String content) {
ServiceBean serviceBean = new Gson().fromJson(content, ServiceBean.class);
// 切换到客服
if (serviceBean != null && serviceBean.getData() != null && serviceBean.getBusiness() != null && serviceBean.getBusiness().equals("change_doctor")) {
isChangeDoctor = true;
String serviceUid = String.valueOf(serviceBean.getData().getToUid());
tb.setTitle(serviceBean.getData().getName());
YDLP2PMessageActivity.startChangeDoctor(YDLP2PMessageActivity.this, serviceUid, SessionHelper.getP2pCustomization(-1), null, new P2PCustomActionHandlerImpl(serviceUid, serviceBean.getData().getName(), serviceUid));
}
}
});
// 埋点 // 埋点
ActionCountUtils.Companion.baiDuCountSign2(ImActionCountConstantsKt.YDL_MEDICAL_MESSAGE_DETAIL_PAGE,"page_visit",sessionId,ActionHandlerStorage.getL(sessionId).getInfo().name); ActionCountUtils.Companion.baiDuCountSign2(ImActionCountConstantsKt.YDL_MEDICAL_MESSAGE_DETAIL_PAGE,"page_visit", sessionId, ActionHandlerStorage.getL(sessionId).getInfo().name);
} }
@Override @Override
...@@ -159,7 +136,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -159,7 +136,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers(false); registerObservers(false);
super.onDestroy(); super.onDestroy();
AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.YUNXIN, "退出聊天页面");
} }
@Override @Override
...@@ -200,12 +176,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -200,12 +176,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
/** /**
* 用户信息观察者 * 用户信息观察者
*/ */
private UserInfoObserver userInfoObserver = new UserInfoObserver() { private UserInfoObserver userInfoObserver = accounts -> {
@Override if (accounts.contains(sessionId)) {
public void onUserInfoChanged(List<String> accounts) { requestBuddyInfo();
if (accounts.contains(sessionId)) {
requestBuddyInfo();
}
} }
}; };
......
...@@ -138,7 +138,7 @@ public interface IP2PCustomActionHandler { ...@@ -138,7 +138,7 @@ public interface IP2PCustomActionHandler {
class DocInfo { class DocInfo {
public String toUid; public String toUid;
public String doctorId; public String doctorId="";
public String listenerId; public String listenerId;
public String name = ""; public String name = "";
public String title; public String title;
......
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