Commit 2b3616b4 by 刘鹏

feat: 路由问题修复

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