1:添加酒吧房上麦

This commit is contained in:
2026-01-07 17:13:33 +08:00
parent 3dcdd1e599
commit 5f7bac8a12
6 changed files with 29 additions and 20 deletions

View File

@@ -661,7 +661,7 @@ public interface ApiServer {
@FormUrlEncoded
@POST(Constants.APPLY_PIT)
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number);
Call<BaseModel<String>> applyPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number,@Field("gift_id")String gift_id);
@FormUrlEncoded
@POST(Constants.START_FRIEND)

View File

@@ -4221,7 +4221,7 @@ public class RetrofitClient {
}
public void applyPit(String roomId, String pitNumber, BaseObserver<String> observer) {
sApiServer.applyPit(roomId, pitNumber).enqueue(new Callback<BaseModel<String>>() {
sApiServer.applyPit(roomId, pitNumber,"").enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
onNextRetu(response, observer);
@@ -4234,9 +4234,9 @@ public class RetrofitClient {
});
}
// TODO: 2026/1/7
public void applyPubPit(String roomId, String pitNumber, BaseObserver<String> observer) {
sApiServer.applyPit(roomId, pitNumber).enqueue(new Callback<BaseModel<String>>() {
// TODO: 2026/1/7 修改了上麦接口,这里重新写一个,是只针对酒吧房使用的
public void applyPubPit(String roomId, String pitNumber,String gift_id, BaseObserver<String> observer) {
sApiServer.applyPit(roomId, pitNumber,gift_id).enqueue(new Callback<BaseModel<String>>() {
@Override
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
onNextRetu(response, observer);

View File

@@ -14,7 +14,7 @@ class PubContacts {
}
interface Ipre : IPresenter{
fun applyPit(roomId:String,pitNumber:String)
fun applyPit(roomId:String,pitNumber:String,giftId: String)

View File

@@ -145,8 +145,8 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
} else {
if (view.pitBean.user_id == "0" || view.pitBean.user_id.isEmpty()) {
// TODO: 这是展示设置心愿礼物的,这里有个点,要考虑,当前用户在麦位上,点击的时候,直接走上麦按钮,如果不在麦上,就直接选择心愿礼物
// WishGiftDialog(ActivityUtils.getTopActivity(),mRoomId).show()
MvpPre!!.applyPit(mRoomInfoResp?.room_info?.room_id!!, view.pitNumber)
WishGiftDialog(ActivityUtils.getTopActivity(),mRoomId).show()
// MvpPre!!.applyPit(mRoomInfoResp?.room_info?.room_id!!, view.pitNumber)
} else {
RoomUserInfoFragment.show(
mRoomInfoResp?.room_info?.room_id,

View File

@@ -14,20 +14,21 @@ import java.lang.ref.WeakReference
class PubPresenter(context: Context, val view: PubContacts.View?) :
BasePresenter<PubContacts.View>(view, context), PubContacts.Ipre {
override fun applyPit(roomId: String, pitNumber: String) {
RetrofitClient.getInstance().applyPit(roomId, pitNumber, object : BaseObserver<String?>() {
override fun onSubscribe(d: Disposable) {
addDisposable(d)
}
override fun applyPit(roomId: String, pitNumber: String, giftId: String) {
RetrofitClient.getInstance()
.applyPubPit(roomId, pitNumber, giftId, object : BaseObserver<String?>() {
override fun onSubscribe(d: Disposable) {
addDisposable(d)
}
override fun onNext(s: String) {
override fun onNext(s: String) {
}
})
}
})
}
override fun wallet(list:List<String>) {
override fun wallet(list: List<String>) {
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean?>() {
override fun onSubscribe(d: Disposable) {
addDisposable(d)
@@ -37,11 +38,10 @@ class PubPresenter(context: Context, val view: PubContacts.View?) :
if (MvpRef == null) {
MvpRef = WeakReference(view)
}
MvpRef.get()?.wallet(list,walletBean)
MvpRef.get()?.wallet(list, walletBean)
}
})
}
}

View File

@@ -45,7 +45,16 @@ class WishGiftDialog(context: Context, val roomId: String) :
// (ActivityUtils.getTopActivity() as? RoomActivity)?.let { roomActivity ->
// roomActivity.dialogMessage(messageEvent)
// }
dismiss()
RetrofitClient.getInstance().applyPubPit(roomId,"",adapter?.getSelectedValue()?.gift_id,object : BaseObserver<String>() {
override fun onSubscribe(d: Disposable) {
}
override fun onNext(t: String) {
dismiss()
}
})
}
}