|
|
@@ -14,6 +14,7 @@ import com.yingyang.healthconsultation.R
|
|
|
import com.yingyang.healthconsultation.adapter.EvaluateAdapter
|
|
|
import com.yingyang.healthconsultation.databinding.ActivityDoctorDetailsBinding
|
|
|
import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
|
|
|
+import com.yingyangfly.baselib.db.DoctorBean
|
|
|
import com.yingyangfly.baselib.ext.getEndAnimation
|
|
|
import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.ext.show
|
|
|
@@ -32,6 +33,7 @@ class DoctorDetailsActivity :
|
|
|
BaseMVVMActivity<ActivityDoctorDetailsBinding, DoctorDetailsViewModel>(), View.OnTouchListener {
|
|
|
|
|
|
private var id: String = ""
|
|
|
+ private val consultationBeans = mutableListOf<DoctorBean>()
|
|
|
private val adapter by lazy { EvaluateAdapter() }
|
|
|
private var evaluateRecordsBeans = mutableListOf<EvaluateRecordsBean>()
|
|
|
|
|
|
@@ -65,9 +67,30 @@ class DoctorDetailsActivity :
|
|
|
if (TextUtils.isEmpty(id).not()) {
|
|
|
getDoctorDetail()
|
|
|
getPatientReview()
|
|
|
+ getConsultationList()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取咨询列表
|
|
|
+ */
|
|
|
+ private fun getConsultationList() {
|
|
|
+ viewModel.getConsultationList(fail = {
|
|
|
+ it.toast()
|
|
|
+ }, success = {
|
|
|
+ if (it != null) {
|
|
|
+ consultationBeans.clear()
|
|
|
+ if (it.isNullOrEmpty().not()) {
|
|
|
+ it.forEach {
|
|
|
+ if (it.doctor != null) {
|
|
|
+ consultationBeans.add(it.doctor)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取医生详情
|
|
|
*/
|
|
|
@@ -132,12 +155,16 @@ class DoctorDetailsActivity :
|
|
|
}
|
|
|
|
|
|
R.id.btnConsult -> {
|
|
|
- if (id.isNotEmpty()) {
|
|
|
- JumpUtil.jumpActivityWithUrl(
|
|
|
- RouterUrlCommon.consultationRequest,
|
|
|
- id,
|
|
|
- mContext
|
|
|
- )
|
|
|
+ if (consultationBeans.isNotEmpty()) {
|
|
|
+ "您有正在医疗咨询中,结束问诊后才能购买".toast()
|
|
|
+ } else {
|
|
|
+ if (id.isNotEmpty()) {
|
|
|
+ JumpUtil.jumpActivityWithUrl(
|
|
|
+ RouterUrlCommon.consultationRequest,
|
|
|
+ id,
|
|
|
+ mContext
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|