1、開通守護-使用優惠券
This commit is contained in:
@@ -43,6 +43,7 @@ import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.dialog.GuardBuyCouponTipsDialog;
|
||||
import com.yunbao.common.dialog.GuardBuyTipsDialog;
|
||||
import com.yunbao.common.dialog.GuardBuyTipsNewDialog;
|
||||
import com.yunbao.common.dialog.GuardUpgradePopup;
|
||||
import com.yunbao.common.dialog.LiveBuyGuardSelectPopup;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -247,8 +248,10 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
openTheGuard.setText(dataTipModel.isOpen() ? WordUtil.isNewZh() ? "續費神之守護" : "Renew God Guardian"
|
||||
: WordUtil.getNewString(R.string.open_the_god_guard));
|
||||
}
|
||||
discountPrice.setTag("1");
|
||||
guardPriceModel = price.get(0);
|
||||
discountPrice.setTag("1");
|
||||
discount.setTag(guardPriceModel.getCouponId());
|
||||
|
||||
if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) {
|
||||
discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice()));
|
||||
originalPrice.setVisibility(GONE);
|
||||
@@ -311,6 +314,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
public void onLiveBuyGuardSelectListener(GuardPriceModel model) {
|
||||
guardPriceModel = model;
|
||||
discountPrice.setTag(String.valueOf(guardPriceModel.getPriceKey()));
|
||||
discount.setTag(guardPriceModel.getCouponId());
|
||||
if (TextUtils.isEmpty(guardPriceModel.getDiscountPrice())) {
|
||||
discountPrice.setText(String.valueOf(guardPriceModel.getOriginalPrice()));
|
||||
originalPrice.setVisibility(GONE);
|
||||
@@ -343,22 +347,27 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
ViewClicksAntiShake.clicksAntiShake(openTheGuard, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
//判断是否选择的是一个月
|
||||
if(discountPrice.getTag().equals("1")){
|
||||
GuardBuyCouponTipsDialog.showBuyOrRenewDialog(mContext, WordUtil.isNewZh() ? guardPriceModel.getCouponDiscount() : guardPriceModel.getCouponDiscountEn(), guardPriceModel.getCouponDiscountPrice(), dataTipModel.getGuardName(), new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
bugGurd(true);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
if (TextUtils.equals(mGuardUserInfoModel.getIsOpen(), "1") &&
|
||||
dataTipModel.getGuardType() < mGuardUserInfoModel.getGuardType()) {
|
||||
//开通比当前低级的的守护
|
||||
GuardBuyTipsNewDialog.showBuyOrRenewDialog(mContext);
|
||||
}else{
|
||||
bugGurd(false);
|
||||
//判断是否选择的是一个月
|
||||
if(discountPrice.getTag().equals("1")&&!discount.getTag().toString().equals("0")){
|
||||
GuardBuyCouponTipsDialog.showBuyOrRenewDialog(mContext, WordUtil.isNewZh() ? guardPriceModel.getCouponDiscount() : guardPriceModel.getCouponDiscountEn(), guardPriceModel.getCouponDiscountPrice(), dataTipModel.getGuardName(), new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
bugGurd(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
bugGurd(false);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
bugGurd(false);
|
||||
}
|
||||
}
|
||||
switch (dataTipModel.getGuardType()) {
|
||||
case 1:
|
||||
@@ -444,7 +453,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
@@ -531,7 +540,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
@@ -586,7 +595,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
|
||||
LiveNetManager.get(activity)
|
||||
.openGuard(mLiveUid,
|
||||
String.valueOf(dataTipModel.getGuardType()),
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0", new HttpCallback<String>() {
|
||||
String.valueOf(guardPriceModel.getPriceKey()), mStream,isCoupon?"1":"0",discount.getTag().toString(), new HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
if (TextUtils.equals(data, "22")) {
|
||||
|
||||
Reference in New Issue
Block a user