Commit b81ea17f by 徐健

在user组件增加双十一活动是否展示属性

parent 5ea2e0ca
...@@ -82,6 +82,7 @@ dependencies { ...@@ -82,6 +82,7 @@ dependencies {
implementation modularPublication('com.ydl:m-consultant-api') implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-tests-api') implementation modularPublication('com.ydl:m-tests-api')
implementation modularPublication('com.ydl:m-im-api')
implementation project(':ydl-webview') implementation project(':ydl-webview')
implementation project(':ydl-media') implementation project(':ydl-media')
implementation project(":ydl-platform") implementation project(":ydl-platform")
...@@ -91,6 +92,7 @@ dependencies { ...@@ -91,6 +92,7 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"] compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"] compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api (rootProject.ext.dependencies["ydl-platform"]) { api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
} }
......
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-home-api" artifactId = "m-home-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"] // version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
package com.yidianling.home.modular
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.yidianling.home.api.service.IHomeService
import com.yidianling.home.ui.utils.Double11ActivityManagerUtils
@Route(path = "/home/HomeService")
class HomeServiceImpl : IHomeService {
override fun init(context: Context?) {
}
override fun setDouble11ShowType(mBool: Boolean) {
Double11ActivityManagerUtils.notShowDouble11Activity = mBool
}
}
\ No newline at end of file
...@@ -8,7 +8,6 @@ public class Double11ActivityManagerUtils { ...@@ -8,7 +8,6 @@ public class Double11ActivityManagerUtils {
/** /**
* 不显示双11活动,仅用于2019年双11活动使用 * 不显示双11活动,仅用于2019年双11活动使用
*/ */
//todo xj 国威说需要在登录接口设置该字段,如果是第一次登录则设置为true,表示不显示,避免与新用户弹框重复
public static boolean notShowDouble11Activity = false; public static boolean notShowDouble11Activity = false;
} }
package com.yidianling.home.event; package com.yidianling.home.api.event;
public class HomeModuleTabEvent { public class HomeModuleTabEvent {
int tabIndex; int tabIndex;
......
package com.yidianling.home.api.service
import com.alibaba.android.arouter.facade.template.IProvider
interface IHomeService : IProvider {
//如果是第一次登录则设置为true,表示不显示,避免与新用户弹框重复
fun setDouble11ShowType(mBool: Boolean)
}
\ No newline at end of file
...@@ -27,7 +27,6 @@ import com.yidianling.home.constract.IHomeContract ...@@ -27,7 +27,6 @@ import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.dialog.ActivityDialog import com.yidianling.home.dialog.ActivityDialog
import com.yidianling.home.dialog.ActivityGuideDialog import com.yidianling.home.dialog.ActivityGuideDialog
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.listener.HomeConfideRecyleSuspendListener import com.yidianling.home.listener.HomeConfideRecyleSuspendListener
import com.yidianling.home.model.bean.* import com.yidianling.home.model.bean.*
import com.yidianling.home.presenter.HomePresenterImpl import com.yidianling.home.presenter.HomePresenterImpl
...@@ -49,8 +48,8 @@ import kotlinx.android.synthetic.xlzx.layout_home_module_toolbar.* ...@@ -49,8 +48,8 @@ import kotlinx.android.synthetic.xlzx.layout_home_module_toolbar.*
*/ */
class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>(), class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>(),
IHomeContract.View, IHomeContract.View,
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
private var adapter: YdlHomeAdapter? = null private var adapter: YdlHomeAdapter? = null
...@@ -96,7 +95,12 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -96,7 +95,12 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private fun initView() { private fun initView() {
home_swipe_refresh_layout.setOnRefreshListener(this) home_swipe_refresh_layout.setOnRefreshListener(this)
home_swipe_refresh_layout.setColorSchemeColors(ContextCompat.getColor(context, R.color.platform_main_theme_blue)) home_swipe_refresh_layout.setColorSchemeColors(
ContextCompat.getColor(
context,
R.color.platform_main_theme_blue
)
)
home_swipe_refresh_layout.setProgressViewOffset(false, 0, 200) home_swipe_refresh_layout.setProgressViewOffset(false, 0, 200)
home_swipe_refresh_layout.isEnabled = false home_swipe_refresh_layout.isEnabled = false
etSearch.setOnClickListener { homeEvent?.searchTvClick("") } etSearch.setOnClickListener { homeEvent?.searchTvClick("") }
...@@ -108,7 +112,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -108,7 +112,9 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
appbar_layout.addOnOffsetChangedListener { appBarLayout, i -> appbar_layout.addOnOffsetChangedListener { appBarLayout, i ->
home_swipe_refresh_layout.isEnabled = i >= 0 home_swipe_refresh_layout.isEnabled = i >= 0
val scale = java.lang.Float.valueOf(Math.abs(i).toFloat())!! / java.lang.Float.valueOf(appBarLayout.totalScrollRange.toFloat())!! val scale = java.lang.Float.valueOf(Math.abs(i).toFloat())!! / java.lang.Float.valueOf(
appBarLayout.totalScrollRange.toFloat()
)!!
view_search_toolbar_bg.alpha = scale view_search_toolbar_bg.alpha = scale
val leftMargin = inputOriginMargin - inputOffset * scale val leftMargin = inputOriginMargin - inputOffset * scale
val rightMargin = inputOriginMargin - inputOffset * scale val rightMargin = inputOriginMargin - inputOffset * scale
...@@ -222,12 +228,18 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -222,12 +228,18 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
aa = ActivityDialog(activity, act.imageBanner, act.linkUrl, act.title) aa = ActivityDialog(activity, act.imageBanner, act.linkUrl, act.title)
aa?.show() aa?.show()
aa?.setOnDismissListener { aa?.setOnDismissListener {
if (!TextUtils.isEmpty(act.title)){ if (!TextUtils.isEmpty(act.title)) {
img_ad.post { img_ad.post {
val heig = StatusBarUtils.getStatusBarHeight(context) val heig = StatusBarUtils.getStatusBarHeight(context)
var location = IntArray(2) var location = IntArray(2)
img_ad.getLocationInWindow(location) img_ad.getLocationInWindow(location)
ActivityGuideDialog(activity, act.imageUrl, act.title, location[1] - heig, location[0]).show() ActivityGuideDialog(
activity,
act.imageUrl,
act.title,
location[1] - heig,
location[0]
).show()
} }
} }
} }
...@@ -269,10 +281,14 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -269,10 +281,14 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
for (item in cacheList) { for (item in cacheList) {
imageViews.add(item.imageUrl!!) imageViews.add(item.imageUrl!!)
} }
banner_search.setImageLoader(GlideImageLoader(R.drawable.home_module_image_default_back)).setImages(imageViews).start() banner_search.setImageLoader(GlideImageLoader(R.drawable.home_module_image_default_back))
.setImages(imageViews).start()
banner_search.setOnBannerListener { banner_search.setOnBannerListener {
homeEvent?.bannerClick(cacheList!![it]) homeEvent?.bannerClick(cacheList!![it])
YdlBuryPointUtil.sendClick("ydl-xinlizixun-home-banner$it", "${cacheList[it].imageUrl}") YdlBuryPointUtil.sendClick(
"ydl-xinlizixun-home-banner$it",
"${cacheList[it].imageUrl}"
)
} }
banner_search.setIndicatorBottomPadding(20) banner_search.setIndicatorBottomPadding(20)
} }
...@@ -361,7 +377,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -361,7 +377,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
} }
private fun showConsultAssistantDialog() { private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).showConsultAssistantDialog(activity) ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(activity)
} }
private fun hideConsultAssistantDialog() { private fun hideConsultAssistantDialog() {
......
...@@ -87,9 +87,11 @@ dependencies { ...@@ -87,9 +87,11 @@ dependencies {
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-audioim-api') implementation modularPublication('com.ydl:m-audioim-api')
implementation modularPublication('com.ydl:m-home-api')
}else { }else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies['m-home-api']
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"] compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
......
...@@ -9,11 +9,13 @@ import com.ydl.ydlcommon.base.BaseActivity ...@@ -9,11 +9,13 @@ import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.UserInfoCache import com.ydl.ydlcommon.utils.UserInfoCache
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.home.api.service.IHomeService
import com.yidianling.router.im.IMLoginInfo import com.yidianling.router.im.IMLoginInfo
import com.yidianling.router.im.IMRequestCallback import com.yidianling.router.im.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
...@@ -148,6 +150,7 @@ class SmsLoginActivity : BaseActivity() { ...@@ -148,6 +150,7 @@ class SmsLoginActivity : BaseActivity() {
//关闭手势解锁页面与指纹解锁页面 //关闭手势解锁页面与指纹解锁页面
finishFinger() finishFinger()
if (it.firstLogin == 1) { if (it.firstLogin == 1) {
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
baiduActionBury() baiduActionBury()
}else { }else {
ActionCountUtils.countUid(it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN) ActionCountUtils.countUid(it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN)
......
...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter ...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.text.TextUtils import android.text.TextUtils
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StringUtils import com.ydl.ydlcommon.utils.StringUtils
...@@ -10,6 +11,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils ...@@ -10,6 +11,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
...@@ -58,6 +60,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -58,6 +60,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
saveUserData(it.data) saveUserData(it.data)
ActionCountUtils.count(UserBIConstants.ACTION_TYPE_RESET_PWD) ActionCountUtils.count(UserBIConstants.ACTION_TYPE_RESET_PWD)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点 // 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury() //view.baiduActionBury()
} else { } else {
...@@ -96,6 +99,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -96,6 +99,7 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
} else { } else {
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury() mView.baiduActionBury()
} else { } else {
ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_PWD_LOGIN,it.data.uid!!) ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_PWD_LOGIN,it.data.uid!!)
......
...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint ...@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.text.TextUtils import android.text.TextUtils
import com.umeng.socialize.bean.SHARE_MEDIA import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
...@@ -11,6 +12,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils ...@@ -11,6 +12,7 @@ import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
...@@ -71,6 +73,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -71,6 +73,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
//绑定手机号 //绑定手机号
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK) mView.baiduActionBury(it.data.uid, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK)
} else { } else {
ActionCountUtils.count(UserBIConstants.ACTION_TYPE_DIRECT_LOGIN) ActionCountUtils.count(UserBIConstants.ACTION_TYPE_DIRECT_LOGIN)
...@@ -201,6 +204,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -201,6 +204,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
LogHelper.getInstance().writeLogSync(media.getName() + "登录成功") LogHelper.getInstance().writeLogSync(media.getName() + "登录成功")
if (media == SHARE_MEDIA.QQ) { if (media == SHARE_MEDIA.QQ) {
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK)
} else { } else {
ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN, ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN,
...@@ -209,6 +213,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -209,6 +213,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
} }
} else { } else {
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK)
} else { } else {
ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN, ActionCountUtils.count(UserHelper.getUserInfo()!!.uid, UserBIConstants.PART_ID_LOGIN_MAIN,
......
package com.yidianling.user.ui.login.presenter package com.yidianling.user.ui.login.presenter
import android.text.TextUtils import android.text.TextUtils
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.api.service.IHomeService
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
...@@ -144,6 +146,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base ...@@ -144,6 +146,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
ModularServiceManager.provide(IHomeService::class.java).setDouble11ShowType(true)
mView.baiduActionBury() mView.baiduActionBury()
} else { } else {
ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_CODE_LOGIN,it.data.uid!!) ActionCountUtils.countUid(UserBIConstants.ACTION_TYPE_CODE_LOGIN,it.data.uid!!)
......
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