Commit 6febe8f9 by 刘鹏

fix:IM模块问题修复

parent a05d8a8d
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.31",
"m-home" : "0.0.22.61",
"m-im" : "0.0.18.55",
"m-im" : "0.0.18.58",
"m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.8",
......@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.31",
"m-home" : "0.0.22.61",
"m-im" : "0.0.18.55",
"m-im" : "0.0.18.58",
"m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.6",
......
......@@ -26,7 +26,7 @@ class ImConstants {
val FREEDTAIL = HttpConfig.H5_URL + "consult-trial/"
//免费体验订单详情 后边拼接orderid 如果没有拼""
val ORDER_DETAIL = HttpConfig.H5_URL + "/wb/user/order/detail?needOrderHelperAlert=1&orderid="
val ORDER_DETAIL = HttpConfig.MH5_URL + "wb/user/order/detail?needOrderHelperAlert=1&orderid="
const val BIND_PHONE_ACTION = "wxbind"
......
......@@ -116,7 +116,7 @@ interface ImRetrofitApi {
fun standardOrderServiceOperation(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
/**已完成订单*/
@POST("consult/user/order/affirmComplete")
@GET("consult/user/order/affirmComplete")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun affirmComplete(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
fun affirmComplete( @Query("id") orderId: String): Observable<BaseAPIResponse<Any>>
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ public class CustomAttachConsultSubScript extends CustomAttachment {
private String FLAG = "flag";
private String URL = "url";
private String IS_PACKAGE = "isPackage";
private static final String NEWSORDERID = "newsOrderId";//用于跳转新版订单详情
private static final String NEWSORDERID = "newOrderId";//用于跳转新版订单详情
private static final String STATUS = "status";//状态,1代表已确认,0代表待确认
......@@ -31,7 +31,7 @@ public class CustomAttachConsultSubScript extends CustomAttachment {
public int flag;//0 未确认 1已确认
public byte isPackage = 0; //是否套餐 1单次 2套餐
/***新订单*/
public String newsOrderId;
public String newOrderId;
public int status;
public CustomAttachConsultSubScript() {
......@@ -48,7 +48,7 @@ public class CustomAttachConsultSubScript extends CustomAttachment {
url = data.getString(URL);
flag = data.getInteger(FLAG);
isPackage = data.getByte(IS_PACKAGE);
this.newsOrderId = data.getString(NEWSORDERID);
this.newOrderId = data.getString(NEWSORDERID);
this.status = data.getInteger(STATUS);
}
......@@ -64,7 +64,7 @@ public class CustomAttachConsultSubScript extends CustomAttachment {
data.put(URL,url);
data.put(FLAG,flag);
data.put(IS_PACKAGE,isPackage);
data.put(NEWSORDERID, newsOrderId);
data.put(NEWSORDERID, newOrderId);
data.put(STATUS, status);
return data;
}
......
......@@ -39,7 +39,7 @@ import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
* 确认订单
* 确认订单 消息类型 38
*/
public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
......@@ -48,12 +48,11 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
private ImageView img_icon;
/***跳转url*/
public String url;
/***新订单id*/
public String newsOrderId;
/***订单id*/
public String orderId;
/***0 未确认 1已确认*/
public int flag;
public boolean isSureed = false;//是否已确认
public MsgViewHolderConfirmOrder(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
......@@ -98,7 +97,6 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
tv_date.setText(customAttachment.bookingTime == null ? "" : customAttachment.bookingTime);
tv_type.setText(customAttachment.servicetype == null ? "" : customAttachment.servicetype);
url = customAttachment.url;
newsOrderId = customAttachment.newsOrderId;
orderId = customAttachment.orderId;
flag = customAttachment.status;
......@@ -139,22 +137,51 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
});
}
try {
Map<String,Object> map = message.getLocalExtension();
if (map!=null){
Object obj = map.get("isSure");
Object exp = map.get("isExpired");
if (obj!=null){
boolean b = (boolean) obj;
if (flag == 1 || b){
updateSureView("已确认");
}
}else if (exp!=null){
boolean expb = (boolean) exp;
if (expb){
updateSureView("已确认");
}
}else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12));
}
}else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12));
}
}catch (Exception e){}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url) && newsOrderId == null) {
if (TextUtils.isEmpty(url) && orderId == null) {
return;
}
if (newsOrderId == null || newsOrderId.isEmpty()) {
if (orderId == null || orderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newsOrderId.isEmpty() ? "" : newsOrderId), null);
ImConstants.Companion.getORDER_DETAIL() + (orderId.isEmpty() ? "" : orderId), null);
NewH5Activity.start(context, orderParams);
}
}
......
......@@ -35,7 +35,7 @@ public class MsgViewHolderConsultSubScribe extends MsgViewHolderBase {
public int flag;//0 未确认 1已确认
public byte isPackage;
/***新订单id*/
public String newsOrderId;
public String newOrderId;
public MsgViewHolderConsultSubScribe(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
......@@ -85,6 +85,7 @@ public class MsgViewHolderConsultSubScribe extends MsgViewHolderBase {
url = ((CustomAttachConsultSubScript) attachment).url;
flag = ((CustomAttachConsultSubScript) attachment).flag;
isPackage = ((CustomAttachConsultSubScript) attachment).isPackage;
newOrderId = ((CustomAttachConsultSubScript) attachment).newOrderId;
}
tv_title.setText(title);
......@@ -113,16 +114,16 @@ public class MsgViewHolderConsultSubScribe extends MsgViewHolderBase {
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url)&& newsOrderId == null){
if (TextUtils.isEmpty(url)&& newOrderId == null){
return;
}
if (newsOrderId == null || newsOrderId.isEmpty()) {
if (newOrderId == null || newOrderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newsOrderId.isEmpty() ? "" : newsOrderId), null);
ImConstants.Companion.getORDER_DETAIL() + (newOrderId.isEmpty() ? "" : newOrderId), null);
NewH5Activity.start(context, orderParams);
}
}
......
......@@ -8,7 +8,6 @@ import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.google.gson.Gson;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService;
......@@ -21,7 +20,6 @@ import com.ydl.ydlcommon.data.http.RxUtils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.bean.OrderBean;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
......@@ -36,11 +34,9 @@ import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
* 已完成订单
* 已完成订单 消息类型39
*/
public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
......@@ -50,12 +46,12 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
/***跳转url*/
public String url;
/***新订单id*/
public String newsOrderId;
/***订单id*/
public String orderId;
/***0 未确认 1已确认*/
public int flag;
public boolean isSureed = false;//是否已确认
public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
......@@ -100,7 +96,6 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
tv_date.setText(customAttachment.consultDuration == null ? "" : customAttachment.consultDuration);
tv_type.setText(customAttachment.serviceType == null ? "" : customAttachment.serviceType);
url = customAttachment.url;
newsOrderId = customAttachment.newsOrderId;
orderId = customAttachment.orderId;
flag = customAttachment.status;
......@@ -125,11 +120,7 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
//确认接口
ToastUtil.toastShort(context, "发送中...");
String str = new Gson().toJson(new OrderBean(orderId));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str);
Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().affirmComplete(body)
Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().affirmComplete(orderId)
.compose(RxUtils.INSTANCE.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......@@ -142,20 +133,51 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
});
}
try {
Map<String,Object> map = message.getLocalExtension();
if (map!=null){
Object obj = map.get("isSure");
Object exp = map.get("isExpired");
if (obj!=null){
boolean b = (boolean) obj;
if (flag == 1 || b){
updateSureView("已确认");
}
}else if (exp!=null){
boolean expb = (boolean) exp;
if (expb){
updateSureView("已确认");
}
}else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12));
}
}else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context,R.drawable.bg_radius_green_linear_12));
}
}catch (Exception e){}
hideItemBg();
}
@Override
protected void onItemClick() {
if (TextUtils.isEmpty(url) && newsOrderId == null) {
if (TextUtils.isEmpty(url) && orderId == null) {
return;
}
if (newsOrderId == null || newsOrderId.isEmpty()) {
if (orderId == null || orderId.isEmpty()) {
NewH5Activity.start(context, new H5Params(url, null));
} else {
//跳转新订单详情页
H5Params orderParams = new H5Params(
ImConstants.Companion.getORDER_DETAIL() + (newsOrderId.isEmpty() ? "" : newsOrderId), null);
ImConstants.Companion.getORDER_DETAIL() + (orderId.isEmpty() ? "" : orderId), null);
NewH5Activity.start(context, orderParams);
}
}
......
......@@ -78,16 +78,18 @@
<TextView
android:id="@+id/tv_submit"
android:layout_width="60dp"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_below="@+id/rl_center"
android:layout_alignRight="@id/rl_center"
android:layout_marginTop="12dp"
android:background="@drawable/bg_radius_green_linear_12"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="确认"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="13dp" />
android:textSize="13dp"
android:visibility="gone" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/lin_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/im_bg_radius_no_topleft_white_8"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:paddingBottom="12dp"
android:background="@drawable/im_bg_radius_no_topleft_white_8">
android:paddingRight="12dp"
android:paddingBottom="12dp">
<ImageView
android:id="@+id/img_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginRight="4dp"
android:layout_alignTop="@+id/tv_title"
android:layout_alignBottom="@+id/tv_title"
android:layout_marginRight="4dp"
android:src="@mipmap/im_consult_data_sure"
android:visibility="gone"
tools:visibility="gone"/>
tools:visibility="gone" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dp"
android:textColor="@color/im_color_242424"
android:layout_toRightOf="@+id/img_icon"
tools:text="我已完成本次咨询,请确认"/>
android:textColor="@color/im_color_242424"
android:textSize="14dp"
tools:text="我已完成本次咨询,请确认" />
<RelativeLayout
android:id="@+id/rl_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_below="@+id/tv_title"
android:layout_marginTop="8dp"
android:background="@drawable/im_bg_radius_f7_2">
android:background="@drawable/im_bg_radius_f7_2"
android:paddingLeft="12dp"
android:paddingTop="8dp"
android:paddingRight="12dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/tv_package"
android:layout_width="24dp"
android:layout_height="14dp"
android:text="套餐"
android:layout_marginTop="3dp"
android:textSize="10dp"
android:textColor="@color/platform_color_FFFFFF"
android:gravity="center"
android:layout_marginRight="3dp"
android:visibility="gone"
android:background="@drawable/im_bg_radius_yellow_1" />
android:background="@drawable/im_bg_radius_yellow_1"
android:gravity="center"
android:text="套餐"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="10dp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_package"
android:layout_marginTop="2dp"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_package"
tools:text="咨询时间:2019-12-55 12:00:00"/>
tools:text="咨询时间:2019-12-55 12:00:00" />
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_date"
android:layout_marginTop="2dp"
android:textColor="@color/platform_color_999999"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_below="@+id/tv_date"
tools:text="服务方式:电话"/>
tools:text="服务方式:电话" />
</RelativeLayout>
<TextView
android:id="@+id/tv_submit"
android:layout_width="60dp"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_below="@+id/rl_center"
android:layout_alignRight="@id/rl_center"
android:layout_marginTop="12dp"
android:background="@drawable/bg_radius_green_linear_12"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="确认"
android:visibility="gone"
android:textColor="@color/white"
android:textSize="13dp" />
android:textSize="13dp"
android:visibility="gone" />
</RelativeLayout>
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