Commit 0e1cad6c by 严久程

课程、支付

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