diff --git a/common/src/main/java/com/yunbao/common/bean/HotStrategyBean.java b/common/src/main/java/com/yunbao/common/bean/HotStrategyBean.java index 2a465f9ec..d7ee4e45a 100644 --- a/common/src/main/java/com/yunbao/common/bean/HotStrategyBean.java +++ b/common/src/main/java/com/yunbao/common/bean/HotStrategyBean.java @@ -1,10 +1,19 @@ package com.yunbao.common.bean; public class HotStrategyBean { + private String id; private String title; private String english_title; private String url; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + public String getTitle() { return title; } diff --git a/common/src/main/java/com/yunbao/common/fragment/LiveDataNowFragment.java b/common/src/main/java/com/yunbao/common/fragment/LiveDataNowFragment.java index 42d5788e2..c41198e32 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveDataNowFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveDataNowFragment.java @@ -30,8 +30,9 @@ public class LiveDataNowFragment extends Fragment { private List list; private String mLiveUid; private onDataResult onDataResult; + private String mStream; - public LiveDataNowFragment(Context context, String liveUid,LiveDataNowFragment.onDataResult onDataResult) { + public LiveDataNowFragment(Context context, String liveUid,String mStream,LiveDataNowFragment.onDataResult onDataResult) { this.mLiveUid = liveUid; this.onDataResult = onDataResult; } @@ -63,7 +64,7 @@ public class LiveDataNowFragment extends Fragment { list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), getContext().getString(R.string.live_data_loading))); adapter.setList(list); LiveNetManager.get(getContext()) - .getLiveData(mLiveUid, new HttpCallback() { + .getLiveData(mLiveUid,mStream, new HttpCallback() { @Override public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) { list.clear(); diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 7447a28e8..5e1aeff3c 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -556,7 +556,8 @@ public interface PDLiveApi { */ @GET("/api/public/?service=Live.getLiveStatisticalData") Observable> getLiveDataInfo( - @Query("liveuid") String liveUid + @Query("liveuid") String liveUid, + @Query("stream") String stream ); /** diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index db1e00906..8f6ba3bec 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -1216,9 +1216,9 @@ public class LiveNetManager { /** * 获取直播数据 */ - public void getLiveData(String liveUid, HttpCallback callback) { + public void getLiveData(String liveUid,String stream, HttpCallback callback) { API.get().pdLiveApi(mContext) - .getLiveDataInfo(liveUid) + .getLiveDataInfo(liveUid,stream) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java index e26e08176..e371a13aa 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveDataInfoDialog.java @@ -62,7 +62,7 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow { protected void onCreate() { super.onCreate(); final String[] titles = new String[]{WordUtil.getNewString(R.string.live_data_now_data), WordUtil.getNewString(R.string.live_data_gift_history)}; - fragmentList.add(new LiveDataNowFragment(mContext, mLiveUid, new LiveDataNowFragment.onDataResult() { + fragmentList.add(new LiveDataNowFragment(mContext, mLiveUid, mStream,new LiveDataNowFragment.onDataResult() { @Override public void Result(String countZs, String countPerson) { diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index 6989d235a..9901eb018 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -314,7 +314,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList findViewById(R.id.go_anchor_center).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Auth&a=authcenter"; + String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Auth&"; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); ZhuangBanActivity.forward(mContext, url, 0); } @@ -332,24 +332,6 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList Bus.get().post(new CloseEvent()); } }); - LiveNetManager.get(mContext).getLiveData(CommonAppConfig.getInstance().getUid(), new HttpCallback() { - @Override - public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) { - count1.setText(data.getTotalCoin() + ""); - count2.setText(data.getTotalGold() + ""); - count3.setText(data.getAcceptNum() + ""); - count4.setText(data.getEnterNum() + ""); - count5.setText(data.getAttentionNum() + ""); - count6.setText(data.getAttentionNumRate() + ""); - count7.setText(data.getFanGroupNum() + ""); - count8.setText(data.getFanGroupNumRate() + ""); - } - - @Override - public void onError(String error) { - ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error)); - } - }); } public static void upData(String votes, String length, int nums, String uname) { @@ -416,7 +398,8 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList ViewClicksAntiShake.clicksAntiShake(week, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - WebViewActivity.forward(mContext,hotStrategyBeanList.get(finalI).getUrl(),true); + String url = CommonAppConfig.HOST+"/h5/activity/pdlNewCenter/details.html?id="+hotStrategyBeanList.get(finalI).getId(); + WebViewActivity.forward(mContext,url,true); } }); live_end_vf.addView(weekView); @@ -476,6 +459,24 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList ImgLoader.displayAvatar(mContext, liveBean.getAvatar(), clipImageanchor); } ImgLoader.displayBlur(mContext, liveBean.getAvatar(), mAvatar1); + LiveNetManager.get(mContext).getLiveData(CommonAppConfig.getInstance().getUid(),stream, new HttpCallback() { + @Override + public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) { + count1.setText(data.getTotalCoin() + ""); + count2.setText(data.getTotalGold() + ""); + count3.setText(data.getAcceptNum() + ""); + count4.setText(data.getEnterNum() + ""); + count5.setText(data.getAttentionNum() + ""); + count6.setText(data.getAttentionNumRate() + ""); + count7.setText(data.getFanGroupNum() + ""); + count8.setText(data.getFanGroupNumRate() + ""); + } + + @Override + public void onError(String error) { + ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error)); + } + }); } @Override diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 2a752952d..6a58ce71b 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -2,6 +2,7 @@ package com.yunbao.live.views; import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive; import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; +import static com.yunbao.live.views.LiveRoomViewHolder.mStream; import android.app.Activity; import android.app.Dialog; @@ -910,7 +911,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe L.e("getIsNewUser:"+data.getEnterRoomInfo().getIsNewUser()); L.e("getIsattention:"+data.getEnterRoomInfo().getIsattention()); //检测是否是首次观看该直播间 - if(data.getEnterRoomInfo().getIsFirstEntry().equals("1")&&data.getEnterRoomInfo().getIsNewUser().equals("1")&&data.getEnterRoomInfo().getIsattention().equals("0")){ + if(data.getEnterRoomInfo().getIsFirstEntry().equals("1")&&data.getEnterRoomInfo().getIsNewUser().equals("1")){ mLiveRoomViewHolder.firstLookLiveNotify(); } //判断是否有免费礼物