Commit 859a19a6 by 刘鹏

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

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