Commit 4d2fb21f by 刘鹏

feat : 处方单消息

parent cf689cc6
......@@ -11,7 +11,7 @@ ext {
"m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70",
"m-im-medical" : "0.0.20.87",
"m-im-medical" : "0.0.20.88",
"m-im" : "0.0.20.76",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10",
......@@ -97,7 +97,7 @@ ext {
"m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70",
"m-im-medical" : "0.0.20.87",
"m-im-medical" : "0.0.20.88",
"m-im" : "0.0.20.76",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8",
......
......@@ -69,6 +69,7 @@ import com.yidianling.im.session.extension.CustomAttachmentPhoneCallRedPacket;
import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice;
import com.yidianling.im.session.extension.CustomAttachmentReceivedSuccess;
import com.yidianling.im.session.extension.CustomAttachmentReceivedTimeout;
import com.yidianling.im.session.extension.CustomAttachmentRecipel;
import com.yidianling.im.session.extension.CustomAttachmentRecommendAssistant;
import com.yidianling.im.session.extension.CustomAttachmentRedStatus;
import com.yidianling.im.session.extension.CustomAttachmentShareMsg;
......@@ -108,6 +109,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderPhoneCallSystemNotice;
import com.yidianling.im.session.viewholder.MsgViewHolderPleaseSubscribeConsultDate;
import com.yidianling.im.session.viewholder.MsgViewHolderReceivedMoney;
import com.yidianling.im.session.viewholder.MsgViewHolderReceivedStatus;
import com.yidianling.im.session.viewholder.MsgViewHolderRecipel;
import com.yidianling.im.session.viewholder.MsgViewHolderRecommendAssistant;
import com.yidianling.im.session.viewholder.MsgViewHolderRecommendExpertList;
import com.yidianling.im.session.viewholder.MsgViewHolderRedPacket;
......@@ -489,6 +491,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryReceive.class, MsgViewHolderInquiryreceive.class);//接诊通知
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryStart.class, MsgViewHolderInquiryStart.class);//问诊订单接诊通知消息提醒类型
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryEnd.class, MsgViewHolderInquiryEnd.class);//问诊订单结束通知消息提醒类型
NimUIKit.registerMsgItemViewHolder(CustomAttachmentRecipel.class, MsgViewHolderRecipel.class);//处方单创建消息类型
}
......
......@@ -33,6 +33,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachmentType.TYPE_INQUIRY_END:
attachment = new CustomAttachmentInquiryEnd();
break;
case CustomAttachmentType.TYPE_RECIPE:
attachment = new CustomAttachmentRecipel();
break;
//// case CustomAttachmentType.SnapChat:
// return new SnapChatAttachment(data);
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 处方单创建消息类型
*/
public class CustomAttachmentRecipel extends CustomAttachment {
private static final String KEY_FROM_RECIPELID = "recipelId";
private static final String KEY_FROM_SICKNESS = "sickness";
private String fromRecipelId = "";
private String fromSickness = "";
public CustomAttachmentRecipel() {
super(CustomAttachmentType.TYPE_RECIPE);
}
@Override
protected void parseData(JSONObject data) {
fromRecipelId = data.getString(KEY_FROM_RECIPELID);
fromSickness = data.getString(KEY_FROM_SICKNESS);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_FROM_RECIPELID, fromRecipelId);
data.put(KEY_FROM_SICKNESS, fromSickness);
return data;
}
public String getFromRecipelId() {
return fromRecipelId;
}
public String getFromSickness() {
return fromSickness;
}
}
......@@ -60,5 +60,6 @@ public interface CustomAttachmentType {
int TYPE_INQUIRY_RECEIVE = 81;//接诊通知
int TYPE_INQUIRY_START = 82;//问诊订单接诊通知消息提醒类型
int TYPE_INQUIRY_END = 83;//问诊订单结束通知消息提醒类型
int TYPE_RECIPE = 86;//处方单创建消息类型
}
package com.yidianling.im.session.viewholder
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentInquiryEnd
import com.yidianling.im.session.extension.CustomAttachmentRecipel
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
/**
* 处方单创建消息类型
*/
class MsgViewHolderRecipel(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private var name: TextView? = null
private var item: ConstraintLayout? = null
var itemBean: CustomAttachmentRecipel? = null
override fun getContentResId(): Int {
return R.layout.im_nim_recipel_layout
}
override fun inflateContentView() {
name = findViewById(R.id.name)
item = findViewById(R.id.item)
}
override fun bindContentView() {
itemBean = message.attachment as CustomAttachmentRecipel
name?.text = itemBean?.fromSickness
hideItemBg()
setAvatarRightInVisibity()
item?.setOnClickListener {
NewH5Activity.start(
view?.context, H5Params(
"${HttpConfig.MEDICAL_H5URL}/ct/prescription/details?recipeId=${itemBean?.fromRecipelId}&hideNavBar=1",
"处方详情"
)
)
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:layout_width="263dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="@dimen/platform_dp_12"
android:background="@color/white"
android:elevation="0dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxWidth="263dp"
android:minWidth="263dp"
android:padding="@dimen/platform_dp_12">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="处方详情"
android:textColor="#ff0c1d31"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="病情诊断:"
android:textColor="#ff8595a9"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#ff0c1d31"
android:textSize="16sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_info"
app:layout_constraintLeft_toRightOf="@id/tv_info"
tools:text="青少年忧郁症" />
<View
android:id="@+id/line_center"
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginTop="12dp"
android:background="@color/medical_color_e7ecf0"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_info" />
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="查看处方详情"
android:textColor="#ff8595a9"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/line_center" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/medical_icon_arrow_right"
app:layout_constraintBottom_toBottomOf="@id/detail"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/detail" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
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