Commit 859a19a6 by 刘鹏

1.测试模块,登录接入优先一键登录功能

parent a69ee716
......@@ -33,11 +33,7 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
* 跳转我的界面
*/
override fun jumpMine() {
// TestHomeUtils.buildJumpMine(context!!)
if (!TestsIn.isLogin()) {
//如果未登录 走登录逻辑
context!!.startActivity(TestsIn.loginWayIntent(context as Activity))
if (!TestsIn.loginByOneKeyLogin(context as Activity,true)) {
return
}
val testParam = H5Params(HttpConfig.MH5_URL + "ceshi/my-test", "测试记录")
......
......@@ -67,10 +67,8 @@ class TestPlugin : MethodChannel.MethodCallHandler {
}
}
GO_MY_TESTS -> {
// ActionCountUtils.count(TestBIConstants.YDL_TEST__MAIN_MY_TEST_CLICK)
if (!TestsIn.isLogin()) {
if (!TestsIn.loginByOneKeyLogin(mActivity!!,true)) {
//如果未登录 走登录逻辑
mActivity?.startActivity(TestsIn.loginWayIntent(mActivity!!))
return
}
val testParam = H5Params(HttpConfig.MH5_URL + "ceshi/my-test", "测试记录")
......
......@@ -136,8 +136,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
BuryPointUtils.getInstance().createMap()
.put("test_type_click", testCategory?.get(position)?.name + "")
.burryPoint("Testtype_click")
if (("my" == testCategory?.get(position)?.tab || "unpay" == testCategory?.get(position)?.tab) && !TestsIn.isLogin()) {
startActivity(TestsIn.loginWayIntent(this@TestCategoryListActivity))
if (("my" == testCategory?.get(position)?.tab || "unpay" == testCategory?.get(position)?.tab) ) {
TestsIn.loginByOneKeyLogin(this@TestCategoryListActivity,true)
}
}
})
......
......@@ -57,11 +57,10 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
LogUtil.d("page selected: " + testCategorys?.get(position)?.name)
BuryPointUtils.getInstance().createMap()
.put("test_type_click", testCategorys?.get(position)?.name + "")
.burryPoint("Testtype_click")
if (("my" == testCategorys?.get(position)?.tab || "unpay" == testCategorys?.get(position)?.tab) && !TestsIn.isLogin()) {
// RouterManager.startActivity(this@TestListActivity,RouterEnum.USER,null,ClassNameEnum.ChooseLoginWayActivity)
startActivity(TestsIn.loginWayIntent(this@TestListActivity))
.put("test_type_click", testCategorys?.get(position)?.name + "")
.burryPoint("Testtype_click")
if (("my" == testCategorys?.get(position)?.tab || "unpay" == testCategorys?.get(position)?.tab)) {
TestsIn.loginByOneKeyLogin(this@TestListActivity, true)
}
}
})
......
package com.yidianling.tests.router
import android.app.Activity
import android.content.Context
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlUserInfo
......@@ -68,4 +69,13 @@ object TestsIn {
fun myRedPockIntent(activity: Activity){
getAppService().myRedPockIntent(activity)
}
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean{
return getUserService().loginByOneKeyLogin(context,isOpenDialog)
}
}
\ 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