|
|
@@ -4,11 +4,14 @@ import android.annotation.SuppressLint
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
+import com.alibaba.android.arouter.launcher.ARouter
|
|
|
import com.yingyang.healthconsultation.R
|
|
|
import com.yingyang.healthconsultation.adapter.ConsultationRecordAdapter
|
|
|
import com.yingyang.healthconsultation.databinding.ActivityConsultationRecordBinding
|
|
|
import com.yingyang.healthconsultation.entity.ConsultationRecordsBean
|
|
|
+import com.yingyang.healthconsultation.entity.PurchaseConsultationBean
|
|
|
import com.yingyangfly.baselib.db.DoctorBean
|
|
|
+import com.yingyangfly.baselib.dialog.TipsDialog
|
|
|
import com.yingyangfly.baselib.ext.getEndAnimation
|
|
|
import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.ext.show
|
|
|
@@ -36,7 +39,7 @@ class ConsultationRecordActivity :
|
|
|
when (it.status) {
|
|
|
"0" -> {
|
|
|
//0未支付
|
|
|
- cancleOrder(it.id)
|
|
|
+ showTipsDialog(it.id)
|
|
|
}
|
|
|
"1" -> {
|
|
|
//1待接诊
|
|
|
@@ -52,7 +55,7 @@ class ConsultationRecordActivity :
|
|
|
}
|
|
|
"4" -> {
|
|
|
//4已完成
|
|
|
-
|
|
|
+ evaluationOrder()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -61,11 +64,11 @@ class ConsultationRecordActivity :
|
|
|
when (it.status) {
|
|
|
"0" -> {
|
|
|
//0未支付
|
|
|
-
|
|
|
+ payOrder(it)
|
|
|
}
|
|
|
"1" -> {
|
|
|
//1待接诊
|
|
|
- cancleOrder(it.id)
|
|
|
+ showTipsDialog(it.id)
|
|
|
}
|
|
|
"2" -> {
|
|
|
//2接诊中
|
|
|
@@ -99,6 +102,20 @@ class ConsultationRecordActivity :
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ private fun showTipsDialog(id: String) {
|
|
|
+ TipsDialog.TipDialogBuilder()
|
|
|
+ .title("提示")
|
|
|
+ .content("是否取消该笔订单")
|
|
|
+ .leftBtnText("取消")
|
|
|
+ .rightBtnText("确定")
|
|
|
+ .leftClick({
|
|
|
+ }, true)
|
|
|
+ .rightClick({
|
|
|
+ cancleOrder(id)
|
|
|
+ }, true)
|
|
|
+ .show(supportFragmentManager)
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
override fun initListener() {
|
|
|
binding.backLayout.setOnTouchListener(this)
|
|
|
@@ -108,6 +125,32 @@ class ConsultationRecordActivity :
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 评价订单
|
|
|
+ */
|
|
|
+ private fun evaluationOrder() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 支付订单
|
|
|
+ */
|
|
|
+ private fun payOrder(bean: ConsultationRecordsBean) {
|
|
|
+ val purchaseConsultationBean = PurchaseConsultationBean()
|
|
|
+ purchaseConsultationBean.let {
|
|
|
+ it.remark = bean.remark
|
|
|
+ it.sysUserId = bean.sysUserId
|
|
|
+ it.sickTime = bean.sickTime
|
|
|
+ it.images = bean.images
|
|
|
+ it.isConsultation = bean.isConsultation
|
|
|
+ }
|
|
|
+ ARouter.getInstance().build(RouterUrlCommon.payment)
|
|
|
+ .withString("id", bean.doctor.id)
|
|
|
+ .withSerializable("purchaseConsultationBean", purchaseConsultationBean)
|
|
|
+ .withTransition(R.anim.leftin, R.anim.leftout)
|
|
|
+ .navigation(mContext)
|
|
|
+ }
|
|
|
+
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
loadData()
|