update:默认隐藏新人特惠入口

update:更新新人特惠接口
This commit is contained in:
zlzw 2022-08-23 17:38:27 +08:00
parent 23f765230b
commit 7f762189df
4 changed files with 94 additions and 3 deletions

View File

@ -0,0 +1,62 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.google.gson.annotations.SerializedName;
/**
* 直播间新人特惠入口信息
*/
public class NewPeopleInfo extends BaseModel{
@SerializedName("charge_hidden")
private int chargeHidden;
@SerializedName("one_coin_show")
private int oneCoinShow;
@SerializedName("is_show")
private int isShow;//是否展示入口
@SerializedName("link")
private String link;//入口地址
public boolean getChargeHidden() {
return chargeHidden==1;
}
public void setChargeHidden(int chargeHidden) {
this.chargeHidden = chargeHidden;
}
public boolean getOneCoinShow() {
return oneCoinShow==1;
}
public void setOneCoinShow(int oneCoinShow) {
this.oneCoinShow = oneCoinShow;
}
public boolean getIsShow() {
return isShow==1;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
@NonNull
@Override
public String toString() {
return "NewPeopleInfo{" +
"chargeHidden=" + chargeHidden +
", oneCoinShow=" + oneCoinShow +
", isShow=" + isShow +
", link='" + link + '\'' +
'}';
}
}

View File

@ -7,6 +7,7 @@ import com.yunbao.common.bean.ContributeModel;
import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.bean.SetAttentsModel;
@ -162,4 +163,11 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Contribute.index")
Observable<ResponseModel<ContributeModel>> getRanksList(@Query("uid")String uid);
/**
* 直播间新人特惠信息
* @return 新人特惠数据
*/
@GET("/api/public/?service=Live.newUserPreferential")
Observable<ResponseModel<NewPeopleInfo>> getNewPeopleInfo();
}

View File

@ -33,9 +33,10 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.MsgModel;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.API;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
@ -50,6 +51,7 @@ import com.yunbao.live.bean.LiveChatBean;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveMicUserDialogFragment;
import com.yunbao.live.dialog.LivePromotionDialogFragment;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpUtil;
import org.greenrobot.eventbus.EventBus;
@ -58,6 +60,9 @@ import org.greenrobot.eventbus.ThreadMode;
import java.util.Locale;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* Created by cxf on 2018/10/9.
* 观众直播间逻辑
@ -78,6 +83,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
private int icon = 0;
private String nobleName, nobleTtext;
private ImageView giftImage, liveNewPeople;
private String newPeopleUrl=null;
public LiveAudienceViewHolder(Context context, ViewGroup parentView) {
super(context, parentView);
@ -356,7 +362,20 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
LiveRoomViewHolder.insertChat(lvBean2, 1);
}
}, 10000);//3秒后执行Runnable中的run方法
getNewPeopleInfo();
}
public void getNewPeopleInfo(){
API.get().pdLiveApi(mContext)
.getNewPeopleInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(stringResponseModel -> {
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
if(peopleInfo.getIsShow()){
liveNewPeople.setVisibility(View.VISIBLE);
newPeopleUrl=peopleInfo.getLink();
}
}).isDisposed();
}
@Override
@ -387,7 +406,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
showTrickeryDialog();
}else if (i==R.id.live_new_people){
Bundle bundle=new Bundle();
String url= CommonAppConfig.HOST+"/h5/activity/1diamondLottery/index.html?g=Appapi&m=Turntable&a=tricky";
String url= newPeopleUrl+"?g=Appapi&m=Turntable&a=tricky";
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@ -460,6 +461,7 @@
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/gift_image"
android:padding="4dp"
android:visibility="gone"
android:src="@mipmap/live_icon_newpeople_en" />
</RelativeLayout>