From 82ccd2d89c0491a54cbf935fa861889265ce4cf8 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 8 Aug 2023 11:37:19 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/LiveNewWishListFragment.java | 56 ++++++++++++++++++- common/src/main/res/values-en-rUS/string.xml | 3 + common/src/main/res/values-zh-rHK/strings.xml | 3 + common/src/main/res/values-zh-rTW/strings.xml | 3 + common/src/main/res/values-zh/strings.xml | 3 + common/src/main/res/values/strings.xml | 3 + 6 files changed, 68 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java index c6dfaf62d..32197b1d5 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java @@ -22,6 +22,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.HintCustomPopup; import com.yunbao.common.views.LiveNewWishGiftPopup; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -66,7 +67,7 @@ public class LiveNewWishListFragment extends BaseFragment { @Override public void onViewClicks() { saveWish(); - Bus.get().post(new PopupViewDismissEvent()); + } }); } @@ -110,7 +111,7 @@ public class LiveNewWishListFragment extends BaseFragment { List wishList2 = new ArrayList<>(); Gson gson = new Gson(); for (WishModel model : wishList) { - if (model!=null){ + if (model != null) { WishModel2 model2 = gson.fromJson(gson.toJson(model), WishModel2.class); wishList2.add(model2); } @@ -118,8 +119,57 @@ public class LiveNewWishListFragment extends BaseFragment { } if (wishList2.size() == 0) { Bus.get().post(new PopupViewDismissEvent()); + } else if (wishList2.size() == 1) { + new XPopup.Builder(getContext()) + .asCustom(new HintCustomPopup(getContext(), + getContext().getString(R.string.dialog_tip), + getContext().getString(R.string.sett_rigger)) + .setLiveOpenOk(getContext().getString(R.string.cancel_ca)) + .setLiveOpenCancel(getContext().getString(R.string.settings_ser)) + .setCallBack(new HintCustomPopup.HintCustomCallBack() { + @Override + public void onSure() { + + if (wishList2.size() > 10) { + ToastUtil.show(R.string.must_hint); + return; + } + LiveNetManager.get(getContext()). + setWishlistV2(type, gson.toJson(wishList2), new HttpCallback() { + @Override + public void onSuccess(String data) { + Bus.get().post(new PopupViewDismissEvent()); + } + + @Override + public void onError(String error) { + ToastUtil.show(R.string.net_error); + } + }); + switch (type) { + case 1: + Bus.get().post(new LiveNewWishListCloseEvent().setDayWish(false)); + break; + case 2: + Bus.get().post(new LiveNewWishListCloseEvent().setZhouXin(false)); + break; + case 3: + Bus.get().post(new LiveNewWishListCloseEvent().setLunarWish(false)); + break; + case 4: + Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(false)); + break; + } + } + + @Override + public void onCancel() { + + } + })).show(); } else { - if (wishList2.size()>10){ + Bus.get().post(new PopupViewDismissEvent()); + if (wishList2.size() > 10) { ToastUtil.show(R.string.must_hint); return; } diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 01a937fd8..c0ec19604 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1308,6 +1308,9 @@ Limited ride And limited avatar frame Please make gifts in the studio Been sent out Send out + "At least 2 types of gifts can be set to trigger the wish list special effect gift. " + cancel + settings diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index a1b2ca7d1..9724141a6 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1304,4 +1304,7 @@ 请在直播间内进行送礼 已送出 立即送出 + 最低设置2种类型礼物才能触发心愿单特效礼物。 + 不再设置 + 去设置 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 56cc1c802..643b04889 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1303,4 +1303,7 @@ 请在直播间内进行送礼 已送出 立即送出 + 最低设置2种类型礼物才能触发心愿单特效礼物。 + 不再设置 + 去设置 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index ebe4b025f..bf87d8472 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1303,6 +1303,9 @@ 请在直播间内进行送礼 已送出 立即送出 + 最低设置2种类型礼物才能触发心愿单特效礼物。 + 不再设置 + 去设置 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index d3e9b1d33..d6af03ba2 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1309,5 +1309,8 @@ Limited ride And limited avatar frame Please make gifts in the studio Been sent out Send out + At least 2 types of gifts can be set to trigger the wish list special effect gift. + cancel + settings