Commit 09838f7e by 霍志良

feat:客服转介自定义云信UI

parent 796f67fe
...@@ -63,6 +63,7 @@ import com.yidianling.im.session.extension.CustomAttachmentReceivedTimeout; ...@@ -63,6 +63,7 @@ import com.yidianling.im.session.extension.CustomAttachmentReceivedTimeout;
import com.yidianling.im.session.extension.CustomAttachmentRecommendAssistant; import com.yidianling.im.session.extension.CustomAttachmentRecommendAssistant;
import com.yidianling.im.session.extension.CustomAttachmentRedStatus; import com.yidianling.im.session.extension.CustomAttachmentRedStatus;
import com.yidianling.im.session.extension.CustomAttachmentShareMsg; import com.yidianling.im.session.extension.CustomAttachmentShareMsg;
import com.yidianling.im.session.extension.CustomAttachmentSwitchKeFuTips;
import com.yidianling.im.session.extension.CustomAttachmentTest; import com.yidianling.im.session.extension.CustomAttachmentTest;
import com.yidianling.im.session.extension.CustomCustomerServiceCardAttachment; import com.yidianling.im.session.extension.CustomCustomerServiceCardAttachment;
import com.yidianling.im.session.extension.CustomRecommendExpertListMsg; import com.yidianling.im.session.extension.CustomRecommendExpertListMsg;
...@@ -97,6 +98,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderSendTest; ...@@ -97,6 +98,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderSendTest;
import com.yidianling.im.session.viewholder.MsgViewHolderShareMsg; import com.yidianling.im.session.viewholder.MsgViewHolderShareMsg;
import com.yidianling.im.session.viewholder.MsgViewHolderSticker; import com.yidianling.im.session.viewholder.MsgViewHolderSticker;
import com.yidianling.im.session.viewholder.MsgViewHolderSubscriptTime; import com.yidianling.im.session.viewholder.MsgViewHolderSubscriptTime;
import com.yidianling.im.session.viewholder.MsgViewHolderSwitchKeFuTips;
import com.yidianling.im.session.viewholder.MsgViewHolderSystemTips; import com.yidianling.im.session.viewholder.MsgViewHolderSystemTips;
import com.yidianling.im.session.viewholder.MsgViewHolderTip; import com.yidianling.im.session.viewholder.MsgViewHolderTip;
import com.yidianling.im.ui.param.BuryRedPointParam; import com.yidianling.im.ui.param.BuryRedPointParam;
...@@ -454,6 +456,7 @@ public class SessionHelper { ...@@ -454,6 +456,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class); NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class);
NimUIKit.registerMsgItemViewHolder(CustomAttachmentBusinessCard.class, MsgViewHolderBusinessCard.class);//专家自定义名片 ,TYPE=34 NimUIKit.registerMsgItemViewHolder(CustomAttachmentBusinessCard.class, MsgViewHolderBusinessCard.class);//专家自定义名片 ,TYPE=34
NimUIKit.registerMsgItemViewHolder(CustomAttachmentJumpToDaoYi.class, MsgViewHolderJumpToDaoYi.class);//跳转导医聊天窗口触发导医分配逻辑,TYPE=35 NimUIKit.registerMsgItemViewHolder(CustomAttachmentJumpToDaoYi.class, MsgViewHolderJumpToDaoYi.class);//跳转导医聊天窗口触发导医分配逻辑,TYPE=35
NimUIKit.registerMsgItemViewHolder(CustomAttachmentSwitchKeFuTips.class, MsgViewHolderSwitchKeFuTips.class);//客服转介需求,TYPE=40
} }
private static void setSessionListener() { private static void setSessionListener() {
......
...@@ -126,6 +126,10 @@ public class CustomAttachParser implements MsgAttachmentParser { ...@@ -126,6 +126,10 @@ public class CustomAttachParser implements MsgAttachmentParser {
//跳转导医聊天界面 //跳转导医聊天界面
attachment = new CustomAttachmentJumpToDaoYi(); attachment = new CustomAttachmentJumpToDaoYi();
break; break;
case CustomAttachmentType.TYPE_SWITCH_KEFU_TIPS:
//客服转介需求
attachment = new CustomAttachmentSwitchKeFuTips();
break;
default: default:
attachment = new DefaultCustomAttachment(); attachment = new DefaultCustomAttachment();
break; break;
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2021/1/26
*/
public class CustomAttachmentSwitchKeFuTips extends CustomAttachment{
private static final String HIDDEN_APP = "hidden_app";
private static final String TO_CONTENT = "to_content";
public String hidden_app;
public String to_content;
public CustomAttachmentSwitchKeFuTips() {
super(CustomAttachmentType.TYPE_SWITCH_KEFU_TIPS);
}
@Override
protected void parseData(JSONObject data) {
hidden_app = data.getString(HIDDEN_APP);
to_content = data.getString(TO_CONTENT);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(HIDDEN_APP, hidden_app);
data.put(TO_CONTENT, to_content);
return data;
}
}
...@@ -37,4 +37,5 @@ public interface CustomAttachmentType { ...@@ -37,4 +37,5 @@ public interface CustomAttachmentType {
int ASSISTANT_RECEIVEDMONEY = 33;//发起收款 int ASSISTANT_RECEIVEDMONEY = 33;//发起收款
int TYPE_EXPERT_DETAIL_CARD=34;//专家名片 int TYPE_EXPERT_DETAIL_CARD=34;//专家名片
int TYPE_JUMPTO_DAOYI=35;//跳转导医聊天界面 int TYPE_JUMPTO_DAOYI=35;//跳转导医聊天界面
int TYPE_SWITCH_KEFU_TIPS=40;//客服切换第一次提示语
} }
package com.yidianling.im.session.viewholder;
import android.widget.TextView;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachmentSwitchKeFuTips;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2021/1/26
*/
public class MsgViewHolderSwitchKeFuTips extends MsgViewHolderBase {
private TextView textViewTips;
public MsgViewHolderSwitchKeFuTips(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_nim_switch_kefu_tips;
}
@Override
protected void inflateContentView() {
textViewTips=findViewById(R.id.tips_kefu);
}
@Override
protected void bindContentView() {
CustomAttachmentSwitchKeFuTips customBusinessCard = (CustomAttachmentSwitchKeFuTips) message.getAttachment();
textViewTips.setText(customBusinessCard.to_content);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/im_kefu_tips_bg"
android:paddingTop="3dp"
android:paddingBottom="@dimen/platform_dp_3"
android:paddingLeft="@dimen/platform_dp_2"
android:paddingRight="@dimen/platform_dp_2"
android:id="@+id/tips_kefu"
android:text="将为您服务"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#30999999" />
<corners android:radius="@dimen/platform_dp_10" />
</shape>
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