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);