Commit 80d9b9ef by 霍志良

feat:心理咨询和壹点灵包m-home埋点

parent 4c425445
......@@ -9,7 +9,7 @@ ext {
"m-consultant" : "0.0.59.93",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.74",
"m-home" : "0.0.22.73",
"m-home" : "0.0.22.75",
"m-im" : "0.0.19.80",
"m-dynamic" : "0.0.7.29",
"m-article" : "0.0.0.10",
......@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.45",
"ydl-platform" : "0.0.40.48",
//第二步 若干
"ydl-webview" : "0.0.38.47",
......@@ -92,7 +92,7 @@ ext {
"m-consultant" : "0.0.59.93",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.73",
"m-home" : "0.0.22.73",
"m-home" : "0.0.22.75",
"m-im" : "0.0.19.80",
"m-dynamic" : "0.0.7.29",
"m-article" : "0.0.0.8",
......@@ -115,7 +115,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.43",
"ydl-platform" : "0.0.40.48",
//第二步 若干
"ydl-webview" : "0.0.38.47",
......
......@@ -36,6 +36,11 @@ class HomeBIConstants {
const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域
const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit "//首页浏览事件
const val YDL_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "private_chat_click" // 首页咨询分类点击私聊按钮
const val YDL_HOME_DWELL_TIME: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_stay_visit" // 首页停留时长
const val YDL_HOME_ZHUMIANMINGXIANG: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_more_click" // 首页助眠冥想
const val YDL_HOME_ZHUMIANICON: String = YDL_USER_MAIN_PAGE + "ydl_user_listen_type_click" // 首页_助眠_icon
}
}
\ No newline at end of file
......@@ -81,7 +81,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/
private var isFromCreate: Boolean = true
var startTime by Delegates.notNull<Long>()
var endTime by Delegates.notNull<Long>()
override fun layoutResId(): Int {
return R.layout.home_fragment_home_module
}
......@@ -387,11 +388,15 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private fun hideConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
override fun onStop() {
super.onStop()
endTime=System.currentTimeMillis()
ActionCountUtils.count(HomeBIConstants.YDL_HOME_DWELL_TIME,(endTime-startTime).toString())
}
override fun onResume() {
super.onResume()
startTime=System.currentTimeMillis()
if (userVisibleHint) {
if (isFromCreate) {
isFromCreate = false
mPresenter?.loadHomeData()
......
......@@ -5,6 +5,8 @@ import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.constract.IHomeContract
/**
......@@ -20,13 +22,14 @@ open class HomeImpl(context: Context, homeView: IHomeContract.View) : HomeBaseIm
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_HOME_ZHUMIANMINGXIANG)
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "")
.putExtra(IYDLRouterConstant.DATA_JSON, dataJson))
}
override fun museClick(musicUrl: String, dataJson: String) {
override fun museClick(musicUrl: String, dataJson: String,iconName:String) {
if (Utils.isFastClick()) {
//防止连击
return
......
......@@ -10,5 +10,5 @@ interface IHomeEvent {
/**
* 冥想item点击事件
*/
fun museClick(url: String, dataJson: String)
fun museClick(url: String, dataJson: String,iconName:String)
}
\ No newline at end of file
......@@ -22,9 +22,7 @@ import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.home.R
......@@ -43,6 +41,7 @@ import com.yidianling.home.ui.view.HomeSpaceItemDecoration
import com.yidianling.home.utils.HomeAnimUtils
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
import kotlin.properties.Delegates
/**
......@@ -94,6 +93,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
open var searchText: String = ""
open var doctorName: String = ""
var startTime by Delegates.notNull<Long>()
var endTime by Delegates.notNull<Long>()
/**
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
......@@ -511,8 +512,14 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
override fun onStop() {
super.onStop()
endTime=System.currentTimeMillis()
ActionCountUtils.count(HomeBIConstants.YDL_HOME_DWELL_TIME,(endTime-startTime).toString())
}
override fun onResume() {
super.onResume()
startTime=System.currentTimeMillis()
if (userVisibleHint) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
......
......@@ -53,44 +53,44 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
if (null != bean.muses) {
if (bean.muses?.size!! > 0) {
muse_first.setOnClickListener {
homeEvent?.museClick(bean.muses!![0].audioUrl, dataJson)
homeEvent?.museClick(bean.muses!![0].audioUrl, dataJson,muse_first_text.text.toString())
}
}
if (bean.muses?.size!! > 1) {
muse_second.setOnClickListener {
homeEvent?.museClick(bean.muses!![1].audioUrl, dataJson)
homeEvent?.museClick(bean.muses!![1].audioUrl, dataJson,muse_second_text.text.toString())
}
}
if (bean.muses?.size!! > 2) {
muse_third.setOnClickListener {
homeEvent?.museClick(bean.muses!![2].audioUrl, dataJson)
homeEvent?.museClick(bean.muses!![2].audioUrl, dataJson,muse_third_text.text.toString())
}
}
if (bean.muses?.size!! > 3) {
muse_forth.setOnClickListener {
homeEvent?.museClick(bean.muses!![3].audioUrl, dataJson)
homeEvent?.museClick(bean.muses!![3].audioUrl, dataJson,muse_forth_text.text.toString())
}
}
}
if (null != bean.sleeps) {
if (bean.sleeps?.size!! > 0) {
sleeps_first.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![0].audioUrl, dataJson)
homeEvent?.museClick(bean.sleeps!![0].audioUrl, dataJson,sleeps_first_text.text.toString())
}
}
if (bean.sleeps?.size!! > 1) {
sleeps_second.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![1].audioUrl, dataJson)
homeEvent?.museClick(bean.sleeps!![1].audioUrl, dataJson,sleeps_second_text.toString())
}
}
if (bean.sleeps?.size!! > 2) {
sleeps_third.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![2].audioUrl, dataJson)
homeEvent?.museClick(bean.sleeps!![2].audioUrl, dataJson,sleeps_third_text.text.toString())
}
}
if (bean.sleeps?.size!! > 3) {
sleeps_forth.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![3].audioUrl, dataJson)
homeEvent?.museClick(bean.sleeps!![3].audioUrl, dataJson,sleeps_forth_text.text.toString())
}
}
}
......
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