6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-08 14:50:13 +08:00
parent 40e744a533
commit 44b95cb1c6
9 changed files with 42 additions and 32 deletions

View File

@ -1,5 +1,6 @@
package com.yunbao.common.adapter; package com.yunbao.common.adapter;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -11,6 +12,7 @@ import com.yunbao.common.R;
import com.yunbao.common.bean.WishModel; import com.yunbao.common.bean.WishModel;
import com.yunbao.common.event.LiveNewWishListCloseEvent; import com.yunbao.common.event.LiveNewWishListCloseEvent;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.DayWishItemViewHolder; import com.yunbao.common.views.DayWishItemViewHolder;
import com.yunbao.common.views.LunarWishItemViewHolder; import com.yunbao.common.views.LunarWishItemViewHolder;
import com.yunbao.common.views.SeasonalWishItemViewHolder; import com.yunbao.common.views.SeasonalWishItemViewHolder;
@ -46,8 +48,20 @@ public class LiveNewWishAdapter extends RecyclerView.Adapter {
Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true)); Bus.get().post(new LiveNewWishListCloseEvent().setSeasonalWish(true));
break; break;
} }
boolean isAdd = false;
for (int i = 0; i < wishList.size(); i++) {
if (wishList.get(i)!=null){
if (!TextUtils.isEmpty(wishList.get(i).getLid()) && !TextUtils.isEmpty(model.getLid())
&& TextUtils.equals(wishList.get(i).getLid(), model.getLid())) {
ToastUtil.show(R.string.too_many_gifts);
isAdd = true;
}
}
wishList.add(0, model); }
if (!isAdd) {
wishList.add(0, model);
}
notifyDataSetChanged(); notifyDataSetChanged();
} }

View File

@ -119,6 +119,7 @@ public class LiveNewWishListFragment extends BaseFragment {
} }
if (wishList2.size() == 0) { if (wishList2.size() == 0) {
Bus.get().post(new PopupViewDismissEvent()); Bus.get().post(new PopupViewDismissEvent());
} else if (wishList2.size() == 1) { } else if (wishList2.size() == 1) {
new XPopup.Builder(getContext()) new XPopup.Builder(getContext())
.asCustom(new HintCustomPopup(getContext(), .asCustom(new HintCustomPopup(getContext(),
@ -146,20 +147,6 @@ public class LiveNewWishListFragment extends BaseFragment {
ToastUtil.show(R.string.net_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 @Override
@ -185,22 +172,22 @@ public class LiveNewWishListFragment extends BaseFragment {
ToastUtil.show(R.string.net_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;
}
} }
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;
}
} }
} }

View File

@ -167,6 +167,7 @@ public class LiveNewWishListPopup extends BottomPopupView {
.setWishlistName(event.getModel().getName()) .setWishlistName(event.getModel().getName())
.setWishlistIcon(event.getModel().getImg()) .setWishlistIcon(event.getModel().getImg())
.setWishlistNum("1") .setWishlistNum("1")
.setLid(event.getModel().getId())
.setLuid("" + IMLoginManager.get(mContext).getUserInfo().getId()) .setLuid("" + IMLoginManager.get(mContext).getUserInfo().getId())
.setWishlistProgress("0") .setWishlistProgress("0")
.setPrice(Integer.parseInt(event.getModel().getPrice())) .setPrice(Integer.parseInt(event.getModel().getPrice()))
@ -334,7 +335,7 @@ public class LiveNewWishListPopup extends BottomPopupView {
setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() { setWishlistV2(type, gson.toJson(wishList2), new HttpCallback<String>() {
@Override @Override
public void onSuccess(String data) { public void onSuccess(String data) {
ToastUtil.show(data); ToastUtil.show("修改成功");
} }
@Override @Override

View File

@ -39,7 +39,10 @@
android:layout_width="117dp" android:layout_width="117dp"
android:layout_height="31dp" android:layout_height="31dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/background_wish_replacement" android:background="@drawable/background_wish_replacement"
android:gravity="center" android:gravity="center"
android:text="@string/replacement_wish_day" android:text="@string/replacement_wish_day"

View File

@ -1311,6 +1311,7 @@ Limited ride And limited avatar frame</string>
<string name="sett_rigger">"At least 2 types of gifts can be set to trigger the wish list special effect gift. "</string> <string name="sett_rigger">"At least 2 types of gifts can be set to trigger the wish list special effect gift. "</string>
<string name="cancel_ca">cancel</string> <string name="cancel_ca">cancel</string>
<string name="settings_ser">settings</string> <string name="settings_ser">settings</string>
<string name="too_many_gifts">Too many gifts</string>
</resources> </resources>

View File

@ -1307,4 +1307,5 @@
<string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string> <string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string>
<string name="cancel_ca">不再设置</string> <string name="cancel_ca">不再设置</string>
<string name="settings_ser">去设置</string> <string name="settings_ser">去设置</string>
<string name="too_many_gifts">重複添加禮物</string>
</resources> </resources>

View File

@ -1306,4 +1306,5 @@
<string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string> <string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string>
<string name="cancel_ca">不再设置</string> <string name="cancel_ca">不再设置</string>
<string name="settings_ser">去设置</string> <string name="settings_ser">去设置</string>
<string name="too_many_gifts">重複添加禮物</string>
</resources> </resources>

View File

@ -1306,6 +1306,7 @@
<string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string> <string name="sett_rigger">最低设置2种类型礼物才能触发心愿单特效礼物。</string>
<string name="cancel_ca">不再设置</string> <string name="cancel_ca">不再设置</string>
<string name="settings_ser">去设置</string> <string name="settings_ser">去设置</string>
<string name="too_many_gifts">重複添加禮物</string>
</resources> </resources>

View File

@ -1312,5 +1312,6 @@ Limited ride And limited avatar frame</string>
<string name="sett_rigger">At least 2 types of gifts can be set to trigger the wish list special effect gift. </string> <string name="sett_rigger">At least 2 types of gifts can be set to trigger the wish list special effect gift. </string>
<string name="cancel_ca">cancel</string> <string name="cancel_ca">cancel</string>
<string name="settings_ser">settings</string> <string name="settings_ser">settings</string>
<string name="too_many_gifts">Too many gifts</string>
</resources> </resources>