1:羽声新版本
This commit is contained in:
@@ -82,6 +82,11 @@ public class ConfirmDialog extends Dialog {
|
||||
|
||||
// 设置点击监听器
|
||||
btnPositive.setOnClickListener(v -> {
|
||||
isCountdownCancelled = true; // 标记倒计时被取消
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel(); // 取消倒计时
|
||||
countDownTimer = null;
|
||||
}
|
||||
if (positiveButtonClickListener != null) {
|
||||
positiveButtonClickListener.onClick(v);
|
||||
}
|
||||
@@ -126,7 +131,7 @@ public class ConfirmDialog extends Dialog {
|
||||
// rootView.startAnimation(shake);
|
||||
// }
|
||||
}
|
||||
|
||||
private boolean isCountdownCancelled = false; // 添加标志位
|
||||
private void startCountdown(Button btnNegative) {
|
||||
countDownTimer = new CountDownTimer(countdownSeconds * 1000L, 1000) {
|
||||
@Override
|
||||
@@ -137,11 +142,14 @@ public class ConfirmDialog extends Dialog {
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
btnNegative.setText(negativeButtonText);
|
||||
if (negativeButtonClickListener != null) {
|
||||
negativeButtonClickListener.onClick(btnNegative); // 自动触发取消
|
||||
// 检查是否被主动取消
|
||||
if (!isCountdownCancelled) {
|
||||
btnNegative.setText(negativeButtonText);
|
||||
if (negativeButtonClickListener != null) {
|
||||
negativeButtonClickListener.onClick(btnNegative); // 自动触发取消
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@@ -14,14 +14,12 @@ import androidx.annotation.NonNull;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.GiftAdapter;
|
||||
import com.xscm.moduleutil.adapter.HeavenGiftAdapter;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.DialogFirstChargeBinding;
|
||||
import com.xscm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
@@ -42,7 +40,6 @@ import io.reactivex.disposables.Disposable;
|
||||
*/
|
||||
public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
|
||||
GiftAdapter giftAdapter;
|
||||
HeavenGiftAdapter heavenGiftAdapter;
|
||||
FirstChargeGiftBean firstChargeGiftBean;
|
||||
private int type;
|
||||
@@ -66,7 +63,6 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
mBinding.tvTitle2.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
heavenGiftAdapter = new HeavenGiftAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setAutoPlay(false)
|
||||
.setRevealWidth(0, 0)
|
||||
.setIndicatorVisibility(View.VISIBLE)
|
||||
@@ -160,18 +156,6 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
}
|
||||
});
|
||||
|
||||
// List<HeavenGiftBean> list = new ArrayList<>();
|
||||
// for (int i = 0; i < 7; i++) {
|
||||
// HeavenGiftBean bean = new HeavenGiftBean();
|
||||
// bean.setTitle("礼物" + i);
|
||||
// bean.setPicture("");
|
||||
// bean.setType(1);
|
||||
// bean.setQuantity("x" + i);
|
||||
// bean.setGold(i + "");
|
||||
// bean.setDays(i + "天");
|
||||
// list.add(bean);
|
||||
// }
|
||||
// mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
}
|
||||
|
||||
private List<BaseListData<RoonGiftModel>> baseListData(List<RoonGiftModel> list, int chunkSize) {
|
||||
@@ -203,14 +187,15 @@ public class FirstChargeDialog extends BaseDialog<DialogFirstChargeBinding> {
|
||||
if (firstChargeGiftBean.getGift_bag().size() > 0) {
|
||||
type=1;
|
||||
List<RoonGiftModel> list = new ArrayList<>();
|
||||
mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||
mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||
// mBinding.tvTitle1.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle1());
|
||||
// mBinding.tvTitle2.setText(firstChargeGiftBean.getGift_bag().get(0).getTitle2());
|
||||
// mBinding.btn0.setText(firstChargeGiftBean.getGift_bag().get(0).getName());
|
||||
list.addAll(firstChargeGiftBean.getGift_bag().get(0).getGift_list());
|
||||
mBinding.tvTitle22.setText("充值"+firstChargeGiftBean.getGift_bag().get(0).getName()+"即可获得"+firstChargeGiftBean.getGift_bag().get(0).getTitle2()+"的道具或装扮");
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
|
||||
mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||
mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||
// mBinding.btn1.setText(firstChargeGiftBean.getGift_bag().get(1).getName());
|
||||
// mBinding.btn2.setText(firstChargeGiftBean.getGift_bag().get(2).getName());
|
||||
} else if (firstChargeGiftBean.getGift_bag().size() == 2) {
|
||||
// mBinding.rg.check(R.id.btn_0);
|
||||
// mBinding.btn1.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
@@ -11,15 +12,21 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.GiftAdapter;
|
||||
import com.xscm.moduleutil.adapter.HeavenGiftAdapter;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.bean.HeavenGiftBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.DialogHeavenGiftBinding;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
||||
import com.zhpan.indicator.base.IIndicator;
|
||||
import com.zhpan.indicator.enums.IndicatorSlideMode;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -30,17 +37,27 @@ import java.util.List;
|
||||
*/
|
||||
public class HeavenGiftDialog extends BaseDialog<DialogHeavenGiftBinding> {
|
||||
|
||||
GiftAdapter giftAdapter;
|
||||
HeavenGiftAdapter heavenGiftAdapter;
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
public HeavenGiftDialog(@NonNull Context context) {
|
||||
super(context,R.style.BaseDialogStyleH);
|
||||
}
|
||||
|
||||
HeavenGiftBean heavenGiftBea;
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_heaven_gift;
|
||||
}
|
||||
private OnFirstChargeListener listener;
|
||||
public interface OnFirstChargeListener {
|
||||
void onFirstChargeConfirmed(HeavenGiftBean giftBean, int type);
|
||||
void onFirstChargeCancelled();
|
||||
}
|
||||
|
||||
// 设置监听器的方法
|
||||
public void setOnFirstChargeListener(OnFirstChargeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
@@ -64,29 +81,98 @@ public class HeavenGiftDialog extends BaseDialog<DialogHeavenGiftBinding> {
|
||||
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
||||
.setAdapter(heavenGiftAdapter)
|
||||
.create();
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvInvite, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvInvite.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.tvInvite.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onFirstChargeConfirmed(heavenGiftBea,2);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
List<HeavenGiftBean> list=new ArrayList<>();
|
||||
for (int i = 0; i < 7; i++){
|
||||
HeavenGiftBean bean=new HeavenGiftBean();
|
||||
bean.setTitle("礼物"+i);
|
||||
bean.setPicture("");
|
||||
bean.setType(1);
|
||||
bean.setQuantity("x"+i);
|
||||
bean.setGold(i+"");
|
||||
bean.setDays(i+"天");
|
||||
list.add(bean);
|
||||
|
||||
RetrofitClient.getInstance().getDayDropGift(new BaseObserver<HeavenGiftBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(HeavenGiftBean heavenGiftBean) {
|
||||
if (heavenGiftBean != null){
|
||||
heavenGiftBea=heavenGiftBean;
|
||||
mBinding.tvTitle.setText(heavenGiftBean.getCounter());
|
||||
// 示例:假设从 HeavenGiftBean 中获取倒计时时间(单位:秒)
|
||||
// long countdownTime =Integer.parseInt(heavenGiftBean.getEffective_time()) * 1000L; // 转换为毫秒
|
||||
// startCountdown(countdownTime);
|
||||
mBinding.tvSj.setText("截止时间:"+heavenGiftBean.getEffective_time());
|
||||
mBinding.bannerViewPager.create(baseListData(heavenGiftBean.getGift_list(),4));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// List<HeavenGiftBean> list=new ArrayList<>();
|
||||
// for (int i = 0; i < 7; i++){
|
||||
// HeavenGiftBean bean=new HeavenGiftBean();
|
||||
// bean.setTitle("礼物"+i);
|
||||
// bean.setPicture("");
|
||||
// bean.setQuantity("x"+i);
|
||||
// bean.setGold(i+"");
|
||||
// bean.setDays(i+"天");
|
||||
// list.add(bean);
|
||||
// }
|
||||
//// giftAdapter.setNewData(list);
|
||||
// mBinding.bannerViewPager.create(baseListData(list,4));
|
||||
}
|
||||
private void startCountdown(long millisInFuture) {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
// giftAdapter.setNewData(list);
|
||||
mBinding.bannerViewPager.create(baseListData(list,4));
|
||||
|
||||
countDownTimer = new CountDownTimer(millisInFuture, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
updateCountdownDisplay(millisUntilFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// 倒计时结束时的处理
|
||||
mBinding.tvSj.setText("00:00:00");
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private List<BaseListData<HeavenGiftBean>> baseListData(List<HeavenGiftBean> list, int chunkSize){
|
||||
List<BaseListData<HeavenGiftBean>> baseListData = new ArrayList<>();
|
||||
private void updateCountdownDisplay(long millisUntilFinished) {
|
||||
long totalSeconds = millisUntilFinished / 1000;
|
||||
long hours = totalSeconds / 3600;
|
||||
long minutes = (totalSeconds % 3600) / 60;
|
||||
long seconds = totalSeconds % 60;
|
||||
|
||||
String timeFormatted = String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
mBinding.tvSj.setText(timeFormatted);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
}
|
||||
private List<BaseListData<RoonGiftModel>> baseListData(List<RoonGiftModel> list, int chunkSize) {
|
||||
List<BaseListData<RoonGiftModel>> baseListData = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||
BaseListData<HeavenGiftBean> baseListData1 = new BaseListData<>();
|
||||
BaseListData<RoonGiftModel> baseListData1 = new BaseListData<>();
|
||||
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||
baseListData.add(baseListData1);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.TextPaint;
|
||||
@@ -16,6 +19,7 @@ import androidx.databinding.DataBindingUtil;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.SpanUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.databinding.DialogPolicBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
@@ -42,7 +46,12 @@ public class PolicyDialog extends Dialog {
|
||||
ClickableSpan clickSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6");
|
||||
intent.putExtra("title", "用户协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +63,12 @@ public class PolicyDialog extends Dialog {
|
||||
ClickableSpan ysClickSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4");
|
||||
intent.putExtra("title", "隐私协议");
|
||||
startActivity(intent);
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +77,7 @@ public class PolicyDialog extends Dialog {
|
||||
ds.setUnderlineText(true);
|
||||
}
|
||||
};
|
||||
spanUtils.append("欢迎使用羽声!\n").append("在使用我们的产品和服务之前,请您先阅读并了解").append("《用户协议》").setClickSpan(clickSpan).append("和").append("《隐私协议》").setClickSpan(ysClickSpan).append("。我们将严格按照上述协议为" +
|
||||
spanUtils.append("欢迎使用羽声语音!\n").append("在使用我们的产品和服务之前,请您先阅读并了解").append("《用户协议》").setClickSpan(clickSpan).append("和").append("《隐私协议》").setClickSpan(ysClickSpan).append("。我们将严格按照上述协议为" +
|
||||
"您提供服务,保护您的信息安全,点" +
|
||||
"击“同意”即表示您已阅读并同意全部" +
|
||||
"条款,可以继续使用我们的产品和服" +
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.DialogRealNameBinding;
|
||||
import com.xscm.moduleutil.databinding.IndexDialogYouthModelBinding;
|
||||
@@ -20,6 +21,18 @@ import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
*/
|
||||
public class RealNameDialog extends BaseDialog<DialogRealNameBinding> {
|
||||
|
||||
|
||||
|
||||
public interface OnFirstChargeListener {
|
||||
void onFirstChargeConfirmed(String giftBean, int type);
|
||||
void onFirstChargeCancelled();
|
||||
}
|
||||
private OnFirstChargeListener listener;
|
||||
// 设置监听器的方法
|
||||
public void setOnFirstChargeListener(OnFirstChargeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public RealNameDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
@@ -36,8 +49,19 @@ public class RealNameDialog extends BaseDialog<DialogRealNameBinding> {
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
mBinding.tvIKnow.setOnClickListener(v -> dismiss());
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
// mBinding.tvIKnow.setOnClickListener(v -> dismiss());
|
||||
// mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
|
||||
mBinding.tvIKnow.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onFirstChargeConfirmed(null, 0);
|
||||
}
|
||||
});
|
||||
mBinding.ivClose.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onFirstChargeCancelled();
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvIKnow, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvIKnow.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -13,6 +15,7 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||
@@ -30,8 +33,12 @@ import com.xscm.moduleutil.widget.PaymentUtil;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
@@ -46,14 +53,19 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
private BindType.AllData selectedItem;
|
||||
private PayMethodAdapter bindTypeAdapter;
|
||||
private String roomId;
|
||||
private String gift_bag_id="0";//默认0 类型id 传 gift_bag_id
|
||||
private String type_params="0"; //默认0 类型参数 1首充 2天降好礼 3新人好礼
|
||||
|
||||
public static void show(String id, String type,FragmentManager fragmentManager) {
|
||||
public static RechargeDialogFragment show(String id, String type, FragmentManager fragmentManager,String gift_bag_id,String type_params) {
|
||||
RechargeDialogFragment dialogFragment = new RechargeDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("roomId", id); //// 可选:传递参数
|
||||
args.putString("type", type);
|
||||
args.putString("gift_bag_id", gift_bag_id);
|
||||
args.putString("type_params", type_params);
|
||||
dialogFragment.setArguments(args);
|
||||
dialogFragment.show(fragmentManager, "RoomOnlineDialogFragment");
|
||||
return dialogFragment;
|
||||
}
|
||||
@Override
|
||||
protected void initDialogStyle(Window window) {
|
||||
@@ -66,8 +78,11 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
super.onAttach(context);
|
||||
roomId = getArguments().getString("roomId");
|
||||
type = getArguments().getString("type");
|
||||
gift_bag_id = getArguments().getString("gift_bag_id");
|
||||
type_params = getArguments().getString("type_params");
|
||||
if(type!=null){
|
||||
money=type;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +118,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
ToastUtils.showShort("请选择支付方式");
|
||||
return;
|
||||
}
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType());
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(),type_params,gift_bag_id);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -125,7 +140,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
if (type!=null){
|
||||
mBinding.r4.setVisibility(View.GONE);
|
||||
}else{
|
||||
mBinding.r4.setVisibility(View.VISIBLE);
|
||||
mBinding.r4.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,11 +151,11 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
|
||||
@Override
|
||||
public void setRechargeData(List<RechargeBean> rechargeData) {
|
||||
RechargeBean customItem = new RechargeBean();
|
||||
customItem.setCoins("自定义");
|
||||
customItem.setMoney("");
|
||||
customItem.setItemViewType(1);
|
||||
rechargeData.add(customItem);
|
||||
// RechargeBean customItem = new RechargeBean();
|
||||
// customItem.setCoins("自定义");
|
||||
// customItem.setMoney("");
|
||||
// customItem.setItemViewType(1);
|
||||
// rechargeData.add(customItem);
|
||||
rechargeAdapter = new BalanceRechargeAdapter(rechargeData);
|
||||
rechargeAdapter.setNewData(rechargeData);
|
||||
rechargeAdapter.setListener(new BalanceRechargeAdapter.OnRechargeItemClickListener() {
|
||||
@@ -155,6 +170,9 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
public void onInputBoxVisibilityChanged(boolean isVisible) {
|
||||
// 根据 isVisible 的值来显示或隐藏输入框
|
||||
mBinding.r4.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
if (isVisible){
|
||||
money="0";
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.rvComment.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
@@ -194,7 +212,56 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
IWXAPI wxapi = WXAPIFactory.createWXAPI(getContext(), CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId());
|
||||
PaymentUtil.payWxMiniProgram2(wxapi,appPay);
|
||||
|
||||
}else if (appPay.getTl()!=null){
|
||||
if (appPay.getTl().getRemark().equals("5")) {//微信
|
||||
IWXAPI wxapi = WXAPIFactory.createWXAPI(getContext(), CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId());
|
||||
try {
|
||||
String paramString = buildParamString(appPay.getTl());
|
||||
PaymentUtil.payWxMiniProgramWx(wxapi,paramString);
|
||||
android.util.Log.d("RequestParams", paramString); // 输出拼接后的参数
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (appPay.getTl().getRemark().equals("4")) {//支付宝
|
||||
String s= JSON.toJSONString(appPay.getTl());
|
||||
try {
|
||||
String query = URLEncoder.encode("payinfo=" + URLEncoder.encode(s, "UTF-8"), "UTF-8");
|
||||
String url = "alipays://platformapi/startapp?appId=2021001104615521&page=pages/orderDetail/orderDetail&thirdPartSchema="
|
||||
+ URLEncoder.encode("myziroom://myziroom/", "UTF-8") + "&query=" + query;
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static String buildParamString(Object obj) throws IllegalAccessException {
|
||||
Class<?> clazz = obj.getClass();
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
TreeMap<String, String> paramMap = new TreeMap<>();
|
||||
|
||||
// 遍历字段并填充 TreeMap
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true); // 允许访问私有字段
|
||||
Object value = field.get(obj);
|
||||
if (value != null && !String.valueOf(value).isEmpty()) {
|
||||
paramMap.put(field.getName(), String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
// 使用 StringBuilder 拼接参数字符串
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append("&");
|
||||
}
|
||||
builder.append(entry.getKey())
|
||||
.append("=")
|
||||
.append(entry.getValue());
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,8 +4,10 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -20,6 +22,7 @@ import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.databinding.WebViewDialogBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
@@ -39,12 +42,27 @@ import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity;
|
||||
public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
|
||||
String mUrl;
|
||||
int type;//10:天空之境 11:岁月之城 12:时空之巅
|
||||
|
||||
public WebViewDialog(@NonNull Context context,String url) {
|
||||
public WebViewDialog(@NonNull Context context, Bundle args) {
|
||||
super(context, R.style.BaseDialogStyleH);
|
||||
this.mUrl=url;
|
||||
this.mUrl = args.getString("url");
|
||||
this.type = args.getInt("type");
|
||||
initData1();
|
||||
}
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (getWindow() != null) {
|
||||
// 获取屏幕尺寸
|
||||
android.util.DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
|
||||
// 设置高度为屏幕高度的80%
|
||||
android.view.WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.height = (int) (displayMetrics.heightPixels * 0.9);
|
||||
params.width = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
getWindow().setAttributes(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.web_view_dialog;
|
||||
@@ -52,19 +70,64 @@ public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
setCancelable(true);
|
||||
setCanceledOnTouchOutside(true);
|
||||
Window window = getWindow();
|
||||
assert window != null;
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 320.f / 375), WindowManager.LayoutParams.MATCH_PARENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
//
|
||||
}
|
||||
|
||||
if (type==10){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.tkzj);
|
||||
mBinding.imGz.setImageResource(R.mipmap.tkzj_gz);
|
||||
mBinding.webView.setPadding(16, 0, 16, 0);
|
||||
}else if (type==11){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.syzc);
|
||||
mBinding.imGz.setImageResource(R.mipmap.syzc_gz);
|
||||
}else if (type==12){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.skzj);
|
||||
mBinding.imGz.setImageResource(R.mipmap.skzj_gz);
|
||||
}else if (type==13){
|
||||
mBinding.gzCl.setBackgroundResource(R.mipmap.xlh);
|
||||
mBinding.imGz.setImageResource(R.mipmap.xlh_gz);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void initData1() {
|
||||
// WebSettings webSettings = mBinding.webView.getSettings();
|
||||
// webSettings.setUseWideViewPort(true);
|
||||
// webSettings.setLoadWithOverviewMode(true);
|
||||
// webSettings.setJavaScriptEnabled(true);
|
||||
// webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存
|
||||
// //增加JSBridge
|
||||
// mBinding.webView.addJavascriptInterface(new WebAppInterface(getContext()), "Android");
|
||||
//// mBinding.webView.addJavascriptInterface(new WebViewBridgeConfig(title), WebViewBridgeConfig.NAME);
|
||||
// webSettings.setBuiltInZoomControls(false);
|
||||
// webSettings.setSupportZoom(false);
|
||||
// webSettings.setDomStorageEnabled(true);
|
||||
// webSettings.setBlockNetworkImage(false);//解决图片不显示
|
||||
// // 启用 WebView 内容的滚动
|
||||
// mBinding.webView.setVerticalScrollBarEnabled(true);
|
||||
// mBinding.webView.setScrollbarFadingEnabled(true);
|
||||
// webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
// webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
// mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
|
||||
// mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
|
||||
// mBinding.webView.setWebViewClient(new WebViewClient());
|
||||
// mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
|
||||
// mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
//
|
||||
// mBinding.webView.requestFocus();
|
||||
// mBinding.webView.loadUrl(mUrl);
|
||||
|
||||
WebSettings webSettings = mBinding.webView.getSettings();
|
||||
webSettings.setUseWideViewPort(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
@@ -79,14 +142,18 @@ public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
webSettings.setBlockNetworkImage(false);//解决图片不显示
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
// 启用 WebView 内容的滚动,但隐藏滚动条
|
||||
mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
|
||||
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
|
||||
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示滚动条
|
||||
mBinding.webView.setWebViewClient(new WebViewClient());
|
||||
mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
|
||||
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
|
||||
// 确保内容可以滚动
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
|
||||
mBinding.webView.requestFocus();
|
||||
mBinding.webView.loadUrl("https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
|
||||
mBinding.webView.loadUrl(mUrl);
|
||||
}
|
||||
|
||||
private Resources getResources() {
|
||||
@@ -126,7 +193,9 @@ public class WebViewDialog extends BaseDialog<WebViewDialogBinding> {
|
||||
|
||||
@JavascriptInterface
|
||||
public void jumpRoomPage(String room_id) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getContext(), room_id,"");
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation();
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void jumpWebPage(String objects) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
@@ -9,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.TeenagerInfo;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
@@ -41,7 +43,13 @@ public class YouthModelDialog extends BaseDialog<IndexDialogYouthModelBinding> {
|
||||
Window window = getWindow();
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
mBinding.tvIKnow.setOnClickListener(v -> dismiss());
|
||||
mBinding.tvIKnow.setOnClickListener(v -> {
|
||||
|
||||
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 0).navigation();
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken()).navigation();
|
||||
// dismiss();
|
||||
});
|
||||
mBinding.tvOpen.setOnClickListener(v -> {
|
||||
// if (teenagerInfo.getHad_password() == 1) {
|
||||
|
||||
@@ -49,7 +57,11 @@ public class YouthModelDialog extends BaseDialog<IndexDialogYouthModelBinding> {
|
||||
// } else {
|
||||
// ARouter.getInstance().build(ARouteConstants.SET_YOUTH_PWD_ACTIVITY).withInt("type", SetYouthPasswordActivity.SET_TYPE).navigation();
|
||||
// }
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/teenage?id="+ SpUtil.getToken()).navigation();
|
||||
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken());
|
||||
getContext().startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken()).navigation();
|
||||
dismiss();
|
||||
});
|
||||
|
||||
|
||||
@@ -4,13 +4,46 @@ import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftLotteryContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getGiftListSuccess(BlindBoxBean blindBoxBean);
|
||||
|
||||
void drawGiftListSuccess(BlindReslutBean blindReslutBean);
|
||||
|
||||
void getMyRecordSuccess(List<GiftBean> data);
|
||||
void getAllRecordSuccess(List<GiftBean> data);
|
||||
|
||||
void finishRefreshLoadMore();
|
||||
void wallet(WalletBean walletBean);
|
||||
|
||||
void xlhChouSuccess(List<XlhDrawBean> data);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
void getGiftList(String giftBagId,String roomId);
|
||||
|
||||
void drawGiftList(String giftBagId,String gift_user_ids,String roomId,String num,String heart_id,String auction_id);
|
||||
|
||||
void getMyRecord(String giftBagId,String page,String pageSize,int type);//我的抽奖记录 type: 1:我的抽奖 2:全服抽奖
|
||||
|
||||
void giftSend(String send_id);
|
||||
|
||||
void wallet();
|
||||
|
||||
void xlh(String room_id);
|
||||
|
||||
void xlhChou(String room_id,String num);
|
||||
|
||||
void xlhAllRecord(String room_id,String page,String pageSize,int type);
|
||||
|
||||
void xlhMyRecord(String room_id,String page,String pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,216 @@ package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View> implements GiftLotteryContacts.IRoomPre {
|
||||
GiftLotteryContacts.View mView;
|
||||
public GiftLotteryPresenter(GiftLotteryContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftList(String giftBagId, String roomId) {
|
||||
api.getBoxGiftList(giftBagId, roomId, new BaseObserver<BlindBoxBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BlindBoxBean blindBoxBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getGiftListSuccess(blindBoxBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,String heart_id,String auction_id) {
|
||||
api.drawGiftList(giftBagId, gift_user_ids, roomId, num,heart_id,auction_id, new BaseObserver<BlindReslutBean>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BlindReslutBean blindReslutBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().drawGiftListSuccess(blindReslutBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMyRecord(String giftBagId, String page, String pageSize,int type) {
|
||||
if (type==1) {
|
||||
api.getMyRecord(giftBagId, page, pageSize, new BaseObserver<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBean) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getMyRecordSuccess(giftBean);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}else {
|
||||
api.getAllRecord(giftBagId,page,pageSize,new BaseObserver<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getAllRecordSuccess(giftBean);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giftSend(String send_id) {
|
||||
api.giftSend(send_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet() {
|
||||
api.wallet(new BaseObserver<WalletBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(WalletBean walletBean) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().wallet(walletBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
///巡乐会
|
||||
@Override
|
||||
public void xlh(String room_id) {
|
||||
// api.xlh(room_id, new BaseObserver<String>() {)
|
||||
|
||||
api.getBoxGiftListXLH(room_id, new BaseObserver<BlindBoxBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BlindBoxBean blindBoxBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getGiftListSuccess(blindBoxBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhChou(String room_id, String num) {
|
||||
if (api==null){
|
||||
api= RetrofitClient.getInstance();
|
||||
}
|
||||
api.xlhChou(room_id,num, new BaseObserver<List<XlhDrawBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<XlhDrawBean> xlhDrawBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().xlhChouSuccess(xlhDrawBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhAllRecord(String room_id, String page, String pageSize,int type) {
|
||||
|
||||
|
||||
api.xlhAllRecord(room_id, page, pageSize,type, new BaseObserver<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBean) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getAllRecordSuccess(giftBean);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void xlhMyRecord(String room_id, String page, String pageSize) {
|
||||
api.xlhMyRecord(room_id,page,pageSize,new BaseObserver<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<GiftBean> giftBeans) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getMyRecordSuccess(giftBeans);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user