Commit de20c0a4 by 霍志良

feat:消息类型-39 订单已完成

parent ded41739
......@@ -57,6 +57,7 @@ import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.im.session.extension.CustomAttachmentEvaluate;
import com.yidianling.im.session.extension.CustomAttachmentFilter;
import com.yidianling.im.session.extension.CustomAttachmentJumpToDaoYi;
import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
import com.yidianling.im.session.extension.CustomAttachmentOrderStatus;
import com.yidianling.im.session.extension.CustomAttachmentPhoneCallRedPacket;
import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice;
......@@ -86,6 +87,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderDefCustom;
import com.yidianling.im.session.viewholder.MsgViewHolderEvaluate;
import com.yidianling.im.session.viewholder.MsgViewHolderJumpToDaoYi;
import com.yidianling.im.session.viewholder.MsgViewHolderModifyTime;
import com.yidianling.im.session.viewholder.MsgViewHolderOrderAlreadyDone;
import com.yidianling.im.session.viewholder.MsgViewHolderOrderStatus;
import com.yidianling.im.session.viewholder.MsgViewHolderPerfectConsultData;
import com.yidianling.im.session.viewholder.MsgViewHolderPhoneCallRedPacket;
......@@ -461,7 +463,9 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachmentJumpToDaoYi.class, MsgViewHolderJumpToDaoYi.class);//跳转导医聊天窗口触发导医分配逻辑,TYPE=35
NimUIKit.registerMsgItemViewHolder(CustomAttachmentSwitchKeFuTips.class, MsgViewHolderSwitchKeFuTips.class);//客服转介需求,TYPE=40
NimUIKit.registerMsgItemViewHolder(CustomAttachmentFilter.class, MsgViewHolderUnknown.class);// 注册消息过滤器
NimUIKit.registerMsgItemViewHolder(CustomAttachmentConfirmOrder.class, MsgViewHolderConfirmOrder.class);//完成订单消息类型38
NimUIKit.registerMsgItemViewHolder(CustomAttachmentConfirmOrder.class, MsgViewHolderConfirmOrder.class);//确认完成订单消息类型38
NimUIKit.registerMsgItemViewHolder(CustomAttachmentOrderAlreadyDone.class, MsgViewHolderOrderAlreadyDone.class);//已完成订单消息类型39
}
private static void setSessionListener() {
......
......@@ -138,6 +138,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachmentType.TYPE_CONFIRM_ORDER://38 确认订单消息
attachment=new CustomAttachmentConfirmOrder();
break;
case CustomAttachmentType.TYPE_ORDER_ALREADY_DONE://39 订单已完成
attachment=new CustomAttachmentOrderAlreadyDone();
break;
default:
attachment = new DefaultCustomAttachment();
break;
......
package com.yidianling.im.session.viewholder;
import android.annotation.SuppressLint;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachConsultSubScript;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
private TextView tv_title, tv_date, tv_type;
private View lin_root;
private ImageView img_icon;
public String url;//跳转url
public int flag;//0 未确认 1已确认
public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_ui_message_custom_order_alreadydone;
}
@Override
protected void inflateContentView() {
tv_title = view.findViewById(R.id.tv_title);
tv_date = view.findViewById(R.id.tv_date);
tv_type = view.findViewById(R.id.tv_type);
lin_root = view.findViewById(R.id.lin_root);
img_icon = view.findViewById(R.id.img_icon);
if (isReceivedMessage()){
setAvatarRightInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topleft_white_8);
}else {
setAvatarLeftInVisibity();
lin_root.setBackgroundResource(R.drawable.im_bg_radius_no_topright_white_8);
}
}
@SuppressLint("SetTextI18n")
@Override
protected void bindContentView() {
if (isReceivedMessage()){
setAvatarRightInVisibity();
}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);
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url)){
return;
}
NewH5Activity.start(context,new H5Params(url,null));
}
}
<?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"
android:id="@+id/lin_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:paddingBottom="12dp"
android:background="@drawable/im_bg_radius_no_topleft_white_8">
<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:src="@mipmap/im_consult_data_sure"
android:visibility="gone"
tools:visibility="gone"/>
<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="我已完成本次咨询,请确认"/>
<RelativeLayout
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">
<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" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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"/>
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_date"
tools:text="服务方式:电话"/>
</RelativeLayout>
</RelativeLayout>
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