diff --git a/common/src/main/java/com/yunbao/common/bean/BannerBean.java b/common/src/main/java/com/yunbao/common/bean/BannerBean.java index 45e58e583..d48e7392a 100644 --- a/common/src/main/java/com/yunbao/common/bean/BannerBean.java +++ b/common/src/main/java/com/yunbao/common/bean/BannerBean.java @@ -29,6 +29,7 @@ public class BannerBean { private String wishlistProgress; @SerializedName("wishlist_name") private String wishlistName; + private Object data;//用来存储任意bean public String getmImageUrl() { return mImageUrl; @@ -189,6 +190,14 @@ public class BannerBean { this.mIconRes = mIconRes; } + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + @NonNull @Override public String toString() { diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java b/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java index 1cedccb49..400322cb9 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java @@ -26,10 +26,30 @@ public class LiveAnchorCallMeModel extends BaseModel { private AppBean line; @SerializedName("whatsApp") private AppBean whatsApp; + @SerializedName("isGet") + private int isGet; + @SerializedName("link") + private String link; public LiveAnchorCallMeModel() { } + public int getIsGet() { + return isGet; + } + + public void setIsGet(int isGet) { + this.isGet = isGet; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + public int getId() { return id; } @@ -114,6 +134,8 @@ public class LiveAnchorCallMeModel extends BaseModel { ", wechat=" + wechat + ", line=" + line + ", whatsApp=" + whatsApp + + ", isGet=" + isGet + + ", link='" + link + '\'' + '}'; } 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 208ac6b57..73d800acb 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -146,6 +146,7 @@ import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment; import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; +import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.event.LiveAudienceEvent; @@ -354,6 +355,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //----!主播说组件---// private Banner topBanner1;//心愿单&联系方式 public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; + private String mAnchorName;//主播名字 @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { @@ -2426,6 +2428,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 显示用户名 */ public void setName(String name) { + mAnchorName = name; if (mName != null) { mNameText = name; @@ -4797,19 +4800,36 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { Dialog loading = DialogUitl.loadingDialog(mContext); loading.show(); - LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); - fragment.setOnDismissListener(dialog -> { - checkNewLetter(); - } - ); - fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); - Bundle bundle = new Bundle(); - bundle.putString(Constants.LIVE_UID, mLiveUid); - bundle.putString(Constants.LIVE_STREAM, mStream); - bundle.putString(Constants.LIVE_WISH_GIFTID, mTopBannerList.get(position).getActivityId() + ""); - bundle.putBoolean("isContactGift", true); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + LiveNetManager.get(mContext) + .getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { + + @Override + public void onSuccess(LiveAnchorCallMeModel data) { + if (data.getIsGet() == 1) { + new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, mAnchorName, data.getLink()) + .setOnDismissListener(dialog -> loading.dismiss()) + .showDialog(); + return; + } + LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); + fragment.setOnDismissListener(dialog -> checkNewLetter() + ); + fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); + Bundle bundle = new Bundle(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + bundle.putString(Constants.LIVE_WISH_GIFTID, data.getGiftId() + ""); + bundle.putBoolean("isContactGift", true); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + } + + @Override + public void onError(String error) { + loading.dismiss(); + } + }); + } else { BannerBean bean = mTopBannerList.get(position); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); @@ -4842,6 +4862,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } }) .start(); + updateCallMe(); + } + + private void updateCallMe() { LiveNetManager.get(mContext) .getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { @Override @@ -4850,7 +4874,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (data.getIsShow() == 1) { topBanner1.setVisibility(View.VISIBLE); BannerBean call = new BannerBean(); - call.setActivityId(data.getGiftId()); + call.setData(data); call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR); mTopBannerList.add(0, call); topBanner1.update(mTopBannerList);