From dd4172fc3deac493ea77b2dbb88682b9e4493107 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 7 Jul 2023 09:51:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/http/PDLiveApi.java | 13 +++++++-- .../common/http/live/LiveNetManager.java | 28 +++++++++++++++++-- common/src/main/res/values-en-rUS/string.xml | 1 + common/src/main/res/values-zh-rHK/strings.xml | 1 + common/src/main/res/values-zh-rTW/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 1 + common/src/main/res/values/strings.xml | 1 + gradle.properties | 8 +++--- .../live/dialog/SendRendPacketPopup.java | 2 +- .../yunbao/live/views/LiveRoomViewHolder.java | 16 ++++++++++- 10 files changed, 62 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 92d5a8ecb..60938e8fb 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -20,7 +20,6 @@ import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAnchorCallMeModel; import com.yunbao.common.bean.LiveAnchorSayModel; -import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; @@ -38,9 +37,9 @@ import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.RedPacketDetailsBean; -import com.yunbao.common.bean.RedPacketListBean; import com.yunbao.common.bean.RedPacketGiftModel; import com.yunbao.common.bean.RedPacketInfoModel; +import com.yunbao.common.bean.RedPacketListBean; import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.bean.SlideInBannerModel; @@ -820,4 +819,14 @@ public interface PDLiveApi { @Query("liveuid") String liveUid, @Query("red_packet_id") String redPacketId ); + + /** + * 获取普通红包的领取记录 + */ + @GET("/api/public/?service=Live.startRedPacketRobot") + Observable> startRedPacketRobot( + @Query("liveuid") String liveUid, + @Query("stream") String stream, + @Query("red_packet_id") String redPacketId + ); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index c7c63d736..6e1313e02 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -1622,9 +1622,9 @@ public class LiveNetManager { @Override public void accept(ResponseModel objectResponseModel) throws Exception { if (callback != null) { - if(objectResponseModel.getData().getCode()==0){ + if (objectResponseModel.getData().getCode() == 0) { callback.onSuccess(objectResponseModel.getData().getMsg()); - }else { + } else { callback.onError(objectResponseModel.getData().getMsg()); } } @@ -1772,6 +1772,30 @@ public class LiveNetManager { }).isDisposed(); } + public void startRedPacketRobot(String liveUid, String stream, String redPacketId, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .startRedPacketRobot(liveUid, stream, redPacketId) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel objectResponseModel) throws Exception { + if (objectResponseModel.getData().getCode() == 0) { + callback.onSuccess(objectResponseModel.getData().getMsg()); + } else { + callback.onError(objectResponseModel.getData().getMsg()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + /** * 直播间取消网络请求 */ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index a3eca3045..1a84487dd 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1247,6 +1247,7 @@ Limited ride And limited avatar frame Miss the red envelope Check out your luck %s drew %s in the lucky red envelope + number diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 8fb233925..0ed5dee4a 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1242,4 +1242,5 @@ 與紅包擦肩而過 查看大家手氣 " %s 在 好運紅包 中抽到了 %s" + 数量 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index bffbc8271..fbdb32fed 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1241,4 +1241,5 @@ 與紅包擦肩而過 查看大家手氣 " %s 在 好運紅包 中抽到了 %s" + 数量 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 288c8faa9..a21e0efad 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1242,6 +1242,7 @@ 與紅包擦肩而過 查看大家手氣 " %s 在 好運紅包 中抽到了 %s" + 数量 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index ce5fea838..cce8d3738 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1248,4 +1248,5 @@ Limited ride And limited avatar frame Miss the red envelope Check out your luck %s drew %s in the lucky red envelope + number diff --git a/gradle.properties b/gradle.properties index e850a38e3..321e7baef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,8 +19,8 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=true -systemProp.http.proxyHost=127.0.0.1 -systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=10809 -systemProp.http.proxyPort=10809 +#systemProp.http.proxyHost=127.0.0.1 +#systemProp.https.proxyHost=127.0.0.1 +#systemProp.https.proxyPort=10809 +#systemProp.http.proxyPort=10809 #android.enableR8.fullMode=true \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java index 60794d98d..6c4fc6725 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java @@ -135,7 +135,7 @@ public class SendRendPacketPopup extends CenterPopupView { if (numberInt >= 1 && numberInt <= 100) { totalConsumptionOfDrill.setText(String.format(getContext().getString(R.string.total_consumption_of_drill), String.valueOf((rillInt * numberInt)))); } else { - ToastUtil.show(getContext().getString(R.string.drill) + String.format(getContext().getString(R.string.range_range_is), "1~100")); + ToastUtil.show(getContext().getString(R.string.lucky_red_envelope_amount) + String.format(getContext().getString(R.string.range_range_is), "1~100")); } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 1a8741966..f44a743fe 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1414,6 +1414,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mCountdown = mCountdown - 1; anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000); Log.e("主播倒计时", String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(mCountdown))); + if (mCountdown == 180) { + LiveNetManager.get(mContext). + startRedPacketRobot(mLiveUid, mStream, mRedPacketModel.getRedPacketId(), new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(String data) { + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } } else { redPacket.setVisibility(View.GONE); anchorTimeHandler.removeCallbacks(anchorTimeRunnable); @@ -1483,7 +1497,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .show(); } else if (TextUtils.equals(data.getReceiveStatus(), "1")) { new XPopup.Builder(mContext) - .asCustom(new ResultRendPacketPopup(mContext, true, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) + .asCustom(new ResultRendPacketPopup(mContext, true, data.setRedPacketId(redPacketModel.getRedPacketId()), false)) .show(); } else { new XPopup.Builder(mContext)