Commit 44c7b91a by 刘鹏

feat: 1.阿里云忽略埋点接口,2.复联站内信和聊天完成

parent 3afb39e5
......@@ -8,10 +8,10 @@ class ImConstants {
val YYPJ = HttpConfig.H5_URL + "comment/"
//聆听者主页
val YTZDETAIL = HttpConfig.MH5_URL+ "experts/"
val YTZDETAIL = HttpConfig.MH5_URL + "experts/"
//用户私聊视频h5介绍
val H5VIDEO_INFO = HttpConfig.H5_URL+ "ex-help/76"
val H5VIDEO_INFO = HttpConfig.H5_URL + "ex-help/76"
const val HTTP_CODE_UNLOGIN = 100005
const val SILENCED_CODE = 1000020
......@@ -20,10 +20,14 @@ class ImConstants {
const val PAGE_SIZE = 20
//我的微问诊记录
val MY_CHAT = HttpConfig.H5_URL+ "consult/my-chat"
val MY_CHAT = HttpConfig.H5_URL + "consult/my-chat"
//免费体验订单详情
val FREEDTAIL = HttpConfig.H5_URL+ "consult-trial/"
val FREEDTAIL = HttpConfig.H5_URL + "consult-trial/"
//免费体验订单详情 后边拼接orderid 如果没有拼""
val ORDER_DETAIL = HttpConfig.H5_URL + "/wb/user/order/detail?needOrderHelperAlert=1&orderid="
const val BIND_PHONE_ACTION = "wxbind"
const val HELP_URL = "https://h2.yidianling.com/ex-help/96"
......@@ -43,7 +47,7 @@ class ImConstants {
//连接倾听未绑定手机提示
const val TEL_BINDPHONE = "电话连接需要绑定手机哦~"
const val KEFUXIAOYI="14"
const val KEFUXIAOYI = "14"
}
......
......@@ -106,4 +106,13 @@ interface ImRetrofitApi {
@POST("lingxi/asistant/buryRedPoint")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun imBuryRedPoints(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
@POST("/counselor/order/standardOrderServiceOperation")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun standardOrderServiceOperation(@Query("id")id: String, @Query("status")status: Int): Observable<BaseResponse<Any>>
@POST("/consult/user/order/affirmComplete")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun affirmComplete(@Query("id")id: String): Observable<BaseResponse<Any>>
}
\ No newline at end of file
......@@ -452,7 +452,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachmentPhoneCallSystemNotice.class, MsgViewHolderPhoneCallSystemNotice.class);//本地自定义消息
NimUIKit.registerMsgItemViewHolder(CustomSystemTips.class, MsgViewHolderSystemTips.class);//本地系统自定义消息 对应24
NimUIKit.registerMsgItemViewHolder(CustomRecommendExpertListMsg.class, MsgViewHolderRecommendExpertList.class);//推荐专家列表 对应25
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultSubScript.class, MsgViewHolderConsultSubScribe.class);//确认咨询预约消息
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultSubScript.class, MsgViewHolderConsultSubScribe.class);//确认咨询预约消息 27
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultPerfectData.class, MsgViewHolderPerfectConsultData.class);//完善咨询资料提醒消息
NimUIKit.registerMsgItemViewHolder(CustomAttachPleaseSubscribeConsultDate.class, MsgViewHolderPleaseSubscribeConsultDate.class);//请预约咨询时间
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
......
......@@ -2,18 +2,25 @@ package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
public class CustomAttachmentConfirmOrder extends CustomAttachment{
private static final String TITLE="title";//标题
private static final String STATUS="status";//状态,1代表已确认,0代表待确认
private static final String BOOKINGTIME="bookingTime";///咨询时间
private static final String SERVICETYPE="serviceType";//服务方式
private static final String ORDERID="orderId";//订单号
public class CustomAttachmentConfirmOrder extends CustomAttachment {
private static final String TITLE = "title";//标题
private static final String STATUS = "status";//状态,1代表已确认,0代表待确认
private static final String BOOKINGTIME = "bookingTime";///咨询时间
private static final String SERVICETYPE = "serviceType";//服务方式
private static final String ORDERID = "orderId";//订单号
private static final String NEWSORDERID = "newsOrderId";//用于跳转新版订单详情
private static final String URL = "url";//跳转链接
public String title;
public String status;
public String bookingtime;
public String servicetype;
public Long orderid;
public String consultDuration;
public String bookingTime;
public String title;
public String productName;
public String url;
public String orderId;
public String newsOrderId;
public String serviceId;
public int status;
CustomAttachmentConfirmOrder() {
super(CustomAttachmentType.TYPE_CONFIRM_ORDER);
......@@ -22,21 +29,25 @@ public class CustomAttachmentConfirmOrder extends CustomAttachment{
@Override
protected void parseData(JSONObject data) {
this.title=data.getString(TITLE);
this.status=data.getString(STATUS);
this.bookingtime=data.getString(BOOKINGTIME);
this.servicetype=data.getString(SERVICETYPE);
this.orderid=data.getLong(ORDERID);
this.title = data.getString(TITLE);
this.status = data.getInteger(STATUS);
this.bookingTime = data.getString(BOOKINGTIME);
this.servicetype = data.getString(SERVICETYPE);
this.orderId = data.getString(ORDERID);
this.newsOrderId = data.getString(NEWSORDERID);
this.url = data.getString(URL);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(TITLE,title);
data.put(TITLE, title);
data.put(STATUS, status);
data.put(BOOKINGTIME, bookingtime);
data.put(BOOKINGTIME, bookingTime);
data.put(SERVICETYPE, servicetype);
data.put(ORDERID, orderid);
data.put(ORDERID, orderId);
data.put(NEWSORDERID, newsOrderId);
data.put(URL, url);
return data;
}
}
......@@ -8,23 +8,44 @@ import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachConsultSubScript;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
private TextView tv_title, tv_date, tv_type;
private TextView tv_title, tv_date, tv_type, tv_submit;
private View lin_root;
private ImageView img_icon;
public String url;//跳转url
public int flag;//0 未确认 1已确认
/***跳转url*/
public String url;
/***新订单id*/
public String newsOrderId;
/***订单id*/
public String orderId;
/***0 未确认 1已确认*/
public int flag;
public MsgViewHolderConfirmOrder(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
......@@ -42,11 +63,12 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
tv_type = view.findViewById(R.id.tv_type);
lin_root = view.findViewById(R.id.lin_root);
img_icon = view.findViewById(R.id.img_icon);
tv_submit = view.findViewById(R.id.tv_submit);
if (isReceivedMessage()){
if (isReceivedMessage()) {
setAvatarRightInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topleft_white_8);
}else {
} else {
setAvatarLeftInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topright_white_8);
}
......@@ -55,25 +77,124 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
@SuppressLint("SetTextI18n")
@Override
protected void bindContentView() {
if (isReceivedMessage()){
if (isReceivedMessage()) {
setAvatarRightInVisibity();
}else {
} else {
setAvatarLeftInVisibity();
}
MsgAttachment attachment = message.getAttachment();
if (attachment instanceof CustomAttachmentConfirmOrder) {
tv_title.setText(((CustomAttachmentConfirmOrder) attachment).title);
tv_date.setText("咨询时间:"+((CustomAttachmentConfirmOrder) attachment).bookingtime);
tv_type.setText("服务方式:"+((CustomAttachmentConfirmOrder) attachment).servicetype);
CustomAttachmentConfirmOrder customAttachment = (CustomAttachmentConfirmOrder) attachment;
tv_title.setText(customAttachment.title);
tv_date.setText("咨询时间:" + customAttachment.bookingTime);
tv_type.setText("服务方式:" + customAttachment.servicetype);
url = customAttachment.url;
newsOrderId = customAttachment.newsOrderId;
orderId = customAttachment.orderId;
flag = customAttachment.status;
if (flag == 1) {
// 1代表已确认,0代表待确认
tv_submit.setText("已确认");
tv_submit.setEnabled(false);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_gray_linear_12));
img_icon.setVisibility(View.VISIBLE);
tv_submit.setVisibility(View.GONE);
} else {
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
img_icon.setVisibility(View.GONE);
tv_submit.setVisibility(View.VISIBLE);
}
tv_submit.setOnClickListener(v -> {
//确定按钮给服务端发消息发送
//确认接口
ToastUtil.toastShort(context, "发送中...");
ImRetrofitApi.Companion.getImRetrofitApi().standardOrderServiceOperation(orderId, flag)
.subscribeOn(Schedulers.io())
.compose(RxUtils.INSTANCE.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(it -> {
//确认完成,按钮置灰,更新本地消息
updateLocalMsg();
}, throwable -> HttpErrorUtils.Companion.handleError(context, throwable));
});
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url)){
if (TextUtils.isEmpty(url)) {
return;
}
NewH5Activity.start(context,new H5Params(url,null));
if (newsOrderId == null || newsOrderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newsOrderId.isEmpty() ? "" : newsOrderId), null);
NewH5Activity.start(context, orderParams);
}
}
private void updateLocalMsg() {
updateSureView("已确认");
//更新本地消息
Map<String, Object> map = message.getLocalExtension();
if (map == null) {
map = new HashMap();
}
map.put("isSure", true);
message.setLocalExtension(map);
NIMClient.getService(MsgService.class).updateIMMessage(message);
//同时更新历史同订单未确认的消息状态
NIMClient.getService(MsgService.class).queryMessageList(message.getFromAccount(), SessionTypeEnum.P2P, 0, 100).setCallback(new RequestCallback<List<IMMessage>>() {
@Override
public void onSuccess(List<IMMessage> param) {
if (param != null && param.size() > 0) {
for (IMMessage msg : param) {
MsgAttachment attachment = msg.getAttachment();
if (attachment instanceof CustomAttachmentConfirmOrder) {
CustomAttachmentConfirmOrder customAttachConsultSubScript = (CustomAttachmentConfirmOrder) attachment;
if (customAttachConsultSubScript.orderId.equals(orderId)) {
//修改历史消息状态为已失效
Map map1 = msg.getLocalExtension();
if (map1 == null) {
map1 = new HashMap();
map1.put("isExpired", true);
msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg);
}
}
}
}
}
}
@Override
public void onFailed(int code) {
}
@Override
public void onException(Throwable exception) {
}
});
}
private void updateSureView(String btnName) {
tv_submit.setText(btnName);
tv_submit.setEnabled(false);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_gray_linear_12));
}
}
......@@ -8,23 +8,45 @@ import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachConsultSubScript;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
private TextView tv_title, tv_date, tv_type;
private TextView tv_title, tv_date, tv_type, tv_submit;
private View lin_root;
private ImageView img_icon;
public String url;//跳转url
public int flag;//0 未确认 1已确认
/***跳转url*/
public String url;
/***新订单id*/
public String newsOrderId;
/***订单id*/
public String orderId;
/***0 未确认 1已确认*/
public int flag;
public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
......@@ -42,11 +64,12 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
tv_type = view.findViewById(R.id.tv_type);
lin_root = view.findViewById(R.id.lin_root);
img_icon = view.findViewById(R.id.img_icon);
tv_submit = view.findViewById(R.id.tv_submit);
if (isReceivedMessage()){
if (isReceivedMessage()) {
setAvatarRightInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topleft_white_8);
}else {
} else {
setAvatarLeftInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topright_white_8);
}
......@@ -55,25 +78,122 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
@SuppressLint("SetTextI18n")
@Override
protected void bindContentView() {
if (isReceivedMessage()){
if (isReceivedMessage()) {
setAvatarRightInVisibity();
}else {
} else {
setAvatarLeftInVisibity();
}
MsgAttachment attachment = message.getAttachment();
if (attachment instanceof CustomAttachmentConfirmOrder) {
tv_title.setText(((CustomAttachmentConfirmOrder) attachment).title);
tv_date.setText("咨询时间:"+((CustomAttachmentConfirmOrder) attachment).bookingtime);
tv_type.setText("服务方式:"+((CustomAttachmentConfirmOrder) attachment).servicetype);
CustomAttachmentConfirmOrder customAttachment = (CustomAttachmentConfirmOrder) attachment;
tv_title.setText(customAttachment.title);
tv_date.setText("咨询时间:" + (customAttachment.bookingTime));
tv_type.setText("服务方式:" + (customAttachment.servicetype));
url = customAttachment.url;
newsOrderId = customAttachment.newsOrderId;
orderId = customAttachment.orderId;
flag = customAttachment.status;
if (flag == 1) {
// 1代表已确认,0代表待确认
tv_submit.setText("已确认");
tv_submit.setEnabled(false);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_gray_linear_12));
img_icon.setVisibility(View.VISIBLE);
tv_submit.setVisibility(View.GONE);
} else {
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
img_icon.setVisibility(View.GONE);
tv_submit.setVisibility(View.VISIBLE);
}
tv_submit.setOnClickListener(v -> {
//确定按钮给服务端发消息发送
//确认接口
ToastUtil.toastShort(context, "发送中...");
ImRetrofitApi.Companion.getImRetrofitApi().affirmComplete(orderId)
.subscribeOn(Schedulers.io())
.compose(RxUtils.INSTANCE.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(it -> {
//确认完成,按钮置灰,更新本地消息
updateLocalMsg();
}, throwable -> HttpErrorUtils.Companion.handleError(context, throwable));
});
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url)){
if (TextUtils.isEmpty(url)) {
return;
}
NewH5Activity.start(context,new H5Params(url,null));
if (newsOrderId == null || newsOrderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newsOrderId.isEmpty() ? "" : newsOrderId), null);
NewH5Activity.start(context, orderParams);
}
}
private void updateLocalMsg() {
updateSureView("已确认");
//更新本地消息
Map<String, Object> map = message.getLocalExtension();
if (map == null) {
map = new HashMap();
}
map.put("isSure", true);
message.setLocalExtension(map);
NIMClient.getService(MsgService.class).updateIMMessage(message);
//同时更新历史同订单未确认的消息状态
NIMClient.getService(MsgService.class).queryMessageList(message.getFromAccount(), SessionTypeEnum.P2P, 0, 100).setCallback(new RequestCallback<List<IMMessage>>() {
@Override
public void onSuccess(List<IMMessage> param) {
if (param != null && param.size() > 0) {
for (IMMessage msg : param) {
MsgAttachment attachment = msg.getAttachment();
if (attachment instanceof CustomAttachmentConfirmOrder) {
CustomAttachmentConfirmOrder customAttachConsultSubScript = (CustomAttachmentConfirmOrder) attachment;
if (customAttachConsultSubScript.orderId.equals(orderId)) {
//修改历史消息状态为已失效
Map map1 = msg.getLocalExtension();
if (map1 == null) {
map1 = new HashMap();
map1.put("isExpired", true);
msg.setLocalExtension(map1);
NIMClient.getService(MsgService.class).updateIMMessage(msg);
}
}
}
}
}
}
@Override
public void onFailed(int code) {
}
@Override
public void onException(Throwable exception) {
}
});
}
private void updateSureView(String btnName) {
tv_submit.setText(btnName);
tv_submit.setEnabled(false);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_gray_linear_12));
}
}
......@@ -37,7 +37,7 @@ import io.reactivex.disposables.Disposable;
/**
* 动态消息列表
*/
public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler{
public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler {
String title = "";
......@@ -48,13 +48,14 @@ public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler{
TitleBar titlebar;
MsgListAdapter adapter;
int type; //消息类别
//消息类别
int type;
int page = 0;
boolean hasMore = true;
List<MsgData> msgDatas;
@Override
protected int layoutResId() {
return R.layout.im_activity_other_msg_detail;
......@@ -75,14 +76,15 @@ public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler{
@NotNull
@Override
public StatusBarOptions getStatusViewOptions() {
return new StatusBarOptions(true,true);
return new StatusBarOptions(true, true);
}
void init() {
if (title != null && !title.equals("")) {
titlebar.setTitle(title);
}
if (type == 14) {//反馈页面
//反馈页面
if (type == 14) {
titlebar.setTitle("通知");
titlebar.setmRightText("投诉反馈");
}
......@@ -107,7 +109,7 @@ public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler{
store_house_ptr_frame.setPtrHandler(this);
store_house_ptr_frame.addPtrUIHandler(header);
adapter = new MsgListAdapter(this, type,this);
adapter = new MsgListAdapter(this, type, this);
lv_content.setAdapter(adapter);
lv_content.setEmptyView(ll_empty);
......@@ -155,7 +157,9 @@ public class OtherMsgDetailActivity extends BaseActivity implements PtrHandler{
LogUtil.d("data fetch compelete");
store_house_ptr_frame.refreshComplete();
msgDatas = msgData;
if (msgDatas.size() == 0) return;
if (msgDatas.size() == 0) {
return;
}
if (msgDatas == null || msgDatas.size() < ImConstants.PAGE_SIZE) {
hasMore = false;
}
......
......@@ -13,7 +13,6 @@ import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.im.bean.MsgData;
......@@ -41,7 +40,8 @@ import io.reactivex.schedulers.Schedulers;
public class MsgListAdapter extends CommonAdapter<MsgData> {
private ILifecycleable lifecycleable;
private Activity context;
private int type = 0;//消息类型
/*** 消息类型*/
private int type = 0;
public MsgListAdapter(Activity context) {
this.context = context;
......@@ -49,7 +49,7 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
private ImHttp httpHelper;
public MsgListAdapter(Activity context, int type,ILifecycleable lifecycleable) {
public MsgListAdapter(Activity context, int type, ILifecycleable lifecycleable) {
this.context = context;
this.type = type;
this.lifecycleable = lifecycleable;
......@@ -108,6 +108,8 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
ARouter.getInstance().build("/mine/MyFeedBackActivity").withString("intent_id", mDataList.get(position).relation_id).navigation();
fla = true;
break;
default:
break;
}
}
......@@ -129,7 +131,7 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
}
});
//如果是动态消息则到此结束,其它消息类型走下面流程
}else {
} else {
Disposable di = httpHelper.getMsgDetail(new MsgDetailParam(mDataList.get(position).id))
// .compose(RxUtils.applySchedulers(lifecycleable))
.subscribeOn(Schedulers.io())
......@@ -159,7 +161,6 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
case 508:
case 509:
//预约评价 微问诊评价 倾诉评价
H5Params h5Paramspi = new H5Params(ImConstants.Companion.getYYPJ() + msgDetail.relation_id1, null);
NewH5Activity.start(context, h5Paramspi);
break;
......@@ -175,9 +176,24 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
break;
case 1003:
// ImIn.INSTANCE.MyRedPackActivity(context,null);
ImIn.INSTANCE.myRedPockIntent(context);
break;
case 521:
case 522:
case 523:
case 524:
case 525:
case 526:
// 521-526 解忧 - 订单详情
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL()
+ (msgDetail.relation_id1.isEmpty() ? "" : msgDetail.relation_id1),
null);
NewH5Activity.start(context, orderParams);
break;
default:
break;
}
}, new ThrowableConsumer() {
@Override
......@@ -200,7 +216,9 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
notifyDataSetChanged();
}
//根据url解析跳转
/**
* 根据url解析跳转
*/
private boolean jumpForUrl(String url) {
boolean fa = false;
Map<String, String> map = StringUtils.IsHttpReturn(url);
......
......@@ -2,8 +2,8 @@ package com.yidianling.im.ui.page.fragment
import android.content.Context
import android.graphics.Color
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack
import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.ydlcommon.base.BaseFragment
......@@ -34,12 +34,14 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
SERVICING, // 服务中
SERVICED // 服务过
}
private lateinit var mContext:Context
private lateinit var mContext: Context
private var chatAdapter: ChatAdapter? = null
private var allChatData: ChatModelBean = ChatModelBean() //全部数据
private var showData: ArrayList<ChatItemBean> = ArrayList() // 最终展示的数据
private var threeWeekItem: ChatItemBean = ChatItemBean(0, 0, "", 0, 0, "", 0, 0, 0, 0, 0, "", 0, "", "", 0, 0, 0, "", 1, "", true)
private var threeWeekItem: ChatItemBean =
ChatItemBean(0, 0, "", 0, 0, "", 0, 0, 0, 0, 0, "", 0, "", "", 0, 0, 0, "", 1, "", true)
private var mChatModelType: ChatModelType = ChatModelType.ALL // 默认展示全部
......@@ -80,10 +82,12 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
fun getChatMessageData() {
var selectType: Int = if (mChatModelType == ChatModelType.ALL) 0 else if (mChatModelType == ChatModelType.SERVICING) 1 else 2
var selectType: Int =
if (mChatModelType == ChatModelType.ALL) 0 else if (mChatModelType == ChatModelType.SERVICING) 1 else 2
if (ImIn.getUserInfo()?.uid != "0") {
var dis = ImHttpImpl.getInstance().getAllChatMessage(ChatParam("${ImIn.getUserInfo()?.uid}", "${selectType}"))
var dis = ImHttpImpl.getInstance()
.getAllChatMessage(ChatParam("${ImIn.getUserInfo()?.uid}", "${selectType}"))
.compose(RxUtils.applySchedulers(this))
.compose<ChatModelBean>(RxUtils.resultJavaData())
.subscribe({ it ->
......@@ -159,35 +163,44 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
// 全部
ChatModelType.ALL -> {
showData.addAll(allChatData.topData.data.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.is_top == 0 }.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.is_top == 0 }
.sortedWith(mCompare))
if (allChatData.before.data.any { it.is_top == 0 }) {
showData.add(threeWeekItem)
showData.addAll(allChatData.before.data.filter { it.is_top == 0 }.sortedWith(mCompare))
showData.addAll(allChatData.before.data.filter { it.is_top == 0 }
.sortedWith(mCompare))
}
}
// 服务中
ChatModelType.SERVICING -> {
showData.addAll(allChatData.topData.data.filter { it.isBusy == 1 }.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.isBusy == 1 && it.is_top == 0 }.sortedWith(mCompare))
showData.addAll(allChatData.topData.data.filter { it.isBusy == 1 }
.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.isBusy == 1 && it.is_top == 0 }
.sortedWith(mCompare))
if (allChatData.before.data.any { it.isBusy == 1 && it.is_top == 0 }) {
showData.add(threeWeekItem)
showData.addAll(allChatData.before.data.filter { it.isBusy == 1 && it.is_top == 0 }.sortedWith(mCompare))
showData.addAll(allChatData.before.data.filter { it.isBusy == 1 && it.is_top == 0 }
.sortedWith(mCompare))
}
}
// 服务过
ChatModelType.SERVICED -> {
showData.addAll(allChatData.topData.data.filter { it.isBusy != 1 && it.orderCount + it.listenOrderCount > 0 }.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0) }.sortedWith(mCompare))
if (allChatData.before.data.any { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0)}) {
showData.addAll(allChatData.topData.data.filter { it.isBusy != 1 && it.orderCount + it.listenOrderCount > 0 }
.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0) }
.sortedWith(mCompare))
if (allChatData.before.data.any { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0) }) {
showData.add(threeWeekItem)
showData.addAll(allChatData.before.data.filter { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0) }.sortedWith(mCompare))
showData.addAll(allChatData.before.data.filter { it.isBusy != 1 && it.is_top == 0 && (it.orderCount + it.listenOrderCount > 0) }
.sortedWith(mCompare))
}
}
}
// 重置消息未读数
MsgReceiveHelper.reQueryUnreadNumber {
showData.forEachIndexed { index, _ ->
showData[index].unReadNum = MsgReceiveHelper.getUnNum(showData[index].toUid.toString())
showData[index].unReadNum =
MsgReceiveHelper.getUnNum(showData[index].toUid.toString())
}
chatAdapter?.notifyDataSetChanged()
resetPageShow()
......@@ -205,17 +218,18 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
private fun initListData() {
chatAdapter = ChatAdapter(mContext, showData,this)
chatAdapter = ChatAdapter(mContext, showData, this)
chatAdapter?.setlistener(object : ChatAdapter.ChatRecyclerViewCallback {
override fun onRefresh() {
getChatMessageData()
}
})
chat_recyclerview.layoutManager =
LinearLayoutManager(context)
chat_recyclerview.layoutManager = LinearLayoutManager(context)
chat_recyclerview.adapter = chatAdapter
chat_recyclerview.setLoadingListener(this)
chat_recyclerview.setFootView(ChatFooterItemView(mContext), object : CustomFooterViewCallBack {
chat_recyclerview.setFootView(
ChatFooterItemView(mContext),
object : CustomFooterViewCallBack {
override fun onSetNoMore(p0: View?, p1: Boolean) {
}
......@@ -272,7 +286,9 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() {
startActivity(ImIn.getConsultService().expertSearchIntent(activity!!, 0, 0, false))
startActivity(
ImIn.getConsultService().expertSearchIntent(activity!!, 0, 0, false)
)
}
})
}
......@@ -283,7 +299,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_chat_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() {
ImIn.loginByOneKeyLogin(mContext,true)
ImIn.loginByOneKeyLogin(mContext, true)
}
})
}
......@@ -304,15 +320,19 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
chat_servicing_message.setTextColor(Color.parseColor("#666666"))
chat_serviced_message.setTextColor(Color.parseColor("#666666"))
if (modelType == ChatModelType.ALL) {
when (modelType) {
ChatModelType.ALL -> {
chat_all_message.setTextColor(resources.getColor(R.color.platform_but_text_color_selected))
chat_all_message.setBackgroundResource(R.drawable.im_chat_model_selected_bg)
} else if (modelType == ChatModelType.SERVICING) {
}
ChatModelType.SERVICING -> {
chat_servicing_message.setTextColor(resources.getColor(R.color.platform_but_text_color_selected))
chat_servicing_message.setBackgroundResource(R.drawable.im_chat_model_selected_bg)
} else if (modelType == ChatModelType.SERVICED) {
}
ChatModelType.SERVICED -> {
chat_serviced_message.setTextColor(resources.getColor(R.color.platform_but_text_color_selected))
chat_serviced_message.setBackgroundResource(R.drawable.im_chat_model_selected_bg)
}
}
}
}
\ No newline at end of file
......@@ -87,7 +87,6 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && getIsViewCreated()) {
// 每次展示的时候都需要处理页面展示逻辑
resetPageShow()
......@@ -104,7 +103,6 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
* 页面展示状态逻辑
*/
private fun resetPageShow() {
if (ImIn.isLogin()) {
//登录状态
if (noticeList.size != 0) {
......
......@@ -20,7 +20,8 @@ class NoticeAdapter(var context: Context, private var mList: ArrayList<NoticeIte
companion object {
const val TYPE_NORMAL_ITEM = 1001 // 正常item
// 正常item
const val TYPE_NORMAL_ITEM = 1001
}
override fun getItemViewType(position: Int): Int {
......
......@@ -12,6 +12,8 @@ class NoticeItemBean(
var time: String = "",
var link: String = "",
var timestamp: String = "",
var mType: Int = 0, //用于预约提醒传的mType
var relationId1: String = "" //用于投诉反馈
//用于预约提醒传的mType
var mType: Int = 0,
//用于投诉反馈
var relationId1: String = ""
)
\ No newline at end of file
......@@ -31,6 +31,7 @@ class NoticeItemView(mContext: Context): LinearLayout(mContext) {
notice_message_content.text = bean.content
if (bean.num > 0) {
//未读数
notice_message_unread_num.text = "${bean.num}"
notice_message_unread_num.visibility = View.VISIBLE
}else {
......
......@@ -458,4 +458,5 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
audioRightSmallTip.setVisibility(View.GONE);
audioLeftSmallTip.setVisibility(View.GONE);
}
}
......@@ -70,7 +70,7 @@ interface ServiceApi {
fun focus(@Query("doctorId") doctorId: String, @Query("status") status: String): Observable<BaseAPIResponse<Any>>
//服务列表
@GET("consult/expert-page/products")
@GET("consult/expert-page/nproducts")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun serviceList(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"></corners>
<solid android:color="#999999" />
<gradient android:startColor="#999999"
android:endColor="#999999"
android:angle="180"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"></corners>
<gradient
android:angle="180"
android:endColor="#23B2FA"
android:startColor="#1DA1F2" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/lin_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/im_bg_radius_no_topleft_white_8"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:paddingBottom="12dp"
android:background="@drawable/im_bg_radius_no_topleft_white_8">
android:paddingRight="12dp"
android:paddingBottom="12dp">
<ImageView
android:id="@+id/img_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginRight="4dp"
android:layout_alignTop="@+id/tv_title"
android:layout_alignBottom="@+id/tv_title"
android:layout_marginRight="4dp"
android:src="@mipmap/im_consult_data_sure"
android:visibility="gone"
tools:visibility="gone"/>
tools:visibility="visible" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dp"
android:textColor="@color/im_color_242424"
android:layout_toRightOf="@+id/img_icon"
tools:text="我已完成本次咨询,请确认"/>
android:textColor="@color/im_color_242424"
android:textSize="14dp"
tools:text="我已完成本次咨询,请确认" />
<RelativeLayout
android:id="@+id/rl_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_below="@+id/tv_title"
android:layout_marginTop="8dp"
android:background="@drawable/im_bg_radius_f7_2">
android:background="@drawable/im_bg_radius_f7_2"
android:paddingLeft="12dp"
android:paddingTop="8dp"
android:paddingRight="12dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/tv_package"
android:layout_width="24dp"
android:layout_height="14dp"
android:text="套餐"
android:layout_marginTop="3dp"
android:textSize="10dp"
android:textColor="@color/platform_color_FFFFFF"
android:gravity="center"
android:layout_marginRight="3dp"
android:visibility="gone"
android:background="@drawable/im_bg_radius_yellow_1" />
android:background="@drawable/im_bg_radius_yellow_1"
android:gravity="center"
android:text="套餐"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="10dp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_package"
android:layout_marginTop="2dp"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_package"
tools:text="咨询时间:2019-12-55 12:00:00"/>
tools:text="咨询时间:2019-12-55 12:00:00" />
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_date"
android:layout_marginTop="2dp"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_date"
tools:text="服务方式:电话"/>
tools:text="服务方式:电话" />
</RelativeLayout>
<TextView
android:id="@+id/tv_submit"
android:layout_width="60dp"
android:layout_height="24dp"
android:layout_below="@+id/rl_center"
android:layout_alignRight="@id/rl_center"
android:layout_marginTop="12dp"
android:background="@drawable/bg_radius_green_linear_12"
android:gravity="center"
android:text="确认"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="13dp" />
</RelativeLayout>
......@@ -32,6 +32,7 @@
tools:text="我已完成本次咨询,请确认"/>
<RelativeLayout
android:id="@+id/rl_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
......@@ -74,5 +75,19 @@
android:layout_below="@+id/tv_date"
tools:text="服务方式:电话"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_submit"
android:layout_width="60dp"
android:layout_height="24dp"
android:layout_below="@+id/rl_center"
android:layout_alignRight="@id/rl_center"
android:layout_marginTop="12dp"
android:background="@drawable/bg_radius_green_linear_12"
android:gravity="center"
android:text="确认"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="13dp" />
</RelativeLayout>
......@@ -212,9 +212,12 @@ class HttpConfig {
val message = originalResponse.message()
val api = request.url().encodedPath()
ActionCountUtils.baiDuCount("ydl_user_error_business","error_log",api,params,message)
//阿里云忽略埋点接口
if (!api.contains("maidian/writeMaiDianData")){
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.API, "error_log---api:$api---params:$params ---- message:$message")
}
}
}
originalResponse
}
}
......
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