调整战令页面间距

修复【战令余额不足未跳转充值页面】问题
修复【战令开通等级时弹框金额偶尔不显示问题】
调整战令获取金额接口
调整战令item名字显示模式
调整战令购买经验弹框显示
This commit is contained in:
2024-01-17 16:21:25 +08:00
parent 3a1268aac7
commit 2857127285
11 changed files with 174 additions and 28 deletions

View File

@@ -77,6 +77,7 @@ public class LiberalBattlePassPopupWindow extends CenterPopupView {
mPassCallback.onCallback(data.getData().getCode(), data.getData().getMsg());
}
IMLoginManager.get(getContext()).upDataUserInfo();
IMLoginManager.get(getContext()).updateUserCoin();
}
@Override

View File

@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import com.yunbao.common.bean.BattlePassUserInfoBean;
import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
@@ -28,11 +29,12 @@ public class OrderLevelPopupWindow extends CenterPopupView {
private ProgressBar progressBar;
private OrderLevelCallback orderLevelCallback;
private long maxExp;
public OrderLevelPopupWindow(@NonNull Context context,
private BattlePassUserInfoBean userInfoBean;
public OrderLevelPopupWindow(@NonNull Context context, BattlePassUserInfoBean userInfoBean,
int mCurrentExperience, int mTotalExperience,
String mCurrentLevel, String mBalance,long maxExp, OrderLevelCallback mOrderLevelCallback) {
String mCurrentLevel, String mBalance, long maxExp, OrderLevelCallback mOrderLevelCallback) {
super(context);
this.userInfoBean = userInfoBean;
currentExperience = mCurrentExperience;
totalExperience = mTotalExperience;
currentLevel = mCurrentLevel;
@@ -59,7 +61,7 @@ public class OrderLevelPopupWindow extends CenterPopupView {
orderLevel.setText(buyExp);
progressBar.setMax(totalExperience);
progressBar.setProgress(currentExperience);
expText.setText(String.format("%s/%s", currentExperience, totalExperience));
expText.setText(String.format("%s/%s", userInfoBean.getBattlePassExp(), userInfoBean.getNextLevelExp()));
current.setText(String.format("Lv%s", currentLevel));
balanceDiamond.setText(balance);
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
@@ -102,6 +104,7 @@ public class OrderLevelPopupWindow extends CenterPopupView {
.buyingExperiencePoint(buyExp, new HttpCallback<ResponseModel<Object>>() {
@Override
public void onSuccess(ResponseModel<Object> data) {
if (orderLevelCallback != null) {
orderLevelCallback.onCallback(data.getData().getCode(), data.getMsg());
}dialog.dismiss();

View File

@@ -2675,9 +2675,7 @@ public class LiveNetManager {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(responseModel -> {
if (callback != null) {
if (callback != null) {
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
}
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
}
}, new Consumer<Throwable>() {
@Override

View File

@@ -8,6 +8,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.umeng.analytics.MobclickAgent;
@@ -509,5 +510,22 @@ public class IMLoginManager extends BaseCacheManager {
}
});
}
public void updateUserCoin(){
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
JSONObject obj = JSONObject.parseObject(info[0]);
String golds = obj.getString("gold");
String coins = obj.getString("coin");
String yuanbaos = obj.getString("yuanbao");
userInfo.setCoin(obj.getLong("coin"));
userInfo.setGold(obj.getLong("gold"));
userInfo.setYuanbao(yuanbaos);
}
}
});
}
}