Commit 1fa5ffdd by 刘鹏

Merge branch 'd/v4.3.98' into 'release'

D/v4.3.98

See merge request app_android_lib/YDL-Component!177
parents dd806cb2 852a4569
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../maven_push_api.gradle"
version = '1.0.0'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.ydl.confide.api">
</manifest>
\ No newline at end of file
......@@ -5,11 +5,11 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.32",
"m-confide" : "0.0.50.37",
"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",
......@@ -41,7 +41,6 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -92,11 +91,11 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.32",
"m-confide" : "0.0.50.37",
"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",
......@@ -127,7 +126,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-confide-api" : "1.0.0",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......
......@@ -2,13 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件
// 配置资源重命名插件
resConfig {
new_prefix = 'confide_' // 资源前缀
old_prefix = '' // 老前缀,可为''空字符串
}
apply from : '../maven_push.gradle'
kapt {
arguments {
......@@ -17,16 +11,11 @@ kapt {
}
android {
// compileSdkVersion rootProject.ext.android["compileSdkVersion"]
// buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
// minSdkVersion rootProject.ext.android["minSdkVersion"]
// targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
......@@ -54,12 +43,6 @@ android {
enabled true
}
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
//设置JDK1.8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
......@@ -96,7 +79,7 @@ dependencies {
api project(':ydl-utils')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-confide-api')
implementation project(':api:confide')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
......
modular {
packageName "com.ydl.confide"
// 模块发布需要的参数
publish {
modules {
xlzx {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-module-xlzx"
// 上报的业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-module-ydl"
// 上报的业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-confide-api"
version = rootProject.ext.ydlPublishVersion["${childProject.getName()}-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
......@@ -9,5 +9,7 @@
<activity
android:name=".intro.ExpertIntroActivity"
android:screenOrientation="portrait" />
<activity android:name=".home.ConfideSearchActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>
package com.ydl.confide.home
import android.content.Context
import android.content.Intent
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import android.view.WindowManager
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.TextView
import com.ydl.confide.R
import com.ydl.confide.home.constants.FinalString
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import kotlinx.android.synthetic.main.confide_search_activity.*
class ConfideSearchActivity : BaseActivity() {
override fun initDataAndEvent() {
val keyWord = intent.getStringExtra(FinalString.CONFIDE_SEARCH_KEY_WORD)
if (!TextUtils.isEmpty(keyWord)){
etSearch?.setText(keyWord)
iv_delete_icon.visibility = View.VISIBLE
}
etSearch.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
val keyword = etSearch!!.text.trim().toString()
//埋点
ActionCountUtils.record("listen_counselor_list_page","listen_counselor_list_search_click",keyword)
val intent = Intent()
intent.putExtra(FinalString.CONFIDE_SEARCH_KEY_WORD, keyword)
setResult(RESULT_OK,intent)
finish()
}
true
}
findViewById<TextView>(R.id.tv_search_cancle).setOnClickListener {
setResult(RESULT_OK)
finish()
}
if (etSearch.requestFocus()) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
val isShowing = imm.showSoftInput(etSearch, InputMethodManager.SHOW_IMPLICIT)
if (!isShowing) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
}
}
etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) {
iv_delete_icon.visibility = View.INVISIBLE
} else {
iv_delete_icon.visibility = View.VISIBLE
}
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
iv_delete_icon.setOnClickListener {
etSearch.setText("")
}
}
override fun layoutResId(): Int {
return R.layout.confide_search_activity
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@ package com.ydl.confide.home.bean
*/
data class ConfideHomeAllFiltersBean(
var page : Int,
//通过倾诉师的名字搜索
var keywords : String,
//选择的综合排序Id
var selectSort : ConfideHomeFiterItemBean?,
//选择的性别id
......@@ -19,4 +21,6 @@ data class ConfideHomeAllFiltersBean(
val selectGoodData : ArrayList<ConfideHomeFiterItemBean>?,
//当前列表已存在专家uid列表
var notInUid : ArrayList<Int> = ArrayList()
)
\ No newline at end of file
......@@ -30,4 +30,6 @@ data class ConfideHomeDataBean(
/**
* 为你推荐Id 本地使用 用于区分音频播放区域
*/
var recommendId : Int)
\ No newline at end of file
var recommendId : Int,
var keyword : String = "")
\ No newline at end of file
......@@ -20,6 +20,8 @@ interface IConfideHomeConfig{
const val TYPE_RECOMMEND = 5
const val TYPE_SOUND = 6
const val TYPE_VIDEO_SHOW = 7
const val TYPE_SEARCH = 8
const val TYPE_EMPTY = 9
const val TYPE_FOOTER = 999
/**
* section id. 与上面相对应
......@@ -31,6 +33,8 @@ interface IConfideHomeConfig{
const val SECTION_RECOMMEND = 10005
const val SECTION_SOUND = 10006
const val SECTION_CONSULTANT = 10007
const val SECTION_SEARCH = 10008
const val SECTION_EMPTY = 10009
const val SECTION_FOOTER = 19999
......
......@@ -19,4 +19,9 @@ public class FinalString {
//连接倾听未绑定手机提示
public static final String TEL_BINDPHONE = "电话连接需要绑定手机哦~";
public static final String CONFIDE_SEARCH_KEY_WORD = "confide_key_word";
public static final int SEARCH_REQUEST_CODE = 1;
}
......@@ -132,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
override fun consultantClick(doctorId: String?, confideId: String?, uid: String?) {
override fun consultantClick(doctorId: String?, confideId: String?, uid: String?,listenFree : Boolean?, expertUrl:String?) {
confideId?.let {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
mContext as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it),
doctorId!!, uid = uid
doctorId!!, uid = uid, listenFree = listenFree ?: false,expertUrl = expertUrl?:""
)
}
}
......
......@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun consultantClick(doctorId: String?, confideId: String?, uid: String?)
fun consultantClick(doctorId: String?, confideId: String?, uid: String?, listenFree: Boolean?= false, expertUrl : String?="")
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
......
......@@ -38,7 +38,7 @@ interface ConfideHomeApi {
// 1=在线 3-通话中 2-离线
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("auth/listen/dialchangestatus")
fun getDialStatus(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<DialStatus>>
fun getDialStatus(@Query("doctorId") doctorId: String, @Query("listenVersion")listenVersion : String = "2.1"): Observable<BaseAPIResponse<DialStatus>>
@GET
fun recommendDoctor(
......
......@@ -51,6 +51,7 @@ class ConfideHomeHttpImpl private constructor() : IConfideHomeHttp {
val sb = StringBuffer()
sb.append("page").append("=").append(param.page).append("&")
.append("keywords").append("=").append(param.getKeywords()).append("&")
.append("sortType").append("=").append(param.getSortType()).append("&")
.append("sexType").append("=").append(param.getSexType()).append("&")
.append("ageType").append("=").append(param.getAgeType()).append("&")
......
......@@ -30,6 +30,8 @@ class ConfideRecommendParam private constructor(builder: Builder){
*/
private var goodType : String = ""
private var keyWords : String = ""
//当前列表已存在专家uid列表
var notInUid : ArrayList<Int> = ArrayList()
......@@ -49,6 +51,10 @@ class ConfideRecommendParam private constructor(builder: Builder){
return goodType
}
fun getKeywords() : String{
return keyWords
}
init {
this.page = builder.page
this.sortType = builder.sortType
......@@ -56,6 +62,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
this.ageType = builder.ageType
this.goodType = builder.goodType
this.notInUid = builder.notInUid
this.keyWords = builder.keyWords
}
class Builder {
......@@ -65,6 +72,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
internal var ageType : String = ""
internal var goodType : String = ""
internal var notInUid : ArrayList<Int> = ArrayList()
internal var keyWords : String = ""
fun page(page: Int): Builder {
this.page = page
......@@ -91,9 +99,17 @@ class ConfideRecommendParam private constructor(builder: Builder){
return this
}
fun keyWords(keyWords: String): Builder {
this.keyWords = keyWords
return this
}
fun build() : ConfideRecommendParam{
return ConfideRecommendParam(this)
}
}
}
......
......@@ -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()
}
}
/**
......@@ -54,7 +72,7 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
mRecyclerView.scrollBy(0, 1)
val childAt = mRecyclerView.getChildAt(mIndex)
if (childAt !is ConfideHomeFilterView) return
val top = childAt.top
val top = childAt.top - childAt.height
if(top==0 || top==1){
//已滚动到顶部
......@@ -82,4 +100,6 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
// move = true
// }
}
}
\ No newline at end of file
package com.ydl.confide.home.listener
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.View
import android.widget.EditText
import android.widget.ImageView
import android.widget.RelativeLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.ydl.confide.R
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.widget.ConfideHomeFilterView
import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.utils.KeyboardChangeListener
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
/**
* @author yuanwai
......@@ -22,9 +32,14 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
private var mSuspensionHeight: Int = RxImageTool.dip2px(48f)
private var mSearchViewHeight: Int = RxImageTool.dip2px(48f)
private var filterView: ConfideHomeFilterView? = null
private var searchView: RelativeLayout? = null
private var divView: View? = null
private var searchText = ""
private var adapter: ConfideHomeAdapter? = null
fun setFilterView(filterView: ConfideHomeFilterView, divView: View) {
......@@ -32,6 +47,17 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
this.divView = divView
}
fun setFilterView(
filterView: ConfideHomeFilterView,
searchView: RelativeLayout,
divView: View
) {
this.filterView = filterView
this.divView = divView
this.searchView = searchView
}
fun setSectionAdapter(adapter: ConfideHomeAdapter) {
this.adapter = adapter
}
......@@ -41,6 +67,11 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
if (null != filterView) {
mSuspensionHeight = filterView!!.height
}
if (searchView != null) {
mSearchViewHeight = searchView!!.height
}
}
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
......@@ -49,24 +80,42 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
return
}
val manager = recyclerView!!.layoutManager as LinearLayoutManager
val findFirstCompletelyVisibleItemPosition =
manager.findFirstCompletelyVisibleItemPosition();
if (findFirstCompletelyVisibleItemPosition != 0 && findFirstCompletelyVisibleItemPosition != 1) {
searchView?.visibility = View.VISIBLE
} else {
searchView?.visibility = View.INVISIBLE
}
if (mCurrentPosition != manager.findFirstVisibleItemPosition()) {
mCurrentPosition = manager.findFirstVisibleItemPosition()
}
LogUtil.e("http----------------type="+adapter!!.getItemViewType(mCurrentPosition))
if (adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_RECOMMEND) {
LogUtil.e("http----------------type=" + adapter!!.getItemViewType(mCurrentPosition))
if (adapter!!.getItemViewType(mCurrentPosition + 1) == IConfideHomeConfig.TYPE_RECOMMEND) {
var view = manager.findViewByPosition(mCurrentPosition + 1)
if (view != null) {
if (view.top <= mSuspensionHeight) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
} else {
if (view is ConfideHomeFilterView) {
if (view.top <= mSuspensionHeight) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
} else {
// filterView!!.visibility = View.INVISIBLE
filterView!!.visibility = View.INVISIBLE
divView?.visibility = View.INVISIBLE
}
}
}
}else if (adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_RECOMMEND || adapter!!.getItemViewType(mCurrentPosition) == IConfideHomeConfig.TYPE_SOUND){
} else if (adapter!!.getItemViewType(mCurrentPosition + 1) == IConfideHomeConfig.TYPE_RECOMMEND || adapter!!.getItemViewType(
mCurrentPosition + 1
) == IConfideHomeConfig.TYPE_SOUND
) {
filterView!!.visibility = View.VISIBLE
divView?.visibility = View.VISIBLE
}else {
} else {
filterView!!.visibility = View.INVISIBLE
divView?.visibility = View.INVISIBLE
}
......
package com.ydl.confide.home.listener
interface HideScrollListener {
fun onHide()
fun onShow()
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
tvSexTitle.text = "性别筛选"
tvAgeTitle.text = "年龄筛选"
if (null == mAllFiltersBean){
mAllFiltersBean = ConfideHomeAllFiltersBean(allFiltersBean.page,allFiltersBean.selectSort,allFiltersBean.selectSex,allFiltersBean.selectAgeData,allFiltersBean.selectGoodData)
mAllFiltersBean = ConfideHomeAllFiltersBean(allFiltersBean.page,"",allFiltersBean.selectSort,allFiltersBean.selectSex,allFiltersBean.selectAgeData,allFiltersBean.selectGoodData)
}
initData(sexData,ageData,mAllFiltersBean!!)
initSexData(view,mAllFiltersBean!!)
......
......@@ -490,6 +490,10 @@ class ConfideHomeUtils {
if (-1 != allFiltersBean.page) {
param.page(allFiltersBean.page)
}
if (null != allFiltersBean.keywords){
param.keyWords(allFiltersBean.keywords)
}
//综合排序
if (null != allFiltersBean.selectSort && !TextUtils.isEmpty(allFiltersBean.selectSort!!.id) && "-1" != allFiltersBean.selectSort!!.id) {
param.sortType(allFiltersBean.selectSort!!.id!!)
......
......@@ -16,9 +16,15 @@ fun TextView.confideLineText(line: Int) {
3 -> {
text = "通话中"
}
4->{
4 -> {
text = "继续倾诉"
}
5 -> {
text = "已离线,可预约"
}
6 -> {
text = "已离线,可留言"
}
}
}
......
......@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
private fun click(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 3, 4 -> {
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree)
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -94,7 +94,8 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1"
)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree,bodyBean.linkUrl)
}
img_head.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2")
......@@ -344,7 +345,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideLine == 3) {
}
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString(), bodyBean.listenFree)
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.intro
import android.app.Activity
import android.net.Uri
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.SeekBar
......@@ -11,6 +12,7 @@ import androidx.databinding.ObservableInt
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
......@@ -35,6 +37,8 @@ import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
import java.net.URLEncoder
import java.util.concurrent.TimeUnit
......@@ -77,6 +81,36 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
)
val status = item.lineStatus.get()
when (status) {
5 -> {
if (!TextUtils.isEmpty(item.linkedUrl.get())){
val linkUri = Uri.parse(item.linkedUrl.get())
if (linkUri != null) {
val host = linkUri.host
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation()
}catch (e : NullPointerException){
com.yidianling.common.tools.LogUtil.e("params参数为空")
}catch (e : UnsupportedEncodingException){
com.yidianling.common.tools.LogUtil.e("解码错误")
}catch (e : UnsupportedOperationException){
com.yidianling.common.tools.LogUtil.e("这不是一个uri格式的地址")
}
}
}
}
}
6 -> {
if (!item.uid.isNullOrBlank()) {
(itemView.context as? Activity)?.let { it1 ->
ARouter.getInstance().navigation(IImService::class.java)
?.startChatBySessionId(it1, item.uid!!)
}
}
}
2, 3 -> {//离线,通话中
(itemView.context as? Activity)?.let { aty ->
findRouteService(IImService::class.java).startChat(aty, item.uid!!, 0, 0)
......@@ -226,12 +260,19 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/" + R.drawable.first_order))
.setUri(Uri.parse("res://drawable/" + R.drawable.confide_first_order))
.setOldController(binding.confideFirstFree.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
binding.confideFirstFree.controller = controller
val freeController: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/" + R.drawable.confide_free))
.setOldController(binding.free.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
binding.free.controller = freeController
binding.seekbar.progress = 0
binding.seekbar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
......@@ -330,7 +371,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
itemView.context as FragmentActivity,
url,
item.doctorId!!,
uid = item.uid
uid = item.uid,
listenFree = item.listenFree.get()
)
}
}
......@@ -352,6 +394,8 @@ class VideoViewModel {
var uid: String? = null
var doctorId: String? = null
var confideId: String? = null
var listenFree = ObservableBoolean(false)
var linkedUrl = ObservableField<String>("")
}
private fun genMinProgramPath(url: String): String {
......@@ -363,6 +407,7 @@ private fun genMinProgramPath(url: String): String {
internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
name.set(bean.confidedName)
avatar.set(bean.confidedIcon)
linkedUrl.set(bean.linkUrl)
val num = bean.confideNum?.replace("人", "") ?: "0"
count.set("倾诉人次 $num")
intro.set(bean.confideContent)
......@@ -385,6 +430,11 @@ internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
uid = bean.uid?.toString()
doctorId = bean.doctorId
confideId = bean.confidedId
if (bean.listenFree == null) {
listenFree.set(false)
} else {
listenFree.set(bean.listenFree!!)
}
return this
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="40dp"/>
<solid android:color="#F7F7F7" />
<stroke android:width="1px" android:color="#E6E6E6"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:width="1dp" />
<span style="font-family: Arial, Helvetica, sans-serif;"/>
<solid android:color="@color/platform_main_theme" />
</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:radius="26dp" />
<gradient
android:endColor="#FE745B"
android:startColor="#FF8772" />
<stroke
android:width="1dp"
android:color="#69FFFFFF" />
</shape>
\ No newline at end of file
......@@ -83,12 +83,24 @@
app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/free"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/first_order"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"/>
app:layout_constraintCircleRadius="70dp"
android:visibility="gone"
tools:ignore="MissingConstraints" />
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/empty_rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:layout_marginTop="100dp"
android:orientation="vertical"
>
<ImageView
android:id="@+id/empty_img"
android:layout_width="180dp"
android:layout_height="120dp"
android:src="@drawable/platform_ico_img_zixun_empty" />
<TextView
android:id="@+id/hint_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_35"
android:text="没有搜到相关信息,换个关键词看看吧"
android:textColor="@color/platform_color_999999"
android:textSize="14dp" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -16,7 +16,8 @@
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/quick_consult_card"
......@@ -33,8 +34,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"
......@@ -137,11 +137,75 @@
android:background="#80000000"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/rl_search_head"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:background="@color/white"
android:visibility="gone"
tools:visibility="gone">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/confide_dp_15"
android:layout_marginRight="@dimen/confide_dp_15"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<TextView
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
</RelativeLayout>
<com.ydl.confide.home.widget.ConfideHomeFilterView
android:id="@+id/v_filterView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
android:layout_below="@+id/rl_search_head"
android:visibility="gone"
tools:visibility="gone"/>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:descendantFocusability="blocksDescendants"
>
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/confide_dp_15"
android:layout_marginRight="@dimen/confide_dp_15"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/platform_dp_25"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<TextView
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_48"
android:paddingStart="15dp"
android:tag="tag_search_input"
>
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="60dp"
android:background="@drawable/confide_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/confide_icon_input_search"
android:tag="tag_search_input_img" />
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="请输入倾诉师姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@drawable/confide_edit_cursor_drawable"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
<TextView
android:id="@+id/tv_search_cancle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:padding="5dp"
android:text="取消"
android:textColor="#242424"
android:textSize="15dp" />
</RelativeLayout>
<View
android:id="@+id/v_topLine"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="@+id/rl_search"
android:layout_marginTop="@dimen/platform_dp_6"
android:background="@color/platform_color_E0E0E0"
/>
</LinearLayout>
\ No newline at end of file
......@@ -100,7 +100,7 @@
android:layout_width="160dp"
android:layout_height="47dp"
android:layout_marginBottom="28dp"
android:background="@{item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
android:background="@{(item.lineStatus == 5 || item.lineStatus == 6) ? @drawable/confide_offline_book_bg : item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
......@@ -166,13 +166,24 @@
app:layout_constraintCircleRadius="70dp" />-->
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/free"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
android:visibility="@{item.listenFree?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp"
tools:ignore="MissingConstraints" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/confide_first_free"
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_34"
android:layout_width="@dimen/platform_dp_48"
android:layout_height="@dimen/platform_dp_24"
android:visibility="@{item.showFreeTag?View.VISIBLE:View.GONE}"
app:layout_constraintCircle="@+id/layoutCall"
app:layout_constraintCircleAngle="70"
app:layout_constraintCircleRadius="70dp" />
app:layout_constraintCircleRadius="70dp"
tools:ignore="MissingConstraints" />
<TextView
android:id="@+id/tvTag"
......
......@@ -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
}
}
/**
* 设置红包、原价
* 设置在线状态
*/
@SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
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)
}
}
}
if(!TextUtils.isEmpty(bodyBean.couponText)){
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
}else{
tvCoupon.visibility = View.GONE
private fun setConfideTag(bodyBean: HomeConfideBean.BodyBean) {
if (null == bodyBean.confidedTag || bodyBean.confidedTag!!.isEmpty()) {
return
}
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
var i = 0
val sb = StringBuilder()
for (tag in bodyBean.confidedTag!!) {
if (i > 4) break
sb.append(tag).append(" | ")
i++
}
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 (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){
// //防止数据类型变化引起奔溃
// }
}
}
<?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);
}
}
......@@ -281,15 +281,16 @@
<!--用户评论banner-->
<LinearLayout
android:id="@+id/comment_banner_view_ll"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:visibility="gone">
android:id="@+id/comment_banner_view_ll"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/im_focus_btn"
......@@ -302,16 +303,16 @@
tools:text="关注" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:background="#F0F0F0" />
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:background="#F0F0F0" />
<com.yidianling.uikit.business.session.view.ImCommentBannerView
android:id="@+id/comment_banner_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"></com.yidianling.uikit.business.session.view.ImCommentBannerView>
android:id="@+id/comment_banner_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
......@@ -487,12 +488,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="立即咨询"
......
apply plugin: 'maven'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() {
return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
}
task sourceJar(type:Jar){
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourceJar
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = "m-" + project.name + "-api"
pom.groupId = "com.ydl"
pom.version = project.version
repository(url: mavenRepositoryUrl) {
authentication(userName: "admin", password: "fjoi#1+#@")
}
// repository(url:mavenLocal().url)
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, getVersionName()
, "aar"
, "release"
)
}
}
\ No newline at end of file
......@@ -4,4 +4,4 @@ include ':app',
':m-home',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic","m-article","m-audioim","m-user","m-confide"
include ':ydl-tuicore'
include ':ydl-tuicore',':api:confide'
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