Commit fe9433f7 by 霍志良

feat:未登录状态导医点击直接跳转

parent f6da08cb
......@@ -6,11 +6,11 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.52",
"m-consultant" : "0.0.60.04",
"m-consultant" : "0.0.60.08",
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.94",
"m-user" : "0.0.61.96",
"m-home" : "0.0.22.85",
"m-im" : "0.0.21.17",
"m-im" : "0.0.21.18",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10",
......@@ -26,7 +26,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
......@@ -89,11 +89,11 @@ ext {
//第三步 若干
"m-confide" : "0.0.49.52",
"m-consultant" : "0.0.60.03",
"m-consultant" : "0.0.60.08",
"m-fm" : "0.0.30.07",
"m-user" : "0.0.61.94",
"m-user" : "0.0.61.96",
"m-home" : "0.0.22.85",
"m-im" : "0.0.21.17",
"m-im" : "0.0.21.18",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8",
......@@ -108,7 +108,7 @@ ext {
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.17",
"m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23",
"m-dynamic-api" : "0.0.3.71",
......
......@@ -5,6 +5,7 @@ import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -16,6 +17,7 @@ import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.home.api.event.HomeModuleTabEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -114,11 +116,22 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (ConsultantIn.getUserImpl().loginByOneKeyLogin(activity,true)){
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid("", activity, 1)
}
override fun notLogin() {
}
})
}
}
......@@ -150,10 +163,20 @@ class ConsultAssistantDialogUtils private constructor() {
if (Utils.isFastClick()) {
return onClickAction()
}
if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(activity, true)) {
return
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid("", activity, 17)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid("", activity, 17)
}
override fun notLogin() {
}
})
}
getConsultAssistantUid("", activity, 17)
}
})
......@@ -243,10 +266,19 @@ class ConsultAssistantDialogUtils private constructor() {
}
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (ConsultantIn.loginByOneKeyLogin(activity, true)) {
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid(origin, activity, 6)
}
override fun notLogin() {
}
})
}
}
......
......@@ -841,7 +841,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
})
}
},2000)
},1000)
}
......
......@@ -14,6 +14,7 @@ import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.Logout
import com.yidianling.user.route.UserIn
......@@ -35,7 +36,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
* time : 2018/05/09
*/
object LoginUtils {
var logingCallBackListener: LoginCallBackListener? = null
fun setLoginCallBack(listener: LoginCallBackListener) {
logingCallBackListener = listener
}
@JvmStatic
fun saveData(userInfo: UserResponseBean?) {
UserHelper.setUserinfo(userInfo)
......@@ -107,6 +111,7 @@ object LoginUtils {
@JvmStatic
fun loginSuccessOperate(activity: Activity) {
logingCallBackListener?.loginSuccess()
// 登录成功后,如果一键登录界面没有关闭,则关闭掉
OneKeyLoginHelp.quitLoginPage()
val size = ActivityManager.getActivitySize()
......
......@@ -20,6 +20,7 @@ import com.yidianling.user.UserConstants
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -321,4 +322,12 @@ public class UserServiceImp : IUserService {
override fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean):Boolean {
return OneKeyLoginHelp.startLoginByStatus(context,isOpenDialog)
}
override fun loginByOneKeyLoginCallBack(
context: Context,
isOpenDialog: Boolean,
listener: LoginCallBackListener
) {
OneKeyLoginHelp.startLoginByStatusLoginCallBack(context,isOpenDialog,listener)
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.PhoneLoginAutoParam
......@@ -526,6 +527,7 @@ object OneKeyLoginHelp {
// 号码验证监听
private lateinit var verifyTokenResultListener: VerifyTokenResultListener
interface VerifyTokenResultListener {
fun onTokenSuccess(result: String)
......@@ -591,7 +593,23 @@ object OneKeyLoginHelp {
}
return UserHelper.isLogin()
}
/**
* @param isOpenDialog true: 使用弹窗展示一键登录
* false: 使用全页面展示一键登录
* @return true:登录。false:未登录
* */
fun startLoginByStatusLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener) {
LoginUtils.setLoginCallBack(listener)
if (!UserHelper.isLogin()) {
if (this::mActivity.isInitialized) {
//如果mActivity有初始化,代表项目使用了一键登录
startLogin(context as Activity, isOpenDialog)
} else {
//如果mActivity未初始化,使用正常登录
RegisterAndLoginActivity.start(context)
}
}
}
/**
* @param isOpenDialog true 使用弹窗
* */
......
package com.yidianling.user.api.listener
interface LoginCallBackListener {
fun loginSuccess()
fun notLogin()
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.bean.UserSettingBean
import com.yidianling.user.api.listener.LoginCallBackListener
import com.yidianling.user.api.listener.SecretDataListener
import com.yidianling.user.api.listener.UserInfoFromApiListener
import com.yidianling.user.api.listener.VersionUpdateStatusListener
......@@ -114,4 +115,11 @@ interface IUserService : IProvider {
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLoginCallBack(context: Context, isOpenDialog: Boolean,listener: LoginCallBackListener)
}
\ No newline at end of file
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