6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-17 18:15:25 +08:00
parent c594364574
commit 8f9d558043
6 changed files with 473 additions and 44 deletions

View File

@ -0,0 +1,359 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GiftNamingInfoModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("sendtype")
private String sendtype;
@SerializedName("type")
private String type;
@SerializedName("name")
private String name;
@SerializedName("release_status")
private String releaseStatus;
@SerializedName("type_sort")
private String typeSort;
@SerializedName("operate_image")
private String operateImage;
@SerializedName("operate_url")
private String operateUrl;
@SerializedName("mark")
private String mark;
@SerializedName("giftname")
private String giftname;
@SerializedName("needcoin")
private String needcoin;
@SerializedName("gifticon")
private String gifticon;
@SerializedName("gift_description")
private String giftDescription;
@SerializedName("corner_mark")
private String cornerMark;
@SerializedName("swf")
private String swf;
@SerializedName("gift_uid")
private String giftUid;
@SerializedName("type_start_time")
private String typeStartTime;
@SerializedName("type_end_time")
private String typeEndTime;
@SerializedName("gift_start_time")
private String giftStartTime;
@SerializedName("gift_end_time")
private String giftEndTime;
@SerializedName("naming_liveuid")
private String namingLiveuid;
@SerializedName("naming_uid")
private String namingUid;
@SerializedName("naming_live_name")
private String namingLiveName;
@SerializedName("naming_user_name")
private String namingUserName;
@SerializedName("naming_live_avatar")
private String namingLiveAvatar;
@SerializedName("naming_user_avatar")
private String namingUserAvatar;
@SerializedName("naming_status")
private String namingStatus;
@SerializedName("naming_coin")
private String namingCoin;
@SerializedName("fans_level")
private String fansLevel;
@SerializedName("naming_user_coin")
private String namingUserCoin;
@SerializedName("naming_live_coin")
private String namingLiveCoin;
@SerializedName("isweek")
private String isweek;
public String getId() {
return id;
}
public GiftNamingInfoModel setId(String id) {
this.id = id;
return this;
}
public String getSendtype() {
return sendtype;
}
public GiftNamingInfoModel setSendtype(String sendtype) {
this.sendtype = sendtype;
return this;
}
public String getType() {
return type;
}
public GiftNamingInfoModel setType(String type) {
this.type = type;
return this;
}
public String getName() {
return name;
}
public GiftNamingInfoModel setName(String name) {
this.name = name;
return this;
}
public String getReleaseStatus() {
return releaseStatus;
}
public GiftNamingInfoModel setReleaseStatus(String releaseStatus) {
this.releaseStatus = releaseStatus;
return this;
}
public String getTypeSort() {
return typeSort;
}
public GiftNamingInfoModel setTypeSort(String typeSort) {
this.typeSort = typeSort;
return this;
}
public String getOperateImage() {
return operateImage;
}
public GiftNamingInfoModel setOperateImage(String operateImage) {
this.operateImage = operateImage;
return this;
}
public String getOperateUrl() {
return operateUrl;
}
public GiftNamingInfoModel setOperateUrl(String operateUrl) {
this.operateUrl = operateUrl;
return this;
}
public String getMark() {
return mark;
}
public GiftNamingInfoModel setMark(String mark) {
this.mark = mark;
return this;
}
public String getGiftname() {
return giftname;
}
public GiftNamingInfoModel setGiftname(String giftname) {
this.giftname = giftname;
return this;
}
public String getNeedcoin() {
return needcoin;
}
public GiftNamingInfoModel setNeedcoin(String needcoin) {
this.needcoin = needcoin;
return this;
}
public String getGifticon() {
return gifticon;
}
public GiftNamingInfoModel setGifticon(String gifticon) {
this.gifticon = gifticon;
return this;
}
public String getGiftDescription() {
return giftDescription;
}
public GiftNamingInfoModel setGiftDescription(String giftDescription) {
this.giftDescription = giftDescription;
return this;
}
public String getCornerMark() {
return cornerMark;
}
public GiftNamingInfoModel setCornerMark(String cornerMark) {
this.cornerMark = cornerMark;
return this;
}
public String getSwf() {
return swf;
}
public GiftNamingInfoModel setSwf(String swf) {
this.swf = swf;
return this;
}
public String getGiftUid() {
return giftUid;
}
public GiftNamingInfoModel setGiftUid(String giftUid) {
this.giftUid = giftUid;
return this;
}
public String getTypeStartTime() {
return typeStartTime;
}
public GiftNamingInfoModel setTypeStartTime(String typeStartTime) {
this.typeStartTime = typeStartTime;
return this;
}
public String getTypeEndTime() {
return typeEndTime;
}
public GiftNamingInfoModel setTypeEndTime(String typeEndTime) {
this.typeEndTime = typeEndTime;
return this;
}
public String getGiftStartTime() {
return giftStartTime;
}
public GiftNamingInfoModel setGiftStartTime(String giftStartTime) {
this.giftStartTime = giftStartTime;
return this;
}
public String getGiftEndTime() {
return giftEndTime;
}
public GiftNamingInfoModel setGiftEndTime(String giftEndTime) {
this.giftEndTime = giftEndTime;
return this;
}
public String getNamingLiveuid() {
return namingLiveuid;
}
public GiftNamingInfoModel setNamingLiveuid(String namingLiveuid) {
this.namingLiveuid = namingLiveuid;
return this;
}
public String getNamingUid() {
return namingUid;
}
public GiftNamingInfoModel setNamingUid(String namingUid) {
this.namingUid = namingUid;
return this;
}
public String getNamingLiveName() {
return namingLiveName;
}
public GiftNamingInfoModel setNamingLiveName(String namingLiveName) {
this.namingLiveName = namingLiveName;
return this;
}
public String getNamingUserName() {
return namingUserName;
}
public GiftNamingInfoModel setNamingUserName(String namingUserName) {
this.namingUserName = namingUserName;
return this;
}
public String getNamingLiveAvatar() {
return namingLiveAvatar;
}
public GiftNamingInfoModel setNamingLiveAvatar(String namingLiveAvatar) {
this.namingLiveAvatar = namingLiveAvatar;
return this;
}
public String getNamingUserAvatar() {
return namingUserAvatar;
}
public GiftNamingInfoModel setNamingUserAvatar(String namingUserAvatar) {
this.namingUserAvatar = namingUserAvatar;
return this;
}
public String getNamingStatus() {
return namingStatus;
}
public GiftNamingInfoModel setNamingStatus(String namingStatus) {
this.namingStatus = namingStatus;
return this;
}
public String getNamingCoin() {
return namingCoin;
}
public GiftNamingInfoModel setNamingCoin(String namingCoin) {
this.namingCoin = namingCoin;
return this;
}
public String getFansLevel() {
return fansLevel;
}
public GiftNamingInfoModel setFansLevel(String fansLevel) {
this.fansLevel = fansLevel;
return this;
}
public String getNamingUserCoin() {
return namingUserCoin;
}
public GiftNamingInfoModel setNamingUserCoin(String namingUserCoin) {
this.namingUserCoin = namingUserCoin;
return this;
}
public String getNamingLiveCoin() {
return namingLiveCoin;
}
public GiftNamingInfoModel setNamingLiveCoin(String namingLiveCoin) {
this.namingLiveCoin = namingLiveCoin;
return this;
}
public String getIsweek() {
return isweek;
}
public GiftNamingInfoModel setIsweek(String isweek) {
this.isweek = isweek;
return this;
}
}

View File

@ -64,6 +64,17 @@ public class LiveGiftBean {
private String namingStatus; private String namingStatus;
@JSONField(name = "naming_coin") @JSONField(name = "naming_coin")
private String namingCoin; private String namingCoin;
@JSONField(name = "naming_user_coin")
private String namingUserCoin;
public String getNamingUserCoin() {
return namingUserCoin;
}
public LiveGiftBean setNamingUserCoin(String namingUserCoin) {
this.namingUserCoin = namingUserCoin;
return this;
}
public View getmView() { public View getmView() {
return mView; return mView;

View File

@ -17,6 +17,7 @@ import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo; import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.GiftAlreadyWallModel; import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel; import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
import com.yunbao.common.bean.GiftWallGiftDetail; import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel; import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.HourRank;
@ -932,6 +933,7 @@ public interface PDLiveApi {
/** /**
* 获取粉丝团礼物信息 * 获取粉丝团礼物信息
*
* @param packId 礼包id * @param packId 礼包id
*/ */
@GET("/api/public/?service=Fans.getFansExclusivePack") @GET("/api/public/?service=Fans.getFansExclusivePack")
@ -941,6 +943,7 @@ public interface PDLiveApi {
/** /**
* 购买粉丝团礼包 * 购买粉丝团礼包
*
* @param packId 礼包id * @param packId 礼包id
*/ */
@GET("/api/public/?service=Fans.buyFansExclusivePack") @GET("/api/public/?service=Fans.buyFansExclusivePack")
@ -954,11 +957,15 @@ public interface PDLiveApi {
*/ */
@GET("/api/public/?service=Fans.userFansExclusivePackList") @GET("/api/public/?service=Fans.userFansExclusivePackList")
Observable<ResponseModel<List<FansGroupGiftPack>>> userFansExclusivePackList(@Query("liveuid") String liveUid); Observable<ResponseModel<List<FansGroupGiftPack>>> userFansExclusivePackList(@Query("liveuid") String liveUid);
/** /**
* 获取粉丝团礼物包裹 * 获取粉丝团礼物包裹
*/ */
@GET("/api/public/?service=Fans.getCheckFansLevelUpgrade") @GET("/api/public/?service=Fans.getCheckFansLevelUpgrade")
Observable<ResponseModel<FansCheckRed>> getCheckFansLevelUpgrade(@Query("liveuid") String liveUid); Observable<ResponseModel<FansCheckRed>> getCheckFansLevelUpgrade(@Query("liveuid") String liveUid);
@GET("/api/public/?service=gift.getGiftNamingInfo")
Observable<ResponseModel<GiftNamingInfoModel>> getGiftNamingInfo(@Query("gift_id") String giftId);
} }

View File

@ -18,6 +18,7 @@ import com.yunbao.common.bean.FansGroupGiftPack;
import com.yunbao.common.bean.FansGroupGiftPackInfo; import com.yunbao.common.bean.FansGroupGiftPackInfo;
import com.yunbao.common.bean.GiftAlreadyWallModel; import com.yunbao.common.bean.GiftAlreadyWallModel;
import com.yunbao.common.bean.GiftGuideModel; import com.yunbao.common.bean.GiftGuideModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
import com.yunbao.common.bean.GiftWallGiftDetail; import com.yunbao.common.bean.GiftWallGiftDetail;
import com.yunbao.common.bean.GiftWallModel; import com.yunbao.common.bean.GiftWallModel;
import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.HttpCallbackModel;
@ -28,6 +29,7 @@ import com.yunbao.common.bean.LiveAiRobotBean;
import com.yunbao.common.bean.LiveAnchorCallMeModel; import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel; import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveDataInfoModel;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.LiveRoomVoteModel; import com.yunbao.common.bean.LiveRoomVoteModel;
@ -57,8 +59,6 @@ import com.yunbao.common.http.API;
import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.base.CheckLiveCallBack; import com.yunbao.common.http.base.CheckLiveCallBack;
import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -2171,6 +2171,28 @@ public class LiveNetManager {
}).isDisposed(); }).isDisposed();
} }
public void getGiftNamingInfo(String giftId,HttpCallback<GiftNamingInfoModel> callback) {
API.get().pdLiveApi(mContext)
.getGiftNamingInfo(giftId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<GiftNamingInfoModel>>() {
@Override
public void accept(ResponseModel<GiftNamingInfoModel> liveGiftBeanResponseModel) throws Exception {
if (callback!=null){
callback.onSuccess(liveGiftBeanResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/** /**
* 直播间取消网络请求 * 直播间取消网络请求
*/ */

View File

@ -195,7 +195,6 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/background_gift_description"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
@ -203,7 +202,7 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textColor="#FFFFFFFF" android:textColor="#80FFFFFF"
android:textSize="12sp" /> android:textSize="12sp" />
<FrameLayout <FrameLayout

View File

@ -43,6 +43,7 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.BlindBoxInfoModel; import com.yunbao.common.bean.BlindBoxInfoModel;
import com.yunbao.common.bean.GiftNamingInfoModel;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.LiveGiftBean2; import com.yunbao.common.bean.LiveGiftBean2;
@ -222,6 +223,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
sendGift(); sendGift();
} }
}); });
// 跳转充值 // 跳转充值
@ -339,18 +341,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
by = bundle.getString("by"); by = bundle.getString("by");
isPk = bundle.getBoolean("pk"); isPk = bundle.getBoolean("pk");
} }
//判断是否缓存礼物列表 //判断是否缓存礼物列表
String giftListJson = CommonAppConfig.getInstance().getGiftListJson();
if (!TextUtils.isEmpty(giftListJson)) {
try {
liveGiftList = JSON.parseArray(giftListJson);
Bus.getOn(this);
} catch (Exception e) {
e.printStackTrace();
}
}
if (liveGiftList == null) {
LiveHttpUtil.getNewGiftList(new HttpCallback() { LiveHttpUtil.getNewGiftList(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -369,15 +360,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
@Override @Override
public void onFinish() { public void onFinish() {
getCoin(); getCoin();
// if (mLoading != null) {
// mLoading.setVisibility(View.INVISIBLE);
// }
} }
}); });
} else {
getCoin();
setTitleData();
}
getBlindBoxInfo(); getBlindBoxInfo();
loadUserVip(); loadUserVip();
} }
@ -508,7 +492,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} else { } else {
String hint = getString(R.string.reach_the_top); String hint = mContext.getString(R.string.reach_the_top);
leaveHint.setText(hint); leaveHint.setText(hint);
progressBar.setMax(10); progressBar.setMax(10);
progressBar.setProgress(10); progressBar.setProgress(10);
@ -642,6 +626,44 @@ public class LiveGiftPopup extends AbsDialogFragment {
lianSongHandler.removeCallbacks(lianSongRunnable); lianSongHandler.removeCallbacks(lianSongRunnable);
mShowLianBtn = false; mShowLianBtn = false;
getCoin(); getCoin();
LiveNetManager.get(mContext)
.getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback<GiftNamingInfoModel>() {
@Override
public void onSuccess(GiftNamingInfoModel data) {
liveGiftModel = JSONObject.parseObject(GsonUtils.toJson(data), LiveGiftBean.class);
if (!TextUtils.isEmpty(liveGiftModel.getNamingLiveuid()) &&
!TextUtils.isEmpty(liveGiftModel.getNamingUid()) &&
!TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") &&
!TextUtils.equals(liveGiftModel.getNamingUid(), "0")) {
namingLayout.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar);
StringBuffer namingNameText = new StringBuffer();
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
namingNameText.append("获取冠名:")
.append(liveGiftModel.getNamingUserCoin())
.append("");
} else {
namingNameText.append("Get title: ")
.append(liveGiftModel.getNamingUserCoin())
.append(" ");
}
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
.append(liveGiftModel.getNamingLiveName())
.append(" ")
.append(mContext.getText(com.yunbao.live.R.string.the_title_financier))
.append(liveGiftModel.getNamingUserName());
namingName.setText(namingNameText.toString());
} else {
namingLayout.setVisibility(View.GONE);
}
}
@Override
public void onError(String error) {
}
});
} }
/** /**
@ -699,6 +721,14 @@ public class LiveGiftPopup extends AbsDialogFragment {
namingLayout.setVisibility(View.VISIBLE); namingLayout.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar); ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar);
StringBuffer namingNameText = new StringBuffer(); StringBuffer namingNameText = new StringBuffer();
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
namingNameText.append("获取冠名:")
.append(liveGiftModel.getNamingUserCoin())
.append("");
} else {
namingNameText.append("Get title: ")
.append(liveGiftModel.getNamingUserCoin());
}
namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor)) namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor))
.append(liveGiftModel.getNamingLiveName()) .append(liveGiftModel.getNamingLiveName())
.append(" ") .append(" ")
@ -738,6 +768,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
operateImage.setVisibility(View.VISIBLE); operateImage.setVisibility(View.VISIBLE);
ImgLoader.display(getContext(), liveGiftModel.getOperateImage(), operateImage); ImgLoader.display(getContext(), liveGiftModel.getOperateImage(), operateImage);
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)