根据需求调整送过一次联系方式礼物后,以后点击联系方式都是直接打开信件详情

This commit is contained in:
zlzw 2023-04-11 14:37:39 +08:00
parent b305ba925b
commit cfc72f7441
3 changed files with 69 additions and 14 deletions

View File

@ -29,6 +29,7 @@ public class BannerBean {
private String wishlistProgress; private String wishlistProgress;
@SerializedName("wishlist_name") @SerializedName("wishlist_name")
private String wishlistName; private String wishlistName;
private Object data;//用来存储任意bean
public String getmImageUrl() { public String getmImageUrl() {
return mImageUrl; return mImageUrl;
@ -189,6 +190,14 @@ public class BannerBean {
this.mIconRes = mIconRes; this.mIconRes = mIconRes;
} }
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@NonNull @NonNull
@Override @Override
public String toString() { public String toString() {

View File

@ -26,10 +26,30 @@ public class LiveAnchorCallMeModel extends BaseModel {
private AppBean line; private AppBean line;
@SerializedName("whatsApp") @SerializedName("whatsApp")
private AppBean whatsApp; private AppBean whatsApp;
@SerializedName("isGet")
private int isGet;
@SerializedName("link")
private String link;
public LiveAnchorCallMeModel() { 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() { public int getId() {
return id; return id;
} }
@ -114,6 +134,8 @@ public class LiveAnchorCallMeModel extends BaseModel {
", wechat=" + wechat + ", wechat=" + wechat +
", line=" + line + ", line=" + line +
", whatsApp=" + whatsApp + ", whatsApp=" + whatsApp +
", isGet=" + isGet +
", link='" + link + '\'' +
'}'; '}';
} }

View File

@ -146,6 +146,7 @@ import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
import com.yunbao.live.dialog.LiveGameDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.LiveGiftDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
@ -354,6 +355,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//----!主播说组件---// //----!主播说组件---//
private Banner topBanner1;//心愿单&联系方式 private Banner topBanner1;//心愿单&联系方式
public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow;
private String mAnchorName;//主播名字
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdata(String str) { public void onUpdata(String str) {
@ -2426,6 +2428,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 显示用户名 * 显示用户名
*/ */
public void setName(String name) { public void setName(String name) {
mAnchorName = name;
if (mName != null) { if (mName != null) {
mNameText = name; mNameText = name;
@ -4797,19 +4800,36 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) {
Dialog loading = DialogUitl.loadingDialog(mContext); Dialog loading = DialogUitl.loadingDialog(mContext);
loading.show(); loading.show();
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); LiveNetManager.get(mContext)
fragment.setOnDismissListener(dialog -> { .getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorCallMeModel>() {
checkNewLetter();
} @Override
); public void onSuccess(LiveAnchorCallMeModel data) {
fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); if (data.getIsGet() == 1) {
Bundle bundle = new Bundle(); new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, mAnchorName, data.getLink())
bundle.putString(Constants.LIVE_UID, mLiveUid); .setOnDismissListener(dialog -> loading.dismiss())
bundle.putString(Constants.LIVE_STREAM, mStream); .showDialog();
bundle.putString(Constants.LIVE_WISH_GIFTID, mTopBannerList.get(position).getActivityId() + ""); return;
bundle.putBoolean("isContactGift", true); }
fragment.setArguments(bundle); LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "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 { } else {
BannerBean bean = mTopBannerList.get(position); BannerBean bean = mTopBannerList.get(position);
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
@ -4842,6 +4862,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
}) })
.start(); .start();
updateCallMe();
}
private void updateCallMe() {
LiveNetManager.get(mContext) LiveNetManager.get(mContext)
.getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorCallMeModel>() { .getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorCallMeModel>() {
@Override @Override
@ -4850,7 +4874,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (data.getIsShow() == 1) { if (data.getIsShow() == 1) {
topBanner1.setVisibility(View.VISIBLE); topBanner1.setVisibility(View.VISIBLE);
BannerBean call = new BannerBean(); BannerBean call = new BannerBean();
call.setActivityId(data.getGiftId()); call.setData(data);
call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR); call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR);
mTopBannerList.add(0, call); mTopBannerList.add(0, call);
topBanner1.update(mTopBannerList); topBanner1.update(mTopBannerList);