Selaa lähdekoodia

1.修改购买问诊后发送患者信息逻辑

王鹏鹏 2 vuotta sitten
vanhempi
commit
11bc0e8161

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

@@ -15,4 +15,5 @@ object CommonParam {
     val MOBILE = "mobile"
     val IDCARD = "idCard"
     val DOCTORAVATAR = "doctor_avatar"
+    val PATIENTINFO = "patientInfo"
 }

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

@@ -223,4 +223,19 @@ object User {
             Preferences.getString(CommonParam.SNCODE)!!
         }
     }
+
+    /**
+     * 保存患者问诊信息
+     */
+    fun savePatientInfo(patientInfo: String) {
+        Preferences.put(CommonParam.PATIENTINFO, patientInfo)
+    }
+
+    fun getPatientInfo(): String {
+        return if (TextUtils.isEmpty(Preferences.getString(CommonParam.PATIENTINFO))) {
+            ""
+        } else {
+            Preferences.getString(CommonParam.PATIENTINFO)!!
+        }
+    }
 }

+ 1 - 0
healthconsultation/src/main/java/com/yingyang/healthconsultation/consultationsheet/ConsultationSheetActivity.kt

@@ -350,6 +350,7 @@ class ConsultationSheetActivity :
             appUserName = User.getName()
             appUserSex = User.getUserSex()
             appUserAge = User.getUserAge()
+            doctorId = id
         }
         val patientInfo = GsonUtil.GsonString(patientConsultationBean)
         ARouter.getInstance().build(RouterUrlCommon.payment)

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

@@ -11,5 +11,6 @@ class PatientConsultationBean {
     var appUserName: String = ""
     var appUserSex: String = ""
     var appUserAge: String = ""
+    var doctorId: String = ""
 
 }

+ 1 - 0
healthconsultation/src/main/java/com/yingyang/healthconsultation/paid/PaidActivity.kt

@@ -330,6 +330,7 @@ class PaidActivity : BaseMVVMActivity<ActivityPaidBinding, PaidViewModel>(),
             it.appUserName = User.getName()
             it.appUserSex = User.getUserSex()
             it.appUserAge = User.getUserAge()
+            it.doctorId = doctorId
         }
         val patientInfo = GsonUtil.GsonString(patientConsultationBean)
         ARouter.getInstance().build(RouterUrlCommon.payment)

+ 8 - 0
healthconsultation/src/main/java/com/yingyang/healthconsultation/payment/PaymentActivity.kt

@@ -20,6 +20,7 @@ import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
 import com.yingyangfly.baselib.router.RouterUrlCommon
 import com.yingyangfly.baselib.utils.LiveEventBusUtil
 import com.yingyangfly.baselib.utils.RxBusCodes
+import com.yingyangfly.baselib.utils.User
 
 /**
  * 订单支付
@@ -33,18 +34,25 @@ class PaymentActivity : BaseMVVMActivity<ActivityPaymentBinding, PaymentViewMode
     private var doctorBean: DoctorBean? = null
     private var orderNo = ""
     private var method = ""
+    private var patientInfo = ""
     private var paymentQrCodeDialog: PaymentQrCodeDialog? = null
     private var purchaseConsultationBean: PurchaseConsultationBean? = null
 
     override fun onCreate(savedInstanceState: Bundle?) {
         id = intent.getStringExtra("id") ?: ""
         price = intent.getStringExtra("price") ?: ""
+        patientInfo = intent.getStringExtra("patientInfo") ?: ""
         purchaseConsultationBean =
             intent.getSerializableExtra("purchaseConsultationBean") as PurchaseConsultationBean
         super.onCreate(savedInstanceState)
     }
 
     override fun initViews() {
+        if (TextUtils.isEmpty(patientInfo)) {
+            User.savePatientInfo("")
+        } else {
+            User.savePatientInfo(patientInfo)
+        }
         if (doctorDao != null) {
             doctorBean = doctorDao?.getDoctor(id)
             if (doctorBean != null) {

+ 1 - 0
healthconsultation/src/main/java/com/yingyang/healthconsultation/record/ConsultationRecordActivity.kt

@@ -188,6 +188,7 @@ class ConsultationRecordActivity :
             appUserName = User.getName()
             appUserSex = User.getUserSex()
             appUserAge = User.getUserAge()
+            doctorId = bean.doctor.id
         }
         val patientInfo = GsonUtil.GsonString(patientConsultationBean)
         ARouter.getInstance().build(RouterUrlCommon.payment)

+ 0 - 1
home/src/main/java/com/yingyangfly/home/activity/HomeActivity.kt

@@ -726,7 +726,6 @@ class HomeActivity : BaseMVVMActivity<ActivityHomeBinding, HomeViewModel>(),
                                     "start" -> {
                                         //医生接诊
                                         RxBus.get().send(RxBusCodes.doctorReception)
-//                                        sendPatientMessage(messageBean)
                                     }
                                 }
                             }