diff --git a/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java b/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java index 58cd6a217..e94be4e5f 100644 --- a/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java +++ b/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import android.text.TextUtils; + import com.google.gson.annotations.SerializedName; public class StarChallengeStatusModel extends BaseModel { @@ -28,6 +30,33 @@ public class StarChallengeStatusModel extends BaseModel { private String taskName1; @SerializedName("taskName2") private String taskName2; + //活动地址 + @SerializedName("activityUrl") + private String activityUrl; + + private String type = "2"; + + public String getType() { + return type; + } + + public StarChallengeStatusModel setType(String type) { + this.type = type; + return this; + } + + public StarChallengeStatusModel(String activityUrl) { + this.activityUrl = activityUrl; + } + + public String getActivityUrl() { + return activityUrl; + } + + public StarChallengeStatusModel setActivityUrl(String activityUrl) { + this.activityUrl = activityUrl; + return this; + } public String getTaskName1() { return taskName1; diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index a1e4d51ae..34f97ddf5 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -62,6 +62,7 @@ import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.BannerBean; import com.yunbao.common.bean.HourRank; +import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.MsgModel; @@ -1055,14 +1056,43 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onBannerClick(List datas, int p) { if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); BannerBean bean = mBannerList2.get(p); - if (bean.getShow_type().equals("1")) { - String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis(); - ZhuangBanActivity.forward(mContext, url, false); + String type = ""; + StringBuffer htmlUrl = new StringBuffer(); + //判断是否是星级活动 + if (bean.isStart()) { + type = bean.getModel().getType(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/") + .append(bean.getModel().getActivityUrl()) + .append("&nickname=") + .append(userInfo.getUserNicename()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&uid=") + .append(userInfo.getId()) + .append("&k=") + .append(System.currentTimeMillis()); + } else { + type = bean.getShow_type(); + htmlUrl.append(bean.getLink()) + .append("?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&t=") + .append(System.currentTimeMillis()); + } + if (TextUtils.equals(type, "1")) { + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else { - String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&t=" + System.currentTimeMillis(); Bundle bundle = new Bundle(); - bundle.putString("url", url); + bundle.putString("url", htmlUrl.toString()); LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle); fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); @@ -1082,14 +1112,43 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onBannerClick(List datas, int p) { if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); BannerBean bean = mBannerList2.get(p); - if (bean.getShow_type().equals("1")) { - String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, url, false); + String type = ""; + StringBuffer htmlUrl = new StringBuffer(); + //判断是否是星级活动 + if (bean.isStart()) { + type = bean.getModel().getType(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/") + .append(bean.getModel().getActivityUrl()) + .append("&nickname=") + .append(userInfo.getUserNicename()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&uid=") + .append(userInfo.getId()) + .append("&k=") + .append(System.currentTimeMillis()); + } else { + type = bean.getShow_type(); + htmlUrl.append(bean.getLink()) + .append("?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&t=") + .append(System.currentTimeMillis()); + } + if (TextUtils.equals(type, "1")) { + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else { - String url = bean.getLink() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; Bundle bundle = new Bundle(); - bundle.putString("url", url); + bundle.putString("url", htmlUrl.toString()); LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle); fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); diff --git a/live/src/main/res/drawable/titile_back.xml b/live/src/main/res/drawable/titile_back.xml new file mode 100644 index 000000000..191806871 --- /dev/null +++ b/live/src/main/res/drawable/titile_back.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 0cb734178..fab7f84b1 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -89,27 +89,6 @@ - - - - - + + + + + \ No newline at end of file