1:修改全部任务显示添加角标

This commit is contained in:
2025-12-16 14:51:57 +08:00
parent 4b356a6ce4
commit 19bc9dbad8
28 changed files with 354 additions and 107 deletions

View File

@@ -0,0 +1,11 @@
package com.xscm.moduleutil.bean
/**
* 项目名称:羽声语音
* 时间2025/12/16 11:35
* 用途:任务未领取角标
*/
class TasksMessage {
var num: Int=0
var not_received_tasks_num : Int=0 //任务未领取奖励数 这是心跳中返回的参数,用于展示任务未领取角标,是在房间内展示的
}

View File

@@ -13,6 +13,7 @@ import com.xscm.moduleutil.widget.Constants;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
@@ -556,6 +557,9 @@ public interface ApiServer {
@GET(Constants.GET_WALLET)
Call<BaseModel<WalletBean>> wallet();
@GET(Constants.GET_TASKS_MESSAGE)
Call<BaseModel<TasksMessage>> getTasksMessage();
@FormUrlEncoded
@POST(Constants.REDPACKET_CREATE)
Call<ResponseBody> redPacketCreate(@Field("type") int type, @Field("password") String password, @Field("coin_type") int coin_type, @Field("total_amount") String total_amount,
@@ -629,7 +633,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.POST_KEEP_XINTIAO)
Call<ResponseBody> keepXintiao(@Field("room_id") String room_id);
Call<BaseModel<TasksMessage>> keepXintiao(@Field("room_id") String room_id);
@FormUrlEncoded
@POST(Constants.DOWN_PIT)

View File

@@ -79,6 +79,7 @@ public class RetrofitClient {
public interface JoinRoomLoadListener {
void onJoinRoomLoad(String result);
}
public void setJoinRoomLoadListener(JoinRoomLoadListener joinRoomLoadListener) {
this.joinRoomLoadListener = joinRoomLoadListener;
}
@@ -161,6 +162,16 @@ public class RetrofitClient {
return cpListener;
}
private TasksMessageListener tasksMessageListener;
public interface TasksMessageListener {
void onTasksMessageNum(int result);
}
public void setTasksMessageListener(TasksMessageListener tasksMessageListener) {
this.tasksMessageListener = tasksMessageListener;
}
public static RetrofitClient getInstance() {
if (INSTANCE == null) {
@@ -545,7 +556,7 @@ public class RetrofitClient {
} catch (ClassNotFoundException e) {
}
} else {
ToastUtils.showLong(baseModel.getMsg());
ToastUtils.showLong(baseModel.getMsg());
}
}
}
@@ -921,7 +932,7 @@ public class RetrofitClient {
BaseModel<List<MyBagDataBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
}else if (baseModel.getCode() == 0) {
} else if (baseModel.getCode() == 0) {
observer.onNext(new ArrayList<>());
}
}
@@ -942,7 +953,7 @@ public class RetrofitClient {
BaseModel<List<MyBagDataBean>> baseModel = response.body();
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
}else if (baseModel.getCode() == 0) {
} else if (baseModel.getCode() == 0) {
observer.onNext(new ArrayList<>());
}
}
@@ -1062,8 +1073,8 @@ public class RetrofitClient {
sApiServer.dailyTasksOpenBox(gift_box_id).compose(new DefaultTransformer<>()).subscribe(observer);
}
public void dailyTasksReceive(String task_id,String student_id, BaseObserver<String> observer) {
sApiServer.dailyTasksReceive(task_id,student_id).enqueue(new Callback<ResponseBody>() {
public void dailyTasksReceive(String task_id, String student_id, BaseObserver<String> observer) {
sApiServer.dailyTasksReceive(task_id, student_id).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
@@ -2261,10 +2272,10 @@ public class RetrofitClient {
}
} else if (roomInfoRespBaseModel.getCode() == 0) {
ToastUtils.showShort(roomInfoRespBaseModel.getMsg());
if (joinRoomLoadListener != null){
if (joinRoomLoadListener != null) {
joinRoomLoadListener.onJoinRoomLoad(roomInfoRespBaseModel.getMsg());
}
}else if (roomInfoRespBaseModel.getCode() == 202){
} else if (roomInfoRespBaseModel.getCode() == 202) {
observer.onNext(roomInfoRespBaseModel.getData());
} else {
MessageListenerSingleton.getInstance().quitGroup(roomId);
@@ -2362,7 +2373,7 @@ public class RetrofitClient {
});
}
public void check_create_room(BaseObserver<String> observer){
public void check_create_room(BaseObserver<String> observer) {
sApiServer.checkCreateRoom().enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -2370,9 +2381,9 @@ public class RetrofitClient {
BaseModel<String> stringBaseModel = response.body();
if (stringBaseModel.getCode() == 1) {
observer.onNext("");
}else if (stringBaseModel.getCode() == 0) {
} else if (stringBaseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(stringBaseModel.getMsg());
}else if(stringBaseModel.getCode()==301){
} else if (stringBaseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(stringBaseModel.getMsg());
@@ -2380,7 +2391,7 @@ public class RetrofitClient {
throw new RuntimeException(e);
}
}
}else {
} else {
LogUtils.e("check_create_room", response.message());
}
@@ -2426,7 +2437,7 @@ public class RetrofitClient {
BaseModel<RoomOnline> roomOnlineBaseModel = response.body();
if (roomOnlineBaseModel.getCode() == 1) {
observer.onNext(roomOnlineBaseModel.getData());
}else if (roomOnlineBaseModel.getCode() == 0) {
} else if (roomOnlineBaseModel.getCode() == 0) {
ToastUtils.showLong(roomOnlineBaseModel.getMsg());
}
}
@@ -2468,7 +2479,7 @@ public class RetrofitClient {
});
}
public void index_recommend_room(BaseObserver<IndexRecommendRoom> observer) {
public void index_recommend_room(BaseObserver<IndexRecommendRoom> observer) {
sApiServer.index_recommend_room().enqueue(new Callback<BaseModel<IndexRecommendRoom>>() {
@Override
@@ -2478,7 +2489,7 @@ public class RetrofitClient {
if (indexRecommendRoomBaseModel.getCode() == 1) {
if (indexRecommendRoomBaseModel.getData() == null) {
observer.onNext(new IndexRecommendRoom());
}else {
} else {
observer.onNext(indexRecommendRoomBaseModel.getData());
}
} else if (indexRecommendRoomBaseModel.getCode() == 0) {
@@ -2496,11 +2507,11 @@ public class RetrofitClient {
@Override
public void onFailure(Call<BaseModel<IndexRecommendRoom>> call, Throwable t) {
LogUtils.e("首页房间推荐",t.fillInStackTrace());
LogUtils.e("首页房间推荐", t.fillInStackTrace());
}
});
}
}
public void wallet(BaseObserver<WalletBean> observer) {
sApiServer.wallet().enqueue(new Callback<BaseModel<WalletBean>>() {
@@ -2521,7 +2532,36 @@ public class RetrofitClient {
});
}
public void redPacketCreate(int type, String password, int coin_type, String total_amount, String total_count, String conditions, String countdown, String room_id, String remark, BaseObserver<String> observer) {
public void getTasksMessage(BaseObserver<TasksMessage> observer) {
sApiServer.getTasksMessage().enqueue(new Callback<BaseModel<TasksMessage>>() {
@Override
public void onResponse(Call<BaseModel<TasksMessage>> call, Response<BaseModel<TasksMessage>> response) {
if (response.code() == 200) {
BaseModel<TasksMessage> tasksMessage = response.body();
if (tasksMessage.getCode() == 1) {
observer.onNext(tasksMessage.getData());
} else if (tasksMessage.getCode() == 0) {
} else if (tasksMessage.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(tasksMessage.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
}
@Override
public void onFailure(Call<BaseModel<TasksMessage>> call, Throwable t) {
LogUtils.e("任务个数", t.fillInStackTrace());
}
});
}
public void redPacketCreate(int type, String password, int coin_type, String
total_amount, String total_count, String conditions, String countdown, String
room_id, String remark, BaseObserver<String> observer) {
sApiServer.redPacketCreate(type, password, coin_type, total_amount, total_count, conditions, countdown, room_id, remark).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
@@ -2582,7 +2622,8 @@ public class RetrofitClient {
// });
}
public void appPay(String user_id, String money, String coin, String type, String type_params, String type_id, String nobility_id, BaseObserver<AppPay> observer) {
public void appPay(String user_id, String money, String coin, String type, String
type_params, String type_id, String nobility_id, BaseObserver<AppPay> observer) {
sApiServer.appPay(user_id, money, coin, type, type_params, type_id, nobility_id).enqueue(new Callback<BaseModel<AppPay>>() {
@Override
public void onResponse(Call<BaseModel<AppPay>> call, Response<BaseModel<AppPay>> response) {
@@ -2641,7 +2682,8 @@ public class RetrofitClient {
});
}
public void bind(String userId, String type, String alipayAccount, String bank_card_number, String bank_card, String open_bank, BaseObserver<String> observer) {
public void bind(String userId, String type, String alipayAccount, String
bank_card_number, String bank_card, String open_bank, BaseObserver<String> observer) {
sApiServer.bind(userId, type, alipayAccount, bank_card_number, bank_card, open_bank).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -2674,7 +2716,8 @@ public class RetrofitClient {
});
}
public void getRoomUserInfo(String room_id, String user_id, BaseObserver<UserInfo> observer) {
public void getRoomUserInfo(String room_id, String
user_id, BaseObserver<UserInfo> observer) {
sApiServer.getRoomUserInfo(room_id, user_id).enqueue(new Callback<BaseModel<UserInfo>>() {
@Override
public void onResponse(Call<BaseModel<UserInfo>> call, Response<BaseModel<UserInfo>> response) {
@@ -2693,8 +2736,9 @@ public class RetrofitClient {
});
}
public void songList(String room_id,String page, BaseObserver<List<MusicSongBean>> observer) {
sApiServer.songList(room_id,page).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
public void songList(String room_id, String
page, BaseObserver<List<MusicSongBean>> observer) {
sApiServer.songList(room_id, page).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<MusicSongBean>>> call, Response<BaseModel<List<MusicSongBean>>> response) {
if (response.code() == 200) {
@@ -2734,7 +2778,8 @@ public class RetrofitClient {
}
public void getSearch(String keyWord, String type, BaseObserver<List<RoomSearchResp>> observer) {
public void getSearch(String keyWord, String
type, BaseObserver<List<RoomSearchResp>> observer) {
sApiServer.getSearch(keyWord, type).enqueue(new Callback<BaseModel<List<RoomSearchResp>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomSearchResp>>> call, Response<BaseModel<List<RoomSearchResp>>> response) {
@@ -2857,7 +2902,8 @@ public class RetrofitClient {
});
}
public void roomAuctionJoin(String auctionId, String userId, String giftId, String num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
public void roomAuctionJoin(String auctionId, String userId, String giftId, String
num, String type, BaseObserver<RoomAuction.AuctionListBean> observer) {
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type).enqueue(new ApiResponseCallback<RoomAuction.AuctionListBean>(CommonAppContext.getInstance()) {
@Override
public void onSuccess(RoomAuction.AuctionListBean data) {
@@ -3200,7 +3246,8 @@ public class RetrofitClient {
});
}
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String type, String pit_number, String heart_id, BaseObserver<RoomGiftData> observer) {
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String
type, String pit_number, String heart_id, BaseObserver<RoomGiftData> observer) {
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
@Override
public void onResponse(Call<BaseModel<RoomGiftData>> call, Response<BaseModel<RoomGiftData>> response) {
@@ -3238,7 +3285,8 @@ public class RetrofitClient {
});
}
public void cpGiveGift(String user_id, String gift_id, String room_id, BaseObserver<RoomGiftData> observer) {
public void cpGiveGift(String user_id, String gift_id, String
room_id, BaseObserver<RoomGiftData> observer) {
sApiServer.cpGiveGift(user_id, gift_id, room_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
@Override
@@ -3432,21 +3480,36 @@ public class RetrofitClient {
}
public void keepXintiao(String roomId) {
sApiServer.keepXintiao(roomId).enqueue(new Callback<ResponseBody>() {
sApiServer.keepXintiao(roomId).enqueue(new Callback<BaseModel<TasksMessage>>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
public void onResponse(Call<BaseModel<TasksMessage>> call, Response<BaseModel<TasksMessage>> response) {
if (response.code() == 200) {
BaseModel<TasksMessage> tasksMessage = response.body();
assert tasksMessage != null;
if (tasksMessage.getCode() == 1) {
if (tasksMessageListener != null) {
tasksMessageListener.onTasksMessageNum(tasksMessage.getData().getNot_received_tasks_num());
}
} else if (tasksMessage.getCode() == 0) {
} else if (tasksMessage.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(tasksMessage.getMsg());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
public void onFailure(Call<BaseModel<TasksMessage>> call, Throwable t) {
LogUtils.e("心跳: " + t.fillInStackTrace());
}
});
}
public void setMutePit(String roomId, String user_id, String
isMute, BaseObserver<String> observer) {
public void setMutePit(String roomId, String user_id, String isMute, BaseObserver<String> observer) {
sApiServer.setMutePit(roomId, user_id, isMute).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -3586,7 +3649,8 @@ public class RetrofitClient {
});
}
public void roomRelationList(String type, BaseObserver<List<RoomRelationBean>> observer) {
public void roomRelationList(String
type, BaseObserver<List<RoomRelationBean>> observer) {
sApiServer.roomRelationList(type).enqueue(new Callback<BaseModel<List<RoomRelationBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomRelationBean>>> call, Response<BaseModel<List<RoomRelationBean>>> response) {
@@ -3723,7 +3787,7 @@ public class RetrofitClient {
public void quitRoom(String room_id, String user_id, BaseObserver<String> observer) {
if (room_id == null ||room_id.isEmpty())
if (room_id == null || room_id.isEmpty())
return;
sApiServer.quitRoom(room_id, user_id).enqueue(new Callback<ResponseBody>() {
@Override
@@ -3738,7 +3802,8 @@ public class RetrofitClient {
});
}
public void getFriendListMore(String user_id, String relation_id, BaseObserver<List<RelationshipBean>> observer) {
public void getFriendListMore(String user_id, String
relation_id, BaseObserver<List<RelationshipBean>> observer) {
sApiServer.getFriendListMore(user_id, relation_id).enqueue(new Callback<BaseModel<List<RelationshipBean>>>() {
@Override
@@ -3884,7 +3949,8 @@ public class RetrofitClient {
});
}
public void commentZone(String id, String content, String pid, String reply_to, BaseObserver<String> observer) {
public void commentZone(String id, String content, String pid, String
reply_to, BaseObserver<String> observer) {
sApiServer.commentZone(id, content, pid, reply_to).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -3898,7 +3964,8 @@ public class RetrofitClient {
});
}
public void getFriendList(String userId, String page, String page_limit, BaseObserver<RelationBean> observer) {
public void getFriendList(String userId, String page, String
page_limit, BaseObserver<RelationBean> observer) {
sApiServer.getFriendList(userId, page, page_limit).enqueue(new Callback<BaseModel<RelationBean>>() {
@Override
public void onResponse(Call<BaseModel<RelationBean>> call, Response<BaseModel<RelationBean>> response) {
@@ -3941,8 +4008,8 @@ public class RetrofitClient {
});
}
public void cancel(String sms_code,BaseObserver<String> observer) {
sApiServer.cancel(SpUtil.getToken(),sms_code).enqueue(new Callback<BaseModel<String>>() {
public void cancel(String sms_code, BaseObserver<String> observer) {
sApiServer.cancel(SpUtil.getToken(), sms_code).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -3970,7 +4037,8 @@ public class RetrofitClient {
});
}
public void getPostData(String new_password, String mobile, String code, String userId, BaseObserver<String> observer) {
public void getPostData(String new_password, String mobile, String code, String
userId, BaseObserver<String> observer) {
sApiServer.getPostData(new_password, mobile, code, userId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4127,7 +4195,8 @@ public class RetrofitClient {
});
}
public void userOnlineStatus(String user_id, String roomId, BaseObserver<List<UserOnlineStatusBean>> observer) {
public void userOnlineStatus(String user_id, String
roomId, BaseObserver<List<UserOnlineStatusBean>> observer) {
sApiServer.userOnlineStatus(user_id, roomId).enqueue(new Callback<BaseModel<List<UserOnlineStatusBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<UserOnlineStatusBean>>> call, Response<BaseModel<List<UserOnlineStatusBean>>> response) {
@@ -4304,7 +4373,8 @@ public class RetrofitClient {
});
}
public void onNextRetu(Response<BaseModel<String>> response, BaseObserver<String> observer) {
public void onNextRetu
(Response<BaseModel<String>> response, BaseObserver<String> observer) {
if (response.code() == 200) {
BaseModel<String> string = response.body();
if (string != null) {
@@ -4427,7 +4497,8 @@ public class RetrofitClient {
}
/// 盲盒转盘抽奖
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num, String heart_id, String auction_id, BaseObserver<BlindReslutBean> observer) {
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String
num, String heart_id, String auction_id, BaseObserver<BlindReslutBean> observer) {
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num, heart_id, auction_id).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
@Override
public void onResponse(Call<BaseModel<BlindReslutBean>> call, Response<BaseModel<BlindReslutBean>> response) {
@@ -4647,7 +4718,8 @@ public class RetrofitClient {
});
}
public void roomUserCharmList(String room_id, String user_id, BaseObserver<List<RoomUserCharmListBean>> observer) {
public void roomUserCharmList(String room_id, String
user_id, BaseObserver<List<RoomUserCharmListBean>> observer) {
sApiServer.roomUserCharmList(room_id, user_id).enqueue(new Callback<BaseModel<List<RoomUserCharmListBean>>>() {
@Override
public void onResponse(Call<BaseModel<List<RoomUserCharmListBean>>> call, Response<BaseModel<List<RoomUserCharmListBean>>> response) {
@@ -4697,8 +4769,8 @@ public class RetrofitClient {
});
}
public void signCoin(String sign_id,String sign_value, BaseObserver<String> observer) {
sApiServer.signCoin(sign_id,sign_value).enqueue(new Callback<BaseModel<String>>() {
public void signCoin(String sign_id, String sign_value, BaseObserver<String> observer) {
sApiServer.signCoin(sign_id, sign_value).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4713,8 +4785,8 @@ public class RetrofitClient {
}
public void getCpRoom(String userId,int page, BaseObserver<HeartCpBean> observer) {
sApiServer.getCpRoom(userId,page+"").enqueue(new Callback<BaseModel<HeartCpBean>>() {
public void getCpRoom(String userId, int page, BaseObserver<HeartCpBean> observer) {
sApiServer.getCpRoom(userId, page + "").enqueue(new Callback<BaseModel<HeartCpBean>>() {
@Override
public void onResponse(Call<BaseModel<HeartCpBean>> call, Response<BaseModel<HeartCpBean>> response) {
if (response.code() == 200) {
@@ -4792,7 +4864,8 @@ public class RetrofitClient {
}
}
public void familyEarnings(String user_id, int page, String start_time, String end_time, BaseObserver<List<FamilyEarnings>> observer) {
public void familyEarnings(String user_id, int page, String start_time, String
end_time, BaseObserver<List<FamilyEarnings>> observer) {
sApiServer.familyEarnings(user_id, page, start_time, end_time).enqueue(new Callback<BaseModel<List<FamilyEarnings>>>() {
@Override
public void onResponse(Call<BaseModel<List<FamilyEarnings>>> call, Response<BaseModel<List<FamilyEarnings>>> response) {
@@ -4893,7 +4966,7 @@ public class RetrofitClient {
});
}
public void signRefuse(String roomId,BaseObserver<String> observer){
public void signRefuse(String roomId, BaseObserver<String> observer) {
sApiServer.signRefuse(roomId).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -4908,8 +4981,8 @@ public class RetrofitClient {
});
}
public void freeReSign(int type, String userId,BaseObserver<String> observer) {
if (type==1) {
public void freeReSign(int type, String userId, BaseObserver<String> observer) {
if (type == 1) {
sApiServer.freeReSign(userId).enqueue(new Callback<BaseModel<String>>() {
@Override
@@ -4922,7 +4995,7 @@ public class RetrofitClient {
LogUtils.e("freeReSign", t.fillInStackTrace());
}
});
}else {
} else {
sApiServer.reSign(userId).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4938,17 +5011,17 @@ public class RetrofitClient {
}
public void signIn(BaseObserver<List<SignInData>> observer) {
sApiServer.signIn().enqueue(new Callback<BaseModel<List<SignInData>>>(){
sApiServer.signIn().enqueue(new Callback<BaseModel<List<SignInData>>>() {
@Override
public void onResponse(Call<BaseModel<List<SignInData>>> call, Response<BaseModel<List<SignInData>>> response) {
if (response.code()==200){
if (response.code() == 200) {
BaseModel<List<SignInData>> baseModel = response.body();
if (baseModel.getCode()==1 ){
observer.onNext(baseModel.getData()!=null ? baseModel.getData() : new ArrayList<SignInData>());
}else if (baseModel.getCode()==0){
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData() != null ? baseModel.getData() : new ArrayList<SignInData>());
} else if (baseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
}else if (baseModel.getCode()==301){
} else if (baseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(baseModel.getMsg());
@@ -4956,8 +5029,8 @@ public class RetrofitClient {
throw new RuntimeException(e);
}
}
}else {
LogUtils.e("signIn",response.errorBody());
} else {
LogUtils.e("signIn", response.errorBody());
}
}
@@ -4968,8 +5041,9 @@ public class RetrofitClient {
});
}
public void dailyTasksSign(BaseObserver<String> observer) {
sApiServer.postDailyTasksSign().enqueue(new Callback<BaseModel<String>>(){
sApiServer.postDailyTasksSign().enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
@@ -4983,18 +5057,19 @@ public class RetrofitClient {
});
}
public void tasksSignStatus(BaseObserver<TasksSignStatus> observer) {
sApiServer.postDailyTasksSignStatus().enqueue(new Callback<BaseModel<TasksSignStatus>>(){
sApiServer.postDailyTasksSignStatus().enqueue(new Callback<BaseModel<TasksSignStatus>>() {
@Override
public void onResponse(Call<BaseModel<TasksSignStatus>> call, Response<BaseModel<TasksSignStatus>> response) {
if (response.code()==200){
if (response.code() == 200) {
BaseModel<TasksSignStatus> baseModel = response.body();
if (baseModel.getCode()==1){
if (baseModel.getCode() == 1) {
observer.onNext(baseModel.getData());
}else if (baseModel.getCode()==0){
} else if (baseModel.getCode() == 0) {
com.hjq.toast.ToastUtils.show(baseModel.getMsg());
}else if (baseModel.getCode()==301){
} else if (baseModel.getCode() == 301) {
try {
CommonAppContext.getInstance().clearLoginInfo();
ToastUtils.showShort(baseModel.getMsg());
@@ -5002,8 +5077,8 @@ public class RetrofitClient {
throw new RuntimeException(e);
}
}
}else {
LogUtils.e("postDailyTasksSignStatus",response.errorBody());
} else {
LogUtils.e("postDailyTasksSignStatus", response.errorBody());
}
}

View File

@@ -272,6 +272,7 @@ public class Constants {
public static final String GET_ROOM_TYPE = "/api/Index/room_type_list";//房间分类列表
public static final String GET_GIVE_GIFT = "/api/Gift/chat_gift_send";//聊天送礼物
public static final String GET_WALLET = "/api/UserWallet/wallet";//钱包
public static final String GET_TASKS_MESSAGE = "/api/Tasks/dailyTasksUnReceiveCount";//【新】未领取奖励任务数量
public static final String REDPACKET_CREATE = "/api/Redpacket/create";//创建红包
public static final String ROOM_REDPACKET = "/api/Redpacket/roomRedPackets";//红包列表

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -10,7 +10,7 @@
<string name="dressup">个性装扮</string>
<string name="shopping">道具商城</string>
<string name="backpack">我的背包</string>
<string name="daily">每日任务</string>
<string name="daily">任务</string>
<string name="news">消息</string>
<string name="setting_name">设置</string>
<string name="me_family">我的家族</string>

View File

@@ -118,6 +118,7 @@ import com.xscm.moduleutil.bean.RoomMessageEvent.T
import com.xscm.moduleutil.bean.RoomMessageEvent.text
import com.xscm.moduleutil.bean.RoomSettingEvent
import com.xscm.moduleutil.bean.RoomSingleton
import com.xscm.moduleutil.bean.TasksMessage
import com.xscm.moduleutil.bean.UserInfo
import com.xscm.moduleutil.bean.UserOnlineStatusBean
import com.xscm.moduleutil.bean.XLHBean
@@ -152,6 +153,7 @@ import com.xscm.moduleutil.event.SurfaceEvent
import com.xscm.moduleutil.event.UnreadCountEvent
import com.xscm.moduleutil.http.BaseObserver
import com.xscm.moduleutil.http.RetrofitClient
import com.xscm.moduleutil.http.RetrofitClient.TasksMessageListener
import com.xscm.moduleutil.interfaces.OnMusicItemClickListener
import com.xscm.moduleutil.listener.MessageListenerSingleton
import com.xscm.moduleutil.listener.MessageListenerSingleton.OnMessageReceivedListener
@@ -241,6 +243,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
private var appStateListener: AppStateListener? = null
private var qxRedPacketManager: QXRedPacketManager? = null
//用户列表用
private var mOnlineBean: RoomOnline? = null
@@ -343,6 +346,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
preloadFloatingViews()
initPublicScreenFragment()
RetrofitClient.getInstance().setTasksMessageListener(TasksMessageListener { result: Int ->
LogUtils.e("tasksMessageListener", result)
getTasksMessageService(result)
})
}
@SuppressLint("ClickableViewAccessibility")
@@ -1011,6 +1019,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
MvpPre?.roomRedPackets(roomId)
Observable.timer(1000, TimeUnit.MILLISECONDS).observeOn(
AndroidSchedulers.mainThread()
).subscribe { aLong: Long? ->
@@ -3783,6 +3792,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
// AgoraManager.getInstance()
// .joinRoom(SpUtil.getRtmToken(), roomId, SpUtil.getUserId(), false, false);
// MvpPre?.postRoomInfo(roomId)
MvpPre?.getTasksMessage()
}
fun refreshRoomInfo(roomId: String) {
@@ -3823,7 +3833,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
// TODO: 根据返回的在线列表获取对应的值,查看是否有在线用户
override fun getRoomOnline(onlineBean: RoomOnline?) {
if (onlineBean != null) {
@@ -4100,6 +4109,26 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
}
override fun getTasksMessage(data: TasksMessage?) {
if (data != null) {
mBinding?.tvTaskMessage?.text = "+" + data.num
if (data.num == 0) {
mBinding?.tvTaskMessage?.visibility = View.GONE
} else {
mBinding?.tvTaskMessage?.visibility = View.VISIBLE
}
}
}
fun getTasksMessageService(number: Int) {
mBinding?.tvTaskMessage?.text = "+" + number
if (number == 0) {
mBinding?.tvTaskMessage?.visibility = View.GONE
} else {
mBinding?.tvTaskMessage?.visibility = View.VISIBLE
}
}
private fun queren1(nickname: String) {
// 创建并显示确认对话框
ConfirmDialog(

View File

@@ -6,6 +6,7 @@ import com.xscm.moduleutil.activity.IPresenter;
import com.xscm.moduleutil.activity.IView;
import com.xscm.moduleutil.bean.RedPacketInfo;
import com.xscm.moduleutil.bean.RoomCharmRankBean;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomOnline;
@@ -52,6 +53,8 @@ public class RoomContacts {
void findRoom();
void roomRedPackets(List<RedPacketInfo> list);
void getTasksMessage(TasksMessage data);
}
public interface IRoomPre extends IPresenter {
@@ -93,5 +96,7 @@ public class RoomContacts {
void auctionDelay(String auctionId);
void roomRedPackets(String roomId);
void getTasksMessage();
}
}

View File

@@ -29,6 +29,7 @@ import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.RedPacketInfo;
import com.xscm.moduleutil.bean.RoomCharmRankBean;
import com.xscm.moduleutil.bean.RoomMessageEvent;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
import com.xscm.moduleutil.bean.room.EMMessageInfo;
import com.xscm.moduleutil.bean.room.FriendInfo;
@@ -763,6 +764,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
@Override
public void getTasksMessage(TasksMessage data) {
}
public void getVoiceStatus(RoomAuction.AuctionUserBean auctionUserBean, List<RoomAuction.AuctionListBean> auctionListBeans, String user_id) {
boolean haveMe = false;

View File

@@ -29,6 +29,7 @@ import com.xscm.moduleutil.bean.MusicSongBean;
import com.xscm.moduleutil.bean.RedPacketInfo;
import com.xscm.moduleutil.bean.RoomCharmRankBean;
import com.xscm.moduleutil.bean.RoomMessageEvent;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserInfo;
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
@@ -1132,4 +1133,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
@Override
public void getTasksMessage(TasksMessage data) {
}
}

View File

@@ -10,6 +10,7 @@ import com.xscm.modulemain.activity.room.contacts.RoomContacts;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.RedPacketInfo;
import com.xscm.moduleutil.bean.RoomCharmRankBean;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomOnline;
@@ -462,4 +463,22 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
}
});
}
@Override
public void getTasksMessage() {
api.getTasksMessage(new BaseObserver<TasksMessage>(){
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(TasksMessage s) {
if (MvpRef==null)
MvpRef=new WeakReference<>(mView);
MvpRef.get().getTasksMessage(s);
}
});
}
}

View File

@@ -5,6 +5,7 @@ import android.app.Activity;
import com.xscm.moduleutil.activity.IPresenter;
import com.xscm.moduleutil.activity.IView;
import com.xscm.moduleutil.bean.BannerModel;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserInfo;
import com.xscm.moduleutil.bean.WalletBean;
@@ -23,6 +24,8 @@ public final class MeConacts {
void wallet(WalletBean walletBean);
void setBanners(List<BannerModel> bannerModels);
void getTasksMessage(TasksMessage data);
}
public interface IMePre extends IPresenter {
@@ -40,6 +43,8 @@ public final class MeConacts {
void wallet();
void getTasksMessage();
}
}

View File

@@ -47,6 +47,7 @@ import com.xscm.modulemain.activity.user.presenter.MePresenter;
import com.xscm.modulemain.activity.WebViewActivity;
import com.xscm.modulemain.dialog.UserNetWorthDialog;
import com.xscm.moduleutil.base.WebUrlConstants;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.widget.ShineTextView;
import com.xscm.moduleutil.base.BaseMvpFragment;
@@ -170,6 +171,7 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
MvpPre.getMyInfo();
MvpPre.wallet();
MvpPre.getBanners("6");
MvpPre.getTasksMessage();
// MvpPre.getMemberList(SpUtils.getUserId(), 1);
}
@@ -180,9 +182,6 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
public void onClick(View view) {
int id = view.getId();
if (id == R.id.ll_visit) {
// ARouter.getInstance().build(ARouteConstants.ME_VISIT).navigation();
// AppLogUtil.reportAppLog(AppLogEvent.C0104);
@@ -410,6 +409,19 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
mBinding.banner.setBannerData(R.layout.index_image_banner, bannerModels);
}
// TODO: 2025/12/16 任务未领取个数
@Override
public void getTasksMessage(TasksMessage data) {
if (data!=null){
mBinding.tvDailyMessage.setText("+"+data.getNum());
if (data.getNum()==0){
mBinding.tvDailyMessage.setVisibility(View.GONE);
}else {
mBinding.tvDailyMessage.setVisibility(View.VISIBLE);
}
}
}
private void copyUserId(CharSequence content) {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import com.xscm.modulemain.activity.user.conacts.MeConacts;
import com.xscm.moduleutil.bean.BannerModel;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserInfo;
import com.xscm.moduleutil.bean.WalletBean;
import com.xscm.moduleutil.http.BaseObserver;
@@ -186,6 +187,25 @@ public class MePresenter extends BasePresenter<MeConacts.View> implements MeCona
});
}
@Override
public void getTasksMessage() {
api.getTasksMessage(new BaseObserver<TasksMessage> () {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(TasksMessage s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().getTasksMessage(s);
}
});
}
public void getBanners(String s) {
// Type listType = new TypeToken<List<BannerModel>>() {}.getType();
// List<BannerModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getHomeBanner(), listType);

View File

@@ -21,6 +21,7 @@ import com.xscm.modulemain.databinding.FragmentRoomOnlineDialogBinding;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.RedPacketInfo;
import com.xscm.moduleutil.bean.RoomCharmRankBean;
import com.xscm.moduleutil.bean.TasksMessage;
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomOnline;
@@ -386,4 +387,9 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
}
@Override
public void getTasksMessage(TasksMessage data) {
}
}

View File

@@ -83,7 +83,7 @@
</com.xscm.moduleutil.widget.DropRedView>
<!-- 每日任务-->
<com.xscm.moduleutil.widget.DropDayTaskView
android:id="@+id/cl_day_task"
android:layout_width="wrap_content"
@@ -97,12 +97,39 @@
tools:visibility="visible">
<!-- android:background="@mipmap/room_xsb"-->
<ImageView
android:id="@+id/im_day_task"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_60"
android:scaleType="fitCenter"
android:src="@mipmap/day_task" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-3dp">
<ImageView
android:id="@+id/im_day_task"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_60"
android:scaleType="fitCenter"
android:src="@mipmap/day_task" />
<TextView
android:id="@+id/tv_task_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/im_day_task"
android:layout_marginStart="-30dp"
android:background="@drawable/ease_bg_msg_count"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="1.5dp"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="2dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
android:visibility="gone"
tools:text="+99"
tools:visibility="visible" />
</RelativeLayout>
</com.xscm.moduleutil.widget.DropDayTaskView>

View File

@@ -801,9 +801,6 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -841,11 +838,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
app:flexWrap="wrap"
app:alignContent="flex_start"
app:alignItems="stretch"
app:justifyContent="flex_start"
app:flexDirection="row"
app:alignContent="flex_start">
app:flexWrap="wrap"
app:justifyContent="flex_start">
<LinearLayout
android:id="@+id/iv_hb"
@@ -855,8 +852,8 @@
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
app:layout_flexGrow="1"
app:layout_flexBasisPercent="25%">
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1">
<ImageView
android:layout_width="@dimen/dp_24"
@@ -880,8 +877,8 @@
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
app:layout_flexGrow="1"
app:layout_flexBasisPercent="25%">
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1">
<ImageView
android:layout_width="@dimen/dp_24"
@@ -898,7 +895,6 @@
</LinearLayout>
<LinearLayout
android:id="@+id/me_daily"
android:layout_width="0dp"
@@ -908,13 +904,38 @@
android:gravity="center"
android:orientation="vertical"
android:visibility="visible"
app:layout_flexGrow="1"
app:layout_flexBasisPercent="25%">
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:src="@mipmap/me_test" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-3dp">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_centerInParent="true"
android:src="@mipmap/me_test" />
<TextView
android:id="@+id/tv_daily_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_25"
android:background="@drawable/ease_bg_msg_count"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="1.5dp"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="2dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
android:visibility="gone"
tools:text="+99"
tools:visibility="visible" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
@@ -934,8 +955,8 @@
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
app:layout_flexGrow="1"
app:layout_flexBasisPercent="25%">
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1">
<ImageView
android:layout_width="@dimen/dp_24"
@@ -1043,9 +1064,9 @@
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1"
android:visibility="invisible">
app:layout_flexGrow="1">
<ImageView
android:layout_width="@dimen/dp_24"
@@ -1070,7 +1091,7 @@
android:orientation="vertical"
android:visibility="invisible"
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1"/>
app:layout_flexGrow="1" />
<LinearLayout
android:layout_width="0dp"
@@ -1080,8 +1101,8 @@
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible"
app:layout_flexGrow="1"
app:layout_flexBasisPercent="25%"/>
app:layout_flexBasisPercent="25%"
app:layout_flexGrow="1" />
</com.google.android.flexbox.FlexboxLayout>
</LinearLayout>