Commit b81ea17f by 徐健

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

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