Commit 10959779 by YKai

fix:消息查看订单标题栏显示问题修复

parent 7fb1dfd9
package com.yidianling.im.session.action;
import android.text.TextUtils;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.base.lifecycle.ILifecycleable;
import com.ydl.ydlcommon.data.http.BaseResponse;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.im.R;
import com.yidianling.im.http.ImHttpImpl;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.http.param.ExpertParam;
import com.yidianling.nimbase.business.session.actions.BaseAction;
import com.yidianling.im.api.bean.IMExpertBuild;
import org.jetbrains.annotations.NotNull;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* author : Zhangwenchao
......@@ -37,47 +21,7 @@ public class OrderAction extends BaseAction {
@Override
public void onClick() {
ILifecycleable lifecycleable = null;
if (getActivity() instanceof ILifecycleable) {
lifecycleable = (ILifecycleable)(getActivity());
}
//先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
Disposable dis = ImRetrofitApi.Companion.getImJavaApi().getUserType(getAccount())
.compose(RxUtils.applySchedulers(lifecycleable))
.subscribe(res -> {
if (res.code == 200) {
Observable<BaseResponse<IMExpertBuild>> observable;
if (TextUtils.equals(res.data.getUserType(), "2")) {//专家
observable = ImRetrofitApi.Companion.getImJavaApi().getPersonalChat(getAccount());
} else {
observable = ImHttpImpl.Companion.getInstance().getExpert(new ExpertParam(Integer.valueOf(getAccount()), 0));
}
Disposable disposable = observable
.compose(RxUtils.applySchedulers())
.subscribe(resp -> {
if (resp != null && resp.data != null && resp.data.shareData != null && !TextUtils.isEmpty(resp.data.shareData.order_url)) {
// NewH5Activity.start(getActivity(), new H5Params(resp.data.shareData.order_url + "?search=" + resp.data.shareData.doctorName, "订单"));
H5Params h5Params3 = new H5Params(HttpConfig.Companion.getMH5_URL() + "wb/user/order/list?needOrderHelperAlert=1", "订单");
NewH5Activity.start(getActivity(), h5Params3);
} else {
if (resp != null) {
ToastHelper.Companion.show(resp.msg);
}
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
ToastHelper.Companion.show(msg);
}
});
} else {
ToastHelper.Companion.show(res.msg);
}
}, throwable -> {
ToastHelper.Companion.show(throwable.getMessage());
});
H5Params h5Params3 = new H5Params(HttpConfig.Companion.getMH5_URL() + "wb/user/order/list?needOrderHelperAlert=1", null);
NewH5Activity.start(getActivity(), h5Params3);
}
}
......@@ -34,22 +34,18 @@
android:id="@+id/rl_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title"
android:layout_marginTop="8dp"
android:background="@drawable/im_bg_radius_f7_2"
android:paddingLeft="12dp"
android:paddingTop="8dp"
android:paddingRight="12dp"
android:paddingBottom="8dp">
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_below="@+id/tv_title"
android:layout_marginTop="8dp"
android:background="@drawable/im_bg_radius_f7_2">
<TextView
android:id="@+id/tv_package"
android:layout_width="24dp"
android:layout_height="14dp"
android:layout_marginTop="3dp"
android:layout_marginRight="3dp"
android:background="@drawable/im_bg_radius_yellow_1"
android:gravity="center"
android:text="套餐"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="10dp"
......
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