Commit 1d422b3c by 严久程

课程、支付

parent 0e1cad6c
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.text.TextUtils
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
......@@ -11,6 +12,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.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
......@@ -23,6 +25,7 @@ import com.yidianling.course.router.CourseIn
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.view.FlutterView
import org.json.JSONObject
/**
* @author jiucheng
......@@ -60,6 +63,7 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
mMap["accessToken"] = loginBean?.token ?: ""
?: ""
mMap["isFromApp"] = "1"
mMap["ffrom"] = PlatformDataManager.getRam().getChannelName()
mMap["version"] = RxDeviceTool.getAppVersionName(BaseApp.getApp())
mMap["osBuild"] =
RxDeviceTool.getBuildMANUFACTURER() + "," + RxDeviceTool.getBuildBrandModel() + "," + RxDeviceTool.getOsBuileVersion() + "," + RxDeviceTool.getAppVersionName(
......@@ -70,6 +74,11 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
JUMPURL -> {
var jumpUrl: String? = methodCall.arguments.toString()
if (!TextUtils.isEmpty(jumpUrl)) {
if (jumpUrl!!.startsWith("http")) {
val h5Params = H5Params(jumpUrl, "")
NewH5Activity.start(mFragment!!.activity, h5Params)
return
}
when {
jumpUrl!!.contains("user/login") -> mFragment!!.startActivity(
CourseIn.loginWayIntent(
......@@ -86,8 +95,9 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
)
jumpUrl.contains("course/detail") -> {
var uri = Uri.parse(jumpUrl)
var id = uri.getQueryParameter("id")
val h5Params = H5Params(CourseConstants.COURSE_DETAIL_H5 + id, "课程详情")
var resultParams = uri.getQueryParameter("params")
val jsonObject = JSONObject(resultParams)
val h5Params = H5Params(CourseConstants.COURSE_DETAIL_H5 + jsonObject.getString("id"), "课程详情")
NewH5Activity.start(mFragment!!.activity, h5Params)
}
else -> YDLRouterManager.router(jumpUrl)
......@@ -141,6 +151,7 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
// PlayerFloatHelper.show(mFragment!!.activity)
}
Handler().postDelayed({ CourseSendPlugin.sendMsg(true) }, 300)
PlayerFloatHelper.addClickListener(object : PlayerFloatView.FloatViewPlayListener {
override fun onStartClick() {
......
......@@ -97,6 +97,10 @@ class SearchBarView : LinearLayout {
}
fun setTextTitle(title: String) {
common_search_bar_btn.text = title
}
private fun setEditTextVisibility(boolean: Boolean) {
if (boolean) {
common_search_bar_text.visibility = View.GONE
......
......@@ -8,12 +8,29 @@
android:orientation="vertical"
>
<include layout="@layout/course_layout_title_bar"/>
<com.yidianling.course.widget.SearchBarView
android:id="@+id/search_view"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="44dp"
android:background="@color/course_color_FFFFFF"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="16dp">
<ImageView
android:id="@+id/iv_back"
android:layout_width="13dp"
android:layout_height="22dp"
android:scaleType="centerCrop"
android:src="@drawable/course_icon_back_black" />
<com.yidianling.course.widget.SearchBarView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:id="@+id/divider_line"
......
......@@ -15,7 +15,7 @@
android:layout_height="wrap_content"
android:visibility="gone"/>
<com.ydl.base_module.ui.searchbarview.SearchBarView
<com.yidianling.course.widget.SearchBarView
android:id="@+id/search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
......
......@@ -77,6 +77,7 @@ dependencies {
api rootProject.ext.dependencies["ydl-hnet"]
api rootProject.ext.dependencies["imagepicker"]
api rootProject.ext.dependencies["ydl-utils"]
api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ydl-flutter"]
api rootProject.ext.dependencies["ydl-net"]
api ('com.ydl:device-id:0.0.7@aar'){
......
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.ydl.ydlcommon.data.http.BaseCommand;
import com.ydl.ydlcommon.data.http.FormatText;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import com.ydl.ydlcommon.router.YdlUserInfo;
import com.yidianling.common.tools.RxAppTool;
......@@ -132,7 +133,7 @@ public class NetworkParamsUtils {
public static String getCommonParam() {
StringBuffer sb = new StringBuffer();
YdlUserInfo userInfo = YdlCommonRouterManager.INSTANCE.getYdlCommonRoute().getUserInfo();
YdlUserInfo userInfo = ModularServiceManager.INSTANCE.getPlatformUserService().getUser();
sb.append("ffrom").append("=").append(PlatformDataManager.INSTANCE.getRam().getChannelName())
.append("&").append("isFromApp").append("=").append("1")
.append("&").append("osBuild").append("=").append(RxDeviceTool.getBuildBrandModel()).append(",")
......
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