新增H5网页跳转直播间并打开礼物栏选中礼物功能
This commit is contained in:
@@ -54,7 +54,8 @@ public class LiveBean implements Parcelable {
|
||||
private String recommendCardIconSizeThree = "";
|
||||
@SerializedName("red_packet_status")
|
||||
private int redPacketStatus;
|
||||
|
||||
@SerializedName("giftId")
|
||||
private String giftId;
|
||||
private Map<String,String> params;//用于跳转Activity时扩展参数,例:从首页Banner跳转到直播间时需要根据携带参数判断是否弹出新人特惠对话框
|
||||
|
||||
public String getRecommendCardIconSizeTwo() {
|
||||
@@ -66,6 +67,14 @@ public class LiveBean implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public String getRecommendCardIcon() {
|
||||
if (TextUtils.isEmpty(recommendCardIconSizeThree)) {
|
||||
if (!TextUtils.isEmpty(recommendCardIconSizeTwo)) {
|
||||
@@ -444,6 +453,7 @@ public class LiveBean implements Parcelable {
|
||||
this.recommendCardtype = in.readString();
|
||||
this.recommendCardIconSizeTwo = in.readString();
|
||||
this.recommendCardIconSizeThree = in.readString();
|
||||
this.giftId = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -488,6 +498,7 @@ public class LiveBean implements Parcelable {
|
||||
dest.writeString(this.recommendCardtype);
|
||||
dest.writeString(this.recommendCardIconSizeTwo);
|
||||
dest.writeString(this.recommendCardIconSizeThree);
|
||||
dest.writeString(this.giftId);
|
||||
}
|
||||
|
||||
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {
|
||||
|
||||
@@ -17,13 +17,16 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.ReportCommunityBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.VideoBean;
|
||||
import com.yunbao.common.bean.VideoListBean;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
@@ -253,6 +256,49 @@ public class JavascriptInterfaceUtils {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转直播并打开礼物栏选中礼物
|
||||
* @param liveId 直播间id
|
||||
* @param giftId 礼物id
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLiveGift(String liveId,String giftId){
|
||||
LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
liveBean.setGiftId(giftId);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
} else {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||
}
|
||||
androidGoBack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void androidMethodLookToLive(String liveId) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
@@ -550,28 +596,32 @@ public class JavascriptInterfaceUtils {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("clickLogOffAccount"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidFansGroupBuy(String id){
|
||||
public void androidFansGroupBuy(String id) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidFansGroupBuy").setUserId(id));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidFansGroupPack(){
|
||||
public void androidFansGroupPack() {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidFansGroupPack"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidFansGroupInfo(){
|
||||
public void androidFansGroupInfo() {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidFansGroupInfo"));
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl,int isAnchor ) {
|
||||
RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0,isAnchor==1);
|
||||
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl, int isAnchor) {
|
||||
RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0, isAnchor == 1);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void wearOrCancelFanMedal(){
|
||||
public void wearOrCancelFanMedal() {
|
||||
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
|
||||
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
|
||||
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
|
||||
@@ -587,8 +637,9 @@ public class JavascriptInterfaceUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void androidCancelAnchorAttention(){
|
||||
public void androidCancelAnchorAttention() {
|
||||
Bus.get().post(new JavascriptInterfaceEvent()
|
||||
.setMethod("androidCancelAnchorAttention"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user