Commit 69ca47cc by 霍志良

feat:埋点增加

parent 2f9e7722
......@@ -46,6 +46,7 @@ import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
import com.yidianling.consultant.bean.ConsultantRecentCity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.POPUP_ICON_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.YDL_USER_CONSULT_SEARCH_CLICK
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnFilterConfirmListener
......@@ -1043,8 +1044,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
.setTitle("温馨提示")
.setMessage("建议您授权定位权限,就能轻松获取周边优秀咨询师和其他服务")
.setLeftOnclick("暂不") { v1 ->
//埋点
ActionCountUtils.count(POPUP_ICON_CLICK, "暂不")
showAreaPopupWindow(false)
}.setRightClick("授权") { v12 ->
ActionCountUtils.count(POPUP_ICON_CLICK, "授权")
MMKV.defaultMMKV().encode(
ConsultBIConstants.ConsultantLocationAuth.WHETHER_LOCATION_AUTH,
true
......
......@@ -928,9 +928,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
.setTitle("温馨提示")
.setMessage("建议您授权定位权限,就能轻松获取周边优秀咨询师和其他服务")
.setLeftOnclick("暂不") { v1 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.POPUP_ICON_CLICK,
"暂不"
)
MMKV.defaultMMKV().encode(REFUSE_ALREADY, true)
showAreaPopupWindow(false)
}.setRightClick("授权") { v12 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.POPUP_ICON_CLICK,
"授权"
)
MMKV.defaultMMKV().encode(WHETHER_LOCATION_AUTH, true)
showAreaPopupWindow(true)
}
......
......@@ -70,6 +70,15 @@ class ConsultBIConstants {
"goodat_crowd_click" // 擅长人群埋点
const val SEARCH_BANNERWORD_CLICK =
"$PART_ID_YDL_USER_MAIN_PAGE|search_bannerword_click" //历史搜索、热门搜索、本周热门专家搜索
const val CONSULT_FILTER_CITY_PAGE = "consult_filter_city_page"
const val POPUP_ICON_CLICK = "$CONSULT_FILTER_CITY_PAGE|popup_icon_click"
const val AUTHORIZATION_ICON_CLICK =
"$CONSULT_FILTER_CITY_PAGE|authorization_icon_click"
const val CITY_NAME_CLICK = "$CONSULT_FILTER_CITY_PAGE|city_name_click"
const val CONSULT_FILTER_PRICE_PAGE = "consult_filter_price_page"
const val PRICE_CHOICE_CLICK = "$CONSULT_FILTER_PRICE_PAGE|price_choice_click"
const val PRICE_SLIDE_CLICK = "$CONSULT_FILTER_PRICE_PAGE|price_slide_click"
const val BOTTOM_ICON_CLICK = "$CONSULT_FILTER_PRICE_PAGE|bottom_icon_click"
}
}
class ConsultSearchListEvent {
......
......@@ -10,6 +10,7 @@ import android.view.ViewGroup
import android.widget.PopupWindow
import com.tencent.mmkv.MMKV
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
......@@ -18,6 +19,7 @@ import com.yidianling.consultant.adapter.RegionRecyclerViewAdapter
import com.yidianling.consultant.adapter.SubRecyclerViewAdapter
import com.yidianling.consultant.bean.ConsultantRecentCity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.CITY_NAME_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultantLocationAuth.Companion.RECENT_CITY
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.RegionItem
......@@ -72,7 +74,17 @@ class AreaPopupWindow(
.setTitle("温馨提示")
.setMessage("建议您授权定位权限,就能轻松获取周边优秀咨询师和其他服务")
.setLeftOnclick("暂不") { v1 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.AUTHORIZATION_ICON_CLICK,
"暂不"
)
}.setRightClick("授权") { v12 ->
ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.AUTHORIZATION_ICON_CLICK,
"授权"
)
MMKV.defaultMMKV().encode(
ConsultBIConstants.ConsultantLocationAuth.WHETHER_LOCATION_AUTH,
true
......@@ -112,6 +124,7 @@ class AreaPopupWindow(
subAdapter.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
saveCitySearchRecord(data)
selectedSub = data
ActionCountUtils.count(CITY_NAME_CLICK, data.value.toString())
onRegionSelectedListener?.onRegionSelected(selectedRegion, selectedSub)
}
view.rvSub.adapter = subAdapter
......
......@@ -11,10 +11,14 @@ import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.PopupWindow
import android.widget.TextView
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.BOTTOM_ICON_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.PRICE_CHOICE_CLICK
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.PRICE_SLIDE_CLICK
import com.yidianling.consultant.listener.OnPriceItemSelectedListener
import com.yidianling.consultant.model.bean.AllFilter
import com.yidianling.consultant.model.bean.Filters
......@@ -58,6 +62,7 @@ class PricePopupWindow(
this.isOutsideTouchable = true
initPriceTag()
contentView.price_Confirm.setOnClickListener {
ActionCountUtils.count(BOTTOM_ICON_CLICK, contentView.price_Confirm.text.toString())
if (max_Price == infiniteText) max_Price = ""
var priceRangesItem = PriceRangesItem(min_Price, max_Price)
tempFilter.priceRanges = priceRangesItem
......@@ -65,6 +70,8 @@ class PricePopupWindow(
dismiss()
}
contentView.price_reset.setOnClickListener {
ActionCountUtils.count(BOTTOM_ICON_CLICK, contentView.price_reset.text.toString())
//重置
contentView.range_price_seekbar.setProgress(0f, 100f)
reset()
......@@ -109,6 +116,7 @@ class PricePopupWindow(
max_Price = infiniteText
}
min_Price = ((leftValue / 100) * maxPriceValue).toInt().toString()
ActionCountUtils.count(PRICE_SLIDE_CLICK, "$min_Price-$max_Price")
contentView.tv_start_end_price.text =
"$min_Price-$max_Price"
......@@ -198,6 +206,10 @@ class PricePopupWindow(
min_price = priceRangesItem.min_price,
max_price = priceRangesItem.max_price
)
ActionCountUtils.count(
PRICE_CHOICE_CLICK,
priceRangesItem.min_price + "-" + priceRangesItem.max_price
)
textView.isSelected = true
textView.paint.isFakeBoldText = true
tempFilter.priceRangesView = textView
......
<?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"
android:layout_marginBottom="@dimen/platform_dp_20"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/category_img"
android:layout_width="@dimen/platform_dp_38"
android:layout_height="@dimen/platform_dp_38" />
<TextView
android:id="@+id/category_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_5"
android:textColor="#1c212d"
android:textSize="@dimen/platform_sp_12" />
</LinearLayout>
\ No newline at end of file
package com.yidianling.home.adapter
import android.content.Context
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.main.home_category_list_item.view.*
/**
* Created by zqk on 17-9-20.
*/
class CategoryAdapter(
private val context: Context,
private val cateList: MutableList<HomeHeaderBean.CategoryGoldListDataBean>,
private val homeEvent: IHomeBaseEvent
) : RecyclerView.Adapter<CategoryAdapter.ViewHolder>() {
override fun getItemCount(): Int = cateList.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val itemView =
LayoutInflater.from(context).inflate(R.layout.home_category_list_item, parent, false)
return ViewHolder(itemView)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
GlideApp.with(context).load(cateList[position].icon)
.centerCrop().into(holder.category_img)
holder.category_text.text = cateList[position].title
holder.itemView.setOnClickListener {
homeEvent.categoryClick(cateList[position])
}
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val category_img = itemView.category_img
val category_text = itemView.category_text
}
}
\ No newline at end of file
......@@ -136,7 +136,10 @@ class YdlHomeAdapter(private val mContext: Context,
if (viewType == -1){
//空布局
val view = View(mContext)
val layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,1)
val layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
view.layoutParams = layoutParams
view.visibility = View.GONE
return HomePagerBannerViewHolder(view,viewType)
......
......@@ -53,11 +53,15 @@ class HomeCategoryContainer(private val mContext: Context, private var homeEvent
fun initData(bean: HomeHeaderBean?) {
if (bean?.goldList == null) return
mHomeCategoryAdapter?.updateItems(bean?.goldList)
//向上取整
count = bean.goldList?.size?.toDouble()?.div(5)?.let { Math.ceil(it).toInt() }!!
val params = RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
RxImageTool.dip2px(143f)
RxImageTool.dip2px(72f * count)
)
vp_category.layoutParams = params
ll_Indicator.visibility = View.GONE
}
......
......@@ -9,14 +9,18 @@ import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.ScreenUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.adapter.CategoryAdapter
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import kotlinx.android.synthetic.ydl.home_pager_banner_category_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页顶部模块-分类模块 金刚位跳转H5或咨询列表页面
......@@ -67,10 +71,12 @@ class HomePagerBannerCategoryItemView(mContext: Context, homeEvent: IHomeBaseEve
* 倍数
*/
private var multiple: Int = 0
/**
* 测评首页事件处理类
*/
private var homeEvent: IHomeBaseEvent? = null
private lateinit var categoryAdapter: CategoryAdapter
init {
initView()
......@@ -85,7 +91,7 @@ class HomePagerBannerCategoryItemView(mContext: Context, homeEvent: IHomeBaseEve
val params = FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)
// params.topMargin = ScreenUtil.screenHeight * (356f / 750f).toInt()
layoutParams = params
initArgs()
// initArgs()
}
/**
......@@ -116,7 +122,18 @@ class HomePagerBannerCategoryItemView(mContext: Context, homeEvent: IHomeBaseEve
mDataList!!.clear()
mDataList!!.addAll(askCategoryDataBean)
}
refreshView()
homeEvent?.let {
categoryAdapter = CategoryAdapter(context, mDataList!!, it)
}
homeModulePagerBannerFlRoot.adapter = categoryAdapter
homeModulePagerBannerFlRoot.layoutManager = GridLayoutManager(
context,
5,
LinearLayoutManager.VERTICAL,
false
)
// refreshView()
// setRealTextView(homeSaleData)
}
......
......@@ -105,11 +105,7 @@ class HomePagerBannerView(private val mContext: Context, private var homeEvent:
if (null != focusListBean && focusListBean.isNotEmpty()) {
mImageViews.clear()
//产品说取前8个
if (focusListBean.size > 8){
cacheList.addAll(focusListBean.subList(0,8))
}else{
cacheList.addAll(focusListBean)
}
cacheList.addAll(focusListBean)
for (item in cacheList) {
mImageViews.add(item.imageUrl!!)
}
......
......@@ -6,7 +6,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/platform_dp_12">
android:paddingTop="@dimen/platform_dp_20">
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst"
......
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/homeModulePagerBannerFlRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/platform_dp_8"
android:layout_marginEnd="@dimen/platform_dp_8"
android:paddingBottom="1dp" />
</merge>
\ No newline at end of file
......@@ -21,7 +21,6 @@
android:id="@+id/homeModulePagerBannerViewAddLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="175dp"
android:background="@drawable/home_home_category_bg"
android:orientation="vertical"
android:paddingTop="20dp">
......
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