Commit 3b3155e2 by 刘鹏

feat : 云信通知,查询订单状态加入surplusInquiryTime 倒计时字段

parent 20a232d4
...@@ -9,10 +9,10 @@ ext { ...@@ -9,10 +9,10 @@ ext {
"m-consultant" : "0.0.59.91", "m-consultant" : "0.0.59.91",
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.90", "m-user-medical" : "0.0.61.90",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-im-medical" : "0.0.20.76", "m-im-medical" : "0.0.20.79",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -95,10 +95,10 @@ ext { ...@@ -95,10 +95,10 @@ ext {
"m-consultant" : "0.0.59.91", "m-consultant" : "0.0.59.91",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.90", "m-user-medical" : "0.0.61.90",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im" : "0.0.20.76", "m-im" : "0.0.20.76",
"m-im-medical" : "0.0.20.76", "m-im-medical" : "0.0.20.79",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
......
...@@ -6,10 +6,15 @@ data class DoctorInquIryIngInfoBean( ...@@ -6,10 +6,15 @@ data class DoctorInquIryIngInfoBean(
val inquiryOrderId: String, val inquiryOrderId: String,
//问诊订单状态: 10:待支付、 20:待接诊、 30:待诊断(已接诊、问诊中)、40:已完成、50:已结束、60:已关闭 //问诊订单状态: 10:待支付、 20:待接诊、 30:待诊断(已接诊、问诊中)、40:已完成、50:已结束、60:已关闭
val status: Int, val status: Int,
//问诊订单状态: 10:待支付、 20:待接诊、 30:待诊断(已接诊、问诊中)、40:已完成、50:已结束、60:已关闭
val statusName: String,
//当前用户是否和医生在问诊中0不在问诊中、1在问诊中(问诊中状态包括待诊断和已完成) //当前用户是否和医生在问诊中0不在问诊中、1在问诊中(问诊中状态包括待诊断和已完成)
val inquiryIng: Int, val inquiryIng: Int,
//医生ID //医生ID
val doctorId: String, val doctorId: String,
//用户ID //用户ID
val userId: String val userId: String,
//倒计时,单位秒
var surplusInquiryTime: Long
) )
...@@ -8,7 +8,12 @@ data class Type91Bean( ...@@ -8,7 +8,12 @@ data class Type91Bean(
//订单状态 //订单状态
var status: Int, var status: Int,
//订单状态名称 //订单状态名称
var statusName: String var statusName: String,
) //倒计时,单位秒
var surplusInquiryTime: Long,
var surplusBeginTime: Long,
var surplusPayTime: Long
)
} }
...@@ -224,7 +224,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -224,7 +224,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
try { try {
Type91Bean type91Bean = new Gson().fromJson(content, Type91Bean.class); Type91Bean type91Bean = new Gson().fromJson(content, Type91Bean.class);
if (type91Bean.getType() == MESSAGE_TYPE) { if (type91Bean.getType() == MESSAGE_TYPE) {
messageFragment.upReceiceType(type91Bean.getData().getStatus(),type91Bean.getData().getStatusName()); messageFragment.upReceiceType(type91Bean.getData().getStatus(),type91Bean.getData().getStatusName(),type91Bean.getData().getSurplusInquiryTime());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -2,9 +2,14 @@ package com.yidianling.uikit.business.session.fragment; ...@@ -2,9 +2,14 @@ package com.yidianling.uikit.business.session.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -143,6 +148,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -143,6 +148,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private TextView tv_receive_unstart; private TextView tv_receive_unstart;
//待诊断 //待诊断
private TextView tv_receive_undiagnosis; private TextView tv_receive_undiagnosis;
//待诊断 倒计时
private TextView time_count_down;
private CountDownTimer timer;
//诊断结束 //诊断结束
private TextView tv_receive_end; private TextView tv_receive_end;
private int expertInfoViewHeight = 0; // 专家信息栏高度 private int expertInfoViewHeight = 0; // 专家信息栏高度
...@@ -182,6 +191,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -182,6 +191,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
receive_unstart = rootView.findViewById(R.id.receive_unstart); receive_unstart = rootView.findViewById(R.id.receive_unstart);
//待诊断 //待诊断
receive_undiagnosis = rootView.findViewById(R.id.receive_undiagnosis); receive_undiagnosis = rootView.findViewById(R.id.receive_undiagnosis);
//问诊中 倒计时
time_count_down = rootView.findViewById(R.id.time_count_down);
//诊断结束 //诊断结束
receive_end = rootView.findViewById(R.id.receive_end); receive_end = rootView.findViewById(R.id.receive_end);
messageListView.setItemAnimator(null); messageListView.setItemAnimator(null);
...@@ -480,7 +492,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -480,7 +492,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> { .subscribe(response -> {
if ("200".equals(response.code)) { if ("200".equals(response.code)) {
upReceiceType(response.data.getStatus(), ""); upReceiceType(response.data.getStatus(), response.data.getStatusName(), response.data.getSurplusInquiryTime());
} else { } else {
ToastUtil.toastShort(response.msg); ToastUtil.toastShort(response.msg);
...@@ -499,7 +511,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -499,7 +511,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
public void upReceiceType(int type, String statusName) { public void upReceiceType(int type, String statusName, Long time) {
if (ActionHandlerStorage.getL(sessionId).getUserType() == USER_TYPE_EXPERT) { if (ActionHandlerStorage.getL(sessionId).getUserType() == USER_TYPE_EXPERT) {
if (type == 30) { if (type == 30) {
// 30:待诊断(已接诊、问诊中) // 30:待诊断(已接诊、问诊中)
...@@ -511,6 +523,44 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -511,6 +523,44 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if (!TextUtils.isEmpty(statusName)) { if (!TextUtils.isEmpty(statusName)) {
tv_receive_undiagnosis.setText(statusName); tv_receive_undiagnosis.setText(statusName);
} }
timer = new CountDownTimer(time * 1000, 1) {
@Override
public void onTick(long millisUntilFinished) {
//单位时
long hour = millisUntilFinished / (1000 * 60 * 60);
//单位分
long minute = (millisUntilFinished - hour * (1000 * 60 * 60)) / (1000 * 60);
//单位秒
long second = (millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000;
String timeStr = "";
if (hour != 0) {
timeStr = hour + "小时" + minute + "分" + second + "秒";
} else if (hour == 0 && minute != 0) {
timeStr = minute + "分" + second + "秒";
}else if (hour == 0 && minute == 0 && second != 0) {
timeStr = second + "秒";
}
if (!TextUtils.isEmpty(timeStr)){
String timeEnd = "后问诊结束";
SpannableStringBuilder spannable = new SpannableStringBuilder(timeStr + timeEnd);
spannable.setSpan(new ForegroundColorSpan(Color.parseColor("#007AFF")),
0,
timeStr.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
);
time_count_down.setText(spannable);
}else {
time_count_down.setText("");
}
}
@Override
public void onFinish() {
}
};
timer.start();
} else if (type == 20) { } else if (type == 20) {
//待接诊 //待接诊
...@@ -532,9 +582,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -532,9 +582,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if (!TextUtils.isEmpty(statusName)) { if (!TextUtils.isEmpty(statusName)) {
tv_receive_end.setText(statusName); tv_receive_end.setText(statusName);
} }
if (timer != null) {
timer.cancel();
}
} else { } else {
top_expert_info_ll.setVisibility(View.GONE); top_expert_info_ll.setVisibility(View.GONE);
inputPanel.setVisible(false); inputPanel.setVisible(false);
if (timer != null) {
timer.cancel();
}
} }
} }
} }
......
...@@ -71,15 +71,15 @@ ...@@ -71,15 +71,15 @@
android:id="@+id/receive_undiagnosis" android:id="@+id/receive_undiagnosis"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_receive_undiagnosis,tv_receive_undiagnosis" app:constraint_referenced_ids="iv_receive_undiagnosis,tv_receive_undiagnosis,time_count_down"
tools:visibility="gone" /> tools:visibility="visible" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/receive_end" android:id="@+id/receive_end"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_receive_end,tv_receive_end" app:constraint_referenced_ids="iv_receive_end,tv_receive_end"
tools:visibility="visible" /> tools:visibility="gone" />
<ImageView <ImageView
android:id="@+id/iv_receive_unstart" android:id="@+id/iv_receive_unstart"
...@@ -125,6 +125,17 @@ ...@@ -125,6 +125,17 @@
app:layout_constraintLeft_toRightOf="@id/iv_receive_undiagnosis" app:layout_constraintLeft_toRightOf="@id/iv_receive_undiagnosis"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/time_count_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:textColor="#495C72"
android:textSize="14sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_receive_undiagnosis"
app:layout_constraintRight_toRightOf="parent"
tools:text="23小时58分21秒后问诊结束" />
<ImageView <ImageView
android:id="@+id/iv_receive_end" android:id="@+id/iv_receive_end"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
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