From 0ea9ffc2e85ed4d410c341eaf760c82f3caaa480 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 14 Aug 2023 17:40:52 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/JavascriptInterfaceUtils.java | 19 +++++++++++++++++++ .../src/main/res/layout/dialog_live_codex.xml | 11 +++++++---- .../live/activity/LiveAudienceActivity.java | 15 +-------------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 5d2a9412e..5d4e9ea17 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -22,6 +22,8 @@ import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.VideoBean; import com.yunbao.common.bean.VideoListBean; import com.yunbao.common.event.JavascriptInterfaceEvent; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.HttpClient; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; @@ -568,4 +570,21 @@ public class JavascriptInterfaceUtils { public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl,int isAnchor ) { RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0,isAnchor==1); } + @JavascriptInterface + public void wearOrCancelFanMedal(){ + HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") + .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) + .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) + .execute(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + IMLoginManager.get(mContext).upDataUserInfo(info[0]); + JSONObject obj = JSON.parseObject(info[0]); + UserBean bean = JSON.toJavaObject(obj, UserBean.class); + CommonAppConfig.getInstance().setUserBean(bean); + } + } + }); + } } diff --git a/common/src/main/res/layout/dialog_live_codex.xml b/common/src/main/res/layout/dialog_live_codex.xml index 9bc06cce4..9daabd6a7 100644 --- a/common/src/main/res/layout/dialog_live_codex.xml +++ b/common/src/main/res/layout/dialog_live_codex.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 1bc3721ec..732c3949b 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -251,20 +251,7 @@ public class LiveAudienceActivity extends LiveActivity { * 初始化数据 */ private void initData() { - HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") - .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) - .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) - .execute(new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0 && info.length > 0) { - IMLoginManager.get(mContext).upDataUserInfo(info[0]); - JSONObject obj = JSON.parseObject(info[0]); - UserBean bean = JSON.toJavaObject(obj, UserBean.class); - CommonAppConfig.getInstance().setUserBean(bean); - } - } - }); + String json = GsonUtils.toJson(mLiveBean); AnchorRecommendItemModel model = GsonUtils.fromJson(json, AnchorRecommendItemModel.class); itemModelList.add(0, model);