diff --git a/config.gradle b/config.gradle index e4be27b77..15a4d1781 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { minSdkVersion : 21, targetSdkVersion : 33, versionCode : 447, - versionName : "6.5.4" + versionName : "6.5.5" ] manifestPlaceholders = [ //正式、 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 80e74106e..cc3436cd5 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -634,6 +634,34 @@ public class LiveGiftPopup extends AbsDialogFragment { } if (!isWrap) { liveGiftModel.setBlindBoxTicket(liveGiftModel.getBlindBoxTicket() - 1); + } else { + for (int i = 0; i < liveGiftList.size(); i++) { + JSONObject data = liveGiftList.getJSONObject(i); + String giftJson = data.getString("giftlist"); + List liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class); + List liveGiftModels = new ArrayList<>(); + for (LiveGiftBean model : liveGiftBeans) { + if (model.getBlindBoxTicketId() == liveGiftModel.getId() && model.getBlindBoxTicket() > 0) { + model.setBlindBoxTicket(model.getBlindBoxTicket() - 1); + } + liveGiftModels.add(model); + } + liveGiftList.getJSONObject(i).put("giftlist", JSONArray.toJSONString(liveGiftModels)); + } + LiveHttpUtil.getNewGiftList(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + JSONObject obj = JSON.parseObject(info[0]); + liveGiftList = obj.getJSONArray("listarray"); + CommonAppConfig.getInstance().setGiftListJson(obj.getString("listarray")); + } + } + + @Override + public void onFinish() { + } + }); } isGetNewWrap = true; if (isWrap) {