From 79c1c01003f53134df275477561249a89cb23032 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 6 Dec 2023 13:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/CinemaTicketPopupWindow.java | 9 ++-- .../common/http/live/LiveNetManager.java | 11 ++++- common/src/main/res/values-en-rUS/string.xml | 2 +- common/src/main/res/values-zh-rHK/strings.xml | 6 +-- common/src/main/res/values-zh-rTW/strings.xml | 6 +-- common/src/main/res/values-zh/strings.xml | 6 +-- common/src/main/res/values/strings.xml | 2 +- live/src/main/res/layout/view_live_room.xml | 2 +- .../views/MainHomeCommunityViewHolder.java | 47 +++++++++++++------ 9 files changed, 59 insertions(+), 32 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java index d44442c19..010bf189a 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java @@ -75,12 +75,13 @@ public class CinemaTicketPopupWindow extends CenterPopupView { @Override public void onViewClicks() { LiveNetManager.get(getContext()) - .buyTicket(String.valueOf(ticket), new HttpCallback() { + .buyTicket(String.valueOf(ticket), new HttpCallback() { @Override - public void onSuccess(Object data) { + public void onSuccess(String data) { + if (mCinemaTicketPopupWindowCallBack != null) { - mCinemaTicketPopupWindowCallBack.onCallBack(); + mCinemaTicketPopupWindowCallBack.onCallBack(data); } dialog.dismiss(); } @@ -95,6 +96,6 @@ public class CinemaTicketPopupWindow extends CenterPopupView { } public interface CinemaTicketPopupWindowCallBack { - void onCallBack(); + void onCallBack(String data); } } 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 e12e6c590..5b0b47582 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 @@ -2431,7 +2431,7 @@ public class LiveNetManager { } - public void buyTicket(String quantity, HttpCallback callback) { + public void buyTicket(String quantity, HttpCallback callback) { API.get().pdLiveApi(mContext) .buyTicket(quantity) .subscribeOn(Schedulers.io()) @@ -2440,7 +2440,14 @@ public class LiveNetManager { @Override public void accept(ResponseModel objectResponseModel) throws Exception { if (callback != null) { - callback.onSuccess(null); + if (objectResponseModel.getData().getCode() == 0) { + callback.onSuccess("1"); + } else if (objectResponseModel.getData().getCode() == 500) { + callback.onSuccess("2"); + } else { + callback.onError(objectResponseModel.getData().getMsg()); + } + } } }, new Consumer() { diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index ea8c51a54..56358e6b1 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1392,6 +1392,6 @@ Limited ride And limited avatar frame Exchange&Usage Rules: ·One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance; ·One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie; - ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities; + ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 6e3e7cfa5..1c9c00ff1 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1387,7 +1387,7 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊; + ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 23f344a09..99a35ce6f 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1386,7 +1386,7 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊; + ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 15d0d1d1b..9bcf8c8e3 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1386,8 +1386,8 @@ 兌換數量: 需要 %s 兌換&使用規則: - ·星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; - ·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; - ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊; + ·1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認; + ·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片; + ·觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 40ddae421..9b648b88d 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1395,5 +1395,5 @@ Limited ride And limited avatar frame Exchange&Usage Rules: ·One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance; ·One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie; - ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities; + ·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities. diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index c0d36fdfb..9a7a5a8cc 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2531,7 +2531,7 @@ android:layout_height="wrap_content" android:text="1" android:textColor="#FFDD25" - android:textSize="58sp" + android:textSize="45sp" android:textStyle="bold" /> diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index 2cf564480..d9c58e538 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -3,6 +3,7 @@ package com.yunbao.main.views; import static android.content.Context.CLIPBOARD_SERVICE; import android.app.Activity; +import android.app.Dialog; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -46,6 +47,7 @@ import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfacePlayLetUtils; import com.yunbao.common.utils.JavascriptInterfaceUtils; @@ -56,6 +58,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.views.LoadingView; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; +import com.yunbao.main.activity.MyWalletActivity; import com.yunbao.main.dialog.EncourageDialog; import com.yunbao.main.utils.BottomBarUtil; import com.yunbao.share.ui.SharePopDialog; @@ -399,22 +402,38 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) .asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { @Override - public void onCallBack() { - mWebView.post(new Runnable() { - @Override - public void run() { + public void onCallBack(String data) { + if (TextUtils.equals(data, "2")) { + DialogUitl.showSimpleDialog(mContext, mContext.getString(com.yunbao.live.R.string.live_coin_not_enough), false, + new DialogUitl.SimpleCallback2() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1)); + } - NativeCallbackModel model = new NativeCallbackModel(); - model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())); - String nativeJson = new JsonUtil().toJson(model); - mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback() { - @Override - public void onReceiveValue(String value) { - } - }); + @Override + public void onCancelClick() { + + } + }); + } else if (TextUtils.equals(data, "1")) { + mWebView.post(new Runnable() { + @Override + public void run() { + + NativeCallbackModel model = new NativeCallbackModel(); + model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())); + String nativeJson = new JsonUtil().toJson(model); + mWebView.evaluateJavascript("javascript:nativeCallback('" + nativeJson + "')", new ValueCallback() { + @Override + public void onReceiveValue(String value) { + } + }); + + } + }); + } - } - }); } })).show(); }