Преглед на файлове

1.添加获取单个医生信息接口

王鹏鹏 преди 2 години
родител
ревизия
83258b14b5

+ 8 - 0
.idea/misc.xml

@@ -37,6 +37,7 @@
         <entry key="..\:/workspace/hcp-pad/common/src/main/res/layout/common_activity_qr_code_scan.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/common/src/main/res/layout/common_content_loading_dialog.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pad/common/src/main/res/layout/ugckit_fragment_dialog_permission_introduction.xml" value="0.1" />
+        <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_btn_doctor_details.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_button_submitl.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_cancel_order.xml" value="0.155" />
         <entry key="..\:/workspace/hcp-pad/healthconsultation/src/main/res/drawable/bg_condition_describe.xml" value="0.155" />
@@ -450,4 +451,11 @@
   <component name="SuppressionsComponent">
     <option name="suppComments" value="[]" />
   </component>
+  <component name="VisualizationToolProject">
+    <option name="state">
+      <ProjectState>
+        <option name="scale" value="0.42051756007393715" />
+      </ProjectState>
+    </option>
+  </component>
 </project>

+ 91 - 18
healthconsultation/src/main/java/com/yingyang/healthconsultation/doctordetails/DoctorDetailsActivity.kt

@@ -5,17 +5,22 @@ import android.graphics.Color
 import android.os.Bundle
 import android.text.SpannableString
 import android.text.Spanned
+import android.text.TextUtils
 import android.text.style.ForegroundColorSpan
 import android.view.MotionEvent
 import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
 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.ext.getEndAnimation
 import com.yingyangfly.baselib.ext.getScaleAnimation
+import com.yingyangfly.baselib.ext.show
 import com.yingyangfly.baselib.ext.toast
 import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
 import com.yingyangfly.baselib.router.RouterUrlCommon
+import com.yingyangfly.baselib.utils.JumpUtil
 
 /**
  * 医生详情
@@ -25,6 +30,8 @@ class DoctorDetailsActivity :
     BaseMVVMActivity<ActivityDoctorDetailsBinding, DoctorDetailsViewModel>(), View.OnTouchListener {
 
     private var id: String = ""
+    private val adapter by lazy { EvaluateAdapter() }
+    private var evaluateRecordsBeans = mutableListOf<EvaluateRecordsBean>()
 
     override fun onCreate(savedInstanceState: Bundle?) {
         id = intent.getStringExtra("url") ?: ""
@@ -32,40 +39,86 @@ class DoctorDetailsActivity :
     }
 
     override fun initViews() {
-
+        binding {
+            rvEvaluation.adapter = adapter
+            adapter.setData(evaluateRecordsBeans)
+        }
     }
 
     @SuppressLint("ClickableViewAccessibility")
     override fun initListener() {
         binding {
             backLayout.setOnTouchListener(this@DoctorDetailsActivity)
+            btnConsult.setOnTouchListener(this@DoctorDetailsActivity)
+            tvAllEvaluate.setOnTouchListener(this@DoctorDetailsActivity)
         }
     }
 
     override fun initData() {
-        if (id.isNotEmpty()) {
-            viewModel.getDoctorDetail(id, fail = {
-                it.toast()
-            }, success = {
-                if (it != null) {
-                    binding.data = it
-                    val consultationTotal = "咨询量:" + it.consultationTotal
-                    val totalSpannableString = SpannableString(consultationTotal)
-                    totalSpannableString.setSpan(
-                        ForegroundColorSpan(Color.parseColor("#FF4A76FF")),
-                        4, totalSpannableString.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
-                    )
-                    binding.tvConsult.text = totalSpannableString
-                }
-            })
+
+    }
+
+    override fun onResume() {
+        super.onResume()
+        if (TextUtils.isEmpty(id).not()) {
+            getDoctorDetail()
+            getPatientReview()
         }
     }
 
+    /**
+     * 获取医生详情
+     */
+    private fun getDoctorDetail() {
+        viewModel.getDoctorDetail(id, fail = {
+            it.toast()
+        }, success = {
+            if (it != null) {
+                if (daocorDao != null) {
+                    daocorDao?.insert(it)
+                }
+                binding.data = it
+                val consultationTotal = "咨询量:" + it.consultationTotal
+                val totalSpannableString = SpannableString(consultationTotal)
+                totalSpannableString.setSpan(
+                    ForegroundColorSpan(Color.parseColor("#FF4A76FF")),
+                    4, totalSpannableString.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
+                )
+                binding.tvConsult.text = totalSpannableString
+            }
+        })
+    }
+
+    /**
+     * 获取评价列表
+     */
+    private fun getPatientReview() {
+        viewModel.getPatientReview(id, fail = {
+            it.toast()
+        }, success = {
+            if (it != null) {
+                evaluateRecordsBeans.clear()
+                if (it.isNullOrEmpty().not()) {
+                    if (it.size > 5) {
+                        binding.tvAllEvaluate.show(true)
+                        evaluateRecordsBeans.addAll(it.subList(0, 5))
+                    } else {
+                        binding.tvAllEvaluate.show(false)
+                        evaluateRecordsBeans.addAll(it)
+                    }
+                } else {
+                    binding.tvAllEvaluate.show(false)
+                }
+                adapter.setData(evaluateRecordsBeans)
+            }
+        })
+    }
+
     @SuppressLint("ClickableViewAccessibility")
     override fun onTouch(v: View, event: MotionEvent): Boolean {
         when (event.action) {
             MotionEvent.ACTION_DOWN -> {
-                if (v.id == R.id.backLayout) {
+                if (v.id == R.id.backLayout || v.id == R.id.btnConsult || v.id == R.id.tvAllEvaluate) {
                     v.startAnimation(getScaleAnimation())
                 }
             }
@@ -75,10 +128,30 @@ class DoctorDetailsActivity :
                     R.id.backLayout -> {
                         finish()
                     }
+
+                    R.id.btnConsult -> {
+                        if (id.isNotEmpty()) {
+                            JumpUtil.jumpActivityWithUrl(
+                                RouterUrlCommon.consultationRequest,
+                                id,
+                                mContext
+                            )
+                        }
+                    }
+
+                    R.id.tvAllEvaluate -> {
+                        if (id.isNotEmpty()) {
+                            JumpUtil.jumpActivityWithUrl(
+                                RouterUrlCommon.evaluate,
+                                id,
+                                mContext
+                            )
+                        }
+                    }
                 }
             }
             MotionEvent.ACTION_CANCEL -> {
-                if (v.id == R.id.backLayout) {
+                if (v.id == R.id.backLayout || v.id == R.id.btnConsult || v.id == R.id.tvAllEvaluate) {
                     v.startAnimation(getEndAnimation())
                 }
             }

+ 17 - 0
healthconsultation/src/main/java/com/yingyang/healthconsultation/doctordetails/DoctorDetailsViewModel.kt

@@ -1,6 +1,8 @@
 package com.yingyang.healthconsultation.doctordetails
 
+import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
 import com.yingyang.healthconsultation.entity.GetDoctorDetailsBean
+import com.yingyang.healthconsultation.entity.GetPatientReviewBean
 import com.yingyang.healthconsultation.net.HEALTHCONSULTATION_API
 import com.yingyangfly.baselib.db.DoctorBean
 import com.yingyangfly.baselib.mvvm.BaseViewModel
@@ -26,4 +28,19 @@ class DoctorDetailsViewModel : BaseViewModel() {
         success,
         fail
     )
+
+    fun getPatientReview(
+        doctorId: String,
+        fail: ((msg: String) -> Unit)? = null,
+        success: ((success: List<EvaluateRecordsBean>?) -> Unit)? = null,
+    ) = launchFlow(true) {
+        val requestBean = GetPatientReviewBean().apply {
+            id = doctorId
+        }
+        val body = XUtils.createJson(GsonUtil.GsonString(requestBean))
+        HEALTHCONSULTATION_API.getPatientReview(body)
+    }.runUI(
+        success,
+        fail
+    )
 }

+ 1 - 1
healthconsultation/src/main/java/com/yingyang/healthconsultation/entity/GetPatientReviewBean.kt

@@ -1,5 +1,5 @@
 package com.yingyang.healthconsultation.entity
 
 class GetPatientReviewBean {
-    var page: Int = 0
+    var id: String = ""
 }

+ 48 - 43
healthconsultation/src/main/java/com/yingyang/healthconsultation/evaluate/EvaluateActivity.kt

@@ -1,10 +1,18 @@
 package com.yingyang.healthconsultation.evaluate
 
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.text.TextUtils
+import android.view.MotionEvent
+import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.yingyang.healthconsultation.R
 import com.yingyang.healthconsultation.adapter.EvaluateAdapter
 import com.yingyang.healthconsultation.databinding.ActivityEvaluateBinding
 import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
-import com.yingyangfly.baselib.ext.show
+import com.yingyangfly.baselib.ext.getEndAnimation
+import com.yingyangfly.baselib.ext.getScaleAnimation
+import com.yingyangfly.baselib.ext.toast
 import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
 import com.yingyangfly.baselib.router.RouterUrlCommon
 
@@ -12,31 +20,28 @@ import com.yingyangfly.baselib.router.RouterUrlCommon
  * 患者评价
  */
 @Route(path = RouterUrlCommon.evaluate)
-class EvaluateActivity : BaseMVVMActivity<ActivityEvaluateBinding, EvaluateViewModel>() {
+class EvaluateActivity : BaseMVVMActivity<ActivityEvaluateBinding, EvaluateViewModel>(),
+    View.OnTouchListener {
 
-    private var page = 1
+    private var id: String = ""
     private val adapter by lazy { EvaluateAdapter() }
     private var evaluateRecordsBeans = mutableListOf<EvaluateRecordsBean>()
 
+    override fun onCreate(savedInstanceState: Bundle?) {
+        id = intent.getStringExtra("url") ?: ""
+        super.onCreate(savedInstanceState)
+    }
+
     override fun initViews() {
         binding {
-            evaluationRefresh.setEnableRefresh(true)
-            evaluationRefresh.setEnableLoadMore(true)
             rvEvaluation.adapter = adapter
             adapter.setData(evaluateRecordsBeans)
         }
     }
 
+    @SuppressLint("ClickableViewAccessibility")
     override fun initListener() {
-        binding {
-            evaluationRefresh.setOnRefreshListener {
-                loadData(true, false)
-            }
-
-            evaluationRefresh.setOnLoadMoreListener {
-                loadData(false, false)
-            }
-        }
+        binding.backLayout.setOnTouchListener(this)
     }
 
     override fun initData() {
@@ -45,47 +50,47 @@ class EvaluateActivity : BaseMVVMActivity<ActivityEvaluateBinding, EvaluateViewM
 
     override fun onResume() {
         super.onResume()
-        loadData(true, true)
+        if (TextUtils.isEmpty(id).not()) {
+            loadData()
+        }
     }
 
     /**
      * 加载数据
      */
-    private fun loadData(isRefresh: Boolean, isShowLoading: Boolean) {
-        if (isRefresh) {
-            page = 1
-            binding.evaluationRefresh.resetNoMoreData()
-        } else {
-            page++
-        }
-        viewModel.getPatientReview(page, isShowLoading, fail = {
-            endRefresh()
-            it.show()
+    private fun loadData() {
+        viewModel.getPatientReview(id, fail = {
+            it.toast()
         }, success = {
-            endRefresh()
-            if (isRefresh) {
-                evaluateRecordsBeans.clear()
-            }
-            if (it != null) {
-                if (it.records.isNullOrEmpty().not()) {
-                    evaluateRecordsBeans.addAll(it.records)
-                }
-            }
-            if (evaluateRecordsBeans.isEmpty()) {
-                binding.evaluationRefresh.finishLoadMoreWithNoMoreData()
+            evaluateRecordsBeans.clear()
+            if (it.isNullOrEmpty().not()) {
+                evaluateRecordsBeans.addAll(it!!)
             }
             adapter.showEmptyView = evaluateRecordsBeans.isEmpty()
             adapter.setData(evaluateRecordsBeans)
         })
     }
 
-    /**
-     * 结束刷新
-     */
-    private fun endRefresh() {
-        binding {
-            evaluationRefresh.finishRefresh()
-            evaluationRefresh.finishLoadMore()
+    @SuppressLint("ClickableViewAccessibility")
+    override fun onTouch(v: View, event: MotionEvent): Boolean {
+        when (event.action) {
+            MotionEvent.ACTION_DOWN -> {
+                if (v.id == R.id.backLayout) {
+                    v.startAnimation(getScaleAnimation())
+                }
+            }
+            MotionEvent.ACTION_UP -> {
+                v.startAnimation(getEndAnimation())
+                if (v.id == R.id.backLayout) {
+                    finish()
+                }
+            }
+            MotionEvent.ACTION_CANCEL -> {
+                if (v.id == R.id.backLayout) {
+                    v.startAnimation(getEndAnimation())
+                }
+            }
         }
+        return true
     }
 }

+ 5 - 6
healthconsultation/src/main/java/com/yingyang/healthconsultation/evaluate/EvaluateViewModel.kt

@@ -1,6 +1,6 @@
 package com.yingyang.healthconsultation.evaluate
 
-import com.yingyang.healthconsultation.entity.EvaluateRecordListBean
+import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
 import com.yingyang.healthconsultation.entity.GetPatientReviewBean
 import com.yingyang.healthconsultation.net.HEALTHCONSULTATION_API
 import com.yingyangfly.baselib.mvvm.BaseViewModel
@@ -13,13 +13,12 @@ import com.yingyangfly.baselib.utils.GsonUtil
 class EvaluateViewModel : BaseViewModel() {
 
     fun getPatientReview(
-        index: Int,
-        isShowLoading: Boolean,
+        doctorId: String,
         fail: ((msg: String) -> Unit)? = null,
-        success: ((success: EvaluateRecordListBean?) -> Unit)? = null,
-    ) = launchFlow(isShowLoading) {
+        success: ((success: List<EvaluateRecordsBean>?) -> Unit)? = null,
+    ) = launchFlow(true) {
         val requestBean = GetPatientReviewBean().apply {
-            page = index
+            id = doctorId
         }
         val body = XUtils.createJson(GsonUtil.GsonString(requestBean))
         HEALTHCONSULTATION_API.getPatientReview(body)

+ 2 - 2
healthconsultation/src/main/java/com/yingyang/healthconsultation/net/HealthConsultationApiService.kt

@@ -1,6 +1,6 @@
 package com.yingyang.healthconsultation.net
 
-import com.yingyang.healthconsultation.entity.EvaluateRecordListBean
+import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
 import com.yingyang.healthconsultation.entity.UserInfoBean
 import com.yingyangfly.baselib.bean.PayImageBean
 import com.yingyangfly.baselib.db.DoctorBean
@@ -44,7 +44,7 @@ interface HealthConsultationApiService {
      * 评价列表
      */
     @POST("patient_review/list")
-    suspend fun getPatientReview(@Body requestBody: RequestBody): BaseResp<EvaluateRecordListBean>
+    suspend fun getPatientReview(@Body requestBody: RequestBody): BaseResp<List<EvaluateRecordsBean>>
 
     /**
      * 购买医疗咨询

+ 7 - 0
healthconsultation/src/main/res/drawable/bg_btn_doctor_details.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:ignore="ResourceName">
+    <corners android:radius="@dimen/divider_20px" />
+    <solid android:color="@color/color_FF4A76FF" />
+</shape>

+ 231 - 182
healthconsultation/src/main/res/layout/activity_doctor_details.xml

@@ -11,233 +11,282 @@
             type="com.yingyangfly.baselib.db.DoctorBean" />
     </data>
 
-    <androidx.constraintlayout.widget.ConstraintLayout
+    <androidx.core.widget.NestedScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@mipmap/icon_uniform_background">
 
         <LinearLayout
-            android:id="@+id/backLayout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/divider_65px"
-            android:layout_marginTop="@dimen/divider_35px"
-            android:gravity="center"
-            android:orientation="horizontal"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent">
-
-            <androidx.appcompat.widget.AppCompatImageView
-                android:layout_width="@dimen/divider_48px"
-                android:layout_height="@dimen/divider_48px"
-                android:background="@mipmap/icon_back" />
-
-            <androidx.appcompat.widget.AppCompatTextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="@dimen/divider_14px"
-                android:text="@string/back_pager"
-                android:textColor="@android:color/white"
-                android:textSize="@dimen/divider_28px"
-                android:textStyle="bold" />
-
-        </LinearLayout>
-
-        <androidx.appcompat.widget.AppCompatTextView
-            android:id="@+id/tvTitle"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/divider_32px"
-            android:text="@string/doctor_details"
-            android:textColor="@android:color/white"
-            android:textSize="@dimen/divider_38px"
-            android:textStyle="bold"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <com.google.android.material.card.MaterialCardView
             android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_marginStart="@dimen/divider_12px"
-            android:layout_marginTop="@dimen/divider_33px"
-            android:layout_marginEnd="@dimen/divider_32px"
-            android:theme="@style/Theme.MaterialComponents.NoActionBar"
-            app:cardBackgroundColor="@android:color/white"
-            app:cardCornerRadius="@dimen/divider_28px"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/tvTitle">
+            android:layout_height="match_parent"
+            android:orientation="vertical">
 
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-                <androidx.appcompat.widget.AppCompatImageView
-                    android:id="@+id/imageHead"
-                    android:layout_width="@dimen/divider_100px"
-                    android:layout_height="@dimen/divider_100px"
-                    android:layout_marginStart="@dimen/divider_47px"
-                    android:layout_marginTop="@dimen/divider_59px"
-                    app:isCircle="@{true}"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent"
-                    app:loadHeadImg="@{data.avatar}" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvStatus"
-                    android:layout_width="@dimen/divider_114px"
-                    android:layout_height="@dimen/divider_36px"
-                    android:layout_marginStart="@dimen/divider_40px"
-                    android:layout_marginTop="@dimen/divider_141px"
-                    android:background="@drawable/bg_doctor_status"
-                    android:gravity="center"
-                    android:text="@{data.getIsOnlineStatus()}"
-                    android:textColor="@android:color/white"
-                    android:textSize="@dimen/divider_24px"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
+                android:layout_height="wrap_content">
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvName"
+                <LinearLayout
+                    android:id="@+id/backLayout"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_35px"
-                    android:layout_marginTop="@dimen/divider_40px"
-                    android:text="@{data.userName}"
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_28px"
-                    android:textStyle="bold"
-                    app:layout_constraintStart_toEndOf="@+id/imageHead"
-                    app:layout_constraintTop_toTopOf="parent"
-                    tools:text="@string/app_name" />
+                    android:layout_marginStart="@dimen/divider_65px"
+                    android:layout_marginTop="@dimen/divider_35px"
+                    android:gravity="center"
+                    android:orientation="horizontal"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent">
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvDuties"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_40px"
-                    android:layout_marginTop="@dimen/divider_44px"
-                    android:text='@{data.title+data.departmentName}'
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_24px"
-                    app:layout_constraintStart_toEndOf="@+id/tvName"
-                    app:layout_constraintTop_toTopOf="parent"
-                    tools:text="@string/app_name" />
+                    <androidx.appcompat.widget.AppCompatImageView
+                        android:layout_width="@dimen/divider_48px"
+                        android:layout_height="@dimen/divider_48px"
+                        android:background="@mipmap/icon_back" />
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvGoodAt"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_35px"
-                    android:layout_marginTop="@dimen/divider_19px"
-                    android:text="@{data.speciality}"
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_24px"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toEndOf="@+id/imageHead"
-                    app:layout_constraintTop_toBottomOf="@+id/tvDuties"
-                    tools:text="@string/app_name" />
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_14px"
+                        android:text="@string/back_pager"
+                        android:textColor="@android:color/white"
+                        android:textSize="@dimen/divider_28px"
+                        android:textStyle="bold" />
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvConsult"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_35px"
-                    android:layout_marginTop="@dimen/divider_17px"
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_24px"
-                    app:layout_constraintStart_toEndOf="@+id/imageHead"
-                    app:layout_constraintTop_toBottomOf="@+id/tvGoodAt"
-                    tools:text="@string/app_name" />
+                </LinearLayout>
 
                 <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvGoodRate"
+                    android:id="@+id/tvTitle"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/divider_23px"
-                    android:layout_marginEnd="@dimen/divider_26px"
-                    android:text='@{"好评率"+data.goodRate}'
-                    android:textColor="@color/color_FFFF9E05"
-                    android:textSize="@dimen/divider_24px"
+                    android:layout_marginTop="@dimen/divider_32px"
+                    android:text="@string/doctor_details"
+                    android:textColor="@android:color/white"
+                    android:textSize="@dimen/divider_38px"
+                    android:textStyle="bold"
                     app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/tvGoodAt"
-                    tools:text="@string/app_name" />
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout>
+
+            <com.google.android.material.card.MaterialCardView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/divider_12px"
+                android:layout_marginTop="@dimen/divider_33px"
+                android:layout_marginEnd="@dimen/divider_32px"
+                android:theme="@style/Theme.MaterialComponents.NoActionBar"
+                app:cardBackgroundColor="@android:color/white"
+                app:cardCornerRadius="@dimen/divider_28px">
 
                 <androidx.constraintlayout.widget.ConstraintLayout
                     android:layout_width="match_parent"
-                    android:layout_height="@dimen/divider_207px"
-                    android:layout_marginStart="@dimen/divider_47px"
-                    android:layout_marginTop="@dimen/divider_55px"
-                    android:layout_marginEnd="@dimen/divider_25px"
-                    android:background="@drawable/bg_consult"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/tvConsult">
+                    android:layout_height="match_parent"
+                    android:paddingBottom="@dimen/divider_22px">
+
+                    <androidx.appcompat.widget.AppCompatImageView
+                        android:id="@+id/imageHead"
+                        android:layout_width="@dimen/divider_100px"
+                        android:layout_height="@dimen/divider_100px"
+                        android:layout_marginStart="@dimen/divider_47px"
+                        android:layout_marginTop="@dimen/divider_59px"
+                        app:isCircle="@{true}"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toTopOf="parent"
+                        app:loadHeadImg="@{data.avatar}" />
 
                     <androidx.appcompat.widget.AppCompatTextView
-                        android:id="@+id/tvConsultingService"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginStart="@dimen/divider_44px"
-                        android:layout_marginTop="@dimen/divider_22px"
-                        android:text="@string/consulting_service"
+                        android:id="@+id/tvStatus"
+                        android:layout_width="@dimen/divider_114px"
+                        android:layout_height="@dimen/divider_36px"
+                        android:layout_marginStart="@dimen/divider_40px"
+                        android:layout_marginTop="@dimen/divider_141px"
+                        android:background="@drawable/bg_doctor_status"
+                        android:gravity="center"
+                        android:text="@{data.getIsOnlineStatus()}"
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintStart_toStartOf="parent"
                         app:layout_constraintTop_toTopOf="parent" />
 
-                    <androidx.appcompat.widget.AppCompatImageView
-                        android:id="@+id/imageGraphic"
-                        android:layout_width="@dimen/divider_89px"
-                        android:layout_height="@dimen/divider_89px"
-                        android:layout_marginStart="@dimen/divider_66px"
-                        android:layout_marginTop="@dimen/divider_20px"
-                        android:background="@mipmap/icon_consultation_type"
-                        app:layout_constraintStart_toStartOf="parent"
-                        app:layout_constraintTop_toBottomOf="@+id/tvConsultingService" />
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:id="@+id/tvName"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_35px"
+                        android:layout_marginTop="@dimen/divider_40px"
+                        android:text="@{data.userName}"
+                        android:textColor="@color/color_FF333333"
+                        android:textSize="@dimen/divider_28px"
+                        android:textStyle="bold"
+                        app:layout_constraintStart_toEndOf="@+id/imageHead"
+                        app:layout_constraintTop_toTopOf="parent"
+                        tools:text="@string/app_name" />
 
                     <androidx.appcompat.widget.AppCompatTextView
-                        android:id="@+id/tvGraphicConsultation"
+                        android:id="@+id/tvDuties"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        android:layout_marginStart="@dimen/divider_23px"
-                        android:layout_marginTop="@dimen/divider_28px"
-                        android:text="@string/graphic_consultation"
-                        android:textColor="@android:color/white"
+                        android:layout_marginStart="@dimen/divider_40px"
+                        android:layout_marginTop="@dimen/divider_44px"
+                        android:text='@{data.title+data.departmentName}'
+                        android:textColor="@color/color_FF333333"
                         android:textSize="@dimen/divider_24px"
-                        app:layout_constraintStart_toEndOf="@+id/imageGraphic"
-                        app:layout_constraintTop_toBottomOf="@+id/tvConsultingService" />
+                        app:layout_constraintStart_toEndOf="@+id/tvName"
+                        app:layout_constraintTop_toTopOf="parent"
+                        tools:text="@string/app_name" />
+
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:id="@+id/tvGoodAt"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_35px"
+                        android:layout_marginTop="@dimen/divider_19px"
+                        android:text="@{data.speciality}"
+                        android:textColor="@color/color_FF333333"
+                        android:textSize="@dimen/divider_24px"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toEndOf="@+id/imageHead"
+                        app:layout_constraintTop_toBottomOf="@+id/tvDuties"
+                        tools:text="@string/app_name" />
 
                     <androidx.appcompat.widget.AppCompatTextView
-                        android:id="@+id/tvPrice"
+                        android:id="@+id/tvConsult"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        android:layout_marginStart="@dimen/divider_23px"
-                        android:layout_marginTop="@dimen/divider_8px"
-                        android:text='@{data.price+"/次"}'
-                        android:textColor="@android:color/white"
+                        android:layout_marginStart="@dimen/divider_35px"
+                        android:layout_marginTop="@dimen/divider_17px"
+                        android:textColor="@color/color_FF333333"
                         android:textSize="@dimen/divider_24px"
-                        app:layout_constraintStart_toEndOf="@+id/imageGraphic"
-                        app:layout_constraintTop_toBottomOf="@+id/tvGraphicConsultation"
+                        app:layout_constraintStart_toEndOf="@+id/imageHead"
+                        app:layout_constraintTop_toBottomOf="@+id/tvGoodAt"
                         tools:text="@string/app_name" />
 
-                    <androidx.appcompat.widget.AppCompatButton
-                        android:layout_width="@dimen/divider_160px"
-                        android:layout_height="@dimen/divider_48px"
-                        android:layout_marginTop="@dimen/divider_120px"
-                        android:layout_marginEnd="@dimen/divider_29px"
-                        android:background="@drawable/bg_go_consultation"
-                        android:text="@string/go_to_consult"
-                        android:textColor="@android:color/white"
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:id="@+id/tvGoodRate"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="@dimen/divider_23px"
+                        android:layout_marginEnd="@dimen/divider_26px"
+                        android:text='@{"好评率"+data.goodRate}'
+                        android:textColor="@color/color_FFFF9E05"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintEnd_toEndOf="parent"
-                        app:layout_constraintTop_toTopOf="parent" />
+                        app:layout_constraintTop_toBottomOf="@+id/tvGoodAt"
+                        tools:text="@string/app_name" />
+
+                    <androidx.constraintlayout.widget.ConstraintLayout
+                        android:id="@+id/docotrLayout"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/divider_207px"
+                        android:layout_marginStart="@dimen/divider_47px"
+                        android:layout_marginTop="@dimen/divider_55px"
+                        android:layout_marginEnd="@dimen/divider_25px"
+                        android:background="@drawable/bg_consult"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/tvConsult">
+
+                        <androidx.appcompat.widget.AppCompatTextView
+                            android:id="@+id/tvConsultingService"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="@dimen/divider_44px"
+                            android:layout_marginTop="@dimen/divider_22px"
+                            android:text="@string/consulting_service"
+                            android:textColor="@android:color/white"
+                            android:textSize="@dimen/divider_24px"
+                            app:layout_constraintStart_toStartOf="parent"
+                            app:layout_constraintTop_toTopOf="parent" />
+
+                        <androidx.appcompat.widget.AppCompatImageView
+                            android:id="@+id/imageGraphic"
+                            android:layout_width="@dimen/divider_89px"
+                            android:layout_height="@dimen/divider_89px"
+                            android:layout_marginStart="@dimen/divider_66px"
+                            android:layout_marginTop="@dimen/divider_20px"
+                            android:background="@mipmap/icon_consultation_type"
+                            app:layout_constraintStart_toStartOf="parent"
+                            app:layout_constraintTop_toBottomOf="@+id/tvConsultingService" />
+
+                        <androidx.appcompat.widget.AppCompatTextView
+                            android:id="@+id/tvGraphicConsultation"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="@dimen/divider_23px"
+                            android:layout_marginTop="@dimen/divider_28px"
+                            android:text="@string/graphic_consultation"
+                            android:textColor="@android:color/white"
+                            android:textSize="@dimen/divider_24px"
+                            app:layout_constraintStart_toEndOf="@+id/imageGraphic"
+                            app:layout_constraintTop_toBottomOf="@+id/tvConsultingService" />
+
+                        <androidx.appcompat.widget.AppCompatTextView
+                            android:id="@+id/tvPrice"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="@dimen/divider_23px"
+                            android:layout_marginTop="@dimen/divider_8px"
+                            android:text='@{data.price+"/次"}'
+                            android:textColor="@android:color/white"
+                            android:textSize="@dimen/divider_24px"
+                            app:layout_constraintStart_toEndOf="@+id/imageGraphic"
+                            app:layout_constraintTop_toBottomOf="@+id/tvGraphicConsultation"
+                            tools:text="@string/app_name" />
+
+                        <androidx.appcompat.widget.AppCompatButton
+                            android:id="@+id/btnConsult"
+                            android:layout_width="@dimen/divider_160px"
+                            android:layout_height="@dimen/divider_48px"
+                            android:layout_marginTop="@dimen/divider_120px"
+                            android:layout_marginEnd="@dimen/divider_29px"
+                            android:background="@drawable/bg_go_consultation"
+                            android:text="@string/go_to_consult"
+                            android:textColor="@android:color/white"
+                            android:textSize="@dimen/divider_24px"
+                            app:layout_constraintEnd_toEndOf="parent"
+                            app:layout_constraintTop_toTopOf="parent" />
+
+                    </androidx.constraintlayout.widget.ConstraintLayout>
+
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:id="@+id/tvPatientEvaluate"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/divider_47px"
+                        android:layout_marginTop="@dimen/divider_38px"
+                        android:text="@string/patient_evaluate"
+                        android:textColor="@color/color_FF000000"
+                        android:textSize="@dimen/divider_28px"
+                        android:textStyle="bold"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/docotrLayout" />
+
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:id="@+id/tvAllEvaluate"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:paddingStart="@dimen/divider_26px"
+                        android:paddingTop="@dimen/divider_43px"
+                        android:paddingEnd="@dimen/divider_26px"
+                        android:paddingBottom="@dimen/divider_43px"
+                        android:text="@string/view_all"
+                        android:textColor="@color/color_ff4571ff"
+                        android:textSize="@dimen/divider_24px"
+                        android:textStyle="bold"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/docotrLayout" />
+
+                    <androidx.recyclerview.widget.RecyclerView
+                        android:id="@+id/rvEvaluation"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/tvPatientEvaluate" />
 
                 </androidx.constraintlayout.widget.ConstraintLayout>
+            </com.google.android.material.card.MaterialCardView>
 
-            </androidx.constraintlayout.widget.ConstraintLayout>
-        </com.google.android.material.card.MaterialCardView>
-    </androidx.constraintlayout.widget.ConstraintLayout>
+        </LinearLayout>
+    </androidx.core.widget.NestedScrollView>
 </layout>

+ 5 - 11
healthconsultation/src/main/res/layout/activity_evaluate.xml

@@ -64,19 +64,13 @@
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/tvTitle">
 
-            <com.scwang.smartrefresh.layout.SmartRefreshLayout
-                android:id="@+id/evaluationRefresh"
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvEvaluation"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent">
+                android:layout_height="match_parent"
+                android:layout_marginStart="@dimen/divider_47px"
+                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
 
-                <androidx.recyclerview.widget.RecyclerView
-                    android:id="@+id/rvEvaluation"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_marginStart="@dimen/divider_47px"
-                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
-
-            </com.scwang.smartrefresh.layout.SmartRefreshLayout>
         </com.google.android.material.card.MaterialCardView>
     </androidx.constraintlayout.widget.ConstraintLayout>
 

+ 2 - 0
healthconsultation/src/main/res/values/dimens.xml

@@ -39,6 +39,7 @@
     <dimen name="divider_329px" tools:ignore="ResourceName">329px</dimen>
     <dimen name="divider_328px" tools:ignore="ResourceName">328px</dimen>
     <dimen name="divider_327px" tools:ignore="ResourceName">327px</dimen>
+    <dimen name="divider_321px" tools:ignore="ResourceName">321px</dimen>
     <dimen name="divider_320px" tools:ignore="ResourceName">320px</dimen>
     <dimen name="divider_313px" tools:ignore="ResourceName">313px</dimen>
     <dimen name="divider_307px" tools:ignore="ResourceName">307px</dimen>
@@ -57,6 +58,7 @@
     <dimen name="divider_245px" tools:ignore="ResourceName">245px</dimen>
     <dimen name="divider_240px" tools:ignore="ResourceName">240px</dimen>
     <dimen name="divider_237px" tools:ignore="ResourceName">237px</dimen>
+    <dimen name="divider_235px" tools:ignore="ResourceName">235px</dimen>
     <dimen name="divider_234px" tools:ignore="ResourceName">234px</dimen>
     <dimen name="divider_230px" tools:ignore="ResourceName">230px</dimen>
     <dimen name="divider_229px" tools:ignore="ResourceName">229px</dimen>

+ 1 - 0
healthconsultation/src/main/res/values/strings.xml

@@ -53,4 +53,5 @@
     <string name="cancellation_of_order" translatable="false" tools:ignore="ResourceName">取消订单</string>
     <string name="order_payment" translatable="false" tools:ignore="ResourceName">订单支付</string>
     <string name="payment_completed" tools:ignore="ResourceName">已完成支付</string>
+    <string name="view_all" tools:ignore="ResourceName">查看全部</string>
 </resources>