修复人气票没传liveuid和stream问题

This commit is contained in:
zlzw 2023-04-13 10:07:42 +08:00
parent bec764a329
commit 499b73295d
2 changed files with 13 additions and 11 deletions

View File

@ -2,6 +2,7 @@ package com.yunbao.live.dialog;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
import static com.yunbao.live.views.LiveRoomViewHolder.mStream;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color; import android.graphics.Color;
@ -66,7 +67,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
private String roomId; private String roomId;
private DialogInterface.OnShowListener listener; private DialogInterface.OnShowListener listener;
private TextView htmlError; private TextView htmlError;
private boolean isSetHeight =false; private boolean isSetHeight = false;
public LiveHDDialogFragment() { public LiveHDDialogFragment() {
@ -180,7 +181,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
findViewById(R.id.title_laout).setVisibility(View.VISIBLE); findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
} }
if (bundle.getInt("height", -1) != -1) { if (bundle.getInt("height", -1) != -1) {
isSetHeight =true; isSetHeight = true;
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
mWebView.setLayoutParams(params); mWebView.setLayoutParams(params);
} }
@ -189,7 +190,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
params.width = bundle.getInt("width", -1); params.width = bundle.getInt("width", -1);
mWebView.setLayoutParams(params); mWebView.setLayoutParams(params);
} }
mWebView.loadUrl(bundle.getString("url")); String url = bundle.getString("url");
url += "&anchorUid=" + mLiveUid+"&stream="+mStream;
mWebView.loadUrl(url);
mWebView.setWebViewClient(new WebViewClient() { mWebView.setWebViewClient(new WebViewClient() {
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
@ -201,7 +204,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
@Override @Override
public void onPageFinished(WebView view, String url) { public void onPageFinished(WebView view, String url) {
if(!isSetHeight) { if (!isSetHeight) {
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)"); view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
} }
if (listener != null) { if (listener != null) {
@ -236,7 +239,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
} }
private void gotoLive(final String live_id) { private void gotoLive(final String live_id) {
if (!TextUtils.equals(roomId, live_id)) { if (!TextUtils.equals(roomId, live_id)) {
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
@ -250,7 +252,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
if (liveBean == null) { if (liveBean == null) {
return; return;
} }
if(MicStatusManager.getInstance().isMic(liveUid)){ if (MicStatusManager.getInstance().isMic(liveUid)) {
MicStatusManager.getInstance().showDownMicDialog(mContext); MicStatusManager.getInstance().showDownMicDialog(mContext);
return; return;
} }
@ -341,7 +343,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
dismiss(); dismiss();
((LiveAudienceActivity) mContext).openGiftWindow(); ((LiveAudienceActivity) mContext).openGiftWindow();
} else if (TextUtils.equals(event.getMethod(), "androidGoBack")) { } else if (TextUtils.equals(event.getMethod(), "androidGoBack")) {
dismiss(); // dismiss();
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) { } else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
if (mContext instanceof LiveRyAnchorActivity) { if (mContext instanceof LiveRyAnchorActivity) {
return; return;
@ -363,13 +365,13 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
); );
} }
//守護 //守護
}else if(TextUtils.equals(event.getMethod(), "BuyProtection")){ } else if (TextUtils.equals(event.getMethod(), "BuyProtection")) {
((LiveActivity) mContext).openNewBuyGuardWindow(event.getData()); ((LiveActivity) mContext).openNewBuyGuardWindow(event.getData());
}else if(TextUtils.equals(event.getMethod(), "BuyVIP")){ } else if (TextUtils.equals(event.getMethod(), "BuyVIP")) {
UserBean u = CommonAppConfig.getInstance().getUserBean(); UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname="
+ u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid="
+ CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&active="+event.getData()+ "&anchorUid=" + mLiveUid; + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&active=" + event.getData() + "&anchorUid=" + mLiveUid;
ZhuangBanActivity.forward(mContext, url, false); ZhuangBanActivity.forward(mContext, url, false);
} }

View File

@ -212,7 +212,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private ImageView avatarOther; private ImageView avatarOther;
private View mBtnRedPack; private View mBtnRedPack;
public static String mLiveUid; public static String mLiveUid;
private static String mStream; public static String mStream;
private LiveLightAnimPresenter mLightAnimPresenter; private LiveLightAnimPresenter mLightAnimPresenter;
private LiveEnterRoomAnimPresenter mLiveEnterRoomAnimPresenter; private LiveEnterRoomAnimPresenter mLiveEnterRoomAnimPresenter;
private LiveDanmuPresenter mLiveDanmuPresenter; private LiveDanmuPresenter mLiveDanmuPresenter;