Commit 0e1cad6c by 严久程

课程、支付

parent 3a36d2aa
ext {
kotlin_version = '1.3.21'
dev_mode = false
dev_mode = true
ydl_app = [
appName : "心理咨询壹点灵",
......
......@@ -30,6 +30,7 @@ import com.ydl.ydlcommon.adapter.CommonRecyclerAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.ScreenUtil
......@@ -46,6 +47,7 @@ import com.yidianling.course.R
import com.yidianling.course.bean.CourseMediaBean
import com.yidianling.course.bean.CourseMediaDetailBean
import com.yidianling.course.coursePlay.presenter.CoursePlayPresenter
import com.yidianling.course.router.CourseIn
import kotlinx.android.synthetic.main.activity_course_play.*
import org.json.JSONException
import org.json.JSONObject
......@@ -527,8 +529,10 @@ class CoursePlayActivity : BaseActivity() {
dialog.setCallBack(object : YDLShareDialog.ICallBack {
override fun callBack(type: Int) {
if (1 == type) {
if (YdlCommonRouterManager.getYdlCommonRoute().getUid()<=0) {
YdlCommonRouterManager.getYdlCommonRoute().startChooseLoginWay(this@CoursePlayActivity)
ModularServiceManager.getPlatformUserService()
if (CourseIn.isLogin()) {
CourseIn.loginWayIntent(this@CoursePlayActivity)
} else {
//分享到心事动态
toTrend(share)
......
......@@ -11,7 +11,7 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterFragment
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.course.BuildConfig
......@@ -53,10 +53,11 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
override fun onMethodCall(methodCall: MethodCall, result: MethodChannel.Result) {
when (methodCall.method) {
GETPUBLICPARAMAS -> {
val loginBean = ModularServiceManager.getPlatformUserService()?.getUser()
val mMap = mutableMapOf<String, Any>()
mMap["isDevelopment"] = BuildConfig.DEBUG
mMap["uid"] = YdlCommonRouterManager.getYdlCommonRoute().getUid().toString()
mMap["accessToken"] = YdlCommonRouterManager.getYdlCommonRoute().getAccessToken()
mMap["uid"] = loginBean?.userId ?: 0
mMap["accessToken"] = loginBean?.token ?: ""
?: ""
mMap["isFromApp"] = "1"
mMap["version"] = RxDeviceTool.getAppVersionName(BaseApp.getApp())
......@@ -70,7 +71,11 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
var jumpUrl: String? = methodCall.arguments.toString()
if (!TextUtils.isEmpty(jumpUrl)) {
when {
jumpUrl!!.contains("user/login") -> mFragment!!.startActivity(CourseIn.loginWayIntent(mFragment!!.activity!!))
jumpUrl!!.contains("user/login") -> mFragment!!.startActivity(
CourseIn.loginWayIntent(
mFragment!!.activity!!
)
)
jumpUrl.contains("course/myCourse") -> MyCourseActivity.start(mFragment!!.activity)
jumpUrl.contains("course/specialList") -> //跳转专题列表页
mFragment!!.activity!!.startActivity(
......
......@@ -2,8 +2,10 @@ package com.yidianling.course.router
import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.router.user.UserResponse
import com.yidianling.user.api.service.IUserService
/**
* author : Zhangwenchao
......@@ -13,7 +15,7 @@ import com.yidianling.router.user.UserResponse
object CourseIn {
fun isLogin(): Boolean {
return RouterManager.getUserRouter()?.isLogin()?:false
return ModularServiceManager.provide(IUserService::class.java).isLogin()
}
fun getUserInfo(): UserResponse.UserInfo? {
......@@ -21,7 +23,7 @@ object CourseIn {
}
fun loginWayIntent(activity: Activity): Intent? {
return RouterManager.getUserRouter()?.loginWayIntent(activity)
return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
}
fun mainIntent(activity: Activity): Intent? {
......
......@@ -96,15 +96,18 @@
<!--弧度设置圆角Imageview-->
<!-- <attr name="pa_borderRadius" format="dimension" />-->
<!-- <attr name="pa_type">-->
<!-- <enum name="pa_circle" value="0" />-->
<!-- <enum name="pa_round" value="1" />-->
<!-- </attr>-->
<declare-styleable name="Platform_RoundImageView">
<attr name="pa_borderRadius" format="dimension" />
<attr name="pa_type">
<attr name="pa_type" >
<enum name="pa_circle" value="0" />
<enum name="pa_round" value="1" />
</attr>
<declare-styleable name="Platform_RoundImageView">
<attr name="pa_borderRadius" />
<attr name="pa_type" />
</declare-styleable>
<!--九宫格解锁-->
......
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