部分埋点修改

This commit is contained in:
huangjian
2022-08-05 11:20:11 +08:00
parent 7f3ef26283
commit 0975c8d82c
3 changed files with 28 additions and 10 deletions

View File

@@ -12,6 +12,8 @@ import com.yizhuan.xchat_android_core.home.model.HomeModel
import com.yizhuan.xchat_android_core.room.bean.AnchorInfo import com.yizhuan.xchat_android_core.room.bean.AnchorInfo
import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
import com.yizhuan.xchat_android_core.statistic.StatisticManager
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
import com.yizhuan.xchat_android_core.utils.toast import com.yizhuan.xchat_android_core.utils.toast
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
@@ -122,14 +124,24 @@ class HomeViewModel : BaseViewModel() {
} }
fun fastPickGameRoom(mgId: Long? = null) { fun fastPickGameRoom(mgId: Long? = null) {
safeLaunch { safeLaunch(
val homeRoomInfo = HomeModel.fastPickGameRoom(mgId) onError = {
if (homeRoomInfo?.isPick == true) { it.message.toast()
_pickRoomLiveData.value = homeRoomInfo StatisticManager.Instance()
} else if (homeRoomInfo?.isNeedOpenSelfRoom == true) { .onEvent(
_openGameRoomLiveData.value = mgId StatisticsProtocol.EVENT_USERCENTER_QUICK_ENTRYSUCCESS_CLICK,
"个人中心快捷进房点击未匹配成功"
)
},
block = {
val homeRoomInfo = HomeModel.fastPickGameRoom(mgId)
if (homeRoomInfo?.isPick == true) {
_pickRoomLiveData.value = homeRoomInfo
} else if (homeRoomInfo?.isNeedOpenSelfRoom == true) {
_openGameRoomLiveData.value = mgId
}
} }
} )
} }

View File

@@ -119,7 +119,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
StatisticManager.Instance() StatisticManager.Instance()
.onEvent( .onEvent(
StatisticsProtocol.EVENT_USERCENTER_BANNER_CLICK, StatisticsProtocol.EVENT_USERCENTER_BANNER_CLICK,
"usercenter_banner_click", "个人中心banner模块点击",
mapOf("banner_id" to bannerInfo.bannerId.toString()) mapOf("banner_id" to bannerInfo.bannerId.toString())
) )
} }
@@ -139,7 +139,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
StatisticManager.Instance() StatisticManager.Instance()
.onEvent( .onEvent(
StatisticsProtocol.EVENT_USERCENTER_QUICK_ENTRY_CLICK, StatisticsProtocol.EVENT_USERCENTER_QUICK_ENTRY_CLICK,
"个人中心功能板块点击", "个人中心快捷进房点击成功匹配",
mapOf("room_id" to it.erbanNo.toString()) mapOf("room_id" to it.erbanNo.toString())
) )
} }
@@ -148,6 +148,11 @@ class MeFragment : BaseFragment(), View.OnClickListener {
homeViewModel.openGameRoomLiveData.observe(viewLifecycleOwner) { homeViewModel.openGameRoomLiveData.observe(viewLifecycleOwner) {
it?.let { it?.let {
OpenRoomHelper.openRoom(mContext as BaseActivity, RoomInfo.ROOMTYPE_GAME, it) OpenRoomHelper.openRoom(mContext as BaseActivity, RoomInfo.ROOMTYPE_GAME, it)
StatisticManager.Instance()
.onEvent(
StatisticsProtocol.EVENT_USERCENTER_QUICK_ENTRYSUCCESS_CLICK,
"个人中心快捷进房点击成功匹配"
)
} }
} }

View File

@@ -613,7 +613,8 @@ public interface StatisticsProtocol {
String EVENT_USERCENTER_RECHARGE_CARD_CLICK = "usercenter_recharge_card_click";//个人中心充值卡片点击 String EVENT_USERCENTER_RECHARGE_CARD_CLICK = "usercenter_recharge_card_click";//个人中心充值卡片点击
String EVENT_USERCENTER_NOBLE_CARD_CLICK = "usercenter_noble_card_click";//个人中心贵族卡片片点击 String EVENT_USERCENTER_NOBLE_CARD_CLICK = "usercenter_noble_card_click";//个人中心贵族卡片片点击
String EVENT_USERCENTER_FUNCTION_CLIC = "usercenter_function_clicck";//个人中心功能板块点击 String EVENT_USERCENTER_FUNCTION_CLIC = "usercenter_function_clicck";//个人中心功能板块点击
String EVENT_USERCENTER_QUICK_ENTRY_CLICK = "usercenter_quick_entry_click";//个人中心功能板块点击 String EVENT_USERCENTER_QUICK_ENTRY_CLICK = "usercenter_quick_entry_click";//个人中心快捷进房点击未匹配成
String EVENT_USERCENTER_QUICK_ENTRYSUCCESS_CLICK = "usercenter_quick_entrysuccess_click";//个人中心快捷进房点击成功匹配
String EVENT_USERCENTER_BANNER_CLICK = "usercenter_banner_click";//个人中心banner模块点击 String EVENT_USERCENTER_BANNER_CLICK = "usercenter_banner_click";//个人中心banner模块点击