Commit 4b3c125c by konghaorui

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents 776bc4d7 c87dabe8
...@@ -47,12 +47,12 @@ ext { ...@@ -47,12 +47,12 @@ ext {
"m-consultant" : "0.0.50.1", "m-consultant" : "0.0.50.1",
"m-fm" : "0.0.23.1", "m-fm" : "0.0.23.1",
"m-user" : "0.0.40.1", "m-user" : "0.0.40.1",
"m-home" : "0.0.6.2", "m-home" : "0.0.6.3",
"m-muse" : "0.0.20.1", "m-muse" : "0.0.20.1",
"m-tests" : "0.0.15.1", "m-tests" : "0.0.15.1",
"m-course" : "0.0.34.1", "m-course" : "0.0.34.1",
"m-im" : "0.0.1.1", "m-im" : "0.0.2",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.5", "m-audioim-api" : "0.0.5",
...@@ -64,7 +64,7 @@ ext { ...@@ -64,7 +64,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.7", "m-user-api" : "0.0.7",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.1", "m-im-api" : "0.0.2",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
...@@ -107,7 +107,7 @@ ext { ...@@ -107,7 +107,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.7", "m-user-api" : "0.0.7",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.1", "m-im-api" : "0.0.2",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
......
...@@ -35,16 +35,16 @@ object CourseSendPlugin { ...@@ -35,16 +35,16 @@ object CourseSendPlugin {
fun sendMsg(isPlaying: Boolean) { fun sendMsg(isPlaying: Boolean) {
eventSink!!.success(isPlaying) eventSink?.success(isPlaying)
} }
fun sendRequestData() { fun sendRequestData() {
eventSink!!.success("requestData") eventSink?.success("requestData")
} }
fun sendLoginSuccess() { fun sendLoginSuccess() {
eventSink!!.success("loginSuccess") eventSink?.success("loginSuccess")
} }
} }
\ No newline at end of file
...@@ -58,15 +58,11 @@ class HomeConsultBean: HomeItemBaseBean { ...@@ -58,15 +58,11 @@ class HomeConsultBean: HomeItemBaseBean {
*/ */
//字段名称改了 //字段名称改了
@SerializedName("uid")
var doctorUid: Int = 0 var doctorUid: Int = 0
var doctorId: String = "" var doctorId: String = ""
@SerializedName("name")
var doctorName: String? = null var doctorName: String? = null
@SerializedName("head")
var doctorHead: String? = null var doctorHead: String? = null
var profesBack: String? = null var profesBack: String? = null
@SerializedName("minBookingPrice")
var serviceFee: Int = 0 var serviceFee: Int = 0
var zixunOrderNum: Int = 0 var zixunOrderNum: Int = 0
var feedbackRate: Float = 0f var feedbackRate: Float = 0f
...@@ -74,7 +70,6 @@ class HomeConsultBean: HomeItemBaseBean { ...@@ -74,7 +70,6 @@ class HomeConsultBean: HomeItemBaseBean {
var city: String? = null var city: String? = null
var isOnline: Int = 0 var isOnline: Int = 0
var mUrl: String? = null var mUrl: String? = null
@SerializedName("linkUrl")
var hUrl: String? = null var hUrl: String? = null
var share: ShareBean? = null var share: ShareBean? = null
var isHiddenXcx: String? = null var isHiddenXcx: String? = null
......
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-im-api" artifactId = "m-im-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
// version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"] version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
package com.yidianling.uikit.business.session.activity; package com.yidianling.uikit.business.session.activity;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
...@@ -115,6 +116,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -115,6 +116,7 @@ public abstract class YDLBaseMessageActivity extends UI {
//==================== ChatUI Override ==================== //==================== ChatUI Override ====================
@SuppressLint("CheckResult")
public void setToolBar(int toolBarId) { public void setToolBar(int toolBarId) {
tb = (TitleBarBottom) findViewById(toolBarId); tb = (TitleBarBottom) findViewById(toolBarId);
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
...@@ -144,31 +146,34 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -144,31 +146,34 @@ public abstract class YDLBaseMessageActivity extends UI {
Disposable dis = ServiceImpl.Companion.getInstance().getDoctorChatStatus(Long.parseLong(ActionHandlerStorage.getL(sessionId).getInfo().toUid)) Disposable dis = ServiceImpl.Companion.getInstance().getDoctorChatStatus(Long.parseLong(ActionHandlerStorage.getL(sessionId).getInfo().toUid))
.subscribe(chatStatusBean -> { .subscribe(chatStatusBean -> {
int status = chatStatusBean.data.getStatus(); if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).setDoctorStatus(status);
ActionHandlerStorage.getL(sessionId).setDoctorBusyNum(chatStatusBean.data.getBusyTotal()); int status = chatStatusBean.data.getStatus();
ActionHandlerStorage.getL(sessionId).setDoctorStatus(status);
//1.在线,2.离线,3.忙碌 4咨询中, 5倾述中 6咨询前准备 ActionHandlerStorage.getL(sessionId).setDoctorBusyNum(chatStatusBean.data.getBusyTotal());
if (status == 2) { //1.在线,2.离线,3.忙碌 4咨询中, 5倾述中 6咨询前准备
//离线
tb.setMinTitleText("离线"); if (status == 2) {
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); //离线
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line)); tb.setMinTitleText("离线");
} else if (status == 4 || status == 5) { tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
//服务中 tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line));
tb.setMinTitleText("服务中"); } else if (status == 4 || status == 5) {
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); //服务中
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online_server)); tb.setMinTitleText("服务中");
} else { tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
//在线 1,3,6.. tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online_server));
tb.setMinTitleText("在线"); } else {
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); //在线 1,3,6..
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online)); tb.setMinTitleText("在线");
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online));
}
initSystemMessage(chatStatusBean.data.getPromptRule(), status);
} }
initSystemMessage(chatStatusBean.data.getPromptRule(), status);
}, throwable -> { }, throwable -> {
}); });
} else if (ActionHandlerStorage.getL(sessionId).getUserType() == 3) { } else if (ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
...@@ -178,16 +183,18 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -178,16 +183,18 @@ public abstract class YDLBaseMessageActivity extends UI {
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> { .subscribe(res -> {
if (res.data == 1) { if (ActionHandlerStorage.getL(sessionId) != null) {
//在线 if (res.data == 1) {
tb.setMinTitleText("在线"); //在线
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); tb.setMinTitleText("在线");
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online)); tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
} else { tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_online));
//离线 } else {
tb.setMinTitleText("离线"); //离线
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); tb.setMinTitleText("离线");
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line)); tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line));
}
} }
}, throwable -> { }, throwable -> {
}); });
...@@ -221,6 +228,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -221,6 +228,7 @@ public abstract class YDLBaseMessageActivity extends UI {
/** /**
* 发送推荐专家列表 * 发送推荐专家列表
*/ */
@SuppressLint("CheckResult")
public void sendRecommendExpertListMessage(int type, boolean showExpertList) { public void sendRecommendExpertListMessage(int type, boolean showExpertList) {
// 调取接口获取推荐专家列表 // 调取接口获取推荐专家列表
...@@ -232,7 +240,9 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -232,7 +240,9 @@ public abstract class YDLBaseMessageActivity extends UI {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> { .subscribe(res -> {
//发送推荐专家列表消息 //发送推荐专家列表消息
ActionHandlerStorage.getL(sessionId).sendRecommendExpertListMessage(sessionId, res.data, type, showExpertList); if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).sendRecommendExpertListMessage(sessionId, res.data, type, showExpertList);
}
}, throwable -> { }, throwable -> {
ToastUtil.toastShort(throwable.toString()); ToastUtil.toastShort(throwable.toString());
}); });
......
...@@ -214,30 +214,32 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -214,30 +214,32 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
* 初始化顶部专家信息栏 * 初始化顶部专家信息栏
*/ */
private void initTopCustomBar() { private void initTopCustomBar() {
// 头像 if (ActionHandlerStorage.getL(sessionId) != null) {
String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage; // 头像
if (!TextUtils.isEmpty(headUrl)) { String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage;
GlideApp.with(getActivity()).load(headUrl).into(small_head_img); if (!TextUtils.isEmpty(headUrl)) {
} GlideApp.with(getActivity()).load(headUrl).into(small_head_img);
// 帮助人数 }
String help_num = String.valueOf(ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoOrderNum); // 帮助人数
if (TextUtils.isEmpty(help_num)) help_num = "0"; String help_num = String.valueOf(ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoOrderNum);
help_num_tv.setText(help_num); if (TextUtils.isEmpty(help_num)) help_num = "0";
// 服务时长 help_num_tv.setText(help_num);
String server_num = String.valueOf((int) Math.ceil((double) ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoHelpLong / 60.0)); // 服务时长
if (TextUtils.isEmpty(server_num)) server_num = "0"; String server_num = String.valueOf((int) Math.ceil((double) ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoHelpLong / 60.0));
server_num_tv.setText(server_num); if (TextUtils.isEmpty(server_num)) server_num = "0";
// 好评率 server_num_tv.setText(server_num);
String good_num = String.format("%.2f", ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoFeedbackRate * 20); // 好评率
if (TextUtils.isEmpty(good_num)) good_num = "0.00"; String good_num = String.format("%.2f", ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoFeedbackRate * 20);
good_num_tv.setText(good_num + "%"); if (TextUtils.isEmpty(good_num)) good_num = "0.00";
good_num_tv.setText(good_num + "%");
if (!TextUtils.isEmpty(headUrl)) {
IP2PCustomActionHandler.DocInfo info = ActionHandlerStorage.getL(sessionId).getInfo(); if (!TextUtils.isEmpty(headUrl)) {
if (null != info) { IP2PCustomActionHandler.DocInfo info = ActionHandlerStorage.getL(sessionId).getInfo();
NimUserInfo user = NimUserInfoCache.getInstance().getUserInfo(info.toUid); if (null != info) {
if (null != user && null != user.getAvatar() && headUrl.equals(user.getAvatar())) { NimUserInfo user = NimUserInfoCache.getInstance().getUserInfo(info.toUid);
NimUserInfoCache.getInstance().getUserInfoFromRemote(info.toUid, null); if (null != user && null != user.getAvatar() && headUrl.equals(user.getAvatar())) {
NimUserInfoCache.getInstance().getUserInfoFromRemote(info.toUid, null);
}
} }
} }
} }
...@@ -347,14 +349,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -347,14 +349,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题");
ActionHandlerStorage.getL(sessionId).startHelp(getActivity()); if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).startHelp(getActivity());
}
} }
}); });
rootView.findViewById(R.id.action_feedback).setOnClickListener(new View.OnClickListener() { rootView.findViewById(R.id.action_feedback).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈");
ActionHandlerStorage.getL(sessionId).startFeedback(getActivity()); if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).startFeedback(getActivity());
}
} }
}); });
; ;
...@@ -362,7 +368,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -362,7 +368,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线");
ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity()); if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity());
}
} }
}); });
} }
......
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