修改 测试问题

This commit is contained in:
18401019693 2023-12-06 13:45:37 +08:00
parent a2864187ed
commit 79c1c01003
9 changed files with 59 additions and 32 deletions

View File

@ -75,12 +75,13 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
@Override
public void onViewClicks() {
LiveNetManager.get(getContext())
.buyTicket(String.valueOf(ticket), new HttpCallback<Object>() {
.buyTicket(String.valueOf(ticket), new HttpCallback<String>() {
@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);
}
}

View File

@ -2431,7 +2431,7 @@ public class LiveNetManager {
}
public void buyTicket(String quantity, HttpCallback<Object> callback) {
public void buyTicket(String quantity, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.buyTicket(quantity)
.subscribeOn(Schedulers.io())
@ -2440,7 +2440,14 @@ public class LiveNetManager {
@Override
public void accept(ResponseModel<Object> 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<Throwable>() {

View File

@ -1392,6 +1392,6 @@ Limited ride And limited avatar frame</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">·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;</string>
<string name="conversion_quantity_need_of_use2">·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;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
</resources>

View File

@ -1387,7 +1387,7 @@
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊</string>
</resources>

View File

@ -1386,7 +1386,7 @@
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲 打擊</string>
</resources>

View File

@ -1386,8 +1386,8 @@
<string name="conversion_quantity">兌換數量:</string>
<string name="conversion_quantity_need">需要 %s</string>
<string name="conversion_quantity_need_of_use">兌換&amp;使用規則:</string>
<string name="conversion_quantity_need_of_use1">·星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊</string>
<string name="conversion_quantity_need_of_use1">·1星幣兌換1張觀影券您可以根據需求自定義兌換數量觀影券一經兌換不可撤銷請提前確認</string>
<string name="conversion_quantity_need_of_use2">·1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
<string name="conversion_quantity_need_of_use3">·觀影券禁止線下交易、收購等不正當行為PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊</string>
</resources>

View File

@ -1395,5 +1395,5 @@ Limited ride And limited avatar frame</string>
<string name="conversion_quantity_need_of_use">Exchange&amp;Usage Rules:</string>
<string name="conversion_quantity_need_of_use1">·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;</string>
<string name="conversion_quantity_need_of_use2">·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;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities;</string>
<string name="conversion_quantity_need_of_use3">·Ticket prohibit illegal activities such as offline trading and acquisitions, and PDLIVE will crack down severely on various profit-making trading activities.</string>
</resources>

View File

@ -2531,7 +2531,7 @@
android:layout_height="wrap_content"
android:text="1"
android:textColor="#FFDD25"
android:textSize="58sp"
android:textSize="45sp"
android:textStyle="bold" />
</LinearLayout>

View File

@ -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,7 +402,21 @@ 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() {
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));
}
@Override
public void onCancelClick() {
}
});
} else if (TextUtils.equals(data, "1")) {
mWebView.post(new Runnable() {
@Override
public void run() {
@ -407,7 +424,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
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<String>() {
mWebView.evaluateJavascript("javascript:nativeCallback('" + nativeJson + "')", new ValueCallback<String>() {
@Override
public void onReceiveValue(String value) {
}
@ -416,6 +433,8 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
}
});
}
}
})).show();
}