Commit 143ffbf3 by 霍志良

feat:消息列表

parent f4b4ae5a
package com.yidianling.im.bean
data class MedicinelistBean(
val medicineList: MutableList<MedicineBean>
)
data class MedicineBean(
val medicineApplyNumber: String? = "",
val medicineName: String? = "",
val medicineSpec: String? = ""
)
\ No newline at end of file
class MedicineItemBean {
var medicineApplyNumber: Int? = 0
var medicineName: String = ""
var medicineSpec: String = ""
}
\ No newline at end of file
package com.yidianling.im.session.extension
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import com.yidianling.im.bean.MedicinelistBean
import com.yidianling.im.bean.MedicineItemBean
/**
* Created by Ykai on 2021/11/12.
......@@ -17,13 +18,16 @@ class CustomAttachmentPatientMedicineApply :
var title: String? = null
var visitApplyNo: String? = null
var medicinelist: MedicinelistBean? = null
var medicinelist = mutableListOf<MedicineItemBean>()
override fun parseData(data: JSONObject) {
title = data.getString(TITLE)
visitApplyNo = data.getString(VISITAPPLYNO)
medicinelist = data.getObject(MEDICINELIST, MedicinelistBean::class.java)
medicinelist = JSON.parseArray(
data.getString(MEDICINELIST),
MedicineItemBean::class.java
) as MutableList<MedicineItemBean>
}
override fun packData(): JSONObject {
......
......@@ -3,13 +3,11 @@ package com.yidianling.im.session.viewholder
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.webview.H5Params
import com.ydl.ydlcommon.base.config.HttpConfig.Companion.MH5_URL
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentPatientFullInfo
import com.yidianling.im.session.extension.CustomAttachmentPatientMedicineApply
import com.yidianling.im.session.viewholder.adapter.AdapterMedicineApply
import com.yidianling.medical.archives.MedicalUpdateArchivesActivity
import com.yidianling.medical.extension.YDL_MEDICAL_MESSAGE_DETAIL_PAGE
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
......@@ -33,7 +31,7 @@ class MsgViewHolderPatientMedicineApply(adapter: BaseMultiItemFetchLoadAdapter<*
adapterMedicine = AdapterMedicineApply()
medicine_list.layoutManager = LinearLayoutManager(context)
medicine_list.adapter = adapterMedicine
itemBean.medicinelist?.medicineList?.let { adapterMedicine.setTagData(it) }
itemBean.medicinelist?.let { adapterMedicine.setTagData(it) }
}
override fun bindContentView() {
......@@ -43,6 +41,10 @@ class MsgViewHolderPatientMedicineApply(adapter: BaseMultiItemFetchLoadAdapter<*
override fun onItemClick() {
//跳转开药详情页面
val h5Params3 = H5Params(
MH5_URL + "\n" +
"ct/drug/apply/details?visitApplyNo=${itemBean.visitApplyNo}&hideNavBar=1", null
)
NewH5Activity.start(getActivity(), h5Params3)
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ import com.yidianling.im.bean.MedicineBean
* @date 2020/9/7
*/
class AdapterMedicineApply : RecyclerView.Adapter<AdapterMedicineApply.ViewHolder>() {
private lateinit var medicineList: MutableList<MedicineBean>
private var medicineList: MutableList<MedicineBean>? = mutableListOf()
class ViewHolder(itemView: View) :
RecyclerView.ViewHolder(itemView) {
......@@ -37,13 +37,13 @@ class AdapterMedicineApply : RecyclerView.Adapter<AdapterMedicineApply.ViewHolde
}
override fun getItemCount(): Int {
return medicineList.size ?: 0
return medicineList?.size ?: 0
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.medicine_name.text = medicineList[position].medicineName
holder.medicine_spec.text = medicineList[position].medicineSpec
holder.medicine_count.text = "X" + medicineList[position].medicineApplyNumber
holder.medicine_name.text = medicineList?.get(position)?.medicineName
holder.medicine_spec.text = medicineList?.get(position)?.medicineSpec
holder.medicine_count.text = "X" + medicineList?.get(position)?.medicineApplyNumber
}
fun setTagData(data: MutableList<MedicineBean>) {
......
......@@ -2,7 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
android:layout_width="255dp"
android:layout_height="wrap_content">
<View
......@@ -12,7 +12,7 @@
android:background="#ecf5ff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"></View>
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/medicine_title"
......@@ -24,19 +24,19 @@
app:layout_constraintBottom_toBottomOf="@id/back_top"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="开药申请"></TextView>
tools:text="开药申请" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/medicine_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_16"
android:paddingStart="@dimen/platform_dp_16"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginEnd="@dimen/platform_dp_16"
android:paddingEnd="@dimen/platform_dp_16"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/back_top"
tools:itemCount="2"></androidx.recyclerview.widget.RecyclerView>
tools:itemCount="2" />
<View
android:id="@+id/line_center"
......
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