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

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;
@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() {

View File

@ -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 + '\'' +
'}';
}

View File

@ -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();
LiveNetManager.get(mContext)
.getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorCallMeModel>() {
@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, mTopBannerList.get(position).getActivityId() + "");
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<LiveAnchorCallMeModel>() {
@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);