Commit 1b5ec1db by 霍志良

Merge remote-tracking branch 'origin/new_dev_4.3.91' into 心事动态发布优化

parents edfb598e a5d2d185
......@@ -9,9 +9,9 @@ ext {
"m-consultant" : "0.0.60.21",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04",
"m-home" : "0.0.23.37",
"m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.36",
"m-home" : "0.0.23.44",
"m-im" : "0.0.21.33",
"m-dynamic" : "0.0.7.37",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.28",
......@@ -28,7 +28,7 @@ ext {
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
......@@ -95,9 +95,9 @@ ext {
"m-consultant" : "0.0.60.21",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04",
"m-home" : "0.0.23.37",
"m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.36",
"m-home" : "0.0.23.41",
"m-im" : "0.0.21.33",
"m-dynamic" : "0.0.7.37",
"m-article" : "0.0.0.8",
"m-muse" : "0.0.28.28",
......@@ -113,7 +113,7 @@ ext {
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
//mdt组件
......
......@@ -657,6 +657,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@Override
public void showFousChangeView() {
tvGuanzhu.setText("已关注");
tvGuanzhu.setEnabled(false);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
......@@ -1464,6 +1465,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
tvGuanzhu.setVisibility(GONE);
tvGuanzhu.setText("已关注");
}else{
tvGuanzhu.setEnabled(true);
tvGuanzhu.setVisibility(VISIBLE);
tvGuanzhu.setText("关注");
}
......
......@@ -59,10 +59,10 @@
"url": "https://h2.yidianling.com/experts/search?cat=1&"
},
{
"cateId": 699,
"cateTitle": "精神咨询",
"cateId": 0,
"cateTitle": "法律咨询",
"coverUrl": "https://img.ydlcdn.com/file/2020/02/21/8sgcaowkgbd9d7j0.jpg",
"url": "https://h2.yidianling.com/experts/search?cat=699&"
"url": "https://h2.yidianling.com/experts/cates"
},
{
"cateId": 0,
......@@ -160,19 +160,6 @@
"title": "性格心理学:透析对方性格,解决相处问题"
},
{
"focId": 21309,
"imageIphonex": "https://img.ydlcdn.com/file/2020/03/04/72dmpjkbohis3qe0.png",
"imageUrl": "https://img.ydlcdn.com/file/2020/03/04/577tdchz4ti0ts9z.png",
"linkUrl": "ydl-user://h5/h5?params=%7B%22url%22%3A%22https%3A%2F%2Fm.ydl.com%2Fzx%2Factivity%2Fpsychiatry%22%7D",
"shareData": {
"title": "精神科医生专题页",
"cover": "https://img.ydlcdn.com/file/2020/03/04/577tdchz4ti0ts9z.png",
"desc": "",
"shareUrl": ""
},
"title": "精神科医生专题页"
},
{
"focId": 19412,
"imageIphonex": "https://img.ydlcdn.com/file/2019/12/24/k7o29a2rig40e9s6.jpg",
"imageUrl": "https://img.ydlcdn.com/file/2019/12/24/s55wai4yrero8bv4.jpg",
......
......@@ -203,7 +203,6 @@ class YdlHomeAdapter(private val mContext: Context,
}
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
// listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
list[1].headerBean?.listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
}
//咨询模块
......
......@@ -106,22 +106,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
override fun initDataAndEvent() {
// val homeViewOrder = HomeViewConfig.HomeViewOrder()
//
// homeViewOrder.bannerIndex = -1
// homeViewOrder.testsIndex = 1
// homeViewOrder.consultIndex = 2
// homeViewOrder.footerIndex = 3
//
// homeViewOrder.fmIndex = null
// homeViewOrder.articleIndex = null
// homeViewOrder.dynamicIndex = null
// homeViewOrder.museIndex = null
// homeViewOrder.confideIndex = null
// homeViewOrder.courseIndex = null
// homeViewOrder.buttonIndex = null
//
// HomeViewConfig.setOrder(homeViewOrder)
mActivity = requireActivity()
mContext = requireContext()
initHomeEvent()
......@@ -532,6 +516,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
isFromCreate = false
mPresenter?.loadHomeData()
} else {
mPresenter?.loadHomeData()
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
}
......
......@@ -43,6 +43,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
setVisibilityFree(listenFree)
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
......
......@@ -153,6 +153,23 @@ object IMChatUtil {
}
/**
* 直接和对方聊天,不判断是否有代运营
* @param context
* @param chatItemBean
*/
@SuppressLint("CheckResult")
fun startChatBySessionId(context: AppCompatActivity?, sessionId: String) {
context?.let {
prepareChatData(it, sessionId, object :
ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) {
startChatSession(sessionId, expertInfo, 0, context)
}
})
}
}
/**
* 非私聊列表进入,前置数据请求
* */
@SuppressLint("CheckResult")
......@@ -184,9 +201,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
}
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString())
) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
......@@ -259,12 +274,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper.setStatusCache(
"chatEvent",
res.data!!.chatEvent
)
}
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString())) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
getImJavaApi().getChatUid(toUid)
......@@ -374,9 +384,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
}
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
if (TextUtils.equals(res.data!!.userType, "2")) {
//接口返回值是专家,java接口
prepareExpertChatData(context, toUid, listener)
......
......@@ -70,6 +70,9 @@ class IMServiceImpl : IImService {
override fun startP2PSession(context: Activity, location: Int, ffrom2: String?) {
IMChatUtil.startCms(context,location,ffrom2)
}
override fun startChatBySessionId(context: Activity, toUid: String) {
IMChatUtil.startChatBySessionId(context as AppCompatActivity,toUid)
}
override fun startP2PXiaoYi(context: Context) {
if (!ImIn.loginByOneKeyLogin(context,true)) {
......
......@@ -321,10 +321,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rela_zixun.setVisibility(View.GONE);
titleBar.setTitleRightDraw(null);
}
}
// 判断最近一次发送消息的时间是否大于24小时
long time = System.currentTimeMillis()-SPUtils.getInstance().getLong(ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUid(),0L);
if (time==0L||time>24*60*60*1000){ //如果等于0或者大于则请求首问语接口
@SuppressLint("CheckResult")
private void initView() {
if (ChatStatusCacheHelper.getStatusCache("chatEvent")&&SessionTypeEnum.Team!=sessionType) {
// 获取首问语数据
ServiceImpl.Companion.getInstance().getFirstQuestion()
.subscribeOn(Schedulers.io())
......@@ -339,34 +340,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
ToastUtil.toastShort(throwable.getMessage());
});
}
}
@SuppressLint("CheckResult")
private void initView() {
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
//助理
/*rl_common_question_enter.setOnClickListener(v -> {
rl_common_question_enter.setOnClickListener(v -> {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
openOrCloseCommonQuestionLayout(true);
} else {
getCommonQuestionListData();
}
});*/
if (ChatStatusCacheHelper.getStatusCache("chatEvent")) {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
// rl_common_question_enter.postDelayed(() -> openOrCloseCommonQuestionLayout(true), 300);
} else {
try {
YdlBuryPointUtil.sendPv("common_question_pager");
} catch (Exception e) {
e.printStackTrace();
}
getCommonQuestionListData();
}
ChatStatusCacheHelper.clearDataByKey("chatEvent");
}
}
//有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
......@@ -1517,26 +1490,26 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
@SuppressLint("CheckResult")
private void getCommonQuestionListData() {
ServiceImpl.Companion.getInstance().getCommonQuestionList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (res.data != null && res.data.size() > 0) {
if (commonQuestionBeanList == null) {
commonQuestionBeanList = new ArrayList<>();
} else {
commonQuestionBeanList.clear();
}
commonQuestionBeanList.addAll(res.data);
// @SuppressLint("CheckResult")
// private void getCommonQuestionListData() {
// ServiceImpl.Companion.getInstance().getCommonQuestionList()
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(res -> {
// if (res.data != null && res.data.size() > 0) {
// if (commonQuestionBeanList == null) {
// commonQuestionBeanList = new ArrayList<>();
// } else {
// commonQuestionBeanList.clear();
// }
// commonQuestionBeanList.addAll(res.data);
// initCommonQuestionLayout();
}
}, throwable -> {
ToastUtil.toastShort(throwable.toString());
});
}
// }
//
// }, throwable -> {
// ToastUtil.toastShort(throwable.toString());
// });
// }
/*
* 用户是否在当前页面
*
......
......@@ -68,6 +68,7 @@ import com.yidianling.nimbase.common.util.string.StringUtil;
import com.yidianling.uikit.api.NimUIKit;
import com.yidianling.uikit.api.NimUIKitImpl;
import com.yidianling.uikit.business.ait.AitTextChangeListener;
import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper;
import com.yidianling.uikit.custom.widget.SafeHelpRemindDialog;
import com.yidianling.user.api.service.IUserService;
......@@ -313,8 +314,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
String content = firstQuestionAdapter.getData().get(position).getContent();
// 埋点
ActionCountUtils.Companion.baiDuCountSign3("counselor_consult_page","quick_language_click",content,"","");
// 根据uid记录每次发消息的时间戳
SPUtils.getInstance().put(uid,System.currentTimeMillis());
onTextMessageSendButtonPressed(content);
clFirstQuestion.setVisibility(View.GONE);
});
......@@ -553,9 +552,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
* 替换之后最终发送的字符串
*/
private void onTextMessageSendButtonClick() {
// 根据uid记录每次发消息的时间戳
SPUtils.getInstance().put(uid,System.currentTimeMillis());
IMMessage textMessage = createTextMessage(sendText);
if (container.proxy.sendMessage(textMessage)) {
restoreText(true);
......
......@@ -21,6 +21,8 @@ interface IImService : IProvider {
// 打开私聊界面
fun startP2PSession(context: Activity, toUid: String)
// 直接打开聊天页面,不走分配导医
fun startChatBySessionId(context: Activity, toUid: String)
// 打开信息前置收集页
fun startP2PSession(context: Activity, location: Int, ffrom2: String?)
......
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