1:添加单个撩ta数据
2:添加约她获取数据
This commit is contained in:
@@ -89,7 +89,7 @@ public class RoomBean implements Serializable {
|
||||
private int queue_number;//排麦队列人数
|
||||
private HeadlineBean head_line;
|
||||
|
||||
private String sexy_coin;//酒吧房撩的金币
|
||||
private int sexy_coin;//酒吧房撩的金币
|
||||
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
|
||||
@@ -663,6 +663,10 @@ public interface ApiServer {
|
||||
@POST(Constants.APPLY_PIT)
|
||||
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.POST_LIAO_TA)
|
||||
Call<BaseModel<String>> liaoTa(@Field("room_id") String room_id, @Field("to_user_id") String user_id,@Field("type")String type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.START_FRIEND)
|
||||
Call<BaseModel<String>> startFriend(@Field("room_id") String room_id);
|
||||
@@ -923,6 +927,9 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_GIFT_PACK_LIST_COUNT)
|
||||
Call<BaseModel<GiftPackListCount>> getGiftPackListCount();
|
||||
|
||||
@GET(Constants.GET_GIFT_INFO_TA)
|
||||
Call<BaseModel<RoonGiftModel>> getGiftInfoTa(@Query("room_id") String roomId, @Query("to_user_id") String user_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ROOM_USER_RECONNECT)
|
||||
Call<BaseModel<String>> roomUserReconnect(@Field("room_id") String room_id);
|
||||
|
||||
@@ -1266,6 +1266,34 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getGiftInfoTa(String roomId, String userId, BaseObserver<RoonGiftModel> observer) {
|
||||
sApiServer.getGiftInfoTa(roomId, userId).enqueue(new Callback<BaseModel<RoonGiftModel>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoonGiftModel>> call, Response<BaseModel<RoonGiftModel>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RoonGiftModel> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1)
|
||||
observer.onNext(baseModel.getData());
|
||||
else if (baseModel.getCode() == 301) {
|
||||
setCode301(baseModel.getMsg());
|
||||
} else if (baseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
ToastUtils.showLong("约她出现错误", response.code());
|
||||
LogUtils.e("getGiftInfoTa", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RoonGiftModel>> call, Throwable t) {
|
||||
LogUtils.e("getGiftInfoTa", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void roomUserReconnect(String roomId) {
|
||||
sApiServer.roomUserReconnect(roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
@@ -4249,6 +4277,26 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void liaoTa(String roomId,String toUserId,String type ,BaseObserver<String> observer) {
|
||||
sApiServer.liaoTa(roomId,toUserId,type).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
onNextRetu(response, observer);
|
||||
}else {
|
||||
ToastUtils.showLong("撩Ta失败",response.code());
|
||||
LogUtils.e("liaoTa: " + response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
LogUtils.e("liaoTa", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void startFriend(String roomId, BaseObserver<String> observer) {
|
||||
sApiServer.startFriend(roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
|
||||
@@ -297,6 +297,8 @@ public class Constants {
|
||||
public static final String POST_FAMILY_EARNINGS = "/api/Family/familyEarnings";//家族收益详情
|
||||
public static final String GET_ROOM_USER = "/api/Room/room_user_home";//房间内点击头像
|
||||
public static final String APPLY_PIT = "/api/RoomPit/apply_pit";//申请上麦
|
||||
public static final String POST_LIAO_TA = "/api/BarRoom/liao_ta";//撩他
|
||||
public static final String GET_GIFT_INFO_TA = "/api/BarRoom/get_gift_info_ta";//约她
|
||||
public static final String DOWN_PIT = "/api/RoomPit/down_pit";//下麦
|
||||
public static final String ADDRESS_IP = "/api/User/update_user_ip";//修改ip地址
|
||||
public static final String REWARD_ZONE = "/api/UserZone/reward_zone";//动态打赏礼物
|
||||
|
||||
@@ -16,8 +16,8 @@ class PubContacts {
|
||||
interface Ipre : IPresenter{
|
||||
fun applyPit(roomId:String,pitNumber:String,giftId: String)
|
||||
|
||||
|
||||
|
||||
fun wallet(list:List<String>)
|
||||
|
||||
fun liaoTa(roomId: String, userId: String, type: Int)
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.presenter.PubPresenter
|
||||
import com.xscm.modulemain.databinding.FragmentPubRoomBinding
|
||||
import com.xscm.modulemain.dialog.CustomInputDialog
|
||||
import com.xscm.modulemain.dialog.RoomAuctionWebViewDialog
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment
|
||||
import com.xscm.modulemain.dialog.barRoom.FlirtatiousDialog
|
||||
@@ -25,6 +26,7 @@ import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.UserInfo
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -151,15 +153,17 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
|
||||
view.ivLiaoT?.setOnClickListener {
|
||||
if (SpUtil.getBooleanValue("pub", false)) {
|
||||
FlirtatiousDialog(
|
||||
ActivityUtils.getTopActivity(),
|
||||
view.pitBean.nickname
|
||||
).show()
|
||||
MvpPre?.liaoTa(mRoomId, view.pitBean.user_id, 1)
|
||||
} else {
|
||||
FlirtatiousDialog(
|
||||
ActivityUtils.getTopActivity(),
|
||||
view.pitBean.nickname
|
||||
view.pitBean.nickname,
|
||||
mRoomInfoResp?.room_info?.sexy_coin!!,
|
||||
1,
|
||||
view.pitBean.user_id,
|
||||
mRoomId
|
||||
).show()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,8 +235,31 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
val dialog = RoomAuctionWebViewDialog(ActivityUtils.getTopActivity(), bundle)
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
mBinding.imAllLiao.setOnClickListener {
|
||||
|
||||
val validCount = mRoomInfoResp?.room_info?.pit_list?.take(6)
|
||||
?.count { !it.user_id.isNullOrEmpty() && it.user_id != "0" } ?: 0
|
||||
|
||||
ConfirmDialog(
|
||||
ActivityUtils.getTopActivity(),
|
||||
"温馨提示",
|
||||
"确定要撩一撩台上全部嘉宾吗? 共计需要 ${mRoomInfoResp?.room_info?.sexy_coin!! * validCount}个 金币",
|
||||
"确认",
|
||||
"取消",
|
||||
{
|
||||
MvpPre?.liaoTa(mRoomId, "", 2)
|
||||
},
|
||||
{
|
||||
|
||||
},
|
||||
false,
|
||||
0
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
||||
this.mRoomInfoResp = roomInfoResp
|
||||
mUserInfo = this.mRoomInfoResp?.user_info
|
||||
|
||||
@@ -43,5 +43,18 @@ class PubPresenter(context: Context, val view: PubContacts.View?) :
|
||||
})
|
||||
}
|
||||
|
||||
override fun liaoTa(roomId: String, userId: String, type: Int) {
|
||||
RetrofitClient.getInstance().liaoTa(roomId, userId, type.toString(), object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogFlirtatiousBinding
|
||||
@@ -22,13 +20,20 @@ import io.reactivex.disposables.Disposable
|
||||
* 时间:2026/1/5 15:36
|
||||
* 用途:撩他提示框
|
||||
*/
|
||||
class FlirtatiousDialog(context: Context, var nickname: String) :
|
||||
class FlirtatiousDialog(context: Context, var nickname: String, var sexy_coin: Int,var type :Int,var userId: String,var roomId: String) :
|
||||
BaseDialog<DialogFlirtatiousBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
private var mNickName: String = nickname;
|
||||
private var isSelected: Boolean = false
|
||||
private var mSexy_coin: Int = sexy_coin
|
||||
|
||||
private var mType : Int =type
|
||||
|
||||
private var mUserId : String =userId
|
||||
|
||||
private var mRoomId : String =roomId
|
||||
|
||||
// 设置回调接口的方法
|
||||
fun setOnConfirmListener(callback: (String) -> Unit): FlirtatiousDialog {
|
||||
@@ -52,14 +57,25 @@ class FlirtatiousDialog(context: Context, var nickname: String) :
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
if (SpUtil.getBooleanValue("pub",false)) {
|
||||
if (SpUtil.getBooleanValue("pub", false)) {
|
||||
mBinding.vCheckbox.isSelected = true
|
||||
isSelected = true
|
||||
}
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
onConfirmCallback?.invoke("")
|
||||
SpUtil.setBooleanValue("pub", isSelected)
|
||||
dismiss()
|
||||
|
||||
RetrofitClient.getInstance().liaoTa(mRoomId,mUserId,mType.toString(),object : BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
mBinding.tvCancel.setOnClickListener {
|
||||
dismiss()
|
||||
@@ -72,7 +88,7 @@ class FlirtatiousDialog(context: Context, var nickname: String) :
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
mBinding.tvTitle.text = "确定要撩一撩台上的 ${mNickName} 吗?共计需要 10个 金币。"
|
||||
mBinding.tvTitle.text = "确定要撩一撩台上的 ${mNickName} 吗?共计需要 ${sexy_coin}个 金币。"
|
||||
super.show()
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,20 @@ class RoomAboutDialog(
|
||||
// 调用父类的 show() 方法
|
||||
super.show()
|
||||
|
||||
RetrofitClient.getInstance().getGiftInfoTa(mRoomId, mUserId, object : BaseObserver<RoonGiftModel>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: RoonGiftModel) {
|
||||
if (t!=null && t.gift_name != null && t.gift_price != null && t.base_image != null) {
|
||||
mBinding.tvGiftPrice.text = t.gift_price
|
||||
ImageUtils.loadHead(t.base_image, mBinding.ivGiftPic)
|
||||
mBinding.tvGiftName.text = t.gift_name
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/rpwv_3" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_all_liao"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
|
||||
Reference in New Issue
Block a user