Commit 2b3616b4 by 刘鹏

feat: 路由问题修复

parent f03c518a
......@@ -8,11 +8,15 @@ import com.ydl.confide.api.IConfideService;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydl_router.manager.YDLRouterParams;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.im.api.service.IImService;
import com.yidianling.muse.activity.ChooseMusicActivity;
import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
/**
* webview 点击事件监听 抽象类
* Created by harvie on 2017/7/4 0004.
......@@ -453,12 +457,12 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
public void playMeditation(int mediaId, long meditationId, int meditationType, String mediaCoverUrl) {
if (mContext instanceof NewH5Activity) {
ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", meditationId)
.withLong("MEDIA_ID", mediaId)
.withInt("MEDITATION_TYPE", meditationType)
.withString("MEDIA_COVER_URL", mediaCoverUrl)
.navigation();
YDLRouterManager.Companion.router(ROUTER_MUSE_PLAY,
new YDLRouterParams().putExtra("MEDITATION_ID", String.valueOf(meditationId))
.putExtra("MEDIA_ID", String.valueOf(mediaId))
.putExtra("MEDITATION_TYPE", String.valueOf(meditationType))
.putExtra("MEDIA_COVER_URL", mediaCoverUrl));
}
}
......@@ -466,10 +470,10 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
public void switchSound(int mediaId, long meditationId, int meditationType, int businessType,
String buried, String mediaUrl, String mediaCoverUrl,
String title, String desc, int status) {
if (mContext instanceof NewH5Activity ) {
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).switchSound(mediaId, meditationId, meditationType,
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
}else if (mContext instanceof ChooseMusicActivity){
} else if (mContext instanceof ChooseMusicActivity) {
((ChooseMusicActivity) mContext).switchSound(mediaId, meditationId, meditationType,
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
}
......
......@@ -9,7 +9,7 @@ ext {
"m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.19",
"m-home" : "0.0.23.67",
"m-home" : "0.0.23.71",
"m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.10",
......@@ -35,7 +35,7 @@ ext {
//mdt 组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.15",
"ydl-platform" : "0.0.41.20",
//第二步 若干
"ydl-webview" : "0.0.38.84",
......@@ -94,7 +94,7 @@ ext {
"m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08",
"m-user" : "0.0.62.19",
"m-home" : "0.0.23.67",
"m-home" : "0.0.23.71",
"m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.8",
......@@ -118,7 +118,7 @@ ext {
//mdt组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.15",
"ydl-platform" : "0.0.41.20",
//第二步 若干
"ydl-webview" : "0.0.38.84",
......
......@@ -9,12 +9,14 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant.Companion.ROUTER_MUSE_PLAY
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.constants.HomeBIConstants
......@@ -26,10 +28,10 @@ class MeditationTypeAdapter(
private val context: Context,
private val data: List<MeditationModuleBean.MeditationDetail>?,
private val moreLink: String?,
private val homeLink:String?=null,
private val cateId:Long?=null,
private val buried:String?=null,
private val mark:Int?=null,
private val homeLink: String? = null,
private val cateId: Long? = null,
private val buried: String? = null,
private val mark: Int? = null,
private val meditationType: Int? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
......@@ -71,36 +73,48 @@ class MeditationTypeAdapter(
HomeBIConstants.YDL_USER_MAIN_PAGE_MUSE,
HomeBIConstants.YDL_HOME_MEDITATION_CLICK,
buried ?: "",
(position+1).toString(),
(position + 1).toString(),
""
)
if (meditationType == 0){
if (meditationType == 0) {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if(!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(context,true)){
if (!ModularServiceManager.provide(IUserService::class.java)
.loginByOneKeyLogin(context, true)
) {
return@setOnClickListener
}
if(data==null){
return@setOnClickListener
if (data == null) {
return@setOnClickListener
}
ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", data[position]?.meditationId)
.withInt("MEDITATION_TYPE", meditationType)
.withFloat("MEDIA_DURATION", data[position].duration?:0.0f)
.withString("MEDIA_URL", data[position].mediaIdCoverImageUrl)
.withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl)
.navigation()
}else{
// ARouter.getInstance().build("/muse/play")
// .withLong("MEDITATION_ID", data[position]?.meditationId)
// .withInt("MEDITATION_TYPE", meditationType)
// .withFloat("MEDIA_DURATION", data[position].duration ?: 0.0f)
// .withString("MEDIA_URL", data[position].mediaIdCoverImageUrl)
// .withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl)
// .navigation()
YDLRouterManager.router(ROUTER_MUSE_PLAY,
YDLRouterParams().putExtra("MEDITATION_ID" , data[position]?.meditationId.toString())
.putExtra("MEDITATION_TYPE", meditationType.toString())
.putExtra("MEDIA_DURATION", (data[position].duration?:0).toString())
.putExtra("MEDIA_URL", data[position].mediaIdCoverImageUrl.toString())
.putExtra("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl.toString()))
} else {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if(data==null){
return@setOnClickListener
if (data == null) {
return@setOnClickListener
}
val homeLink = "${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
val homeLink =
"${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
if (!homeLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(homeLink, null))
}
......@@ -114,7 +128,10 @@ class MeditationTypeAdapter(
return@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,buried?:"")
ActionCountUtils.count(
HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,
buried ?: ""
)
val moreLink = "${moreLink}mark=$mark&cateId=$cateId"
if (!moreLink.isNullOrBlank()) {
......
......@@ -61,6 +61,8 @@ interface IYDLRouterConstant{
const val ROUTER_CHAT_CONSULT_ASSISTANT = ROUTER_BASE + "chat/ChatService"
//冥想过渡页面
const val ROUTER_MUSE_CENTER = ROUTER_BASE + "muse/MuseService"
//冥想播放页面
const val ROUTER_MUSE_PLAY = ROUTER_BASE + "muse/play"
/**
* 参数名称
*/
......
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