Commit 1b4ccdf4 by 刘鹏

feat: 埋点完成

parent e8c6a1ea
......@@ -16,6 +16,8 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
......@@ -26,6 +28,7 @@ class MeditationTypeAdapter(
private val moreLink: String?,
private val homeLink:String?=null,
private val cateId:Long?=null,
private val buried:String?=null,
private val mark:Int?=null,
private val meditationType: Int? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
......@@ -64,6 +67,13 @@ class MeditationTypeAdapter(
}
holder.cvLayout?.setOnClickListener {
ActionCountUtils.baiDuCountSign3(
HomeBIConstants.YDL_USER_MAIN_PAGE_MUSE,
HomeBIConstants.YDL_HOME_MEDITATION_CLICK,
buried ?: "",
(position+1).toString(),
""
)
if (meditationType == 0){
if (Utils.isFastClick()) {
//防止连击
......@@ -103,6 +113,9 @@ class MeditationTypeAdapter(
//防止连击
return@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,buried?:"")
val moreLink = "${moreLink}mark=$mark&cateId=$cateId"
if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null))
......
......@@ -27,6 +27,7 @@ class MeditationViewPagerAdapter(private val context: Context, private val data:
moreLink = it.lowerFloorMore?:"",
homeLink = it.mditationDetailUrl,
cateId = it.cateId,
buried = it.buried,
mark = it.mark,
meditationType = it.meditionType)
}
......
......@@ -41,7 +41,13 @@ class HomeBIConstants {
const val YDL_HOME_ZHUMIANICON: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_type_click" // 首页_助眠_icon
const val YDL_HOME_SEARCH_TAG: String = YDL_USER_MAIN_PAGE + "ydl_user_search_tag" // 首页_定制咨询点击tag
const val YDL_HOME_POPUPWINDOWS_PAGE_POPUP: String = YDL_USER_MAIN_PAGE + "popupwindows_page_popup" // 首页弹窗页面弹出事件(99元3小时弹出事件)
//首页_冥想(ydl_user_main_page)
const val YDL_USER_MAIN_PAGE_MUSE: String = "ydl_user_main_page"//壹点灵用户版首页 partId
const val YDL_HOME_MEDITATION_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_more_click" // 冥想助眠更多点击事件
const val YDL_HOME_MEDITATION_SUBJECT_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_subject_click" // 冥想|声音|睡眠点击事件
const val YDL_HOME_MEDITATION_VOICE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_voice_more_click" // 冥想|声音|睡眠_更多点击事件
const val YDL_HOME_MEDITATION_CLICK: String = "main_meditation_meditation_click" // 冥想_声音点击事件
}
......
......@@ -12,16 +12,15 @@ import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.MeditationViewPagerAdapter
import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.MeditationModuleBean
......@@ -68,6 +67,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))
}
......@@ -127,6 +128,10 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
//冥想|声音|睡眠点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_SUBJECT_CLICK,
tab?.let { bean?.mditationListResponse?.get(it.position)?.buried } ?:"")
var text: String? = tab?.text.toString().trim()
val spStr = SpannableString(text)
val styleSpan = StyleSpan(Typeface.BOLD)
......
package com.yidianling.muse.constants
/**
* @author liunpeng
* */
class MuseBIConstants {
companion object {
//音乐播放页(meditation_music_play_page)
const val YDL_MUSE_MEDITATION_MUSIC_PLAY_PAGE: String =
"meditation_music_play_page"//音乐播放页(meditation_music_play_page)
const val YDL_MUSE_PLAY_PACK_CLICK: String =
"music_play_pack_click"//收起点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_CLOSE_CLICK: String =
"music_play_close_click" //关闭点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_COLLECT_CLICK: String =
"music_play_collect_click"//收藏点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_SHARE_CLICK: String =
"music_play_share_click"//分享点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_IOC_CLICK: String =
"music_play_ioc_click"//定时 ioc点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PROGRESS_CLICK: String =
"music_play_progress_click"//进度条点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_SPEED_CLICK: String =
"music_play_speed_click"//快进点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_REW_CLICK: String =
"music_play_rew_click"//快退点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_NEXT_CLICK: String =
"music_play_next_click"//下一个点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_LAST_CLICK: String =
"music_play_last_click"//上一个点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PAUSE_CLICK: String =
"music_play_pause_click"//暂停点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PLAY_CLICK: String =
"music_play_play_click"//播放点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PAGE_VISIT: String =
"music_play_page_visit"//曝光事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_CHANGE_CLICK: String =
"music_play_change_click"//切换音频点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_LIST_CLICK: String =
"music_play_list_click"//列表点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
//悬浮窗(meditation_floating_window_play)
private const val YDL_MUSE_MEDITATION_FLOATING_WINDOW: String =
"meditation_floating_window_play|"//悬浮窗
const val YDL_MUSE_MEDITATION_WINDOW_PLAY_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_play_click"//悬浮窗播放点击事件
const val YDL_MUSE_MEDITATION_WINDOW_PAUSE_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_pause_click"//悬浮窗暂停点击事件
const val YDL_MUSE_MEDITATION_WINDOW_CLOSE_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_close_click"//悬浮窗关闭点击事件
const val YDL_MUSE_MEDITATION_WINDOW_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_click"//悬浮窗播放区域点击 事件
}
}
\ No newline at end of file
......@@ -21,10 +21,12 @@ import androidx.core.app.NotificationCompat
import androidx.lifecycle.LifecycleService
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.http.MuseHttp
import com.yidianling.muse.R
import com.yidianling.muse.activity.PlayMeditationActivity
import com.yidianling.muse.bean.MeditationPlayModuleBean
import com.yidianling.muse.constants.MuseBIConstants
import com.yidianling.muse.event.MeditationFloatEvent
import com.yidianling.muse.helper.MediaPlayerManager
import de.greenrobot.event.EventBus
......@@ -117,6 +119,9 @@ class MeditationWindowService : LifecycleService() {
private fun updateFloatView(meditation: MeditationPlayModuleBean.MeditationDetail) {
mMediaPlayer = MediaPlayerManager.getInstance(this)?.getMediaPlayer()
floatRootView?.setOnClickListener {
//悬浮窗暂停点击事件
ActionCountUtils.count(MuseBIConstants.YDL_MUSE_MEDITATION_WINDOW_CLICK,"")
val intent = Intent(this, PlayMeditationActivity::class.java)
intent.putExtra("MEDIA_ID", meditation.mediaId)
intent.putExtra("MEDITATION_ID", meditation.meditationId)
......@@ -143,6 +148,9 @@ class MeditationWindowService : LifecycleService() {
ivPlayOrPause?.setOnClickListener {
if (mMediaPlayer?.isPlaying == true) {
//悬浮窗暂停点击事件
ActionCountUtils.count(MuseBIConstants.YDL_MUSE_MEDITATION_WINDOW_PAUSE_CLICK,"")
MediaPlayerManager.getInstance(this)?.pause()
if (meditation.meditationId != null && meditation.mediaId != null) {
MuseHttp.getInstance().postMeditationPlayRecord(
......@@ -164,6 +172,8 @@ class MeditationWindowService : LifecycleService() {
})
}
} else {
//悬浮窗播放点击事件
ActionCountUtils.count(MuseBIConstants.YDL_MUSE_MEDITATION_WINDOW_PLAY_CLICK,"")
MediaPlayerManager.getInstance(this)?.play()
}
if (mMediaPlayer?.isPlaying == true) {
......@@ -194,6 +204,9 @@ class MeditationWindowService : LifecycleService() {
}
ivClose?.setOnClickListener {
//悬浮窗关闭点击事件
ActionCountUtils.count(MuseBIConstants.YDL_MUSE_MEDITATION_WINDOW_CLOSE_CLICK,"")
postPlayRecord(
1, (ivProgress?.curProcess?.div(1000.00))?.roundToInt() ?: 0,
0,
......
......@@ -492,6 +492,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
jtv_test?.postDelayed({ YdlBuryPointUtil.sendPv("PvEvent") }, 300)
jtv_test?.postDelayed({ YdlBuryPointUtil.sendClick("ClickEvent") }, 500)
} else if (id == R.id.ll_meditation) { //冥想
count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "冥想")
val h5Params3 = H5Params(MH5_URL + "meditation?hideNavBar=1", null)
NewH5Activity.start(activity, h5Params3)
}
......
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