Commit a3acb6d5 by fengquan

Merge remote-tracking branch 'origin/d/v4.3.98' into fix/fq/fq_v4.3.98

# Conflicts:
#	m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
parents 0a9b383a e932a552
......@@ -5,11 +5,11 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.27",
"m-confide" : "0.0.50.35",
"m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.54",
"m-home" : "0.0.23.90",
"m-home" : "0.0.23.93",
"m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
......@@ -92,11 +92,11 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.27",
"m-confide" : "0.0.50.35",
"m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.54",
"m-home" : "0.0.23.90",
"m-home" : "0.0.23.93",
"m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
......
......@@ -8,6 +8,11 @@ import android.os.Build
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.view.animation.AccelerateInterpolator
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import android.view.animation.TranslateAnimation
import android.widget.RelativeLayout
import android.widget.ImageView
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
......@@ -32,6 +37,7 @@ import com.ydl.confide.home.event.ConfideHomeEventImpl
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.listener.HideScrollListener
import com.ydl.confide.home.modular.service.ConfideWebServiceImpl
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils
......@@ -67,7 +73,7 @@ import kotlinx.android.synthetic.main.confide_title_bar.*
@Route(path = ConfideRoute.R_CONFIDE_HOME)
class ConfideHomeActivity :
BaseLceActivity<IConfideHomeContract.View, IConfideHomeContract.Presenter>(),
IConfideHomeContract.View, XRecyclerView.LoadingListener {
IConfideHomeContract.View, XRecyclerView.LoadingListener,HideScrollListener {
private var listenFree = false
......@@ -222,7 +228,6 @@ class ConfideHomeActivity :
// mPresenter.loadLocalData(this)
rv_list.refresh()
initClick()
initQuickConsultDialog()
initStatusBar()
// ModularServiceManager.provide(IConsultantService::class.java).showConfideListDialog(this)
// ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit","17")
......@@ -296,41 +301,6 @@ class ConfideHomeActivity :
}
/**
* 监听控制一键倾诉浮层的显示与隐藏
*/
private fun initQuickConsultDialog() {
rv_list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
quick_consult_card.visibility = View.VISIBLE
}
// val layoutManager: RecyclerView.LayoutManager = recyclerView?.layoutManager!!
// val linearManager = layoutManager as LinearLayoutManager
// if (linearManager is LinearLayoutManager) {
// val firstItemPosition = linearManager.findFirstCompletelyVisibleItemPosition()
// if (firstItemPosition > 3) {
// quick_consult_card.visibility = View.VISIBLE
// }else {
// quick_consult_card.visibility = View.GONE
// }
// }
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy <= 0) {
//向上滚动恢复显示
quick_consult_card.visibility = View.VISIBLE
} else {
//向下滚动隐藏
quick_consult_card.visibility = View.GONE
}
}
})
}
/**
* 初始化一键倾诉浮层的点击事件
*/
private fun initClick() {
......@@ -381,7 +351,7 @@ class ConfideHomeActivity :
}
//用于滑动筛选模块置顶
if (null == listScrollListener) {
listScrollListener = ConfideHomeRecycleViewListener()
listScrollListener = ConfideHomeRecycleViewListener(this)
}
rv_list.addOnScrollListener(listScrollListener!!)
//用于显示筛选悬浮按钮
......@@ -666,6 +636,21 @@ class ConfideHomeActivity :
super.onBackPressed()
}
override fun onHide() {
val lp = quick_consult_card.layoutParams as RelativeLayout.LayoutParams
quick_consult_card.animate().translationY(
(quick_consult_card.height + lp.bottomMargin).toFloat()
).setDuration(1000)
.interpolator = AccelerateInterpolator(3f)
}
override fun onShow() {
quick_consult_card.animate().translationY(0F).setDuration(1000)
.interpolator = DecelerateInterpolator(3f)
}
fun searchLinkUrlByUid(uid : String):String{
cacheList?.forEach {confideHomeDataBean ->
confideHomeDataBean.body?.forEach { confideHomeBodyBean ->
......
......@@ -13,7 +13,7 @@ import com.yidianling.common.tools.RxImageTool
* @Company 壹点灵
* @date 2018/9/25
*/
class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
class ConfideHomeRecycleViewListener() : RecyclerView.OnScrollListener() {
/**
* 筛选模块位置
*/
......@@ -23,6 +23,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
*/
private var move = false
private lateinit var listener: HideScrollListener
private var visible = true
constructor(listener: HideScrollListener):this(){
this.listener = listener
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
//在这里进行第二次滚动(最后的距离)
......@@ -37,6 +46,15 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
recyclerView.scrollBy(0, top)
}
}
if (dy > 0 && visible) {
visible = false
listener.onHide()
} else if (dy < 0 && !visible) {
visible = true
listener.onShow()
}
}
/**
......@@ -82,4 +100,6 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
// move = true
// }
}
}
\ No newline at end of file
package com.ydl.confide.home.listener
interface HideScrollListener {
fun onHide()
fun onShow()
}
\ No newline at end of file
......@@ -33,8 +33,7 @@
android:elevation="2dp"
android:paddingBottom="1dp"
android:paddingRight="@dimen/platform_dp_8"
android:visibility="gone"
tools:visibility="visible">
android:visibility="visible">
<ImageView
android:id="@+id/confide_logo"
......
......@@ -38,6 +38,7 @@ class HomeConfideBean : HomeItemBaseBean {
var confideLine: Int = 0
var confideAddress: String? = null
var confidePraise: String? = null
var confidePraiseScore:String?=null
/**
* 实际费用
*/
......
......@@ -7,13 +7,17 @@ import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.blankj.utilcode.util.SpanUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConfideBean
import kotlinx.android.synthetic.ydl.home_confide_expert_info_view.view.*
import kotlinx.android.synthetic.ydl.home_confide_item_layout.view.*
/**
* @author jiucheng
......@@ -34,7 +38,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.home_confide_expert_info_view, this)
View.inflate(context, R.layout.home_confide_item_layout, this)
}
fun setData(bean: HomeConfideBean.BodyBean?, position: Int, isLast: Boolean) {
......@@ -44,12 +48,19 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
//设置头像
setHead(bean)
setListenAndScore(bean)
setConfideTag(bean)
setLineStatus(bean)
//设置名称
tv_name.text = bean.confidedName
//设置倾诉标签View的最大宽度
tag_view.setConfideWidth()
// tag_view.setConfideWidth()
//咨询师标签
tag_view.initData(bean.confidedTag as MutableList<String>)
// tag_view.initData(bean.confidedTag as MutableList<String>)
//设置向TA倾诉人数
setConfideNum(bean)
//设置接通率文案
......@@ -58,11 +69,15 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
setConfideButton(bean)
//设置红包、原价
setCoupon(bean)
//设置咨询师简介
tv_content.text = bean.confideContent
//最后一项显示分割线
if (isLast) {
view_line.visibility = View.GONE
// view_line.visibility = View.GONE
} else {
view_line.visibility = View.VISIBLE
// view_line.visibility = View.VISIBLE
}
this.setOnClickListener {
homeEvent!!.confideClick(bean.linkUrl, bean.confidedId.toString(), bean.doctorId, bean.uid.toString())
......@@ -73,11 +88,22 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
* 设置头像
*/
private fun setHead(bean: HomeConfideBean.BodyBean) {
val op = SimpleImageOpConfiger()
op.errorPic = R.drawable.platform_head_place_hold_pic
op.loadingPic = R.drawable.platform_head_place_hold_pic
op.transform = 0
YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
// val op = SimpleImageOpConfiger()
// op.errorPic = R.drawable.platform_head_place_hold_pic
// op.loadingPic = R.drawable.platform_head_place_hold_pic
// op.transform = 0
// YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
//这样处理 是防止 滑动过程中 反复去加载图片
if (!TextUtils.isEmpty(bean.confidedIcon) && img_head.getTag(R.id.img_head) != bean.confidedIcon) {
GlideApp.with(context)
.load(bean.confidedIcon)
// .override(dp96, dp96)
.into(img_head)
img_head.setTag(R.id.img_head, bean.confidedIcon)
}
}
/**
......@@ -135,41 +161,99 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
}
private fun setListenAndScore(bodyBean: HomeConfideBean.BodyBean) {
SpanUtils.with(price_content).append(bodyBean.confideFee)
.setForegroundColor(resources.getColor(R.color.home_confide_fe6040)).setFontSize(18, true)
.append("元").setForegroundColor(resources.getColor(R.color.home_confide_fe6040))
.setFontSize(11, true)
.append("/25分钟").setForegroundColor(resources.getColor(R.color.home_confide_aaaeba))
.setFontSize(11, true)
.create()
tv_score.text = bodyBean.confidePraiseScore
if (bodyBean.confideFee == "0" && bodyBean.confideLine == 1) {
confide_free_logo.visibility = VISIBLE
Glide.with(context)
.load(R.drawable.home_confide__free)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(confide_free_logo)
} else {
confide_free_logo.visibility = GONE
}
}
/**
* 设置在线状态
*/
private fun setLineStatus(bodyBean: HomeConfideBean.BodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 4 -> {
tv_online.text = "在线"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
2 -> {
tv_online.text = "离线"
tv_online.setBackgroundResource(R.drawable.home_confide_offline_bg)
}
3 -> {
tv_online.text = "通话中"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
}
}
private fun setConfideTag(bodyBean: HomeConfideBean.BodyBean) {
if (null == bodyBean.confidedTag || bodyBean.confidedTag!!.isEmpty()) {
return
}
var i = 0
val sb = StringBuilder()
for (tag in bodyBean.confidedTag!!) {
if (i > 4) break
sb.append(tag).append(" | ")
i++
}
if (sb.length > 3) {
sb.setLength(sb.length - 3)
}
flowlayout_tag.text = sb.toString()
}
/**
* 设置红包、原价
*/
@SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
if(!TextUtils.isEmpty(bodyBean.couponText)){
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
}else{
tvCoupon.visibility = View.GONE
}
if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
tvOriginalPrice.visibility = View.GONE
}else{
tvOriginalPrice.visibility = View.VISIBLE
val originalBuffer = StringBuffer()
originalBuffer.append(bodyBean.confideFee).append("元/次")
tvOriginalPrice.text = originalBuffer.toString()
//添加删除线
tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
}
try {
val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
val confideFee = bodyBean.confideFee!!.toFloat().toInt()
if (couponMoney >= confideFee){
tv_price.text = "¥0"
}else{
val price = confideFee - couponMoney
tv_price.text = "¥"+price.toString()
}
}catch (e:Exception){
//防止数据类型变化引起奔溃
}
// if(!TextUtils.isEmpty(bodyBean.couponText)){
// tvCoupon.text = bodyBean.couponText
// tvCoupon.visibility = View.VISIBLE
// }else{
// tvCoupon.visibility = View.GONE
// }
// if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
// tvOriginalPrice.visibility = View.GONE
// }else{
// tvOriginalPrice.visibility = View.VISIBLE
// val originalBuffer = StringBuffer()
// originalBuffer.append(bodyBean.confideFee).append("元/次")
// tvOriginalPrice.text = originalBuffer.toString()
// //添加删除线
// tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
// }
// try {
// val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
// val confideFee = bodyBean.confideFee!!.toFloat().toInt()
//
// if (couponMoney >= confideFee){
// tv_price.text = "¥0"
// }else{
// val price = confideFee - couponMoney
// tv_price.text = "¥"+price.toString()
// }
// }catch (e:Exception){
// //防止数据类型变化引起奔溃
// }
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#4d000000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#4d000000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topRightRadius="100dp"
android:bottomRightRadius="100dp"/>
<solid android:color="#40FFFFFF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
tools:ignore="MissingDefaultResource">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginTop="20dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:layout_width="96dp"
android:layout_height="96dp">
<ImageView
android:id="@+id/img_head"
android:layout_width="96dp"
android:layout_height="96dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/tv_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="9dp"
android:paddingRight="9dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:textSize="10sp"
android:textColor="@color/white"
android:background="@drawable/home_confide_recommend_expert_line_bg"
tools:text="在线"/>
<ImageView
android:id="@+id/iv_play"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"/>
</FrameLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:textColor="#333333"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/card_view"
app:layout_constraintTop_toTopOf="@id/card_view"
tools:text="姚雨晴" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_confide_data"
app:layout_constraintTop_toBottomOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/card_view"
android:layout_marginStart="12dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
>
<TextView
android:id="@+id/tv_Connection"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="#555555"
android:textStyle="bold"
tools:text="83%"
/>
<TextView
android:id="@+id/tv_ConnectionContent"
android:layout_marginTop="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="#69696A"
android:text="接通率" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="25dp"
>
<TextView
android:id="@+id/tv_confideNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#555555"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="8000人"
/>
<TextView
android:id="@+id/tv_tv_confideNumContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#69696A"
android:text="倾诉人次"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="25dp"
>
<TextView
android:id="@+id/tv_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#555555"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="4.9"
/>
<TextView
android:id="@+id/tv_tv_ScoreContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#69696A"
android:text="评分"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/price_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginRight="16dp"
android:text="50元/25分钟"
android:textSize="@dimen/platform_sp_12"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_confide_data" />
<TextView
android:id="@+id/flowlayout_tag"
android:layout_width="0dp"
android:layout_height="16dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:textColor="#9495A0"
android:maxLines="1"
android:ellipsize="end"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/card_view"
app:layout_constraintEnd_toStartOf="@+id/price_content"
app:layout_constraintStart_toEndOf="@+id/card_view" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="#919190"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintTop_toBottomOf="@id/card_view"
app:layout_constraintStart_toStartOf="@id/card_view"
android:layout_marginTop="@dimen/platform_dp_15"
tools:text="没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/tv_confide"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginEnd="@dimen/platform_dp_15"
android:gravity="center"/>
<ImageView
android:layout_width="42dp"
android:layout_height="21dp"
android:id="@+id/confide_free_logo"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_marginStart="@dimen/platform_dp_8"/>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
app:layout_constraintTop_toBottomOf="@id/tv_content"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="15dp"
android:background="#F0F0F0"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -4,5 +4,9 @@
<color name="white_60">#99FFFFFF</color>
<color name="white">#FFFFFF</color>
<color name="home_confide_61CEAC">#61CEAC</color>
<color name="home_confide_48CC95">#48CC95</color>
<color name="home_confide_fe6040">#fe6040</color>
<color name="home_confide_aaaeba">#aaaeba</color>
</resources>
package com.yidianling.im.bean
data class CanViewConsult(
val canViewConsult: Boolean = false
)
......@@ -280,11 +280,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
String toUid = expertInfo.shareData.toUid;
......@@ -305,7 +301,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//如果是群聊
if (SessionTypeEnum.Team==sessionType){
titleBar.setRightIcon(getContext().getDrawable(R.drawable.platform_common_more));
rela_zixun.setVisibility(View.GONE);
titleBar.setTitleRightDraw(null);
}
}
......@@ -328,6 +323,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
});
}
boolean isExpert = null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() == 2;
ServiceImpl.Companion.getInstance().canViewConsult(ActionHandlerStorage.getL(sessionId).getInfo().doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.code.equals("200")){
if (response.data!=null && response.data.getCanViewConsult()){
if (isExpert && sessionType != SessionTypeEnum.Team) {
rela_zixun.setVisibility(View.VISIBLE);
}
}
}
}
);
//有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2 || ActionHandlerStorage.getL(sessionId).getInfo().listenOrderCommentStatus == 1) {
......@@ -430,13 +441,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
getInputPanel().setInputHintContent(res.data.getInputBoxReminder());
}
}
if ("200".equals(res.code) && res.data != null) {
if (res.data.getStatus() == 0) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
}
// if ("200".equals(res.code) && res.data != null) {
// if (res.data.getStatus() == 0) {
// if (null != getActivity() && null != rela_zixun) {
// rela_zixun.setVisibility(View.GONE);
// }
// }
// }
}, throwable -> {
});
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 1 && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 3) {
......
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
......@@ -125,4 +126,10 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: crm_cloud")
fun getFirstQuestion( @Body map: Map<String,@JvmSuppressWildcards Any>): Observable<BaseAPIResponse<FirstQuestionBean>>
//倾诉2.0迭代 是否显示立即咨询按钮
@GET("consult/expert-page/canViewConsult")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun canViewConsult(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<CanViewConsult>>
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.uikit.custom.http.response.*
......@@ -200,4 +201,11 @@ class ServiceImpl private constructor() {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getFirstQuestion(map)
}
/**
* 是否显示立即咨询
*/
fun canViewConsult(doctorId: String):Observable<BaseAPIResponse<CanViewConsult>>{
return YDLHttpUtils.obtainApi(ServiceApi::class.java).canViewConsult(doctorId)
}
}
\ No newline at end of file
......@@ -3,18 +3,26 @@ package com.yidianling.uikit.custom.widget;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MessageBuilder;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.confide.api.ConfideRoute;
import com.ydl.confide.api.IConfideService;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.router.IYDLRouterConstant;
import com.ydl.ydlcommon.utils.Utils;
import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
......@@ -27,6 +35,14 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.YDLCacheUtils;
import java.util.HashMap;
import kotlin.Pair;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.findRouteService;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.route;
/**
* Created by haorui on 2019/5/22.
* Des:
......@@ -129,9 +145,29 @@ public class ConfideOrderInfoView extends RelativeLayout {
//点击整个view,跳转订单详情页面
setOnClickListener(view -> {
if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情
H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情");
NewH5Activity.start(mContext, h5Params);
if (Utils.isFastClick()) {
return;
}
String remainTime = ActionHandlerStorage.getL(mSessionId).getInfo().listenOrderRemainTime;
if (TextUtils.isEmpty(remainTime)) {
Pair<String, String> confideId = new Pair<>(IYDLRouterConstant.EXTRA_CONFIDEDID,
info.listenerId);
Pair<String, String> doctorId = new Pair<>(IYDLRouterConstant.EXTRA_DOCTORID,
info.doctorId);
route(getContext(), ConfideRoute.R_CONFIDE_HOME, confideId, doctorId);
} else {
if (info != null) {
String confideId = info.listenerId;
findRouteService(IConfideService.class)
.showExpertDetailDialog(
(FragmentActivity) mContext,
HttpConfig.Companion.getMH5_URL() + ConfideRoute.INSTANCE.h5ConfideIntro(confideId),
info.doctorId,
info.toUid);
}
}
});
}
......@@ -180,4 +216,7 @@ public class ConfideOrderInfoView extends RelativeLayout {
});
MessageListPanelHelper.getInstance().notifyAddMessage(message);
}
}
......@@ -487,12 +487,14 @@
android:background="@drawable/im_bg_im_consult_action"
android:gravity="center"
android:paddingLeft="17dp"
android:paddingRight="11dp">
android:paddingRight="11dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/action_yuyue"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:paddingLeft="5dp"
android:text="立即咨询"
......
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