Explorar o código

1.在线问诊患者信息修改

王鹏鹏 %!s(int64=2) %!d(string=hai) anos
pai
achega
e7d71df06d

+ 2 - 0
.idea/misc.xml

@@ -481,6 +481,7 @@
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/drawable/bg_game_loading.xml" value="0.151" />
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/drawable/bg_game_progressbar_selector.xml" value="0.151" />
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/drawable/home_webview_progressbar_selector.xml" value="0.151" />
+        <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/drawable/layer_rating_bar.xml" value="0.151" />
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/layout/activity_base.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/layout/activity_base_web_view.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/baselib/src/main/res/layout/dialog_evaluate.xml" value="0.23697916666666666" />
@@ -535,6 +536,7 @@
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/dialog_payment_qr_code.xml" value="0.6" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_consultation.xml" value="0.8" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_consultation_record.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_evaluate.xml" value="0.264" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_recommend_doctor.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/healthconsultation/src/main/res/layout/item_search_doctor.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/home/src/main/res/drawable/bg_results_content.xml" value="0.151" />

+ 2 - 0
baselib/src/main/java/com/yingyangfly/baselib/utils/CommonParam.kt

@@ -14,4 +14,6 @@ object CommonParam {
     val USERAGE = "userAge"
     val TXSIGN = "txSign"
     val ORGCODE = "orgCode"
+    val MOBILE = "mobile"
+    val IDCARD = "idCard"
 }

+ 24 - 0
baselib/src/main/java/com/yingyangfly/baselib/utils/User.kt

@@ -10,6 +10,30 @@ object User {
 
     val context: Context
         get() = BaseApplication.appContext
+    
+    fun saveMobile(mobile: String) {
+        Preferences.put(CommonParam.MOBILE, mobile)
+    }
+
+    fun getMobile(): String {
+        return if (Preferences.getString(CommonParam.MOBILE).isNullOrEmpty()) {
+            ""
+        } else {
+            Preferences.getString(CommonParam.MOBILE)!!
+        }
+    }
+
+    fun saveIdCard(idCard: String) {
+        Preferences.put(CommonParam.IDCARD, idCard)
+    }
+
+    fun getIdCard(): String {
+        return if (Preferences.getString(CommonParam.IDCARD).isNullOrEmpty()) {
+            ""
+        } else {
+            Preferences.getString(CommonParam.IDCARD)!!
+        }
+    }
 
     /**
      * 保存用户登陆手机号

+ 0 - 15
healthconsultation/src/main/java/com/yingyang/healthconsultation/consultationsheet/ConsultationRequestActivity.kt

@@ -14,7 +14,6 @@ import com.yingyang.healthconsultation.databinding.ActivityConsultationRequestBi
 import com.yingyangfly.baselib.db.DoctorBean
 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
 import com.yingyangfly.baselib.utils.JumpUtil
@@ -62,23 +61,9 @@ class ConsultationRequestActivity :
     }
 
     override fun initData() {
-        getUserInfo()
         successfulPurchase()
     }
 
-    /**
-     * 获取患者信息
-     */
-    private fun getUserInfo() {
-        viewModel.getUserInfo(fail = {
-            it.toast()
-        }, success = {
-            if (it != null) {
-                binding.user = it
-            }
-        })
-    }
-
     @SuppressLint("ClickableViewAccessibility")
     override fun onTouch(v: View, event: MotionEvent): Boolean {
         when (event.action) {

+ 0 - 12
healthconsultation/src/main/java/com/yingyang/healthconsultation/consultationsheet/ConsultationRequestViewModel.kt

@@ -1,21 +1,9 @@
 package com.yingyang.healthconsultation.consultationsheet
 
-import com.yingyang.healthconsultation.net.HEALTHCONSULTATION_API
-import com.yingyangfly.baselib.bean.UserInfoBean
 import com.yingyangfly.baselib.mvvm.BaseViewModel
 
 /**
  * @author 王鹏鹏
  */
 class ConsultationRequestViewModel : BaseViewModel() {
-
-    fun getUserInfo(
-        fail: ((msg: String) -> Unit)? = null,
-        success: ((success: UserInfoBean?) -> Unit)? = null,
-    ) = launchFlow(true) {
-        HEALTHCONSULTATION_API.getUserInfo()
-    }.runUI(
-        success,
-        fail
-    )
 }

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

@@ -1,8 +1,10 @@
 package com.yingyang.healthconsultation.net
 
-import com.yingyang.healthconsultation.entity.*
+import com.yingyang.healthconsultation.entity.ConsultationListBean
+import com.yingyang.healthconsultation.entity.ConsultationRecordsBean
+import com.yingyang.healthconsultation.entity.EvaluateRecordsBean
+import com.yingyang.healthconsultation.entity.MedicalConsultationDetailBean
 import com.yingyangfly.baselib.bean.PayImageBean
-import com.yingyangfly.baselib.bean.UserInfoBean
 import com.yingyangfly.baselib.db.DoctorBean
 import com.yingyangfly.baselib.net.BaseResp
 import okhttp3.MultipartBody
@@ -25,12 +27,6 @@ interface HealthConsultationApiService {
     @POST("medical_consultation/list")
     suspend fun getConsultationList(): BaseResp<List<ConsultationListBean>>
 
-    /**
-     * 获取个人中心信息接口
-     */
-    @POST("app/user/info")
-    suspend fun getUserInfo(): BaseResp<UserInfoBean>
-
     /**
      * 上传文件接口
      */
@@ -58,14 +54,6 @@ interface HealthConsultationApiService {
     @POST("medical_consultation/my/list")
     suspend fun getConsultationRecordList(): BaseResp<List<ConsultationRecordsBean>>
 
-    /**
-     * 取消支付
-     */
-    @POST("app/pay/delPayOrder")
-    suspend fun delPayOrder(
-        @Query("orderNo") orderNo: String
-    ): BaseResp<String>
-
     /**
      * 获取腾讯IM密钥
      */

+ 6 - 8
healthconsultation/src/main/res/layout/activity_consultation_request.xml

@@ -6,9 +6,7 @@
 
     <data>
 
-        <variable
-            name="user"
-            type="com.yingyangfly.baselib.bean.UserInfoBean" />
+        <import type="com.yingyangfly.baselib.utils.User" />
 
         <variable
             name="data"
@@ -201,7 +199,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/divider_36px"
                         android:layout_marginTop="@dimen/divider_16px"
-                        android:text="@{user.name}"
+                        android:text="@{User.INSTANCE.name}"
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintStart_toStartOf="parent"
@@ -213,7 +211,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/divider_49px"
                         android:layout_marginTop="@dimen/divider_16px"
-                        android:text='@{"性别:"+user.getSex()}'
+                        android:text='@{"性别:"+User.INSTANCE.userSex}'
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintStart_toEndOf="@+id/tvPatientName"
@@ -225,7 +223,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/divider_36px"
                         android:layout_marginTop="@dimen/divider_16px"
-                        android:text='@{"年龄:"+user.getAgeInfo()}'
+                        android:text='@{"年龄:"+User.INSTANCE.userAge}'
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintStart_toEndOf="@+id/tvPatientSex"
@@ -236,7 +234,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/divider_36px"
                         android:layout_marginBottom="@dimen/divider_28px"
-                        android:text='@{"身份证号:"+user.idCard}'
+                        android:text='@{"身份证号:"+User.INSTANCE.idCard}'
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintBottom_toBottomOf="parent"
@@ -247,7 +245,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginEnd="@dimen/divider_24px"
                         android:layout_marginBottom="@dimen/divider_28px"
-                        android:text='@{"手机号:"+user.mobile}'
+                        android:text='@{"手机号:"+User.INSTANCE.mobile}'
                         android:textColor="@android:color/white"
                         android:textSize="@dimen/divider_24px"
                         app:layout_constraintBottom_toBottomOf="parent"

+ 6 - 0
login/src/main/java/com/yingyang/login/ui/login/LoginActivity.kt

@@ -113,6 +113,12 @@ class LoginActivity : BaseMVVMActivity<ActivityLoginBinding, LoginViewModel>(),
             runOnUiThread {
                 startInitService()
                 if (it != null) {
+                    if (TextUtils.isEmpty(it.mobile).not()) {
+                        User.saveMobile(it.mobile)
+                    }
+                    if (TextUtils.isEmpty(it.idCard).not()) {
+                        User.saveIdCard(it.idCard)
+                    }
                     //保存用户头像
                     if (TextUtils.isEmpty(it.avatar).not()) {
                         User.saveAvatar(it.avatar)

+ 6 - 1
personalcenter/src/main/java/com/yingyang/personalcenter/personalcenter/PersonalCenterActivity.kt

@@ -70,7 +70,12 @@ class PersonalCenterActivity :
         }, success = {
             if (it != null) {
                 binding.data = it
-                //保存用户头像
+                if (TextUtils.isEmpty(it.mobile).not()) {
+                    User.saveMobile(it.mobile)
+                }
+                if (TextUtils.isEmpty(it.idCard).not()) {
+                    User.saveIdCard(it.idCard)
+                }
                 //保存用户头像
                 if (TextUtils.isEmpty(it.avatar).not()) {
                     User.saveAvatar(it.avatar)