Commit de7e6896 by upwork.021

feat: 埋点加入

parent 37a9a364
......@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.26",
"m-consultant" : "0.0.60.28",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04",
"m-home" : "0.0.23.44",
......@@ -27,7 +27,7 @@ ext {
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
......@@ -112,7 +112,7 @@ ext {
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 --------------
......
......@@ -8,7 +8,6 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.graphics.Typeface
import android.os.Build
import android.os.Handler
import android.text.TextUtils
import android.view.Gravity
......@@ -35,12 +34,10 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
......@@ -148,9 +145,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
context.startActivity(intent)
}
fun startSearch(context: Context, searchWord: String?) {
/**
* 搜索页面过来的sign2为14 仅用于埋点
*/
fun startSearch(context: Context, searchWord: String?,sign2:String) {
val intent = Intent(context, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_SEARCH_WORD, searchWord)
intent.putExtra("sign2",sign2)
context.startActivity(intent)
}
......@@ -179,7 +180,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private val tempFilter = AllFilter() //临时筛选,未确认状态
private var curPage = 1
private val doctorList = ArrayList<ExpertServiceItem>()
private val serviceList = ArrayList<ExpertServiceItem>()
private var hasMore = true
private var initCategory = "0"
private var initShowType: Int = 1
......@@ -189,11 +189,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private var isFromSplash = false
private val props1 = JSONObject() //筛选标题埋点参数
private var fromPageType: Int = 1 //从哪个页面跳转过来的
private val fromPages = arrayOf("首页", "搜索页面", "在线专家")
private var isRecommend = false //埋点数据
private var keyWord: String? = null //埋点数据
private var cateName: String? = null
private var mSign2: String = "" // 用于搜索页面进来的埋点参数
private var isDoSearch: Boolean = false //埋点判断是否通过搜索进入埋点的
private val bannerList = ArrayList<String>()
private var hasSelectedArea = false //是否选择过地区
private var hasSelectedSort = false //是否选择过排序
......@@ -380,7 +379,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
val params = intent.getStringExtra("routerParam")
val paramsJson = JSONObject(params)
initCategory = paramsJson.getString("cateId")
keyWord = paramsJson.getString("cateTitle")
cateName = paramsJson.getString("cateTitle")
mSign2 = cateName!!
initShowType = paramsJson.getString("showType").toInt()
}
}
......@@ -390,13 +390,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: ""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
tv_search_content.text = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
keyWord = mIntent.getStringExtra(EXTRA_CATEGORY_NAME) ?: ""
mSign2 = mIntent.getStringExtra("sign2")
getRouterParam()
allFilter.showType.key = initShowType
allFilter.categoryId2List.add(initCategory)
if (!TextUtils.isEmpty(keyWord)){
tvSubject.text = keyWord
if (!TextUtils.isEmpty(cateName)){
tvSubject.text = cateName
updateFilterTextViewStatus(tvSubject,FILTER_STATUS_FILTERED)
}
......@@ -504,6 +504,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
dealHotSelect(hot, true)
textView.isSelected = true
textView.paint.isFakeBoldText = true
// 埋点
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,
ConsultBIConstants.ConsultEvent.POSITION_CHOICE_FILTER_CLICK,hot.value!!,"app","")
}
filterLabelSet()
//开始筛选数据
......@@ -792,17 +795,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
* 获取专家列表数据
*/
override fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras:Extras?,curPage:Int) {
LogUtil.d("onDoctorListFetched")
if (rvExperts.adapter != doctorAdapter) {
rvExperts.adapter = doctorAdapter
}
LogUtil.d("data size " + data.size)
if (fromPageType == -1) {
bury(keyWord ?: "", data.size > 0, isRecommend, "首页分类")
} else {
bury(keyWord ?: "", data.size > 0, isRecommend, fromPages[fromPageType])
}
// 如果是第一页
if (curPage==1){
if (data.size>=10){
......@@ -831,6 +827,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
rvExperts.visibility = View.VISIBLE
srlContainer.isRefreshing = false
// 埋点
val sign1 = data.map { it.id }.joinToString { "|" }
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT,sign1,mSign2,"app")
}
override fun fetchListFailed(msg: String?) {
......@@ -1220,12 +1220,16 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
?: ""
)
if (sortItem.value.equals("综合排序")) {
tvSort.text = "排序"
} else if (sortItem.value?.length ?: 0 > 4) {
tvSort.text = sortItem.value?.substring(0, 3) + "..."
} else {
tvSort.text = sortItem.value
when {
sortItem.value.equals("综合排序") -> {
tvSort.text = "排序"
}
sortItem.value?.length ?: 0 > 4 -> {
tvSort.text = sortItem.value?.substring(0, 3) + "..."
}
else -> {
tvSort.text = sortItem.value
}
}
//判断排序选中,判断热门筛选中是否也有该排序
......@@ -1371,8 +1375,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
*
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
*/
override fun onCategoriesSelected() {
// ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_THEME_CLICK, categories.map { it.cateName }.joinToString("|"))
override fun onCategoriesSelected(signLit:ArrayList<String>) {
if (signLit.isNotEmpty()){
val sign1 = signLit.map { it }.joinToString { "," }
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.ConsultEvent.POSITION_TWO_CATEGORY_CLICK, sign1,"app","")
}
if (allFilter.categoryId2List.size>0||allFilter.categoryId3List.size>0){
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED)
......@@ -1415,7 +1422,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
ActionCountUtils.count(
ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK,
keyWord ?: ""
cateName ?: ""
)
isDoSearch = true
resetFilter()
......@@ -1491,17 +1498,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
/**
* 事件埋点
*/
fun bury(keyworks: String, isResult: Boolean, isRecommend: Boolean, location: String) {
BuryPointUtils.getInstance().createMap()
.put("keyWord", keyworks)
.put("hasResult", isResult)
.put("isRecommend", isRecommend)
.put("location", location)
.burryPoint("search")
}
override fun onResume() {
super.onResume()
......
......@@ -52,13 +52,14 @@ import com.yidianling.consultant.ui.view.CategoryPopupWindow
import com.yidianling.consultant.ui.view.FilterPopupWindow
import com.yidianling.consultant.ui.view.SortPopupWindow
import com.yidianling.consultant.ui.view.topView.RecommendListView
import com.yidianling.home.api.event.HomeModuleTabEvent
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
import kotlin.collections.ArrayList
@Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), View.OnClickListener, IExpertSearchView,
......@@ -74,6 +75,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
override fun initDataAndEvent() {
EventBus.getDefault().register(this)
mContext = requireContext()
mActivity = requireActivity()
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mContext)
......@@ -421,8 +423,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (view.childCount > 0) {
return
}
// val popWidth = RxDeviceTool.getScreenWidth(context)
// val mWidth = (popWidth - RxImageTool.dp2px(10f)) / hotData.size
for (hot in hotData) {
val tv = View.inflate(context, R.layout.consultant_item_filter_online, null) as TextView
val textView = tv.tvFree
......@@ -441,6 +441,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
dealHotSelect(hot, true)
textView.isSelected = true
textView.paint.isFakeBoldText = true
// 埋点
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,
ConsultBIConstants.ConsultEvent.POSITION_CHOICE_FILTER_CLICK,hot.value!!,"app","")
}
filterLabelSet()
//开始筛选数据
......@@ -727,17 +730,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
* 获取专家列表数据
*/
override fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras:Extras?,curPage:Int) {
LogUtil.d("onDoctorListFetched")
if (rvExperts.adapter != doctorAdapter) {
rvExperts.adapter = doctorAdapter
}
LogUtil.d("data size " + data.size)
if (fromPageType == -1) {
bury(keyWord ?: "", data.size > 0, isRecommend, "首页分类")
} else {
bury(keyWord ?: "", data.size > 0, isRecommend, fromPages[fromPageType])
}
// 如果是第一页
if (curPage==1){
if (data.size>=10){
......@@ -766,6 +763,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
rvExperts.visibility = View.VISIBLE
srlContainer.isRefreshing = false
// 埋点
val sign1 = data.map { it.id }.joinToString { "|" }
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT,sign1,sign2,"app")
}
override fun fetchListFailed(msg: String?) {
......@@ -1305,8 +1306,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
* 主题选择确认回调
*
*/
override fun onCategoriesSelected() {
// ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_THEME_CLICK, categories.map { it.cateName }.joinToString("|"))
override fun onCategoriesSelected(signLit:ArrayList<String>) {
if (signLit.isNotEmpty()){
val sign1 = signLit.map { it }.joinToString { "," }
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.ConsultEvent.POSITION_TWO_CATEGORY_CLICK, sign1,"app","")
}
if (allFilter.categoryId2List.size>0||allFilter.categoryId3List.size>0){
updateFilterTextViewStatus(tvSubject, FILTER_STATUS_FILTERED)
......@@ -1322,6 +1326,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
/**
* EventBus从首页某个位置点击事件传递
* sign 仅用于埋点事件统计
*/
private var sign2=""
fun onEvent(event: HomeModuleTabEvent) {
if (!TextUtils.isEmpty(event.sign)){
sign2 = event.sign
}
}
//刷新列表
private fun refresh(isShowRefresh: Boolean? = true) {
srlContainer.isRefreshing = isShowRefresh!!
......@@ -1381,18 +1396,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
/**
* 事件埋点
*/
fun bury(keyworks: String, isResult: Boolean, isRecommend: Boolean, location: String) {
BuryPointUtils.getInstance().createMap()
.put("keyWord", keyworks)
.put("hasResult", isResult)
.put("isRecommend", isRecommend)
.put("location", location)
.burryPoint("search")
}
override fun onResume() {
super.onResume()
refresh(false)
......@@ -1402,6 +1405,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
mHandler=null
ConsultAssistantDialogUtils.INSTANCE.resetStatus()
}
......
......@@ -124,7 +124,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
val titleMap = HashMap<String, Any>()
titleMap["in"] = title
filterMap["title"] = titleMap
filterMap["titles.title"] = titleMap
}
// 擅长人群
if (allFilter.specialityCrowd.isNotEmpty()) {
......@@ -134,7 +134,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
val specialityCrowdMap = HashMap<String, Any>()
specialityCrowdMap["in"] = specialityCrowdMap
filterMap["doctor_tag_list.list_cate_id"] = specialityCrowdMap
filterMap["doctor_tag_list.list.tag_id"] = specialityCrowdMap
}
// 学历
if (allFilter.doctorEdu.isNotEmpty()) {
......
......@@ -331,7 +331,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
ExpertSearchActivity.startSearch(this, keyWord)
ExpertSearchActivity.startSearch(this, keyWord,"14")
this.finish()
}
......
......@@ -428,20 +428,10 @@ class ExpertSearchAdapter(
if (!TextUtils.isEmpty(cateId)) {
linkUrl = URLUtils.appendParmas(linkUrl, "cateId", cateId)
}
if (pageIndex == 0) {
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_DOCTOR_CLICK,
itemBean.id ?: ""
)
} else {
ActionCountUtils.count(
ConsultBIConstants.ConsultSearchListEvent.APP_CONSULT_SEARCH_LIST_CONSULT_ITEM_CLICK,
itemBean.id ?: ""
)
}
TempH5RouteUtils.tempH5Route(linkUrl)
// 埋点
ActionCountUtils.baiDuCountSign3(ConsultBIConstants.PART_ID_CONSULT_COUNSELOR_LIST_PAGE,ConsultBIConstants.ConsultEvent.POSITION_CONSULT_COUNSELOR_CARD_CLICK,itemBean.id?:"","app","")
}
}
......
......@@ -19,7 +19,9 @@ 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 POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT="consult_counselor_list_page_visit" // 咨询师列表页面浏览position
}
//====================APP咨询列表页(app_consult_list_page)====================
......@@ -51,6 +53,9 @@ 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" // 八大类标签选择埋点
}
}
class ConsultSearchListEvent {
......
......@@ -5,5 +5,5 @@ package com.yidianling.consultant.listener
* Created by zqk on 17-9-20.
*/
interface OnCategoriesSelectedListener {
fun onCategoriesSelected()
fun onCategoriesSelected(signLit:ArrayList<String>)
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
<LinearLayout
android:id="@+id/clContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
......
......@@ -213,9 +213,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
return
}
EventBus.getDefault().post(
HomeModuleTabEvent(
2
)
HomeModuleTabEvent(2,"12")
)
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_MORE_CLICK)
}
......@@ -286,9 +284,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;
......
......@@ -145,10 +145,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
......@@ -179,17 +178,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
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
//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
}
override fun initDataAndEventLazy() {
......
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