Commit 4d5a4d57 by 万齐军

feat: 埋点

parent f5b13dca
......@@ -42,7 +42,6 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.webview.RefreshWebEvent
import com.ydl.ydl_av.chat.bean.AudioMessageBean
import com.ydl.ydl_av.voice.impl.YDLVoiceApiImpl
import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import com.ydl.ydl_av.voice.manager.YDLVoiceManager
import com.ydl.ydl_image.config.SimpleImageOpConfiger
......@@ -624,6 +623,7 @@ class AudioHomeActivity :
userCloseCalling()
}
ActionCountUtils.record("call_phone_page","call_phone_icon_click",)
ActionCountUtils.count(
"shengwang_popup_layer_page|shengwang_popup_layer_refuse_click",
YdlCommonRouterManager.getYdlCommonRoute().getUid().toString(),
......
......@@ -57,6 +57,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var first_order: View
lateinit var confideProgress: View
lateinit var layout_change_text: View
lateinit var itemView: View
lateinit var jumpUrl: String
......@@ -134,33 +135,37 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
private fun onShowReady(){
itemView = LayoutInflater.from(context).inflate(R.layout.confide_bottom_two, null, false)
layoutCall = itemView.findViewById<View>(R.id.layoutCall)
layoutChange = itemView.findViewById<View>(R.id.layoutChange)
confideProgress = itemView.findViewById<View>(R.id.confide_progress)
layout_change_text = itemView.findViewById<View>(R.id.layout_change_text)
tvCall = itemView.findViewById<TextView>(R.id.tvCall)
tvTime = itemView.findViewById<TextView>(R.id.tvTime)
first_order = itemView.findViewById<TextView>(R.id.first_order)
val isLogin = findRouteService(IUserService::class.java)?.isLogin() ?: false
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
if (shouldShow == true) {
layoutChange.visibility = View.VISIBLE
} else {
layoutChange.visibility = View.GONE
}
layoutCall.setOnClickListener {
callJsFun(wv_content, "listenCallClick()")
}
layoutChange.setOnClickListener {
layout_change_text.visibility = View.GONE
confideProgress.visibility = View.VISIBLE
callJsFun(wv_content, "handleNext()")
}
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
onShowReady()
dialog.setOnShowListener {
val itemView =
LayoutInflater.from(context).inflate(R.layout.confide_bottom_two, null, false)
layoutCall = itemView.findViewById<View>(R.id.layoutCall)
layoutChange = itemView.findViewById<View>(R.id.layoutChange)
confideProgress = itemView.findViewById<View>(R.id.confide_progress)
layout_change_text = itemView.findViewById<View>(R.id.layout_change_text)
tvCall = itemView.findViewById<TextView>(R.id.tvCall)
tvTime = itemView.findViewById<TextView>(R.id.tvTime)
first_order = itemView.findViewById<TextView>(R.id.first_order)
val isLogin = findRouteService(IUserService::class.java)?.isLogin() ?: false
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
if (shouldShow == true) {
layoutChange.visibility = View.VISIBLE
} else {
layoutChange.visibility = View.GONE
}
layoutCall.setOnClickListener {
callJsFun(wv_content, "listenCallClick()")
}
layoutChange.setOnClickListener {
layout_change_text.visibility = View.GONE
confideProgress.visibility = View.VISIBLE
callJsFun(wv_content, "handleNext()")
}
val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
......
......@@ -42,7 +42,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
......@@ -270,6 +270,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/
private fun initClick() {
quick_consult_card.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "akey_consult_icon_click")
bottomSheetDialogFragment=ConfideBottomSheetDialogFragment()
bottomSheetDialogFragment.showBottomSheetDialog(this as FragmentActivity, HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro("0"),"0",true)
......@@ -285,20 +286,20 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
img_mine.setOnClickListener {
//跳转倾诉列表
ActionCountUtils.record("listen_counselor_list_page", "topright_corner_icon_click","1")
if (!PhoneCallIn.loginByOneKeyLogin(this,true)) {
return@setOnClickListener
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "倾诉记录")
.burryPoint("mine")
val h5Paramsqing = H5Params(YDL_H5 + "confideOrderList", null)
NewH5Activity.start(this, h5Paramsqing)
}
findViewById<View>(R.id.img_customer)?.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "topright_corner_icon_click","2")
val imService = findRouteService(IImService::class.java)
imService?.startP2PXiaoYi(this)
}
findViewById<View>(R.id.img_help)?.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "topright_corner_icon_click","3")
val params = H5Params(H5_URL + "help/", "")
params.isShowMenu = true
NewH5Activity.start(this, params)
......@@ -495,6 +496,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
override fun showSortPopupWindow(v_line_top: View, tvSort: DrawableRightTextView, bodyBean: ConfideHomeBodyBean?) {
ActionCountUtils.record("listen_counselor_list_page", "choice_filter_click")
if (null == allFiltersBean) {
return
}
......@@ -505,6 +507,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
override fun showSexAgePopupWindow(v_line_top: View, tvSexAge: DrawableRightTextView, bodyBean: ConfideHomeBodyBean?) {
ActionCountUtils.record("listen_counselor_list_page", "choice_filter_click")
if (null == allFiltersBean) {
return
}
......@@ -515,6 +518,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
override fun showGoodPopupWindow(v_line_top: View, tvGood: DrawableRightTextView, bodyBean: ConfideHomeBodyBean?) {
ActionCountUtils.record("listen_counselor_list_page", "choice_filter_click")
if (null == allFiltersBean) {
return
}
......
......@@ -14,6 +14,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.intro.BindingViewHolder
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
class VideoShowAdapter(private val data: List<ConfideHomeBodyBean>?, private val event: IConfideHomeEvent) :
RecyclerView.Adapter<BindingViewHolder<ItemVideoShowBinding>>() {
......@@ -31,7 +32,10 @@ class VideoShowAdapter(private val data: List<ConfideHomeBodyBean>?, private val
override fun onBindViewHolder(holder: BindingViewHolder<ItemVideoShowBinding>, position: Int) {
val itemVideoShowViewModel = dataList[position]
holder.binding.item = itemVideoShowViewModel
holder.itemView.setOnClickListener { event.videoShowClick(position, data) }
holder.itemView.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "video_card_click")
event.videoShowClick(position, data)
}
}
override fun getItemCount() = dataList.size
......@@ -58,7 +62,15 @@ class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>, private val e
override fun onBindViewHolder(holder: BindingViewHolder<ItemConfideHomeRecentBinding>, position: Int) {
val itemVideoShowViewModel = data[position]
holder.binding.item = itemVideoShowViewModel
holder.itemView.setOnClickListener { event.consultantClick(itemVideoShowViewModel.linkUrl,itemVideoShowViewModel.doctorId) }
holder.itemView.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "1")
ActionCountUtils.record(
"listen_counselor_popupwindows_page",
"popupwindows_page_visit",
itemVideoShowViewModel.confideId ?: "", "2"
)
event.consultantClick(itemVideoShowViewModel.linkUrl, itemVideoShowViewModel.doctorId)
}
}
override fun getItemCount() = data.size
......@@ -71,6 +83,7 @@ class ItemVideoShowViewModel {
val videoCoverUrl = ObservableField<String>("")
val state = ObservableInt()
var doctorId: String? = null
var confideId: String? = null
}
internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoShowViewModel {
......@@ -82,6 +95,7 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS
doctorId?.let {
linkUrl = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)
}
confideId = bean.confidedId
return this
}
......
......@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun consultantClick(linkUrl: String?,doctorId: String?)
fun consultantClick(linkUrl: String?, doctorId: String?)
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
......
......@@ -19,6 +19,7 @@ import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.confide_recommend_view_new.view.*
......@@ -84,9 +85,25 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
setListenAndScore(bodyBean)
//设置页面点击事件
this.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_list_page",
"listen_counselor_card_click",
bodyBean.confidedId ?: ""
)
ActionCountUtils.record(
"listen_counselor_popupwindows_page",
"popupwindows_page_visit",
bodyBean.confidedId ?: "",
"1"
)
confideHomeEvent.consultantClick(bodyBean.linkUrl,bodyBean.doctorId)
}
img_head.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2")
this.performClick()
}
}
private fun setListenAndScore(bodyBean: ConfideHomeBodyBean) {
......@@ -162,6 +179,12 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
iv_play.setImageResource(R.drawable.confide_sond_play)
}
iv_play.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_list_page",
"listen_counselor_icon_click",
bodyBean.confidedId ?: "",
"4"
)
if (bodyBean.confideIsPlay!!) {
confideHomeEvent.pauseVoice()
} else {
......@@ -252,12 +275,14 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
* 设置向TA倾诉按钮状态
*/
private fun setConfideButton(bodyBean: ConfideHomeBodyBean) {
var sign2 = 1
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续倾诉
1 -> {
tv_confide.setBackgroundResource(R.drawable.confide_line_1)
}
2 -> {
//男他女她
sign2 = 3
if (bodyBean.confideSex == 1) {
tv_confide.setBackgroundResource(R.drawable.confide_line_sex_boy)
} else {
......@@ -265,6 +290,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
3 -> {
sign2 = 2
tv_confide.setBackgroundResource(R.drawable.confide_line_3)
}
4 -> {
......@@ -272,6 +298,12 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
}
}
tv_confide.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_list_page",
"listen_counselor_icon_click",
bodyBean.confidedId ?: "",
sign2.toString()
)
click(bodyBean)
}
}
......
......@@ -17,6 +17,7 @@ import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.home.util.ConfideNetworkUtil
import com.ydl.ydlcommon.utils.TimeUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.ToastUtil
......@@ -164,6 +165,15 @@ internal class IntroAdapter(
private fun onLoadDialStatus(position: Int) {
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
val curUid = data[position].uid
val confideId = data[position].confideId
val video = data[position].isVideo
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_visit",
confideId ?: "",
if (video) "1" else "2",
"1"
)
if (curUid != null) {
dispose?.dispose()
dispose = confideApi.getDialStatus(curUid)
......
......@@ -18,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.YDLShareDialog
import com.yidianling.im.api.service.IImService
import io.reactivex.Observable
......@@ -49,16 +50,37 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
fun onBind(item: VideoViewModel) {
vm = item
binding.layoutCall.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
"6"
)
showDoctorDetail(item)
}
binding.btnChat.setOnClickListener {
val aty = it.context as? Activity
if (aty != null && !item.uid.isNullOrEmpty()) {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
"7"
)
findRouteService(IImService::class.java)?.startChat(aty, item.uid!!, 0, 0)
}
}
binding.btnEvaluate.setOnClickListener {
item.doctorId?.let {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
"8"
)
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
itemView.context as FragmentActivity,
......@@ -68,15 +90,41 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
}
binding.tvName.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_popupwindows_page",
"popupwindows_page_visit",
item.confideId ?: "",
"4"
)
showDoctorDetail(item)
}
binding.ivAvatar.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId ?: "",
if (item.isVideo) "1" else "2",
"10"
)
ActionCountUtils.record(
"listen_counselor_popupwindows_page",
"popupwindows_page_visit",
item.confideId ?: "",
"3"
)
showDoctorDetail(item)
}
binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener {
val aty = it.context as? Activity
if (aty != null) {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId ?: "",
if (item.isVideo) "1" else "2",
"9"
)
var shareUrl = "${HttpConfig.MH5_URL}experts/${item.doctorId}"
if (!item.confideId.isNullOrBlank()) {
shareUrl += "?id=${item.confideId}"
......@@ -89,6 +137,13 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
}
binding.videoView.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.doctorId.toString(),
if (item.isVideo) "1" else "2",
if (item.isVideo) "4" else "2"
)
if (video?.canPause() == true) {
video?.pause()
if (item.isVideo) {
......@@ -99,6 +154,13 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
}
binding.ivPlay.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
if (item.isVideo) "3" else "1"
)
video?.start()
if (item.isVideo) {
binding.ivPlay.visibility = View.GONE
......@@ -107,6 +169,13 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
}
binding.voicePlay.setOnClickListener {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
if (item.isVideo) "3" else "1"
)
if (video?.isPlaying == true) {
video?.pause()
binding.voicePlay.stop()
......@@ -132,6 +201,14 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
video?.start()
binding.ivPlay.visibility = View.GONE
}
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_play_icon_click",
item.confideId.toString(),
if (item.isVideo) "1" else "2",
"5"
)
}
})
binding.voicePlay.visibility =
......
......@@ -106,6 +106,11 @@ class ActionCountUtils {
count(uid, partId, position, url, api, signs = *arrayOf(sign1))
}
fun record(partId: String, position: String, vararg signs: String) {
val userId = ModularServiceManager.getPlatformUserService()?.getUser()?.userId ?: ""
count(userId, partId, position, url = "", api = "", signs = *signs)
}
/*
*
* 测试用埋点,现在服务端统一用百度埋点
......@@ -155,7 +160,7 @@ class ActionCountUtils {
DeviceIDHelper.getInstance().deviceId
}
actionDataParams.deviceId(deviceId)
signs == null ?: signs.forEachIndexed { index, s ->
signs.forEachIndexed { index, s ->
//拓展参数个数确定,暂不使用反射调用
//actionDataParams.javaClass.getMethod("sign$index").invoke(s)
when (index) {
......
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