Commit 9847efdf by 刘鹏

feat : 支付返回倒计时接口更改

parent 8cee3a49
......@@ -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.23",
"ydl-medical-pay" : "0.0.01.26",
"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.23",
"ydl-medical-pay" : "0.0.01.26",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......
......@@ -166,6 +166,22 @@ public class TimeBackDialog extends Dialog {
}
/**
* 倒计时控件
*/
public void setMessageToMedicalView(String str) {
String strStart = "\n请在";
String strEnd = "内完成支付,超时将会自动取消\n";
SpannableString ss = new SpannableString(strStart + str + strEnd);
ss.setSpan(new ForegroundColorSpan(Color.parseColor("#FF7766")), strStart.length(), str.length() + strStart.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
if (message_tv != null) {
message_tv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
message_tv.setText(ss);
}
}
/**
* 设置对话框界面
*
* @param v View
......
......@@ -31,10 +31,11 @@ class MedicalPayServiceImpl {
/**
* 获取下单的信息
* @param inquiryOrderId 订单id
* @param bizId 订单id
* @param bizType 1-问诊订单 3-药品订单
*/
fun getSurplusPayTime(inquiryOrderId: String): Observable<BaseResponse<PayTimeRespose>> {
return YDLHttpUtils.obtainApi(MedicalPayServices::class.java).getSurplusPayTime(inquiryOrderId)
fun getSurplusPayTime(bizId: String,bizType:String): Observable<BaseResponse<PayTimeRespose>> {
return YDLHttpUtils.obtainApi(MedicalPayServices::class.java).getSurplusPayTime(bizId,bizType)
}
}
}
\ No newline at end of file
......@@ -21,8 +21,11 @@ interface MedicalPayServices {
/**
* 获取订单结束时间
*/
@GET("api/client/inquiry/v1/getSurplusPayTime")
@GET("api/pay/getBizSurplusPayTime")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun getSurplusPayTime(@Query("inquiryOrderId") inquiryOrderId: String): Observable<BaseResponse<PayTimeRespose>>
fun getSurplusPayTime(
@Query("bizId") bizId: String,
@Query("bizType") bizType: String
): Observable<BaseResponse<PayTimeRespose>>
}
\ No newline at end of file
......@@ -191,7 +191,12 @@ class MedicalPayActivity : BaseActivity() {
@SuppressLint("CheckResult")
private fun backCheck() {
//获取订单结束时间
MedicalPayServiceImpl.getSurplusPayTime(mOrderId)
val bizType = if (mPayBizType == MEDICAL_ORDER_TYPE) {
"3"
} else {
"1"
}
MedicalPayServiceImpl.getSurplusPayTime(mOrderId, bizType)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
......@@ -212,9 +217,15 @@ class MedicalPayActivity : BaseActivity() {
* 关闭弹窗
* */
private fun showCloseDialog(timeStamp: Long) {
val title = if (mPayBizType == MEDICAL_ORDER_TYPE) {
"\n请在23小时59分23秒内完成支付,超时将会自动取消\n"
} else {
"\n已为您锁定问诊名额,请在24小时59分00秒内完成支付,超时名额自动取消\n"
}
val builder = TimeBackDialog.Builder(this@MedicalPayActivity, "center", true)
builder.setTitle("")
builder.setMessage("\n已为您锁定问诊名额,请在24小时59分00秒内完成支付,超时名额自动取消\n")
builder.setMessage(title)
builder.setPositiveButton(
"继续支付"
) { dialog, which ->
......@@ -244,8 +255,12 @@ class MedicalPayActivity : BaseActivity() {
//单位秒
var second =
(millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000
if (mPayBizType == MEDICAL_ORDER_TYPE) {
builder.setMessageToMedicalView("${hour}小时${minute}分${second}")
builder.setMessageToTextView("${hour}小时${minute}分${second}")
} else {
builder.setMessageToTextView("${hour}小时${minute}分${second}")
}
}
override fun onFinish() {
......
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