Commit 7cf1e0bd by 刘鹏

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

v.4.3.95

See merge request app_android_lib/YDL-Component!142
parents 50cd0d65 d3c043fe
......@@ -190,63 +190,34 @@ dependencies {
implementation(rootProject.ext.dependencies["okhttp3"])
implementation("androidx.fragment:fragment:1.2.4")
// TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
if (true) {
//开发模式
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-confide')
implementation modularPublication('com.ydl:m-confide-api')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-tests')
api project(':m-home')
api project(':m-confide')
implementation project(':ydl-flutter-base')
api(project(':ydl-platform')) {
transitive = true
}
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(':m-muse')
implementation project(':m-im')
implementation modularPublication('com.ydl:m-im-api')
implementation project(':m-dynamic')
implementation project(':m-course')
//文章模块
implementation project(':m-article')
implementation project(':m-audioim')
implementation modularPublication('com.ydl:m-audioim-api')
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
implementation project(':ydl-tuicore')
} else {
//发布模式
api 'com.ydl:m-user-module-ydl:0.0.6'
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-m-fm-api"]
api rootProject.ext.dependencies["m-article"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
api(rootProject.ext.dependencies["ydl-tuicalling"]) {
transitive = true
}
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-confide')
implementation modularPublication('com.ydl:m-confide-api')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-tests')
api project(':m-home')
api project(':m-confide')
implementation project(':ydl-flutter-base')
api(project(':ydl-platform')) {
transitive = true
}
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(':m-muse')
implementation project(':m-im')
implementation modularPublication('com.ydl:m-im-api')
implementation project(':m-dynamic')
implementation project(':m-course')
implementation project(':m-article')
implementation project(':m-audioim')
implementation modularPublication('com.ydl:m-audioim-api')
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
implementation project(':ydl-tuicore')
implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -19,6 +19,9 @@ import com.yidianling.muse.activity.ChooseMusicActivity;
//import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
import de.greenrobot.event.EventBus;
import com.yidianling.im.event.CloseBottomWebviewEvent;
import de.greenrobot.event.EventBus;
/**
* webview 点击事件监听 抽象类
......@@ -494,6 +497,11 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
}
}
@Override
public void chatCloseBottomWebView() {
EventBus.getDefault().post(new CloseBottomWebviewEvent(true));
}
@Override
public void reloadUrl(String url) {
......
......@@ -391,6 +391,11 @@ class WebJavascriptHandler : IJavascriptHandler{
wvEnventPro?.setSelfPageType(it.selfPageType)
}
}
"chat_close_bottom_webview" -> {
jsData.cmd!!.params?.let {
wvEnventPro?.chatCloseBottomWebView()
}
}
"meditation_play" -> {
......
......@@ -182,6 +182,9 @@ public interface WebViewClientClickListener {
//设置当前页面类型
void setSelfPageType(int selfType);
//关闭私聊窗口立即咨询webview
void chatCloseBottomWebView();
default void playMeditation(int mediaId,long meditationId,int meditationType,String mediaCoverUrl){}
......
......@@ -5,10 +5,10 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.18",
"m-consultant" : "0.0.60.27",
"m-confide" : "0.0.50.19",
"m-consultant" : "0.0.60.61",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.26",
"m-user" : "0.0.62.46",
"m-home" : "0.0.23.80",
"m-im" : "0.0.21.51",
"m-dynamic" : "0.0.7.74",
......@@ -26,7 +26,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.21",
"m-user-api" : "0.0.10.22",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
......@@ -50,7 +50,7 @@ ext {
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
ydl_app = [
......@@ -94,10 +94,10 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.18",
"m-consultant" : "0.0.60.27",
"m-confide" : "0.0.50.19",
"m-consultant" : "0.0.60.61",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.26",
"m-user" : "0.0.62.46",
"m-home" : "0.0.23.80",
"m-im" : "0.0.21.51",
"m-dynamic" : "0.0.7.74",
......@@ -114,7 +114,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.21",
"m-user-api" : "0.0.10.22",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
......@@ -133,7 +133,7 @@ ext {
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
......
......@@ -75,7 +75,7 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
implementation "com.ydl:ydl-av:1.4.2"
implementation "com.ydl:ydl-av:1.4.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
......
......@@ -552,21 +552,21 @@ class ConsultantAudioHomeActivity :
* 初始化界面用户信息
*/
private fun initUser() {
var userName = "咨询用户"
var userName = "咨询"
if (null != mAudioMessageBean) {
if (!TextUtils.isEmpty(mAudioMessageBean!!.userName)) {
userName = mAudioMessageBean!!.userName!!
if (!TextUtils.isEmpty(mAudioMessageBean?.userName)) {
userName = mAudioMessageBean?.userName!!
}
if (!TextUtils.isEmpty(mAudioMessageBean!!.userIcon)) {
if (!TextUtils.isEmpty(mAudioMessageBean?.userIcon)) {
var option = SimpleImageOpConfiger()
option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0
YDLImageCacheManager.showImage(this, mAudioMessageBean!!.userIcon, iv_head, option)
YDLImageCacheManager.showImage(this, mAudioMessageBean?.userIcon, iv_head, option)
} else {
iv_head.setBackgroundResource(R.drawable.audioim_head_place_hold_pic)
}
userId = mAudioMessageBean!!.userId?.toInt() ?: -1
userId = mAudioMessageBean?.userId?.toInt() ?: -1
} else {
iv_head.setBackgroundResource(R.drawable.audioim_head_place_hold_pic)
}
......
......@@ -293,9 +293,9 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
.subscribe {
val pos = (video?.mMediaPlayer as IjkMediaPlayer?)?.currentPosition ?: 0
if (pos > 0) {
if (vm?.isVideo == true) {
binding.ivCover.visibility = View.GONE
}
// if (vm?.isVideo == true) {
// binding.ivCover.visibility = View.GONE
// }
if (!isTouch) {
binding.seekbar.progress = pos.toInt()// video.bufferPercentage
}
......
......@@ -28,7 +28,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
<!--<ImageView
android:id="@+id/ivCover"
android:layout_width="0dp"
android:layout_height="0dp"
......@@ -36,7 +36,7 @@
app:layout_constraintBottom_toBottomOf="@+id/videoView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent" />-->
<ImageView
android:id="@+id/ivPlay"
......
......@@ -68,7 +68,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -3,23 +3,20 @@ package com.yidianling.consultant
import android.widget.ImageView
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.model.bean.DoctorServiceItem
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.model.bean.Extras
import com.yidianling.consultant.model.bean.HeadData
/**
* Created by zqk on 17-9-19.
*/
interface IExpertSearchView : IView {
fun onServiceListFetched(data: MutableList<DoctorServiceItem>, page: Int, totalPage: Int)
fun showRefreshLayout()
fun localData()
fun updateCache(showType: Int,searchBean: ExpertSearchBean)
fun onHeadFetched(headData: HeadData?)
fun onDoctorListFetched(data: MutableList<DoctorServiceItem>, page: Int,totalPage : Int)
fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras: Extras?,curPage:Int)
fun fetchFailed(msg: String?)
fun fetchListFailed(msg: String?)
fun fetchListEmpty(msg: String?)
......
......@@ -32,7 +32,7 @@ class CategoryRecyclerViewAdapter(private val context: Context, private val cate
override fun getItemCount(): Int = categories.size
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tvSubjectName: TextView = itemView.tvSubjectName
val tvSubjectName: TextView = itemView.tv_sort_name
init {
itemView.setOnClickListener {
......
package com.yidianling.consultant.adapter
import android.text.SpannableString
import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.SearchSuggestListBean
/**
* Created by Ykai on 2022/5/30.
*/
class SearchWordsAdapter(data: List<SearchSuggestListBean>) : BaseQuickAdapter<SearchSuggestListBean, BaseViewHolder>(R.layout.consultant_item_search_words,data) {
private var mSearchWord:String = ""
override fun convert(holder: BaseViewHolder, item: SearchSuggestListBean) {
val tvSearchWords = holder.getView<TextView>(R.id.tv_search_words)
tvSearchWords.text = setWordsStyle(item.suggest_content,mSearchWord)
}
fun notifyDataAndSetSearchWord(searchWord: String){
mSearchWord = searchWord
notifyDataSetChanged()
}
private fun setWordsStyle(words:String,searchWord:String):SpannableString{
val spannableString = SpannableString(words)
if (words.contains(searchWord)){
val startIndex = words.indexOf(searchWord)
val endIndex = startIndex+searchWord.length
spannableString.setSpan(ForegroundColorSpan(ContextCompat.getColor(mContext,R.color.platform_main_theme)), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
return spannableString
}
}
\ No newline at end of file
package com.yidianling.consultant.adapter
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.ChildrenBean
/**
* Created by Ykai on 2022/5/18.
*/
class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<ChildrenBean, BaseViewHolder>(data) {
var isVisible = false
init {
addItemType(1, R.layout.consultant_item_sort1)
addItemType(2, R.layout.consultant_item_sort2)
}
override fun convert(holder: BaseViewHolder, item: ChildrenBean) {
when(holder.itemViewType){
1 ->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
}
}
2->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
}
}
}
}
/**
* 设置大于第12个之后的标签全部显示
*/
fun setAllVisible(){
mData.forEach { bean ->
bean.isVisible = true
}
notifyDataSetChanged()
isVisible = true
}
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun setGone(){
mData.forEachIndexed { index, bean ->
if (index>12){
bean.isVisible = false
}
}
notifyDataSetChanged()
isVisible = false
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ class SortRecyclerViewAdapter(private val context: Context,
val item = sortItems[position]
holder.tvSort.text = item.value
if (item.key == selectedSort.key) {
holder.tvSort.setTypeface(Typeface.DEFAULT_BOLD)
holder.tvSort.typeface = Typeface.DEFAULT_BOLD
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_main_theme))
// holder.ivCheck.visibility = View.VISIBLE
}
......
......@@ -11,8 +11,8 @@ data class ExpertSearchProductsBean(
/**
* 1.单次/2.套餐
*/
val isPackage : Int?,
val product_type: String?,
/**
* 套餐名称
*/
val name : String?)
\ No newline at end of file
val product_name : String?)
\ No newline at end of file
......@@ -11,16 +11,16 @@ data class ExpertSearchTagsIconBean(
/**
* 优质图标
*/
val abilityLevelIcon : String?,
val ability_level_icon : String?,
/**
* 公益图标
*/
val serviceFreeIcon : String?,
val service_free_icon : String?,
/**
* 新入驻图标
*/
val newEnterIcon : String?,
val new_enter_icon : String?,
/**
* 抗疫先锋图标地址
*/
var fightEpidemicIcon: String? = null)
\ No newline at end of file
var fight_epidemic_icon: String? = null)
\ No newline at end of file
package com.yidianling.consultant.bean
/**
* Created by Ykai on 2022/5/30.
*/
data class SearchWordsBean(
val search_suggests:ArrayList<SearchSuggestListBean>?
)
data class SearchSuggestListBean(
val id:String,
val score:String,
val suggest_content:String,
val suggest_relations:ArrayList<String>,
val search_count: Int,
val suggest_classify_types:ArrayList<String>,
val mapping_classify_type_exist:Boolean
)
\ No newline at end of file
......@@ -19,7 +19,12 @@ class ConsultBIConstants {
const val POSITION_CONSULT_FILTER_RESET_CLICK = "consult_filter_reset_click" //重置
const val POSITION_CONSULT_FILTER_CHECKOUT_CLICK = "consult_filter_checkoutallconsultants_click" //查看XXX位咨询师
const val POSITION_DAOYI_ADVERTISEMENT_CLICK="daoyi_advertisement_page|daoyi_advertisement_click"
const val POSITION_DAOYI_ADVERTISEMENT_VISIT="daoyi_advertisement_page|daoyi_advertisement_visit"
const val PART_ID_CONSULT_COUNSELOR_LIST_PAGE="consult_counselor_list_page" // 咨询师列表页面浏览part_id
const val PART_ID_YDL_USER_MAIN_PAGE="ydl_user_main_page" // 联想词part_id
const val POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT="consult_counselor_list_page_visit" // 咨询师列表页面浏览position
const val POSITION_YDL_USER_ASSOCIATE_WORD_VISIT="ydl_user_associate_word_visit" // 联想词曝光position
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
}
//====================APP咨询列表页(app_consult_list_page)====================
......@@ -51,6 +56,10 @@ class ConsultBIConstants {
const val YDL_USER_CONSULT_TYPE_CLICK: String =
APP_CONSULT_LIST_PAGE + "ydl_user_consult_type_click"//咨询师顶部ICON 厌学专题、限时特惠、精神心理
const val POSITION_CONSULT_COUNSELOR_CARD_CLICK="consult_counselor_card_click" // 咨询师列表点击position
const val POSITION_CHOICE_FILTER_CLICK="choice_filter_click" // 热门点击项position
const val POSITION_TWO_CATEGORY_CLICK="two_category_click" // 八大类标签选择埋点
const val POSITION_GOODAT_CROWD_CLICK="goodat_crowd_click" // 擅长人群埋点
}
}
class ConsultSearchListEvent {
......@@ -69,8 +78,7 @@ class ConsultBIConstants {
class UserMainEvent {
companion object {
private const val YDL_USER_MAIN_PAGE: String =
"ydl_user_main_page|"//壹点灵用户版首页 partId
private const val YDL_USER_MAIN_PAGE: String = "ydl_user_main_page|"//壹点灵用户版首页 partId
const val YDL_USER_SEARCH_CLICK: String =
YDL_USER_MAIN_PAGE + "ydl_user_search_click" //搜索栏
......
......@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable
/**
......@@ -26,6 +27,11 @@ class IHotSearchContract {
* 请求失败
*/
fun requestFail()
/**
* 联想词请求成功结果
*/
fun getSearchWordsSuccess(searchWordsBean: SearchWordsBean,searchContent:String,isClickWords:Boolean)
}
interface Presenter : IPresenter<View> {
......@@ -38,6 +44,11 @@ class IHotSearchContract {
* 搜索页接口请求
*/
fun searchData()
/**
* 获取联想词
*/
fun getSearchWords(map:HashMap<String,Any>,searchContent:String,isClickWords:Boolean)
}
interface Model : IModel {
......@@ -45,5 +56,10 @@ class IHotSearchContract {
* 搜索页接口
*/
fun searchData(): Observable<HotSearchBean>
/**
* 获取到联想词
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean>
}
}
\ No newline at end of file
......@@ -5,8 +5,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.ExpertBean
import io.reactivex.Observable
/**
......@@ -45,9 +44,13 @@ class ExpertSearchHttpImpl : IExpertSearchHttp {
return searchApi!!
}
override fun searchDoctor(params: String?): Observable<BaseAPIResponse<ExpertSearchBean>> {
return getSearchApi().searchDoctorService(HttpConfig.JAVA_BASE_URL+ "doctor/nlist?"+params)
// override fun searchDoctor(params: String?): Observable<BaseAPIResponse<ExpertSearchBean>> {
// return getSearchApi().searchDoctorService(HttpConfig.JAVA_BASE_URL+ "doctor/nlist?"+params)
//
// }
override fun getExpertList(map: Map<String, Any>): Observable<BaseAPIResponse<ExpertBean>> {
return getSearchApi().getExpertList(map)
}
override fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>> {
......
......@@ -2,8 +2,8 @@ package com.yidianling.consultant.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean
import io.reactivex.Observable
/**
......@@ -17,7 +17,17 @@ interface IExpertSearchHttp{
/**
* 专家搜索页请求
*/
fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
// fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 获取搜索联想词
*/
// fun getSearchWords(map:Map<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
/**
* 获取专家列表
*/
fun getExpertList(map:Map<String,Any>): Observable<BaseAPIResponse<ExpertBean>>
/**
* 获取当前筛选条件结果数
......
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.http.ExpertSearchParam
import com.yidianling.consultant.model.SearchApi
import io.reactivex.Observable
......@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp {
getSearchApi().searchPage()
}
}
override fun getSearchWords(map: HashMap<String, Any>): Observable<BaseAPIResponse<SearchWordsBean>> {
return getSearchApi().getSearchWords(map)
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable
/**
......@@ -13,7 +14,12 @@ import io.reactivex.Observable
*/
interface IHotSearchHttp{
/**
* 测评首页请求
* 搜索页请求
*/
fun searchData(): Observable<BaseAPIResponse<HotSearchBean>>
/**
* 搜索联想词请求
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
}
\ No newline at end of file
package com.yidianling.consultant.listener
import com.yidianling.consultant.model.bean.CateItem
/**
* Created by zqk on 17-9-20.
*/
interface OnCategoriesSelectedListener {
fun onCategoriesSelected(categories: ArrayList<CateItem>)
fun onCategoriesSelected(signLit:ArrayList<String>)
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yidianling.consultant.model
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import io.reactivex.Observable
......@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{
override fun searchData(): Observable<HotSearchBean> {
return HotSearchDataManager.getHttp().searchData().compose(RxUtils.resultJavaData())
}
override fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean> {
return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData())
}
}
\ No newline at end of file
......@@ -9,7 +9,8 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable
import retrofit2.http.*
......@@ -38,14 +39,25 @@ interface SearchApi {
fun listHead(@FieldMap maps: Map<String, String>): Observable<BaseResponse<HeadData>>
//搜索条件
@GET("consult/search/v2/conditions")
@GET("consult/search/v3/conditions")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//专家服务搜索
@retrofit2.http.Headers("Content-Type:application/json")
@GET
fun searchDoctorService(@Url url: String): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 新咨询师列表接口(包含搜索、筛选咨询师)
*/
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: plough_cloud")
@POST("smart-rank/v1/search")
fun getExpertList(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<ExpertBean>>
/**
* 获取搜索联想词
*/
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@POST("dmp/v1/searchsuggest")
fun getSearchWords(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<SearchWordsBean>>
//搜索页面接口
@retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
......@@ -7,5 +7,5 @@ data class AgeItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null
val key: Int
)
\ No newline at end of file
......@@ -23,5 +23,30 @@ data class AllFilter(
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList(), //资质
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList() // 擅长人群
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList(), // 擅长人群
// 八大类标签集合
val childList:ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val stressList:ArrayList<ChildrenBean> = ArrayList(), // 情绪压力
val loveEmotionList:ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康
// 八大类已选中标签id集合
val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合
val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val chooseChildIndexList:ArrayList<Int> = ArrayList(),
val chooseStressIndexList:ArrayList<Int> = ArrayList(),
val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(),
val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(),
val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(),
val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(),
val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(),
val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList()
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
import android.os.Parcel
import android.os.Parcelable
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.google.gson.annotations.SerializedName
data class CateItem(
......@@ -10,30 +9,23 @@ data class CateItem(
var cateName: String? = null,
@field:SerializedName("cate_id")
var cateId: String? = null
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString()
) {
}
var cateId: String? = null,
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(cateName)
parcel.writeString(cateId)
}
@field:SerializedName("children")
var children: ArrayList<ChildrenBean>?=null
)
override fun describeContents(): Int {
return 0
}
data class ChildrenBean(var cate_name: String,var cate_id:String,var isVisible: Boolean, var type: Int): MultiItemEntity {
// @field:SerializedName("cate_name")
// var cateName: String? = null,
// @field:SerializedName("cate_id")
// var cateId: String? = null,
companion object CREATOR : Parcelable.Creator<CateItem> {
override fun createFromParcel(parcel: Parcel): CateItem {
return CateItem(parcel)
}
// var isVisible: Boolean = false // 是否显示
var isSelected: Boolean = false // 是否选中
override fun newArray(size: Int): Array<CateItem?> {
return arrayOfNulls(size)
}
override fun getItemType(): Int {
return type
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ data class EnquiryItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null,
val key: Int,
val checkRrl: String?,
val unCheckUrl: String?
......
package com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class ExpertBean(
val amount : Int = 0,
val skip : Int = 0,
val limit : Int = 0,
val size : Int = 10,
val objects : MutableList<ExpertServiceItem>,
// 分页需要
val extras: Extras?)
data class Extras(
val skips: HashMap<String, Int>
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class ExpertSearchBean(val endRow : Int = 0,
val hasNextPage : Boolean = false,
val hasPreviousPage : Boolean = false,
val isFirstPage : Boolean = false,
val isLastPage : Boolean = false,
/**
* 数据列表
*/
val list : MutableList<DoctorServiceItem>?,
val navigateFirstPage : Int = 0,
val navigateLastPage : Int = 0,
val navigatePages : Int = 0,
val navigatepageNums : MutableList<Int>?,
val nextPage : Int = 0,
val pageNum : Int = 0,
val pageSize : Int = 0,
/**
* 总页数
*/
val pages : Int = 0,
val prePage : Int = 0,
val size : Int = 0,
val startRow : Int = 0,
/**
* 数据总条数
*/
val total : Int = 0)
\ No newline at end of file
......@@ -10,11 +10,11 @@ import com.yidianling.consultant.bean.ExpertSearchTagsIconBean
* @Company 壹点灵
* @date 2018/12/11
*/
data class DoctorServiceItem(
data class ExpertServiceItem(
/**
* 专家ID
*/
val doctorId: String?,
val id: String,
/**
* 专家uid
*/
......@@ -22,11 +22,11 @@ data class DoctorServiceItem(
/**
* 专家名称
*/
val name: String?,
val doctor_name: String?,
/**
* 跳转路由地址(正常为专家主页地址)
*/
val linkUrl: String?,
val link_url: String?,
/**
* 专家头像地址
*/
......@@ -34,7 +34,7 @@ data class DoctorServiceItem(
/**
* 专家是否在线 1.在线
*/
val isOnline: Int?,
val chat_status: Int?,
/**
* 能力等级 1.实习 2.新手 3.精英
*/
......@@ -42,7 +42,7 @@ data class DoctorServiceItem(
/**
* 有免费咨询:1.有,2.无
*/
val hasServiceFree: Int?,
val has_servicefree_consult: Int?,
/**
* 活动图标
*/
......@@ -54,11 +54,11 @@ data class DoctorServiceItem(
/**
* 是否新入驻:true:是,false:否
*/
var isNewEnter: Boolean = false,
var is_new_enter: Boolean?,
/**
* 好评率(倾诉+咨询)
*/
var feedbackRate: Float = 0f,
var evaluation_average_score: Float = 0f,
/**
* 是否抗疫先锋图标
*/
......@@ -66,59 +66,62 @@ data class DoctorServiceItem(
/**
* 评价数(咨询订单数)
*/
var zixunOrderNum: Int = 0,
var evaluate_num: Int = 0,
/**
* 咨询最低价
*/
val minBookingPrice: String?,
val min_price: String?,
/**
* 资质材料
*/
val teamCertifications: String?,
/**
* 标签分类
*/
val tags: String?,
val title: String?,
/**
* 已帮助人数(咨询人数)
*/
val zixunOrderUser: String?,
val help_num: String?,
/**
* 月售时长
*/
var saleDurationForMonth: Float = 0f,
var p30d_sold_hour: Float = 0f,
/**
* 服务时长
*/
var allSaleDuration: Float = 0f,
var sum_service_time: Float = 0f,
/**
* 服务
*/
val products: MutableList<ExpertSearchProductsBean>?,
val doctor_products: MutableList<ExpertSearchProductsBean>?,
/**
* 标签图片
*/
val tagsIcon: ExpertSearchTagsIconBean?,
/**
* 今日是否可约
*/
val isTodayFree: Boolean?,
/**
* 是否咨询中
*/
var inConsult: Boolean = false,
/**
* 是否聆听中
*/
var isListening: Boolean = false,
val icons: ExpertSearchTagsIconBean?,
// /**
// * 今日是否可约
// */
// val booking_status: Int,
// /**
// * 咨询状态 1-待服务 2-服务中
// */
// var consult_status: Int,
// /**
// * 倾诉状态 1-待服务 2-服务中
// */
// var listen_status: Int,
var open_chat_agency:Int,
var service_status:Int,
var is_free_today:Int,
/**
* 私聊人数
*/
var chatNum: Int = 0,
var chat_num: Int = 0,
/**
* 个人铭言
*/
val famousRemark: String?,
val famous_remark: String?,
/**
* 省
*/
......@@ -130,15 +133,36 @@ data class DoctorServiceItem(
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
val chatBtnText: String?,
val chat_btn_text: String?,
/**
* 新标签分类
*/
val tagList: ArrayList<TagBean>?
)
val feature_tags: ArrayList<FeatureTag>?,
/**
* 是否是头部headView
*/
val is_head_view:Boolean=false,
/**
* 搜索词
*/
val search_content:String,
/**
* 联想词
*/
val related_word:String
) {
constructor(is_head_view: Boolean,search_content: String,related_word:String) : this("","","","","",
1,1,1,"",false,true,
1f,false,0,"","","",1f,1f,
null,null,1,1,1,1,
"","","","",null,is_head_view,search_content,related_word)
}
data class TagBean(
val tagName:String?,
val isHigh:Int
data class FeatureTag(
val tag_id:String,
val tag_name:String,
val is_highlight:Boolean, // 是否高亮
val type:String // 标签类型
)
\ No newline at end of file
......@@ -45,12 +45,6 @@ data class Filters(
@field:SerializedName("title")
val title: List<ReorderItem> = ArrayList(),
// /**
// * 擅长人群
// */
// @field:SerializedName("crowdsTags")
// val crowdsTags: List<AgeItem> = ArrayList()
/**
* 擅长人群
......
......@@ -8,5 +8,11 @@ data class OtherItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null
val key: Int? = null,
@field:SerializedName("value1")
val value1: String,
@field:SerializedName("key1")
val key1: String
)
\ No newline at end of file
......@@ -8,5 +8,11 @@ data class ReorderItem(
var value: String? = null,
@field:SerializedName("key")
var key: String? = null
var key: String? = null,
@field:SerializedName("value1")
var value1: String="",
@field:SerializedName("key1")
var key1: String=""
)
\ No newline at end of file
//package com.yidianling.consultant.model.bean
//
//import com.google.gson.annotations.SerializedName
//
//data class ServiceItem(
//
// @field:SerializedName("doctor_uid")
// val doctorUid: Int = 0,
//
// @field:SerializedName("city")
// val city: String? = null,
//
// @field:SerializedName("product_name")
// val productName: String? = null,
//
// @field:SerializedName("tags")
// val tags: List<String?> = ArrayList(),
//
// @field:SerializedName("uid")
// val uid: Int? = null,
//
// @field:SerializedName("doctor_id")
// val doctorId: Int? = null,
//
// @field:SerializedName("feedback_rate")
// val feedbackRate: String? = null,
//
// @field:SerializedName("doctor_head")
// val doctorHead: String? = null,
//
// @field:SerializedName("province")
// val province: String? = null,
//
//
// @field:SerializedName("doctor_name")
// val doctorName: String? = null,
//
// @field:SerializedName("m_url")
// val mUrl: String? = null,
//
// @field:SerializedName("h_url")
// val hUrl: String? = null,
//
// @field:SerializedName("is_online")
// val isOnline: Int = 0 //1在线,2离线
//)
\ No newline at end of file
......@@ -418,7 +418,7 @@ class ConsultAssistantDialogUtils private constructor() {
.getSecondTaskActivity()?.finish()
activity.finish()
} else {
if (null != activity && !activity.isFinishing) {
if (!activity.isFinishing) {
activity.finish()
}
}
......@@ -432,10 +432,10 @@ class ConsultAssistantDialogUtils private constructor() {
ffrom
)
}
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}
}
)
......
......@@ -53,7 +53,7 @@ object TempH5RouteUtils {
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
val params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation()
return
}catch (e : NullPointerException){
......
package com.yidianling.consultant.presenter
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.google.gson.Gson
......@@ -8,11 +9,14 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.model.HotSearchModelImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
/**
* @author yuanwai
* @描述:搜索页面逻辑实现类
......@@ -20,8 +24,7 @@ import io.reactivex.functions.Consumer
* @Company 壹点灵
* @date 2019/3/19
*/
class HotSearchPresenterImpl () :
BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
class HotSearchPresenterImpl : BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
/**
* 实例化数据模型
......@@ -57,6 +60,7 @@ class HotSearchPresenterImpl () :
/**
* 搜索页接口
*/
@SuppressLint("CheckResult")
override fun searchData() {
mModel.searchData().map { it }
.filter { it != null }
......@@ -71,4 +75,20 @@ class HotSearchPresenterImpl () :
}
})
}
@SuppressLint("CheckResult")
override fun getSearchWords(map:HashMap<String,Any>,searchContent:String,isClickWords:Boolean) {
mModel.getSearchWords(map)
// .debounce(500L, TimeUnit.MILLISECONDS)
.compose(RxLifecycleUtils.bindToLifecycle(mView))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.getSearchWordsSuccess(it,searchContent,isClickWords)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
ToastUtil.toastShort(msg)
}
})
}
}
\ No newline at end of file
......@@ -4,47 +4,40 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.os.Build
import androidx.core.content.ContextCompat
import android.text.*
import android.text.style.AbsoluteSizeSpan
import android.util.Log
import android.view.*
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.*
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.model.bean.AllFilter
import com.yidianling.consultant.model.bean.Filters
import com.yidianling.consultant.model.bean.PriceRangesItem
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_item_filter.view.*
import kotlinx.android.synthetic.main.consultant_item_price_range.view.*
import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.*
import kotlin.math.roundToInt
/**
* 筛选弹窗
* Created by zqk on 17-9-15.
*/
class FilterPopupWindow(
private val context: Context,
private val filterData: Filters,
private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
class FilterPopupWindow(private val context: Context, private val filterData: Filters, private val tempFilter: AllFilter) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private val mDisposableList = CompositeDisposable()
......@@ -121,7 +114,7 @@ class FilterPopupWindow(
@SuppressLint("ClickableViewAccessibility")
private fun initKeyboardListener(view: View) {
var svFilter = view.findViewById<ScrollView>(R.id.sv_filter)
val svFilter = view.findViewById<ScrollView>(R.id.sv_filter)
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
svFilter.setOnTouchListener { _, _ ->
......@@ -246,13 +239,6 @@ class FilterPopupWindow(
biEventParams = tempFilter.doctorEdu.map { it.value }.joinToString(",")
}
}
// 擅长人群拼接
if (tempFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(tempFilter.specialityCrowd.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_GOOD_AT_CLICK==biEventName){
biEventParams = tempFilter.specialityCrowd.map { it.key }.joinToString(",")
}
}
if (tempFilter.others.isNotEmpty()) {
sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) {
......@@ -282,50 +268,49 @@ class FilterPopupWindow(
account += tempFilter.priceRanges?.maxPrice?.toDouble()!!
}
biEventParams = (Math.round(account / 2)).toString()
biEventParams = ((account / 2).roundToInt()).toString()
}
}
//用户行为数据埋点
biEvent(biEventName, biEventParams)
// sb.append("&page=").append(1)
ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
//按钮置灰/解除置灰
contentView.btnConfirm.isEnabled = it > 0
if (it > 0) {
contentView.btnConfirm.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_but_text_color
)
)
contentView.btnConfirm.background =
ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_dark)
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white))
} else {
contentView.btnConfirm.setTextColor(
ContextCompat.getColor(
context,
R.color.platform_text_light_color
)
)
contentView.btnConfirm.background =
ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_light)
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999))
}
}, {
ToastHelper.show(it.message!!)
})
// ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
// .subscribeOn(Schedulers.io())
// .compose(RxUtils.resultJavaData())
// .map { it }
// .filter { true }
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe({
//
// contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
// //按钮置灰/解除置灰
// contentView.btnConfirm.isEnabled = it > 0
// if (it > 0) {
// contentView.btnConfirm.setTextColor(
// ContextCompat.getColor(
// context,
// R.color.platform_but_text_color
// )
// )
// contentView.btnConfirm.background =
// ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_dark)
//// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white))
// } else {
// contentView.btnConfirm.setTextColor(
// ContextCompat.getColor(
// context,
// R.color.platform_text_light_color
// )
// )
// contentView.btnConfirm.background =
// ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_light)
//// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999))
// }
//
// }, {
// ToastHelper.show(it.message!!)
// })
}
private fun biEvent(biEventName: String, biEventParams: String = "") {
......@@ -465,7 +450,6 @@ class FilterPopupWindow(
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
updateCount(ConsultBIConstants.POSITION_GOOD_AT_CLICK)
}
if (index>19){
......
......@@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.consultant_ui_sort_popup_window.view.*
* 排序弹窗
* Created by zqk on 17-9-15.
*/
class SortPopupWindow(val context: Context, private val sortItems: ArrayList<ReorderItem>, var selectedSort: ReorderItem, private val onSortItemSelectedListener: OnSortItemSelectedListener)
class SortPopupWindow(val context: Context, sortItems: ArrayList<ReorderItem>, var selectedSort: ReorderItem, onSortItemSelectedListener: OnSortItemSelectedListener)
: PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private var adapter: SortRecyclerViewAdapter
......@@ -31,12 +31,7 @@ class SortPopupWindow(val context: Context, private val sortItems: ArrayList<Reo
val rvSortItem = view.rvSortItem
adapter = SortRecyclerViewAdapter(context, sortItems, selectedSort, onSortItemSelectedListener)
rvSortItem.adapter = adapter
rvSortItem.layoutManager =
LinearLayoutManager(
context,
LinearLayoutManager.VERTICAL,
false
)
rvSortItem.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
// rvSortItem.addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL))
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<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="8dp" />
<stroke
android:width="1dp"
android:color="@color/platform_color_EBEBEB" />
</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="4dp" />
<stroke
android:width="0.5dp"
android:color="@color/platform_color_EBEBEB" />
<solid android:color="#f9f9f9" />
</shape>
\ No newline at end of file
<?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="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_search_words"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="19dp"
android:paddingEnd="19dp"
android:visibility="gone"
>
<TextView
android:id="@+id/tv_search_related_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textSize="15sp"
android:fontFamily="sans-serif"
android:layout_marginTop="14dp"
android:includeFontPadding="false"
tools:text="根据匹配,为您推荐恋爱情感相关词" />
<TextView
android:id="@+id/tv_search_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_search_word"
app:layout_constraintBottom_toBottomOf="@id/tv_search_word"
android:textSize="15sp"
android:textColor="@color/platform_color_666666"
android:fontFamily="sans-serif"
android:includeFontPadding="false"
android:text="仍搜索" />
<TextView
android:id="@+id/tv_search_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/tv_search_tips"
app:layout_constraintTop_toBottomOf="@id/tv_search_related_word"
android:layout_marginTop="9dp"
android:layout_marginStart="6dp"
android:textSize="14sp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:textColor="@color/platform_color_242424"
android:includeFontPadding="false"
android:background="@drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4"
tools:text="恋爱情感"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ 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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:src="http://schemas.android.com/tools"
android:paddingTop="12dp"
android:paddingBottom="12dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:src="@drawable/consultant_icon_input_search"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="@+id/tv_search_words"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
src:text="李哈哈"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/platform_color_242424"
android:layout_marginStart="38dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingTop="12dp"
android:orientation="vertical"
android:id="@+id/ll_sort_item"
>
<TextView
android:id="@+id/tv_sort_name"
android:layout_width="75dp"
android:layout_height="34dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14sp"
tools:text="恋爱婚姻" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingTop="12dp"
android:orientation="vertical"
android:id="@+id/ll_sort_item"
>
<TextView
android:id="@+id/tv_sort_name"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14sp"
tools:text="恋爱婚姻" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvSubjectName"
android:layout_width="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14dp"
tools:text="恋爱婚姻" />
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_sort_name"
android:layout_width="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14dp"
tools:text="恋爱婚姻" />
......@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/platform_white"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
......
......@@ -211,12 +211,11 @@
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/consultant_bg_radius_5_light"
android:background="@drawable/consultant_bg_radius_5_dark"
android:gravity="center"
android:hint="暂无匹配咨询师"
android:textColor="@color/platform_but_text_color"
android:hint="确定"
android:textColor="@color/white"
android:textColorHint="@color/platform_color_E0E0E0"
android:textSize="16sp" />
</LinearLayout>
......
......@@ -290,9 +290,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
return
}
EventBus.getDefault().post(
HomeModuleTabEvent(
2
)
HomeModuleTabEvent(2,"11")
)
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_CLICK)
}
......
......@@ -75,7 +75,7 @@ interface IHomeBaseEvent {
fun categoryClick(category: HomeHeaderBean.AskCategoryDataBean)
/**
* 预约专家点击事件
* 心理咨询点击事件
*/
fun reservationExpertsClick()
......
......@@ -3,6 +3,12 @@ package com.yidianling.home.api.event;
public class HomeModuleTabEvent {
private int tabIndex;
public String sign; // 用于埋点参数
public HomeModuleTabEvent(int index,String sign) {
tabIndex = index;
this.sign =sign;
}
public HomeModuleTabEvent(int index) {
tabIndex = index;
......
......@@ -120,10 +120,10 @@ class YdlHomeAdapter(private val mContext: Context,
}
override fun getItemViewType(position: Int): Int {
if (position < list.size) {
return list[position].type!!
return if (position < list.size) {
list[position].type!!
} else {
return -1
-1
}
}
......
......@@ -151,10 +151,9 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private fun initView() {
if (HomeViewConfig.getOrder().bannerIndex == null || HomeViewConfig.getOrder().bannerIndex == -1) {
var marginTop = this.resources.getDimension(R.dimen.home_home_title_bar_height)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
marginTop += statusBarHeight
}
//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
marginTop += statusBarHeight
val lp = home_swipe_refresh_layout.layoutParams as FrameLayout.LayoutParams
lp.topMargin = marginTop.toInt()
home_swipe_refresh_layout.layoutParams = lp
......@@ -185,17 +184,16 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_rl_top_bg.layoutParams = lp1
//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
val homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_rl_top_bg.layoutParams = lp1
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
override fun initDataAndEventLazy() {
......@@ -303,7 +301,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
val act = homeHeaderBean.activityResponse
if (act != null) {
if (!TextUtils.isEmpty(act!!.imageUrl)) {
if (!TextUtils.isEmpty(act.imageUrl)) {
img_ad.visibility = View.VISIBLE
ActionCountUtils.count(HomeBIConstants.YDL_HOME_SEARCH_TAG,act.title?:"1")
......
......@@ -68,9 +68,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
*/
private fun initButtonView() {
if (null == buttonParams) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
var viewHeight = viewWidth * 78 / 80
val screenWidth = RxDeviceTool.getScreenWidth(mContext)
val viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
val viewHeight = viewWidth * 78 / 80
buttonParams = LinearLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame = FrameLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame2= FrameLayout.LayoutParams((viewWidth/2.0).toInt(), (viewHeight/2.3).toInt())
......
......@@ -80,6 +80,8 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
//防止连击
return@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_MORE_CLICK)
if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null))
}
......
......@@ -90,6 +90,7 @@ dependencies {
implementation 'com.netease.nimlib:nrtc:9.1.1'
api rootProject.ext.dependencies["ydl-user-router"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api 'com.tencent.tbs.tbssdk:sdk:43903'
if (rootProject.ext.dev_mode){
//开发时使用
......
package com.yidianling.im.event
data class CloseBottomWebviewEvent( var close:Boolean)
\ No newline at end of file
......@@ -71,6 +71,7 @@ import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.bean.RemoveHistory;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.event.CloseBottomWebviewEvent;
import com.yidianling.im.event.MultipleAnswerBean;
import com.yidianling.im.event.MultipleSelectedEvent;
import com.yidianling.im.helper.IMChatUtil;
......@@ -916,7 +917,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.subscribe(res -> {
if (res.data != null && res.data.size() > 0) {
if (getActivity() != null && expertConsultServiceListDialog == null) {
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data,isBusy,sessionId);
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data,isBusy,sessionId,
ActionHandlerStorage.getL(sessionId).getInfo().doctorId
);
expertConsultServiceListDialog.show();
}
} else {
......@@ -1151,6 +1154,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
answerMultipleQuestion(multipleAnswerBean);
}
}
public void onEvent(CloseBottomWebviewEvent event){
expertConsultServiceListDialog.changeItem();
}
private void updateLocalMsg(Integer position,ArrayList<String> selectedPosition) {
IMMessage message=ImIn.INSTANCE.getImMessage();
//更新本地消息
......
......@@ -47,10 +47,17 @@ public class ServiceItemBean {
*/
private ProductDtoBean productDto;
private int catenewId;
private ProductCategoryDtoBean productCategoryDto;
private int isPushToBg;
private List<ProductSpecDtosBean> productSpecDtos;
public int getcatenewId() {
return catenewId;
}
public void setcatenewId(int cateId) {
this.catenewId = cateId;
}
public ProductDtoBean getProductDto() {
return productDto;
}
......@@ -83,6 +90,7 @@ public class ServiceItemBean {
this.productSpecDtos = productSpecDtos;
}
public static class ProductDtoBean {
/**
* id : 91170418024616
......
package com.yidianling.uikit.custom.widget.expertConsultService.view
import `in`.srain.cube.views.GridViewWithHeaderAndFooter
import android.app.Dialog
import android.content.Context
import android.os.Bundle
......@@ -17,7 +16,6 @@ import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachSubScriptTime
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
......@@ -32,13 +30,16 @@ import kotlinx.android.synthetic.main.im_expert_consult_service_list_dialog_layo
*
* @param mIsBusy 咨询师是否是繁忙状态
*/
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>,val mIsBusy: Boolean,val toUid:String): Dialog(mContext, R.style.dialog_default_style) {
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>,val mIsBusy: Boolean,
val toUid:String,val doctorID:String): Dialog(mContext, R.style.dialog_default_style) {
private var mConsultServiceListView: ExpertConsultServiceView? = null
private var mConsultServiceDetailView: ExpertConsultServiceDetailView? = null
private var mWebviewView: ExpertConsultWebview? = null
private var mViewList: ArrayList<View> = ArrayList()
private var mSelectType: String = "全部"
fun changeItem(){
dialog_bottom_scroll_view.currentItem = 0
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -65,11 +66,13 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
}
override fun onItemClick(serviceBean: ServiceItemBean.ProductsBean) {
if (mConsultServiceDetailView != null) {
mConsultServiceDetailView?.updateData(serviceBean)
dialog_bottom_scroll_view.currentItem = 1
}
// if (mConsultServiceDetailView != null) {
// mConsultServiceDetailView?.updateData(serviceBean)
// dialog_bottom_scroll_view.currentItem = 1
// }
mWebviewView?.setData(serviceBean)
dialog_bottom_scroll_view.currentItem = 1
}
override fun addTime() { // 提醒添加时间回调
......@@ -99,13 +102,15 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
mViewList.add(mConsultServiceListView as View)
mConsultServiceDetailView = ExpertConsultServiceDetailView(mContext, object : ConsultServiceViewCallback {
override fun onBackClick() {
dialog_bottom_scroll_view.currentItem = 0
}
},mIsBusy,toUid)
// mConsultServiceDetailView = ExpertConsultServiceDetailView(mContext, object : ConsultServiceViewCallback {
// override fun onBackClick() {
// dialog_bottom_scroll_view.currentItem = 0
// }
// },mIsBusy,toUid)
mViewList.add(mConsultServiceDetailView as View)
// mViewList.add(mConsultServiceDetailView as View)
mWebviewView= ExpertConsultWebview(mContext,doctorID =doctorID )
mViewList.add(mWebviewView as View)
dialog_bottom_scroll_view.adapter = ConsultServicePagerAdapter()
dialog_bottom_scroll_view.currentItem = 0
......
......@@ -121,6 +121,7 @@ class ExpertConsultServiceView : LinearLayout {
if (itemBean.cateName == mTypeList[typeSelectedIndex] || typeSelectedIndex == 0) {
itemBean.products.forEach {
lastList.add(it)
it.setcatenewId(itemBean.cateId)
}
}
}
......
package com.yidianling.uikit.custom.widget.expertConsultService.view
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.view.View
import android.widget.RelativeLayout
import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.*
import com.ydl.utils.WebUrlParamsUtils
import com.ydl.webview.ProgressWebView
import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils
import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
class ExpertConsultWebview : RelativeLayout {
private var doctorID: String
private lateinit var productBean: ServiceItemBean.ProductsBean
private var cateID: Int = 0
private var jumpUrl = ""
private lateinit var wv_content:ProgressWebView
constructor(context: Context, doctorID: String) : super(context) {
mContext = context
this.doctorID = doctorID
initView()
}
private var mContext: Context? = null
private fun initView() {
val mWidth: Int = RxDeviceTool.getScreenWidth(mContext)
val mHeight: Int = LayoutParams.MATCH_PARENT
val params = LayoutParams(
mWidth,
mHeight
)
params.height = mHeight
layoutParams = params
var view = View.inflate(mContext, R.layout.im_expert_consult_webview_view, this)
wv_content= view.findViewById<ProgressWebView>(R.id.wv_content)
webViewInit(wv_content, doctorID)
}
fun setData(productBean: ServiceItemBean.ProductsBean) {
this.productBean = productBean
// this.cateID=cateid
jumpUrl =
HttpConfig.MH5_URL + "wb/product/chat/template?doctorId=${doctorID}&cateId=${productBean.getcatenewId()}&productId=${productBean.productDto.id}"
val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, tellData = TellData())
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
wv_content.loadUrl(url)
}
private fun shouldOverridePayUrl(view: WebView, url: String): Boolean {
if (url.startsWith("weixin://")) {
return try {
mContext?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
true
} catch (e: java.lang.Exception) {
// 防止手机没有安装处理某个 scheme 开头的 url 的 APP 导致 crash
ToastUtil.toastShort("该手机没有安装微信")
true
}
} else if (url.startsWith("alipays://") || url.startsWith("alipay")) {
return try {
mContext?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
true
} catch (e: java.lang.Exception) {
// 防止手机没有安装处理某个 scheme 开头的 url 的 APP 导致 crash
// 启动支付宝 App 失败,会自行跳转支付宝网页支付
true
}
}
// 处理普通 http 请求跳转
// if (!(url.startsWith("http") || url.startsWith("https"))) {
// return true;
// }
// 处理微信 H5 支付跳转时验证请求头 referer 失效
// 验证不通过会出现“商家参数格式有误,请联系商家解决”
if (url.contains("wx.tenpay.com")) {
// 申请微信 H5 支付时填写的域名
// 比如经常用来测试网络连通性的 http://www.baidu.com
val parse = Uri.parse(url)
//从url 中获取 域名信息
val redirectUrlStr = parse.getQueryParameter("redirect_url")
val redirectUrl = Uri.parse(redirectUrlStr)
// 申请微信 H5 支付时填写的域名
val referer = redirectUrl.scheme + "://" + redirectUrl.host
// 兼容 Android 4.4.3 和 4.4.4 两个系统版本设置 referer 无效的问题
return if ("4.4.3" == Build.VERSION.RELEASE
|| "4.4.4" == Build.VERSION.RELEASE
) {
// 返回 false 由系统 WebView 自己处理该 url
false
} else {
// HashMap 指定容量初始化,避免不必要的内存消耗
val map = HashMap<String, String>(1)
map["Referer"] = referer
view.loadUrl(url, map)
true
}
} else if (url.contains("alipay")) {
return false
}
return false
}
fun webViewInit(wv_content: ProgressWebView, doctorID: String) {
val setting: WebSettings = wv_content?.settings!!
//支持js
//支持js
setting.setJavaScriptEnabled(true)
//设置字符编码
//设置字符编码
setting.setDefaultTextEncodingName("GBK")
setting.setDomStorageEnabled(true)
val appCachePath: String = mContext?.getCacheDir()?.getAbsolutePath().toString()
setting.setAppCachePath(appCachePath)
setting.setAllowFileAccessFromFileURLs(true)
setting.setAppCacheEnabled(true)
setting.setAllowFileAccess(true)
setting.setBlockNetworkImage(false)
wv_content!!.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, tellData = TellData())
wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler")
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
wv_content.loadUrl(url)
wv_content.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(webview: WebView, url: String?): Boolean {
if (url.isNullOrBlank()) return false
return shouldOverridePayUrl(webview, url)
}
}
wv_content.webChromeClient = object : WebChromeClient() {
override fun onJsAlert(
webView: WebView,
s: String,
s1: String,
jsResult: JsResult
): Boolean {
return super.onJsAlert(webView, s, s1, jsResult)
}
override fun onProgressChanged(view: WebView, newProgress: Int) {
super.onProgressChanged(view, newProgress)
}
override fun onReceivedTitle(view: WebView, title: String) {
super.onReceivedTitle(view, title)
}
// For Android < 3.0
fun openFileChooser(valueCallback: ValueCallback<Uri?>) {
}
// For Android >= 3.0
fun openFileChooser(valueCallback: ValueCallback<*>, acceptType: String?) {
}
//For Android >= 4.1
override fun openFileChooser(
valueCallback: ValueCallback<Uri>,
acceptType: String,
capture: String
) {
}
// For Android >= 5.0
override fun onShowFileChooser(
webView: WebView,
filePathCallback: ValueCallback<Array<Uri>>,
fileChooserParams: FileChooserParams
): Boolean {
return true
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:ignore="MissingDefaultResource">
<com.ydl.webview.ProgressWebView
android:id="@+id/wv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
\ No newline at end of file
......@@ -153,6 +153,8 @@ class PlayMeditationActivity : BaseActivity() {
mBuried = meditation.buried
mStatus = meditation.status
collected = mStatus == 1
updateUI()
initMediaPlayer(
......
......@@ -28,7 +28,7 @@ class MediaPlayerTimeUtil {
"$minute:$second"
}
}
}else if (time<60){
}else if (time in 1..59){
second = time
return if (second in 0..9){
"00:0$second"
......@@ -36,7 +36,7 @@ class MediaPlayerTimeUtil {
"00:$second"
}
}
return null
return ""
}
fun formatTimeOff(finishTime:Long):String{
......
......@@ -121,7 +121,8 @@ object LoginUtils {
if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity
ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) {
activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
UserIn.mainIntent(activity)
// activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
} else {
UserIn.mainIntent(activity)
}
......@@ -150,7 +151,8 @@ object LoginUtils {
} else {
ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) {
activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
UserIn.mainIntent(activity)
// activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
} else {
UserIn.mainIntent(activity)
}
......
......@@ -32,21 +32,40 @@ class UserBIConstants {
const val POSITION_ALIYUN_REGISTER_CLICK = "aliyun_register_click" //阿里云第一次一键登录
const val POSITION_CODE_REGISTER_CLICK = "code_register_click" //短信第一次登录
const val POSITION_FIRST_LOAD_AND_OPEN_CLICK = "activation_click" //第一次安装并且第一打开
//随便逛逛点击
const val POSITION_LOOK_AROUND_CLICK = "look_around_click"
//登录主页浏览事件(包含随便逛逛)
const val POSITION_LOGIN_ONE_PAGE_VISIT = "login_main_one_page_visit"
//登录主页浏览事件(不包含随便逛逛)
const val POSITION_LOGIN_TWO_PAGE_VISIT = "login_main_two_page_visit"
//隐私授权页事件埋点
const val PRIVACY_AUTHORIZATION_CLICK =
"privacy_authorization_page|privacy_authorization_click"
//手机注册页 手机号一键登录页右上角点击跳过
const val USER_REGISTER_PAGE_SKIP_CLICK = "user_register_page|skip_click"
//隐私授权二次确认弹窗
const val PRIVACY_AUTHORIZATION_TWO_CLICK =
"privacy_authorization_page|privacy_authorization_two_click"
//百度监测 用户信息收集页面
const val COLLECT_USER_INFO_PAGE = "collect_user_info_page"
const val COLLECT_USER_INFO_PAGE_VISIT = "collect_user_info_page_visit" //百度监测 用户信息收集页面--页面浏览事件
const val COLLECT_USER_INFO_SEX_MAN_CLICK = "collect_user_info_sex_man_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别男按钮点击
const val COLLECT_USER_INFO_SEX_FEMALE_CLICK = "collect_user_info_sex_female_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别女按钮点击
const val COLLECT_USER_INFO_NEXT_CLICK= "collect_user_info_next_click" //百度监测 用户信息收集页面--下一步点击
const val COLLECT_USER_INFO_EXIT_CLICK= "collect_user_info_exit_click" //百度监测 用户信息收集页面--退出点击
const val COLLECT_USER_INFO_PAGE_VISIT =
"collect_user_info_page_visit" //百度监测 用户信息收集页面--页面浏览事件
const val COLLECT_USER_INFO_SEX_MAN_CLICK =
"collect_user_info_sex_man_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别男按钮点击
const val COLLECT_USER_INFO_SEX_FEMALE_CLICK =
"collect_user_info_sex_female_click" // (sign1存储状态(1代表选中,2代表取消),String) //百度监测 用户信息收集页面--性别女按钮点击
const val COLLECT_USER_INFO_NEXT_CLICK =
"collect_user_info_next_click" //百度监测 用户信息收集页面--下一步点击
const val COLLECT_USER_INFO_EXIT_CLICK =
"collect_user_info_exit_click" //百度监测 用户信息收集页面--退出点击
//百度监测 收集感兴趣话题页
const val COLLECT_TOPIC_PAGE = "collect_topic_page"
......
......@@ -113,14 +113,15 @@ interface UserApi {
fun privacyAgree(@Query("uid") uid: String): Observable<BaseResponse<Any>>
//服务端校验阿里一键认证
@POST("phone/verification/init")
fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>>
//获取隐私政策数据
@GET("site/get-privacy-content")
fun getSecretData(): Observable<BaseResponse<SecretResponse>>
@GET("config/queryConfigVaule?configKey=user_privacy_content")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getSecretJavaData(): Observable<BaseResponse<String>>
//获取红包单号
@FormUrlEncoded
......@@ -130,7 +131,7 @@ interface UserApi {
//上传用户信息数据接口
@POST("user/collect/submit")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun uploadUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//获取关注问题数据接口
......
......@@ -63,12 +63,13 @@ interface UserHttp {
fun privacyAgree(uid: String): Observable<BaseResponse<Any>>
fun thirdPartJavaLogin(param: ThirdLoginParam): Observable<BaseResponse<UserResponseBean>>
// 友盟第三方登录
fun umLogin(activity: Activity, media: SHARE_MEDIA): Observable<ThirdLoginParam>
fun unBindThirdLogin(param: UnBindThirdLoginParam): Observable<BaseResponse<Any>>
fun getSecretData(): Observable<BaseResponse<SecretResponse>>
fun getSecretJavaData(): Observable<BaseResponse<String>>
fun getRedPacketId(param: RedPacketIdCmd): Observable<BaseResponse<RedPacketId>>
......
......@@ -205,8 +205,9 @@ class UserHttpImpl private constructor() : UserHttp {
return getUserApi().unBindThirdLogin(body)
}
override fun getSecretData(): Observable<BaseResponse<SecretResponse>> {
return getUserApi().getSecretData()
override fun getSecretJavaData(): Observable<BaseResponse<String>> {
return getUserApi().getSecretJavaData()
}
override fun getRedPacketId(param: RedPacketIdCmd): Observable<BaseResponse<RedPacketId>> {
......
......@@ -291,16 +291,12 @@ public class UserServiceImp : IUserService {
@SuppressLint("CheckResult")
override fun getSecretDataApi(activity: Activity, listener: SecretDataListener) {
UserHttpImpl.Companion.getInstance().getSecretData()
UserHttpImpl.Companion.getInstance().getSecretJavaData()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.code === 0) {
if (it.data.getIs_open() === 1) {
SecretActivity.startProtocol(activity, it.data.getContent())
} else {
listener.onOtherAction()
}
if (it.code == 200) {
SecretActivity.startProtocol(activity, it.data)
} else {
listener.onOtherAction()
}
......
......@@ -39,6 +39,7 @@ import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.PhoneLoginAutoParam
import com.yidianling.user.route.UserIn
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import java.math.BigDecimal
......@@ -301,6 +302,7 @@ object OneKeyLoginHelp {
}
.build()
)
var loginLogo = "ic_ydl_login_logo"
var loginHeight = 40
var loginWidth = 118
......@@ -313,6 +315,34 @@ object OneKeyLoginHelp {
loginWidth = 60
appPrivacyOneTip = "壹点灵专家使用协议"
}
//跳过按钮
val jumpLogin = TextView(mActivity)
val jumpLoginlayoutParams = RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
)
jumpLoginlayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE)
// jumpLoginlayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE)
jumpLoginlayoutParams.setMargins(
RxImageTool.dp2px(0f),
RxImageTool.dp2px(0f),
RxImageTool.dp2px(10f),
RxImageTool.dp2px(68f)
)
jumpLogin.text = "跳过"
jumpLogin.setTextColor(Color.parseColor("#999999"))
jumpLogin.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15f)
jumpLogin.gravity = Gravity.RIGHT
jumpLogin.layoutParams = jumpLoginlayoutParams
phoneNumberAuthHelper.addAuthRegistViewConfig(
"jump_login", AuthRegisterViewConfig.Builder()
.setView(jumpLogin)
.setRootViewId(AuthRegisterViewConfig.RootViewId.ROOT_VIEW_ID_BODY)
.setCustomInterface {
UserIn.mainIntent(mActivity)
}
.build()
)
phoneNumberAuthHelper.setAuthUIConfig(
AuthUIConfig.Builder()
.setStatusBarColor(Color.TRANSPARENT)
......
package com.yidianling.user.ui.login
import android.Manifest
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.net.Uri
import android.os.Handler
import android.provider.Settings
import androidx.core.content.ContextCompat
import android.text.*
import android.text.method.LinkMovementMethod
import android.text.style.AbsoluteSizeSpan
import android.text.style.ClickableSpan
import android.view.View
import android.view.animation.AnimationUtils
import androidx.core.content.ContextCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.fm.openinstall.OpenInstall
import com.meituan.android.walle.WalleChannelReader
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper
import com.mobile.auth.gatewayauth.ResultCode
import com.mobile.auth.gatewayauth.model.TokenRet
import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.socialize.UMShareAPI
import com.umeng.socialize.UMShareConfig
import com.umeng.socialize.bean.SHARE_MEDIA
......@@ -60,6 +56,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.img_reg_back
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.view_lin
/**
* @author jiucheng
......@@ -151,32 +149,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.white)
StatusBarUtils.Companion.setStatusBarLightMode(this, true)
}
/*取消READ_PHONE_STATE权限申请,已经在启动页弹过一次
* */
@SuppressLint("CheckResult")
private fun requestPermission() {
val rxPermissions = RxPermissions(this)
rxPermissions.requestEach(Manifest.permission.READ_PHONE_STATE)
.subscribe { permission ->
when {
permission.granted -> {
}
permission.shouldShowRequestPermissionRationale -> {
// 用户拒绝了该权限,没有选中『不再询问』(Never ask again),那么下次再次启动时。还会提示请求权限的对话框
}
else -> {
// 用户拒绝了该权限,而且选中『不再询问』
/*ToastUtil.toastLong(this, "App正常工作需要使用设备信息权限,请开启")
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
val uri = Uri.fromParts("package", packageName, null)
intent.data = uri
startActivity(intent)
finish()*/
}
}
}
}
/**
* 注册流程成功之后,进行百度埋点
*/
......@@ -198,8 +170,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private fun initAuthHelper() {
// requestPermission()
OneKeyLoginHelp.checkEnvAvailable(PhoneNumberAuthHelper.SERVICE_TYPE_AUTH)
OneKeyLoginHelp.setVerifyTokenResultListener(object :
OneKeyLoginHelp.VerifyTokenResultListener {
......@@ -275,7 +245,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
setHint()
requestFocus()
if (isBindPhone) {
skip_bind.visibility = View.VISIBLE
iv_select_protocol.visibility = View.GONE
......@@ -309,6 +278,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (isFromGuide) {
img_reg_back.visibility = View.INVISIBLE
skip_bind.visibility = View.VISIBLE
img_reg_back.isEnabled = false
}
//根据来源不同为当前页面埋点
......@@ -331,6 +301,10 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
sign1 = ""
)
}
et_phone_number.postDelayed(Runnable {
RxKeyboardTool.showSoftInput(this,et_phone_number)
},500)
}
private fun requestFocus() {
......@@ -353,6 +327,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*/
private fun setClickEvent() {
skip_bind.setOnClickListener {
ActionCountUtils.count(UserBIConstants.USER_REGISTER_PAGE_SKIP_CLICK)
ActionCountUtils.count(
uid = "",
partId = UserBIConstants.PART_ID_LOGIN_MAIN,
......@@ -397,6 +372,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
//微信登录
login_wechat.setOnClickListener {
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol) {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
check_protocol.startAnimation(shake)
ToastUtil.toastShort("请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用")
return@setOnClickListener
}
......@@ -405,6 +382,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
//QQ 登录
login_qq.setOnClickListener {
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol) {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
check_protocol.startAnimation(shake)
ToastUtil.toastShort("请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用")
return@setOnClickListener
}
......@@ -422,6 +401,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
//下一步
ll_next.setOnClickListener {
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol) {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
check_protocol.startAnimation(shake)
ToastUtil.toastShort("请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用")
return@setOnClickListener
}
......@@ -714,7 +695,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (isFromGuide) {
LoginUtils.setLoginCallBack(null)
ActivityManager.finishOtherActivity(this)
UserIn.mainIntent(this, 4)
if (StatusUtils.isFirstStartApp) {
UserIn.mainIntent(this, 0)
} else {
UserIn.mainIntent(this, 4)
}
finish()
} else if (isFromOneKeyLogin) { // 来自一键登录界面
// 如果已经登录
......
......@@ -8,7 +8,9 @@ import android.view.KeyEvent
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.user.R
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.widget.SecretDialog
import kotlinx.android.synthetic.main.user_activity_secret.*
......@@ -58,14 +60,25 @@ class SecretActivity : BaseActivity() {
initStatus()
user_secret_no_agree.setOnClickListener {
ActionCountUtils.count(UserBIConstants.PRIVACY_AUTHORIZATION_CLICK, "拒绝")
if (null == secretDialog) {
secretDialog = SecretDialog(this, object : SecretDialog.OnSecretDialogListener {
override fun onCancel() {
setResult(SECRET_PAGE_REQUEST_FAILURE_CODE)
finish()
ActionCountUtils.count(
UserBIConstants.PRIVACY_AUTHORIZATION_TWO_CLICK,
"拒绝"
)
user_secret_no_agree.postDelayed(Runnable {
setResult(SECRET_PAGE_REQUEST_FAILURE_CODE)
finish()
}, 400)
}
override fun onSure() {
ActionCountUtils.count(
UserBIConstants.PRIVACY_AUTHORIZATION_TWO_CLICK,
"同意"
)
agreeAction()
}
})
......@@ -76,6 +89,7 @@ class SecretActivity : BaseActivity() {
}
user_secret_agree.setOnClickListener {
ActionCountUtils.count(UserBIConstants.PRIVACY_AUTHORIZATION_CLICK, "同意")
agreeAction()
}
......
......@@ -15,7 +15,9 @@ import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.user.R
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.ui.login.H5Activity
import kotlinx.android.synthetic.main.user_dialog_secret.*
......@@ -40,10 +42,15 @@ class SecretDescriptionDialog(
user_secret_desc.text = Html.fromHtml(mSecretProtocolString)
user_secret_no_agree.setOnClickListener {
ActionCountUtils.count(
UserBIConstants.PRIVACY_AUTHORIZATION_TWO_CLICK,
"拒绝"
)
listener?.onCancel()
}
user_secret_agree.setOnClickListener {
ActionCountUtils.count(UserBIConstants.PRIVACY_AUTHORIZATION_CLICK, "同意")
agreeAction()
}
......
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="400"
android:duration="300"
android:fromXDelta="0"
android:interpolator="@anim/user_cycle_input"
android:toXDelta="20" />
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
......@@ -172,6 +172,7 @@
/>
<LinearLayout
android:id="@+id/check_protocol"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import com.ydl.ydlnet.utils.CharacterHandler;
import com.ydl.ydlnet.utils.NetLogUtils;
import okhttp3.MediaType;
import okhttp3.Request;
......@@ -48,17 +51,17 @@ public class DefaultFormatPrinter {
* @param request
* @param bodyString
*/
public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) {
final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
// }
}
......@@ -67,16 +70,16 @@ public class DefaultFormatPrinter {
*
* @param request
*/
public void printFileRequest(@NonNull Request request) {
final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, OMITTED_REQUEST, true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, OMITTED_REQUEST, true);
NetLogUtils.debugInfo(tag, END_LINE);
// }
}
......@@ -93,7 +96,7 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param responseUrl 请求地址
*/
public void printJsonResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers, @Nullable MediaType contentType,
@Nullable String bodyString, @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
bodyString = RequestLogInterceptor.isJson(contentType) ? CharacterHandler.jsonFormat(bodyString)
......@@ -102,13 +105,13 @@ public class DefaultFormatPrinter {
final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){
// if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, responseBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// }
}
/**
......@@ -122,18 +125,18 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param responseUrl 请求地址
*/
public void printFileResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers,
@NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){
// if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, OMITTED_RESPONSE, true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// }
}
/**
......@@ -157,7 +160,7 @@ public class DefaultFormatPrinter {
}
private static ThreadLocal<Integer> last = new ThreadLocal<Integer>() {
protected Integer initialValue() {
return 0;
}
......
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