Commit f4080b07 by 严久程

导医的入口和跳转

parent 92efbc41
......@@ -6,17 +6,17 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.74",
"m-consultant" : "0.0.59.23",
"m-consultant" : "0.0.59.27",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.21",
"m-home" : "0.0.22.20",
"m-im" : "0.0.18.14",
"m-dynamic" : "0.0.7.70",
"m-im" : "0.0.18.15",
"m-dynamic" : "0.0.7.9",
"m-article" : "0.0.0.6",
"m-muse" : "0.0.28.20",
"m-tests" : "0.0.24.10",
"m-course" : "0.0.42.6",
"m-course" : "0.0.42.8",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......@@ -40,7 +40,7 @@ ext {
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.29.7",
"ydl-flutter-base": "0.0.14.16",
"ydl-flutter-base": "0.0.14.18",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -102,7 +102,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1",
"m-consultant-api": "0.0.5.2",
"m-consultant-api": "0.0.5.3",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......@@ -121,7 +121,7 @@ ext {
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.29.7",
"ydl-flutter-base": "0.0.14.14",
"ydl-flutter-base": "0.0.14.18",
//以下 几乎不会动
"router" : "0.0.1",
......
......@@ -17,6 +17,7 @@ import com.google.gson.reflect.TypeToken
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
......@@ -29,7 +30,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.HotSearchFocusItemBean
......@@ -117,15 +117,14 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
if (data?.size ?: 0 > 0) {
val imageUrl= data?.get(0)?.pic
iv_daoyi_image.visibility=View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext,imageUrl, iv_daoyi_image, sp)
GlideApp.with(mContext)
.load(imageUrl)
.into(iv_daoyi_image)
iv_daoyi_image.setOnClickListener {
LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}")
ConsultAssistantEntryUtils.jumpConsultAssistant(this,data?.get(0)!!.location.toInt())
}
}
......
......@@ -65,7 +65,7 @@ interface SearchApi {
//获取咨询助理uid
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(location: Int): Observable<BaseAPIResponse<Long>>
fun getConsultAssistantUidRequest(@Query("location")location: Int): Observable<BaseAPIResponse<Long>>
//获取咨询助理uid
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
......@@ -7,7 +7,6 @@ import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.HotSearchActivity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
......@@ -16,26 +15,38 @@ import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
class ConsultAssistantEntryUtils {
companion object{
companion object {
@SuppressLint("CheckResult")
fun jumpConsultAssistant(activity: Activity, location:Int){
ActionCountUtils.count(ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,"$location")
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe( Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, object: ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
fun jumpConsultAssistant(activity: Activity, location: Int) {
ActionCountUtils.count(
ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,
"$location"
)
if (!ConsultantIn.isLogin()) {
ConsultantIn.toLogin(activity)
} else {
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(
activity as AppCompatActivity,
it.data.toString()
)
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}
}
}
)
)
}
}
}
}
\ No newline at end of file
......@@ -81,6 +81,8 @@ dependencies {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
// compileOnlyrootProject.ext.dependencies['com.ydl:m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
......
......@@ -253,10 +253,11 @@ class CourseItemNewView : ConstraintLayout {
fun setGuideData(bean: GuideBean) {
view_bottom_line.visibility = View.INVISIBLE
iv_guide_image.visibility = View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext, bean.pic, iv_guide_image, sp)
GlideApp.with(mContext)
.load(bean.pic)
.into(iv_guide_image)
iv_guide_image.setOnClickListener {
provide(IConsultantService::class.java).jumpConsultAssistant(mContext as Activity, bean.location.toInt())
}
......
......@@ -235,13 +235,15 @@
android:background="@color/course_color_EBEBEB"
app:layout_constraintTop_toBottomOf="@+id/iv_head"/>
<ImageView
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:id="@+id/iv_guide_image"
android:layout_width="match_parent"
android:layout_height="90dp"
android:visibility="gone"
android:layout_marginTop="20dp"
tools:visibility="visible"
app:pa_borderRadius="8dp"
app:pa_type="pa_round"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_head"
/>
......
......@@ -34,6 +34,7 @@ import com.yidianling.im.session.action.OrderAction;
import com.yidianling.im.session.action.RedPacketAction;
import com.yidianling.im.session.action.SendCardAction;
import com.yidianling.im.session.action.TeamAVChatAction;
import com.yidianling.im.session.extension.CustomAttachAssistantReceivedMoney;
import com.yidianling.im.session.extension.CustomAttachChatTipMsg;
import com.yidianling.im.session.extension.CustomAttachConsult;
import com.yidianling.im.session.extension.CustomAttachConsultCallStatus;
......@@ -63,6 +64,7 @@ import com.yidianling.im.session.extension.CustomSystemTips;
import com.yidianling.im.session.extension.DefaultCustomAttachment;
import com.yidianling.im.session.extension.StickerAttachment;
import com.yidianling.im.session.viewholder.MsgViewHolderAVChat;
import com.yidianling.im.session.viewholder.MsgViewHolderAssistantReceivedMoney;
import com.yidianling.im.session.viewholder.MsgViewHolderChatTip;
import com.yidianling.im.session.viewholder.MsgViewHolderConsult;
import com.yidianling.im.session.viewholder.MsgViewHolderConsultCallStatus;
......@@ -415,6 +417,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态
NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class);
}
private static void setSessionListener() {
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 收款消息拓展
* Created by harvie on 2017/1/10.
*/
public class CustomAttachAssistantReceivedMoney extends CustomAttachment {
private static final String KEY_TITLE = "title";
private static final String KEY_NUM = "num";
private static final String KEY_ORPAY = "orPay";
private static final String KEY_URL = "url";
private String num = "";//订单金额
private String title = "";//订单标题题
private int orPay;//支付状态 0未支付1已支付
private String url = "";//订单id
public CustomAttachAssistantReceivedMoney() {
super(CustomAttachmentType.ASSISTANT_RECEIVEDMONEY);
}
public CustomAttachAssistantReceivedMoney(String num, String title, int orPay, String url) {
super(CustomAttachmentType.ASSISTANT_RECEIVEDMONEY);
this.num = num;
this.title = title;
this.orPay = orPay;
this.url = url;
}
@Override
protected void parseData(JSONObject data) {
this.url = data.getString(KEY_URL);
this.title = data.getString(KEY_TITLE);
this.num = data.getString(KEY_NUM);
this.orPay = data.getInteger(KEY_ORPAY);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_URL, url);
data.put(KEY_TITLE, title);
data.put(KEY_NUM, num);
data.put(KEY_ORPAY, orPay);
return data;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public int getOrPay() {
return orPay;
}
public String getTitle() {
return title;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public void setTitle(String title) {
this.title = title;
}
public void setOrPay(int orPay) {
this.orPay = orPay;
}
}
......@@ -115,6 +115,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
//咨询的声网拨打状态的自定义消息
attachment = new CustomAttachConsultCallStatus();
break;
case CustomAttachmentType.ASSISTANT_RECEIVEDMONEY:
attachment = new CustomAttachAssistantReceivedMoney();
break;
default:
attachment = new DefaultCustomAttachment();
break;
......
......@@ -34,4 +34,5 @@ public interface CustomAttachmentType {
int TYPE_PUSH_SHARE = 30;// 分享,倾诉推荐,课程,测评,文章
int TYPE_CUSTOMER_SERVICE = 31; //客服名片
int TYPE_CUSTOMER_CONSULT_CALL_STATUS = 32; //咨询的声网拨打状态的自定义消息
int ASSISTANT_RECEIVEDMONEY = 33;//发起收款
}
package com.yidianling.im.session.viewholder;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachAssistantReceivedMoney;
import com.yidianling.im.session.extension.CustomAttachReceivedMoney;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
/**
* 收款消息拓展
* Created by wi1ls on 2017/1/10.
*/
public class MsgViewHolderAssistantReceivedMoney extends MsgViewHolderBase {
private String num;//订单金额
private String title;//订单标题题
private int orPay;//支付状态 0未支付1已支付
private String url;//订单url
private View message_received;
private TextView tit,content;
private ImageView img;
public MsgViewHolderAssistantReceivedMoney(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_ui_message_received_money;
}
@Override
protected void inflateContentView() {
message_received=findViewById(R.id.message_received);
tit = findViewById(R.id.packet_title);
content = findViewById(R.id.text_content);
img = findViewById(R.id.packte_im);
}
@Override
protected void bindContentView() {
CustomAttachAssistantReceivedMoney customAttachReceivedMoney= (CustomAttachAssistantReceivedMoney) message.getAttachment();
url=customAttachReceivedMoney.getUrl();
num = customAttachReceivedMoney.getNum();
title = customAttachReceivedMoney.getTitle();
orPay = customAttachReceivedMoney.getOrPay();
num = customAttachReceivedMoney.getNum();
if (title!=null)tit.setText(title);
if (orPay == 1) {
//支付成功
if (num!=null)content.setText("您支付了"+num+"元");
img.setImageDrawable(view.getResources().getDrawable(R.mipmap.im_zhifu));
}else{
if (num!=null)content.setText("您需要支付"+num+"元");
img.setImageDrawable(view.getResources().getDrawable(R.mipmap.im_weifu));
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (isReceivedMessage()) {
NewH5Activity.start(view.getContext(), new H5Params(url, null));
}
}
}
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