Commit 65a80944 by 范玉宾

im module feat done

parent cdd04085
package com.yidianling.im.bean
data class CanViewConsult(
val canViewConsult: Boolean = false
)
......@@ -280,11 +280,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
String toUid = expertInfo.shareData.toUid;
......@@ -305,7 +301,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//如果是群聊
if (SessionTypeEnum.Team==sessionType){
titleBar.setRightIcon(getContext().getDrawable(R.drawable.platform_common_more));
rela_zixun.setVisibility(View.GONE);
titleBar.setTitleRightDraw(null);
}
}
......@@ -328,6 +323,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
});
}
boolean isExpert = null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() == 2;
ServiceImpl.Companion.getInstance().canViewConsult("")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.code.equals("200")){
if (response.data!=null && response.data.getCanViewConsult()){
if (isExpert && sessionType != SessionTypeEnum.Team) {
rela_zixun.setVisibility(View.VISIBLE);
}
}
}
}
);
//有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2 || ActionHandlerStorage.getL(sessionId).getInfo().listenOrderCommentStatus == 1) {
......
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
......@@ -125,4 +126,10 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: crm_cloud")
fun getFirstQuestion( @Body map: Map<String,@JvmSuppressWildcards Any>): Observable<BaseAPIResponse<FirstQuestionBean>>
//倾诉2.0迭代 是否显示立即咨询按钮
@GET("consult/expert-page/canViewConsult")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun canViewConsult(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<CanViewConsult>>
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.uikit.custom.http.response.*
......@@ -200,4 +201,11 @@ class ServiceImpl private constructor() {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getFirstQuestion(map)
}
/**
* 是否显示立即咨询
*/
fun canViewConsult(doctorId: String):Observable<BaseAPIResponse<CanViewConsult>>{
return YDLHttpUtils.obtainApi(ServiceApi::class.java).canViewConsult(doctorId)
}
}
\ No newline at end of file
......@@ -9,12 +9,18 @@ import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MessageBuilder;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.confide.api.ConfideRoute;
import com.ydl.confide.api.IConfideService;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.utils.Utils;
import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
......@@ -27,6 +33,10 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.YDLCacheUtils;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.findRouteService;
/**
* Created by haorui on 2019/5/22.
* Des:
......@@ -129,9 +139,28 @@ public class ConfideOrderInfoView extends RelativeLayout {
//点击整个view,跳转订单详情页面
setOnClickListener(view -> {
if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情
H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情");
NewH5Activity.start(mContext, h5Params);
if (Utils.isFastClick()){
return;
}
String remainTime = ActionHandlerStorage.getL(mSessionId).getInfo().listenOrderRemainTime;
if(TextUtils.isEmpty(remainTime)){
if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情
H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情");
NewH5Activity.start(mContext, h5Params);
}
}else {
if (info!=null){
String confideId = info.listenerId;
findRouteService(IConfideService.class)
.showExpertDetailDialog(
(FragmentActivity)mContext,
HttpConfig.Companion.getMH5_URL() + ConfideRoute.INSTANCE.h5ConfideIntro(confideId),
info.doctorId,
info.toUid);
}
}
});
}
......
......@@ -487,12 +487,14 @@
android:background="@drawable/im_bg_im_consult_action"
android:gravity="center"
android:paddingLeft="17dp"
android:paddingRight="11dp">
android:paddingRight="11dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/action_yuyue"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="5dp"
android:text="立即咨询"
......
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