diff --git a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java index 653e05343..32fccb6c4 100644 --- a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java @@ -87,7 +87,6 @@ public class RandomPkManager { @Override public void run() { - status = PK_STATUS_REQUEST; sec++; if (sec % 60 == 0) { min++; @@ -114,9 +113,10 @@ public class RandomPkManager { * 对方拒绝,开始下一轮匹配 */ private void nextPk() { - if (status != PK_STATUS_REQUEST && status != PK_STATUS_REFUSE) { + if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) { return; } + status = PK_STATUS_REQUEST; LiveNetManager.get(CommonAppContext.getTopActivity()) .randomPK(new HttpCallback() { @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index 01a45d438..244984618 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -219,6 +219,13 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On loadDialog = null; if (data.getCode() == 0) { setSwitchBtn(!(boolean) mRandomPkSwitch.getTag()); + } else if (data.getCode() == 500) { + DialogUitl.showSimpleDialog(mContext, "您因拒绝随机PK,被限制关闭中", "随机PK可打开时间:" + data.getMsg(), false, new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + dialog.dismiss(); + } + }); } else { ToastUtil.show(data.getMsg()); } @@ -257,7 +264,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On mPkBtn.setTag(true); } } else { - ToastUtil.show("請先關閉語言連麥"); + ToastUtil.show("請先關閉語言連麥"); } } }); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 163952706..79a163d09 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -1200,10 +1200,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { ((TextView) context).setText("隨機PK可打開時間:" + new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(System.currentTimeMillis() + 7200000)));//7200000ms=120m=2h ((TextView) context).setTextSize(12); ((TextView) context).setTextColor(Color.parseColor("#999999")); - + refusePk(u); cancelBtn.setVisibility(View.GONE); confirmBtn.setOnClickListener(v -> { - refusePk(u); dialog.dismiss(); }); }