Commit c1397851 by 刘鹏

feat : 2.0提测版代码

parent fbdaf7f7
......@@ -105,7 +105,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
yl_twwz.setOnClickListener {
//医疗图文问诊
GraphicConsultationFlow1Activity.start(this@MainActivity,"10586")
GraphicConsultationFlow1Activity.start(this@MainActivity,"10622","130953969")
}
yl_yhdangan_list.setOnClickListener {
......@@ -289,6 +289,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
@SuppressLint("MissingSuperCall")
override fun onDestroy() {
if (serviceConnection != null) {
unbindService(serviceConnection)
......
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.84",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.25",
"m-im" : "0.0.20.27",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10",
......@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.53",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.06",
"ydl-medical-pay" : "0.0.01.07",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.84",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.25",
"m-im" : "0.0.20.27",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8",
......@@ -122,7 +122,7 @@ ext {
"ydl-webview" : "0.0.38.53",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.06",
"ydl-medical-pay" : "0.0.01.07",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......
package com.yidianling.medical.im
data class Type91Bean(
var type: Int,
var data: DataBean
) {
data class DataBean(
//订单状态
var status: Int,
//订单状态名称
var statusName: String
)
}
......@@ -6,8 +6,6 @@ import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
......@@ -18,7 +16,6 @@ import com.netease.nimlib.sdk.msg.model.CustomNotification;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.api.bean.IMRegisterObserverCustomNotificationCallBack;
import com.yidianling.im.bean.ServiceBean;
......@@ -26,6 +23,7 @@ import com.yidianling.im.bridge.P2PCustomActionHandlerImpl;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.ImObserversHelper;
import com.yidianling.im.session.SessionHelper;
import com.yidianling.medical.im.Type91Bean;
import com.yidianling.nimbase.api.model.session.SessionCustomization;
import com.yidianling.nimbase.api.model.user.UserInfoObserver;
import com.yidianling.nimbase.business.session.constant.Extras;
......@@ -53,7 +51,8 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
private int screenHeight;
protected YDLMessageFragment messageFragment;
private boolean isChangeDoctor = false;
String oldName="";
String oldName = "";
private final int MESSAGE_TYPE = 91;
/**
* @param context
......@@ -134,7 +133,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
public void onObserverCustomNotification(@NotNull String fromUid, @NotNull String toUid, @NotNull String content) {
ServiceBean serviceBean = new Gson().fromJson(content, ServiceBean.class);
// 切换到客服
if (serviceBean != null && serviceBean.getData() != null&&serviceBean.getBusiness()!=null && serviceBean.getBusiness().equals("change_doctor")) {
if (serviceBean != null && serviceBean.getData() != null && serviceBean.getBusiness() != null && serviceBean.getBusiness().equals("change_doctor")) {
isChangeDoctor = true;
String serviceUid = String.valueOf(serviceBean.getData().getToUid());
tb.setTitle(serviceBean.getData().getName());
......@@ -152,7 +151,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers(false);
super.onDestroy();
AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.YUNXIN,"退出聊天页面");
AliYunRichLogsHelper.Companion.getInstance().sendRichLog(AliYunLogConfig.YUNXIN, "退出聊天页面");
}
@Override
......@@ -221,28 +220,15 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
}
String content = message.getContent();
try {
JSONObject json = JSON.parseObject(content);
int id = json.getIntValue("id");
if (id == 1) {
//对方输入中
oldName= tb.getTitle();
tb.setTitle("对方正在输入...");
tb.postDelayed(new Runnable() {
@Override
public void run() {
tb.setTitle(oldName);
}
},1500);
} else if (id==2){
//对方结束输入
tb.setTitle(oldName);
}else{
tb.setTitle(oldName);
Type91Bean type91Bean = new Gson().fromJson(content, Type91Bean.class);
if (type91Bean.getType() == MESSAGE_TYPE) {
messageFragment.upReceiceType(type91Bean.getData().getStatus());
}
} catch (Exception e) {
tb.setTitle(oldName);
e.printStackTrace();
}
}
......
......@@ -461,35 +461,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if ("200".equals(response.code)) {
if (response.data.getStatus() == 30) {
// 30:待诊断(已接诊、问诊中)
inputPanel.setVisible(true);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.VISIBLE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.GONE);
} else if (response.data.getStatus() == 20) {
//待接诊
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.VISIBLE);
receive_end.setVisibility(View.GONE);
} else if (response.data.getStatus() == 40) {
//已完成
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.VISIBLE);
} else {
top_expert_info_ll.setVisibility(View.GONE);
inputPanel.setVisible(false);
}
upReceiceType(response.data.getStatus());
} else {
ToastUtil.toastShort(response.msg);
......@@ -503,6 +475,38 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
);
}
public void upReceiceType(int type) {
if (type == 30) {
// 30:待诊断(已接诊、问诊中)
inputPanel.setVisible(true);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.VISIBLE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.GONE);
} else if (type == 20) {
//待接诊
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.VISIBLE);
receive_end.setVisibility(View.GONE);
} else if (type == 40) {
//已完成
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.VISIBLE);
} else {
top_expert_info_ll.setVisibility(View.GONE);
inputPanel.setVisible(false);
}
}
@Override
public void onDestroy() {
EventBus.getDefault().unregister(this);
......
......@@ -9,7 +9,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_height="56dp"
android:background="@color/white"
android:elevation="0dp"
android:gravity="bottom"
......
......@@ -8,7 +8,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_height="56dp"
android:background="@color/white"
android:elevation="0dp"
android:gravity="bottom"
......
package com.medical.ydl.medical.bean
data class PayTimeReqDtoBody(
//订单id
var inquiryOrderId: String
)
\ No newline at end of file
package com.medical.ydl.medical.bean
data class PayTimeRespose(
//订单id
var inquiryOrderId: String,
//剩余秒数
var surplusPayTime: Long,
//文字时间
var surplusPayTimeStr: String
)
......@@ -3,6 +3,8 @@ package com.medical.ydl.medical.http
import com.google.gson.Gson
import com.medical.ydl.medical.bean.CreatePayReqDtoBody
import com.medical.ydl.medical.bean.CreatePayRespose
import com.medical.ydl.medical.bean.PayTimeReqDtoBody
import com.medical.ydl.medical.bean.PayTimeRespose
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
......@@ -26,5 +28,13 @@ class MedicalPayServiceImpl {
) as RequestBody
return YDLHttpUtils.obtainApi(MedicalPayServices::class.java).getOrderInfo(body)
}
/**
* 获取下单的信息
* @param inquiryOrderId 订单id
*/
fun getSurplusPayTime(inquiryOrderId: String): Observable<BaseResponse<PayTimeRespose>> {
return YDLHttpUtils.obtainApi(MedicalPayServices::class.java).getSurplusPayTime(inquiryOrderId)
}
}
}
\ No newline at end of file
package com.medical.ydl.medical.http
import com.medical.ydl.medical.bean.CreatePayRespose
import com.medical.ydl.medical.bean.PayTimeRespose
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA_URL
import com.ydl.ydlcommon.data.http.BaseResponse
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.*
interface MedicalPayServices {
/**
......@@ -18,4 +17,12 @@ interface MedicalPayServices {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun getOrderInfo(@Body body: RequestBody): Observable<BaseResponse<CreatePayRespose>>
/**
* 获取订单结束时间
*/
@GET("ydl-yiliao-api/api/client/inquiry/v1/getSurplusPayTime")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun getSurplusPayTime(@Query("inquiryOrderId") inquiryOrderId: String): Observable<BaseResponse<PayTimeRespose>>
}
\ No newline at end of file
......@@ -163,7 +163,30 @@ class MedicalPayActivity : BaseActivity() {
EventBus.getDefault().unregister(this)
}
@SuppressLint("CheckResult")
private fun backCheck() {
//获取订单结束时间
MedicalPayServiceImpl.getSurplusPayTime(mOrderId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
if (response.code == 200) {
showCloseDialog(response.data.surplusPayTime)
} else {
finish()
}
}, { e ->
finish()
e.printStackTrace()
})
}
/**
* 关闭弹窗
* */
private fun showCloseDialog(timeStamp: Long) {
val builder = TimeBackDialog.Builder(this@MedicalPayActivity, "center", true)
builder.setTitle("")
builder.setMessage("\n已为您锁定问诊名额,请在24小时59分00秒内完成支付,超时名额自动取消\n")
......@@ -186,8 +209,7 @@ class MedicalPayActivity : BaseActivity() {
val dialog = builder.create()
dialog.show()
var timeStamp: Long = 86400000
timer = object : CountDownTimer(timeStamp, 1000) {
timer = object : CountDownTimer(timeStamp * 1000, 1) {
override fun onTick(millisUntilFinished: Long) {
//单位时
var hour = millisUntilFinished / (1000 * 60 * 60)
......@@ -209,7 +231,6 @@ class MedicalPayActivity : BaseActivity() {
}
timer?.start()
}
private fun toPay(response: BaseResponse<CreatePayRespose>, payType: Int) {
......
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