修改测试问题,对接H5页面

This commit is contained in:
18401019693 2024-03-21 18:13:24 +08:00
parent cad8236e5c
commit 5dff64ec99
5 changed files with 41 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@ -30,12 +31,14 @@ import com.lxj.xpopup.enums.PopupPosition;
import com.makeramen.roundedimageview.RoundedImageView;
import com.stx.xhb.androidx.XBanner;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.adapter.LiveBuyGuardPrivilegeAdapter;
import com.yunbao.common.bean.CheckUpgradesModel;
import com.yunbao.common.bean.GuardDataTipModel;
import com.yunbao.common.bean.GuardGetGuardOpenInfoModel;
import com.yunbao.common.bean.GuardGetGuardUserInfoModel;
import com.yunbao.common.bean.GuardPriceModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.dialog.GuardBuyTipsDialog;
import com.yunbao.common.dialog.GuardUpgradePopup;
@ -43,11 +46,14 @@ import com.yunbao.common.dialog.LiveBuyGuardSelectPopup;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.bean.BuyGuardBannerModel;
import com.yunbao.live.fragments.LiveBuyGuardVPFragment;
@ -402,6 +408,30 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow {
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.guard_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
StringBuffer htmlUrl = new StringBuffer();
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
htmlUrl.append(CommonAppConfig.HOST)
.append("/h5/Guard/rules.html")
.append("?token=")
.append(userInfo.getToken())
.append("&uid=")
.append(userInfo.getId())
.append("&anchorUid=")
.append(mLiveUid)
.append("&isZh=")
.append(((WordUtil.isNewZh()) ? "1" : "0"));
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl.toString());
bundle.putInt("height", DeviceUtils.getScreenHeight(getActivity()) / 5 * 3);
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
});
}

View File

@ -44,6 +44,7 @@
android:textStyle="bold" />
<ImageView
android:id="@+id/guard_rule"
android:layout_width="19dp"
android:layout_height="19dp"
android:layout_gravity="center_vertical|end"

View File

@ -292,7 +292,7 @@ public class ZhuangBanActivity extends AbsActivity {
Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag1212", url);
intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
if (url.contains("Noble/index.html") || url.contains("Grade/index.html")) {
if (url.contains("Noble/index.html") || url.contains("Grade/index.html")|| url.contains("Guard/index.html")) {
intent.putExtra("title", "");
}
context.startActivity(intent);

View File

@ -178,6 +178,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
findViewById(R.id.lt_noble).setOnClickListener(this);
findViewById(R.id.lt_name).setOnClickListener(this);
findViewById(R.id.signature).setOnClickListener(this);
findViewById(R.id.lt_guard).setOnClickListener(this);
btnCopy.setOnClickListener(new View.OnClickListener() {
@Override
@ -546,6 +547,13 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
ZhuangBanActivity.forward(mContext, url, false);
} else if (i == R.id.lt_guard) {
MobclickAgent.onEvent(mContext, "my_guard", "个人中心点守護");
Constants.isTitle = true;
UserBean u = CommonAppConfig.getInstance().getUserBean();
String url = CommonAppConfig.HOST + "/h5/Guard/index.html?token=" + CommonAppConfig.getInstance().getToken()
+ "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
ZhuangBanActivity.forward(mContext, url, false);
}

View File

@ -576,6 +576,7 @@
android:layout_height="1dp" />
<FrameLayout
android:id="@+id/lt_guard"
android:layout_width="0dp"
android:layout_height="81dp"