Commit 3edfc1a4 by 刘鹏

feat : 购药返回逻辑优化

parent 372e14b2
......@@ -41,7 +41,7 @@ ext {
"ydl-webview" : "0.0.38.57",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.29",
"ydl-medical-pay" : "0.0.01.31",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......@@ -126,7 +126,7 @@ ext {
"ydl-webview" : "0.0.38.57",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.29",
"ydl-medical-pay" : "0.0.01.31",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......
......@@ -103,9 +103,10 @@ object MedicalPayIn {
.navigation()
}
fun mainIntentToWebView(type: String) {
fun mainIntentToWebView(type: String,data :String) {
val bundle = Bundle();
bundle.putString("webView", type)
bundle.putString("data", data)
ARouter.getInstance().build("/main/main")
.withBundle("webView", bundle)
.navigation()
......
......@@ -37,6 +37,7 @@ import java.util.*
class MedicalPayActivity : BaseActivity() {
companion object {
private const val DRUG_ORDER_DETAIL = "medical_drug_order_detail"
//价格
private const val PRICE_KEY = "price"
......@@ -198,10 +199,10 @@ class MedicalPayActivity : BaseActivity() {
if (response.code == 200) {
showCloseDialog(response.data)
} else {
finish()
payTypefinish()
}
}, { e ->
finish()
payTypefinish()
e.printStackTrace()
})
......@@ -232,7 +233,7 @@ class MedicalPayActivity : BaseActivity() {
) { dialog, which ->
//关闭页面
timer?.cancel()
finish()
payTypefinish()
dialog.dismiss()
}
builder.setRight_color("#3464EC")
......@@ -260,7 +261,7 @@ class MedicalPayActivity : BaseActivity() {
override fun onFinish() {
builder.dismiss()
finish()
payTypefinish()
}
......@@ -268,6 +269,18 @@ class MedicalPayActivity : BaseActivity() {
timer?.start()
}
/**
* 不同支付场景的关闭返回路径
* */
private fun payTypefinish() {
if (mPayBizType == MEDICAL_ORDER_TYPE) {
MedicalPayIn.mainIntentToWebView(DRUG_ORDER_DETAIL, mOrderId)
finish()
} else if (mPayBizType == INQUIRY_ORDER_TYPE) {
finish()
}
}
private fun toPay(response: BaseResponse<CreatePayRespose>, payType: Int) {
if (payType == PAY_ALI && response.data.payParams.isNotEmpty()) {
val payRunnable = Runnable {
......
......@@ -49,9 +49,7 @@ class MedicalPaySuccessActivity : BaseActivity() {
iv_back.setOnClickListener {
MedicalPayIn.mainIntentToWebView(MEDICAL_ORDER_LIST_KEY)
finish()
onBackPressed()
}
to_order.setOnClickListener {
//查看药品订单
......@@ -66,6 +64,11 @@ class MedicalPaySuccessActivity : BaseActivity() {
}
override fun onBackPressed() {
MedicalPayIn.mainIntentToWebView(MEDICAL_ORDER_LIST_KEY,"")
finish()
}
private fun initStatus() {
StatusBarUtils.setTransparentForImageView(this@MedicalPaySuccessActivity, null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment