fix邀请粉丝,推送

This commit is contained in:
oujunhui
2020-08-03 19:45:43 +08:00
parent fbafbf240d
commit 3b01409558
3 changed files with 32 additions and 10 deletions

View File

@@ -90,14 +90,39 @@ public class RoomInviteFansActivity extends BaseActivity {
tvInviteFansConfirm.setClickable(true);
tvInviteFansConfirm.setText("确认邀请");
tvInviteFansConfirm.setOnClickListener(v -> {
RoomInviteFansModel.INSTANCE.setRoomInviteFans(AvRoomDataManager.get().mCurrentRoomInfo.getUid())
.doOnSuccess(s -> {getInviteFans();})
.subscribe();
onRoomInviteFansClick();
});
}
});
}
@SuppressLint("CheckResult")
private void onRoomInviteFansClick(){
if (AvRoomDataManager.get().mCurrentRoomInfo == null){
return;
}
RoomInviteFansModel.INSTANCE.setRoomInviteFans(AvRoomDataManager.get().mCurrentRoomInfo.getUid())
.doOnError(throwable -> LogUtil.print(throwable.getMessage()))
.subscribe(info -> {
tvInviteFansCount.setText(Html.fromHtml("确认邀请后会给收藏该房间的"+"<font color=#7154EE font-size=12dp>"+info.getFansNum()+"</font>"+"位用户发送提醒"));
tvInviteFansTimes.setText(Html.fromHtml("今日剩余"+"<font color=#7662FE font-size=18dp>"+info.getInviteTimes()+"</font>"+""));
tvInviteFansConfirm.setBackground(getResources().getDrawable(R.drawable.bg_common_confirm_normal_22r));
if (info.getInviteInterval() > 0){
tvInviteFansConfirm.setClickable(false);
startCountDownTimer(info.getInviteInterval());
}else {
if (info.getInviteTimes() <= 0){
tvInviteFansConfirm.setBackground(getResources().getDrawable(R.drawable.bg_common_cancel_22r));
tvInviteFansConfirm.setText("今日次数已用完");
return;
}
tvInviteFansConfirm.setClickable(true);
tvInviteFansConfirm.setText("确认邀请");
}
});
}
@Override
protected boolean needSteepStateBar() {
return false;

View File

@@ -22,10 +22,10 @@ object RoomInviteFansModel {
api = RxNet.create(Api::class.java)
}
fun setRoomInviteFans(roomUid: Long):Single<String> {
fun setRoomInviteFans(roomUid: Long):Single<RoomInviteFansInfo> {
return api.setRoomInviteFans(roomUid)
.io2main()
.handleStringData()
.handleBeanData()
}
@@ -41,7 +41,7 @@ object RoomInviteFansModel {
* 房间邀请粉丝
*/
@POST("/room/inviteFans")
fun setRoomInviteFans(@Query("roomUid") uid: Long): Single<ServiceResult<String>>
fun setRoomInviteFans(@Query("roomUid") uid: Long): Single<ServiceResult<RoomInviteFansInfo>>
/**
* 获取房间邀请粉丝

View File

@@ -7,10 +7,6 @@ import lombok.Data;
@Data
public class RoomInviteFansInfo implements Serializable {
private String title;
private String content;
private JumpValue data;
private int skiptype;
@@ -20,6 +16,7 @@ public class RoomInviteFansInfo implements Serializable {
@Data
public class JumpValue implements Serializable{
private long roomUid;
private String content;
}
}