Commit a4a76a66 by 刘鹏

Merge branch 'feat/lp/lp_confide_4' into 'd/v_confide_2.0'

私聊收款跳转倾诉列表问题

See merge request app_android_lib/YDL-Component!83
parents cdd11a9a 2a2d953c
...@@ -5,12 +5,12 @@ ext { ...@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.94", "m-confide" : "0.0.49.95",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
"m-home" : "0.0.23.74", "m-home" : "0.0.23.74",
"m-im" : "0.0.21.46", "m-im" : "0.0.21.47",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -35,7 +35,7 @@ ext { ...@@ -35,7 +35,7 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.18", "ydl-platform" : "0.0.41.21",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.80", "ydl-webview" : "0.0.38.80",
...@@ -90,12 +90,12 @@ ext { ...@@ -90,12 +90,12 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.94", "m-confide" : "0.0.49.95",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
"m-home" : "0.0.23.74", "m-home" : "0.0.23.74",
"m-im" : "0.0.21.46", "m-im" : "0.0.21.47",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -118,7 +118,7 @@ ext { ...@@ -118,7 +118,7 @@ ext {
//mdt组件 //mdt组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.18", "ydl-platform" : "0.0.41.21",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.80", "ydl-webview" : "0.0.38.80",
......
package com.ydl.confide.home package com.ydl.confide.home
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.os.Build import android.os.Build
...@@ -25,9 +26,11 @@ import com.ydl.confide.home.event.ConfideHomeEventImpl ...@@ -25,9 +26,11 @@ import com.ydl.confide.home.event.ConfideHomeEventImpl
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.modular.service.ConfideWebServiceImpl
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.confide.home.widget.FilterItemDecoration import com.ydl.confide.home.widget.FilterItemDecoration
import com.ydl.confide.intro.VideoViewModel
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
...@@ -182,6 +185,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -182,6 +185,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override fun initDataAndEvent() { override fun initDataAndEvent() {
//来自首页倾诉红包入口 //来自首页倾诉红包入口
val isFromRed = intent.getBooleanExtra(IYDLRouterConstant.EXTRA_RED_PACKET,false) val isFromRed = intent.getBooleanExtra(IYDLRouterConstant.EXTRA_RED_PACKET,false)
val confidedId = intent.getStringExtra(IYDLRouterConstant.EXTRA_CONFIDEDID)
val doctorId = intent.getStringExtra(IYDLRouterConstant.EXTRA_DOCTORID)
isSplash = intent.getBooleanExtra("isSplash", false) isSplash = intent.getBooleanExtra("isSplash", false)
//初始化View //初始化View
...@@ -206,6 +211,18 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -206,6 +211,18 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
if (isFromRed){ if (isFromRed){
ToastUtil.toastLong(this@ConfideHomeActivity,"红包已领取成功 可立即点击拨打") ToastUtil.toastLong(this@ConfideHomeActivity,"红包已领取成功 可立即点击拨打")
} }
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()){
ConfideWebServiceImpl().connectionJava(confidedId.toInt(), 3, this@ConfideHomeActivity, null) {
showDoctorDetail(confidedId,doctorId)
}
}
}
private fun showDoctorDetail(confideId: String,doctorId:String) {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId)
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(this@ConfideHomeActivity, url, doctorId)
} }
override fun onResume() { override fun onResume() {
......
...@@ -21,27 +21,29 @@ public class CustomAttachmentShareMsg extends CustomAttachment { ...@@ -21,27 +21,29 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
private final String KEY_SHAREPOPULAR="sharePopular";// 分享的人气 private final String KEY_SHAREPOPULAR="sharePopular";// 分享的人气
private final String KEY_SHARE_JUMP_URL="url";// 分享的跳转链接 private final String KEY_SHARE_JUMP_URL="url";// 分享的跳转链接
private final String KEY_CONFIDEDID="confidedId";//倾诉id
private final String KEY_DOCTORID="doctorId";
private String shareUrl; private String shareUrl;
private String sharePrice; private String sharePrice;
//分享类型,0:测试;1,课程;2,文章;3:倾诉 //分享类型,0:测试;1,课程;2,文章;3:倾诉
private int shareType; private int shareType;
private String confidedId;
private String doctorId;
public CustomAttachmentShareMsg() { public CustomAttachmentShareMsg() {
super(CustomAttachmentType.TYPE_PUSH_SHARE); super(CustomAttachmentType.TYPE_PUSH_SHARE);
} }
public CustomAttachmentShareMsg(String url, String money, ShareMsgTypeEnum typeEnum) {
super(CustomAttachmentType.TYPE_PUSH_SHARE);
this.shareUrl = url;
this.sharePrice = money;
this.shareType = typeEnum.value();
}
@Override @Override
protected void parseData(JSONObject data) { protected void parseData(JSONObject data) {
this.shareUrl=data.getString(KEY_SHARE_JUMP_URL); this.shareUrl=data.getString(KEY_SHARE_JUMP_URL);
this.sharePrice =data.getString(KEY_PRICE); this.sharePrice =data.getString(KEY_PRICE);
this.shareType = data.getInteger(KEY_SHARETYPE); this.shareType = data.getInteger(KEY_SHARETYPE);
this.confidedId = data.getString(KEY_CONFIDEDID);
this.doctorId = data.getString(KEY_DOCTORID);
} }
@Override @Override
...@@ -50,6 +52,8 @@ public class CustomAttachmentShareMsg extends CustomAttachment { ...@@ -50,6 +52,8 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
data.put(KEY_SHARE_JUMP_URL, shareUrl); data.put(KEY_SHARE_JUMP_URL, shareUrl);
data.put(KEY_PRICE, sharePrice); data.put(KEY_PRICE, sharePrice);
data.put(KEY_SHARETYPE, shareType); data.put(KEY_SHARETYPE, shareType);
data.put(KEY_CONFIDEDID, confidedId);
data.put(KEY_DOCTORID, doctorId);
return data; return data;
} }
...@@ -64,4 +68,11 @@ public class CustomAttachmentShareMsg extends CustomAttachment { ...@@ -64,4 +68,11 @@ public class CustomAttachmentShareMsg extends CustomAttachment {
public int getShareType() { public int getShareType() {
return shareType; return shareType;
} }
public String getConfidedId() {
return confidedId;
}
public String getDoctorId() {
return doctorId;
}
} }
...@@ -59,7 +59,9 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase { ...@@ -59,7 +59,9 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
num = customAttachReceivedMoney.getNum(); num = customAttachReceivedMoney.getNum();
isNewOrder = customAttachReceivedMoney.getNewOrder(); isNewOrder = customAttachReceivedMoney.getNewOrder();
if (title != null) tit.setText(title); if (title != null) {
tit.setText(title);
}
if (orPay == 1) { if (orPay == 1) {
//支付成功 //支付成功
if (num != null) { if (num != null) {
......
package com.yidianling.im.session.viewholder;
import android.annotation.SuppressLint;
import android.widget.TextView;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.bean.PushConfideStatusBean;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.extension.CustomAttachmentShareMsg;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* Created by haorui on 2019-11-06 .
* Des: 分享 消息
* 分享的类型,0:测试;1,课程;2,文章;3:倾诉
*/
public class MsgViewHolderShareMsg extends MsgViewHolderBase {
private TextView tv_confide_money;
private TextView tv_confide;
public String mShareUrl;
public String mPrice;
private int mShareType;
private Disposable mSubscribe;
public MsgViewHolderShareMsg(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
MsgAttachment attachment = message.getAttachment();
if (attachment instanceof CustomAttachmentShareMsg) {
CustomAttachmentShareMsg customMsg = (CustomAttachmentShareMsg) attachment;
switch (customMsg.getShareType()) {
//0:测试;
case 0:
return R.layout.im_ui_message_custom_confide;
//1,课程;
case 1:
return R.layout.im_ui_message_custom_confide;
//2,文章;
case 2:
return R.layout.im_ui_message_custom_confide;
//3:倾诉
case 3:
return R.layout.im_ui_message_custom_confide;
}
}
return R.layout.im_ui_message_custom_confide;
}
@Override
protected void inflateContentView() {
tv_confide_money = view.findViewById(R.id.tv_confide_money);
tv_confide = view.findViewById(R.id.tv_confide);
}
@Override
protected void bindContentView() {
MsgAttachment attachment = message.getAttachment();
if (attachment instanceof CustomAttachmentShareMsg) {
mShareUrl = ((CustomAttachmentShareMsg) attachment).getShareUrl();
mPrice = ((CustomAttachmentShareMsg) attachment).getSharePrice();
mShareType = ((CustomAttachmentShareMsg) attachment).getShareType();
}
if (isReceivedMessage()) {
setAvatarRightInVisibity();
} else {
setAvatarLeftInVisibity();
}
switch (mShareType) {
//0:测试;
case 0:
break;
//1,课程;
case 1:
break;
//2,文章;
case 2:
break;
//3:倾诉
case 3:
tv_confide_money.setText(mPrice);
break;
}
}
@Override
protected void onItemClick() {
super.onItemClick();
if (Utils.isFastClick()) {
//防止连击
return;
}
requestConfideStatus();
}
@SuppressLint("CheckResult")
private void requestConfideStatus() {
if(mSubscribe != null && !mSubscribe.isDisposed()){
mSubscribe.dispose();
}
UserResponseBean userInfo = ImIn.INSTANCE.getUserResponse();
mSubscribe = ImRetrofitApi.Companion.getImJavaApi().getPushConfideStatus(userInfo.getUid(), message.getFromAccount()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(it -> {
if ("200".equals(it.code)) {
PushConfideStatusBean data = it.data;
if (data.getIsOpen() != 1) {
ToastUtil.toastShort(view.getContext().getString(R.string.im_push_confide_msg_unopened));
return;
}
if (data.getIsOnline() != 1) {
ToastUtil.toastShort(view.getContext().getString(R.string.im_push_confide_msg_offline));
return;
}
if (data.getIsReducible() != 1) {
ToastUtil.toastShort(view.getContext().getString(R.string.im_push_confide_msg_busy));
return;
}
if (data.getIsStatus() != 1) {
ToastUtil.toastShort(view.getContext().getString(R.string.im_push_confide_msg_calling));
return;
}
NewH5Activity.start(view.getContext(), new H5Params(mShareUrl, null));
}
}, t -> {
HttpErrorUtils.Companion.handleError(context, t);
});
}
}
package com.yidianling.im.session.viewholder
import android.annotation.SuppressLint
import android.widget.TextView
import com.ydl.confide.api.ConfideRoute.R_CONFIDE_HOME
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.modular.route
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils.Companion.handleError
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.bean.PushConfideStatusBean
import com.yidianling.im.http.ImRetrofitApi.Companion.getImJavaApi
import com.yidianling.im.router.ImIn.getUserResponse
import com.yidianling.im.session.extension.CustomAttachmentShareMsg
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
/**
* Created by haorui on 2019-11-06 .
* Des: 分享 消息
* 分享的类型,0:测试;1,课程;2,文章;3:倾诉
* 消息由咨询师端触发
*/
class MsgViewHolderShareMsg(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private var tv_confide_money: TextView? = null
private var tv_confide: TextView? = null
var mShareUrl: String? = null
var mPrice: String? = null
private var mShareType = 0
private var mSubscribe: Disposable? = null
private var mConfidedId: String? = null
private var mDoctorId: String? = null
//测试
val Type0 = 0
//课程
private val Type1 = 1
//文章
private val Type2 = 2
//倾诉
private val Type3 = 3
private val SUCCESS_CODE = "200"
override fun getContentResId(): Int {
val attachment = message.attachment
if (attachment is CustomAttachmentShareMsg) {
return when (attachment.shareType) {
Type0 -> R.layout.im_ui_message_custom_confide
Type1 -> R.layout.im_ui_message_custom_confide
Type2 -> R.layout.im_ui_message_custom_confide
Type3 -> R.layout.im_ui_message_custom_confide
else -> R.layout.im_ui_message_custom_confide
}
}
return R.layout.im_ui_message_custom_confide
}
override fun inflateContentView() {
tv_confide_money = view.findViewById(R.id.tv_confide_money)
tv_confide = view.findViewById(R.id.tv_confide)
}
override fun bindContentView() {
val attachment = message.attachment
if (attachment is CustomAttachmentShareMsg) {
mShareUrl = attachment.shareUrl
mPrice = attachment.sharePrice
mShareType = attachment.shareType
mConfidedId = attachment.confidedId
mDoctorId = attachment.doctorId
}
if (isReceivedMessage) {
setAvatarRightInVisibity()
} else {
setAvatarLeftInVisibity()
}
when (mShareType) {
Type0 -> {
}
Type1 -> {
}
Type2 -> {
}
Type3 -> tv_confide_money!!.text = mPrice
else -> {
}
}
}
override fun onItemClick() {
super.onItemClick()
if (Utils.isFastClick()) {
//防止连击
return
}
requestConfideStatus()
}
@SuppressLint("CheckResult")
private fun requestConfideStatus() {
if (mSubscribe != null && !mSubscribe!!.isDisposed) {
mSubscribe!!.dispose()
}
val userInfo = getUserResponse()
mSubscribe = getImJavaApi().getPushConfideStatus(userInfo!!.uid!!, message.fromAccount)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(
{ it: BaseAPIResponse<PushConfideStatusBean> ->
if (SUCCESS_CODE == it.code) {
val data = it.data
if (data.isOpen != 1) {
ToastUtil.toastShort(view.context.getString(R.string.im_push_confide_msg_unopened))
return@subscribe
}
if (data.isOnline != 1) {
ToastUtil.toastShort(view.context.getString(R.string.im_push_confide_msg_offline))
return@subscribe
}
if (data.isReducible != 1) {
ToastUtil.toastShort(view.context.getString(R.string.im_push_confide_msg_busy))
return@subscribe
}
if (data.isStatus != 1) {
ToastUtil.toastShort(view.context.getString(R.string.im_push_confide_msg_calling))
return@subscribe
}
if (mShareType == Type3 && mConfidedId != null && mDoctorId != null) {
//新版本走倾诉列表逻辑
route(view.context, R_CONFIDE_HOME,
IYDLRouterConstant.EXTRA_CONFIDEDID to mConfidedId,
IYDLRouterConstant.EXTRA_DOCTORID to mDoctorId)
} else {
//老版本去专家主页
NewH5Activity.start(view.context, H5Params(mShareUrl!!, null))
}
}
}) { t: Throwable? -> handleError(context, t!!) }
}
}
\ No newline at end of file
...@@ -78,6 +78,8 @@ interface IYDLRouterConstant{ ...@@ -78,6 +78,8 @@ interface IYDLRouterConstant{
const val EXTRA_SHOWTYPE = "showType" const val EXTRA_SHOWTYPE = "showType"
const val EXTRA_KEYWORD = "keyword" const val EXTRA_KEYWORD = "keyword"
const val EXTRA_RED_PACKET = "by_red_packet" const val EXTRA_RED_PACKET = "by_red_packet"
const val EXTRA_CONFIDEDID = "confidedId"
const val EXTRA_DOCTORID = "doctorId"
/** /**
* 冥想模块额外参数 * 冥想模块额外参数
......
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