1.首页充值
This commit is contained in:
@@ -855,6 +855,24 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
private void heavenGiftDialog(){
|
||||
HeavenGiftDialog heavenGiftDialog = new HeavenGiftDialog(this);
|
||||
heavenGiftDialog.show();
|
||||
heavenGiftDialog.setOnFirstChargeListener(new HeavenGiftDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(HeavenGiftBean giftBean, int type) {
|
||||
String giftId="";
|
||||
String money="";
|
||||
if (giftBean.getGift_list().size()!=0) {
|
||||
giftId = giftBean.getGift_bag_id()+"";
|
||||
money = giftBean.getMoney();
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, money, getSupportFragmentManager(),giftId,type+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstChargeCancelled() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2025/10/12 新人好礼
|
||||
@@ -871,23 +889,36 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
newPeopleDialog.setOnFirstChargeListener(new NewPeopleDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(FirstChargeGiftBean giftBean, int type) {
|
||||
String s = null;
|
||||
if (type == 1) {
|
||||
s = giftBean.getGift_bag().get(0).getMoney();
|
||||
// 初始化默认值
|
||||
String money = "";
|
||||
String giftBagId = "";
|
||||
List<FirstChargeGiftBean.GiftBag> giftBags = giftBean != null ? giftBean.getGift_bag() : null;
|
||||
|
||||
} else if (type == 2) {
|
||||
s = giftBean.getGift_bag().get(1).getMoney();
|
||||
} else if (type == 3) {
|
||||
s = giftBean.getGift_bag().get(2).getMoney();
|
||||
}else if (type==4){
|
||||
s = giftBean.getGift_bag().get(3).getMoney();
|
||||
}
|
||||
if (s == null) {
|
||||
// 校验数据有效性
|
||||
if (giftBags == null || giftBags.isEmpty()) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, s, getSupportFragmentManager());
|
||||
// 计算索引(type从1开始对应索引0)
|
||||
int index = type - 1;
|
||||
|
||||
// 索引安全校验 + 数据获取
|
||||
if (index >= 0 && index < giftBags.size()) {
|
||||
FirstChargeGiftBean.GiftBag currentGift = giftBags.get(index);
|
||||
money = currentGift.getMoney();
|
||||
giftBagId = currentGift.getGift_bag_id();
|
||||
}
|
||||
|
||||
// 最终数据校验
|
||||
if (money == null) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
// 显示对话框
|
||||
RechargeDialogFragment.show(null, money, getSupportFragmentManager(), giftBagId, "3");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -914,21 +945,18 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
firstChargeDialog.setOnFirstChargeListener(new FirstChargeDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(FirstChargeGiftBean giftBean, int type) {
|
||||
String s = null;
|
||||
if (type == 1) {
|
||||
String s = "";
|
||||
String gift_bag_id= "";
|
||||
if (giftBean.getGift_bag().size()!=0) {
|
||||
gift_bag_id = giftBean.getGift_bag().get(0).getGift_bag_id();
|
||||
s = giftBean.getGift_bag().get(0).getMoney();
|
||||
|
||||
} else if (type == 2) {
|
||||
s = giftBean.getGift_bag().get(1).getMoney();
|
||||
} else if (type == 3) {
|
||||
s = giftBean.getGift_bag().get(2).getMoney();
|
||||
}
|
||||
if (s == null) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, s, getSupportFragmentManager());
|
||||
RechargeDialogFragment.show(null, s, getSupportFragmentManager(),gift_bag_id,"1");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user