1:修改酒吧房弹框接口调用
This commit is contained in:
@@ -9,7 +9,6 @@ class PubContacts {
|
||||
|
||||
interface View : IView<Activity>{
|
||||
|
||||
fun signCoinList(list:List<String>)
|
||||
|
||||
fun wallet(list:List<String>,walletBean: WalletBean?)
|
||||
}
|
||||
@@ -17,21 +16,7 @@ class PubContacts {
|
||||
interface Ipre : IPresenter{
|
||||
fun applyPit(roomId:String,pitNumber:String)
|
||||
|
||||
fun signStart(roomId:String,userId:String)
|
||||
|
||||
fun signEnd(signId:String)
|
||||
|
||||
fun signDelay(signId:String,roomId:String)
|
||||
|
||||
fun signRefuse(roomId: String)
|
||||
|
||||
fun signCoinList(signId:String)
|
||||
|
||||
fun signCoin(signId:String,sign_value:String)
|
||||
|
||||
fun setMutePit(roomId:String,pitNumber:String,isMute:String)
|
||||
|
||||
fun setLockPit(roomId:String,pitNumber:String,isLock:String)
|
||||
|
||||
fun wallet(list:List<String>)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.xscm.modulemain.activity.room.fragment
|
||||
import android.os.Bundle
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.presenter.PubPresenter
|
||||
@@ -25,7 +24,11 @@ import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
|
||||
|
||||
/**
|
||||
* @Author
|
||||
* @Time 2026/1/6 14:47
|
||||
* @Description 酒吧房fragment
|
||||
*/
|
||||
class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
BaseMvpFragment<PubPresenter, FragmentPubRoomBinding>() {
|
||||
|
||||
|
||||
@@ -43,105 +43,5 @@ class PubPresenter(context: Context, val view: PubContacts.View?) :
|
||||
}
|
||||
|
||||
|
||||
override fun signStart(roomId: String, userId: String) {
|
||||
RetrofitClient.getInstance().signStart(roomId, userId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signEnd(signId: String) {
|
||||
RetrofitClient.getInstance().signEnd(signId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signDelay(signId: String, roomId: String) {
|
||||
RetrofitClient.getInstance().signDelay(signId, roomId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signRefuse(roomId: String) {
|
||||
RetrofitClient.getInstance().signRefuse(roomId, object : BaseObserver<String?>(){
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signCoinList(signId: String) {
|
||||
RetrofitClient.getInstance().signCoinList(signId, object : BaseObserver<List<String>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(list: List<String>) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = WeakReference(view)
|
||||
}
|
||||
MvpRef.get()?.signCoinList(list)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signCoin(signId: String, sign_value: String) {
|
||||
RetrofitClient.getInstance().signCoin(signId, sign_value, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
override fun setMutePit(roomId: String, pitNumber: String, isMute: String) {
|
||||
RetrofitClient.getInstance()
|
||||
.setMutePit(roomId, pitNumber, isMute, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun setLockPit(roomId: String, pitNumber: String, isLock: String) {
|
||||
RetrofitClient.getInstance()
|
||||
.setLockPit(roomId, pitNumber, isLock, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
|
||||
MvpPre.getAlbumDetail(albumId, pwd, page + "", "10");
|
||||
}
|
||||
});
|
||||
mBinding.tvBj.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
|
||||
mBinding.imCrAlbum.setOnClickListener(this::onClick);
|
||||
mBinding.tvBj.setOnClickListener(this::onClick);
|
||||
mBinding.zan.setOnClickListener(this::onClick);
|
||||
@@ -393,6 +393,7 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
|
||||
ImageUtils.loadHeadCC(albumBean.getImage(), mBinding.ivAlbumDetailBg);
|
||||
mBinding.tvAlbumName.setText(albumBean.getName());
|
||||
mBinding.tvAlbumNum.setText(albumBean.getCount() + "张照片");
|
||||
mBinding.tvBj.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.imCrAlbum.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.topBar.setRightTxtVisible(userId.equals(SpUtil.getUserId() + ""));
|
||||
if (albumBean.getPwd() != null && !albumBean.getPwd().isEmpty()) {
|
||||
|
||||
@@ -58,7 +58,7 @@ class RoomGiftGivingAdapter(private val dataList: List<RoonGiftModel>,
|
||||
53
|
||||
)
|
||||
tv_wheat_qd.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
tv_gift_desc.text = item.new_gift_name
|
||||
tv_gift_desc.text = item.gift_remark_name
|
||||
|
||||
tv_wheat_qd.setOnClickListener {
|
||||
// 回调选中的值和位置
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.PitTimeRespBean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/6 14:31
|
||||
* 用途:
|
||||
*/
|
||||
class RoomPitTimeAdapter(val dataList: List<PitTimeRespBean>,
|
||||
private val onItemSelectedListener: (PitTimeRespBean, Int) -> Unit
|
||||
) : RecyclerView.Adapter<RoomPitTimeAdapter.ViewHolder>() {
|
||||
|
||||
private var selectedPosition = -1 // 默认没有选中项
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_room_talent, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = dataList[position]
|
||||
holder.bind(item, position)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = dataList.size
|
||||
|
||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val textView: TextView = itemView.findViewById(R.id.tv_talent)
|
||||
|
||||
fun bind(item: PitTimeRespBean, position: Int) {
|
||||
textView.text = item.time_str
|
||||
|
||||
// 设置选中状态
|
||||
if (position == selectedPosition) {
|
||||
textView.setBackgroundResource(R.drawable.bg_item_selected) // 选中背景
|
||||
textView.setTextColor(android.graphics.Color.parseColor("#3ABC6D"))
|
||||
} else {
|
||||
textView.setBackgroundResource(R.drawable.bg_item_normal) // 默认背景
|
||||
textView.setTextColor(android.graphics.Color.parseColor("#333333"))
|
||||
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
itemView.setOnClickListener {
|
||||
// 如果点击的是已选中的项,不做处理
|
||||
if (position == selectedPosition) return@setOnClickListener
|
||||
|
||||
// 更新选中位置
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
// 通知之前选中的项更新背景
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
// 通知当前选中的项更新背景
|
||||
notifyItemChanged(position)
|
||||
|
||||
// 回调选中的值和位置
|
||||
onItemSelectedListener(item, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中的位置
|
||||
*/
|
||||
fun setSelectedPosition(position: Int) {
|
||||
if (position in 0 until itemCount && position != selectedPosition) {
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中的位置
|
||||
*/
|
||||
fun getSelectedPosition(): Int = selectedPosition
|
||||
|
||||
/**
|
||||
* 获取当前选中的值
|
||||
*/
|
||||
fun getSelectedValue(): String? {
|
||||
return if (selectedPosition in 0 until itemCount) {
|
||||
dataList[selectedPosition].time.toString()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,8 +48,8 @@ class SetupCustomGiftAdapter(private val dataList: List<RoonGiftModel>,
|
||||
fun bind(item: RoonGiftModel, position: Int) {
|
||||
tv_gift_name.text = item.gift_name
|
||||
tv_gift_price.text = item.gift_price
|
||||
if (item.new_gift_name.isNotEmpty()) {
|
||||
tv_gift_desc.text = item.new_gift_name
|
||||
if (item.gift_remark_name.isNotEmpty()) {
|
||||
tv_gift_desc.text = item.gift_remark_name
|
||||
tv_gift_desc.setTextColor(Color.parseColor("#F5F24F")) // 金色
|
||||
} else {
|
||||
tv_gift_desc.text = "待设置"
|
||||
|
||||
@@ -75,8 +75,7 @@ class GiftGivingDialog(
|
||||
super.show()
|
||||
|
||||
// TODO: 调用赠送自定义礼物。点击麦位上左边的最小图标
|
||||
RetrofitClient.getInstance()
|
||||
.getCustomGiftList(object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
RetrofitClient.getInstance().getCustomGiftList(mUserId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ class PerformInputDialog(context: Context) :
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
if (model.gift_remark_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.gift_remark_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,8 +90,8 @@ class PerformInputDialog(context: Context) :
|
||||
|
||||
private fun refreshData() {
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
if (model.gift_remark_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.gift_remark_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ class RoomAboutDialog(
|
||||
|
||||
|
||||
override fun show() {
|
||||
LogUtils.e("show", "roomId:$mRoomId userId:$mUserId username:$mUsername avatar:$mAvatar")
|
||||
// 确保参数不为空
|
||||
if (!TextUtils.isEmpty(mUsername)) {
|
||||
mBinding.tvName.text = mUsername
|
||||
|
||||
@@ -9,8 +9,9 @@ import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomTalentAdapter
|
||||
import com.xscm.modulemain.adapter.RoomPitTimeAdapter
|
||||
import com.xscm.modulemain.databinding.DialogRoomDurationBinding
|
||||
import com.xscm.moduleutil.bean.PitTimeRespBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
@@ -23,11 +24,11 @@ import io.reactivex.disposables.Disposable
|
||||
* 时间:2026/1/4 18:57
|
||||
* 用途:酒吧房设置时长
|
||||
*/
|
||||
class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
class RoomDurationDialog(context: Context, val roomId: String) :
|
||||
BaseDialog<DialogRoomDurationBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: RoomTalentAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
var adapter: RoomPitTimeAdapter? = null
|
||||
var time: MutableList<PitTimeRespBean> = mutableListOf()
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_room_duration
|
||||
@@ -39,18 +40,21 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
dismiss()
|
||||
}
|
||||
mBinding.tvQd.setOnClickListener {
|
||||
if (adapter?.getSelectedValue()?.isEmpty() == true || adapter?.getSelectedValue()==null) {
|
||||
if (adapter?.getSelectedValue()
|
||||
?.isEmpty() == true || adapter?.getSelectedValue() == null || adapter?.getSelectedValue() == "0"
|
||||
) {
|
||||
ToastUtils.show("请选择时间")
|
||||
} else {//确定
|
||||
RetrofitClient.getInstance().setPitTime(roomId, adapter?.getSelectedValue()!!.replace("分钟", ""),object :
|
||||
BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
RetrofitClient.getInstance()
|
||||
.setPitTime(roomId, adapter?.getSelectedValue()!!.replace("分钟", ""), object :
|
||||
BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,22 +69,28 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
|
||||
|
||||
override fun initData() {
|
||||
time = mutableListOf()
|
||||
RetrofitClient.getInstance().getPitTimeList(object : BaseObserver<List<PitTimeRespBean>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: List<PitTimeRespBean>) {
|
||||
if (t.isNotEmpty()) {
|
||||
time.clear()
|
||||
time.addAll(t)
|
||||
}
|
||||
adapter = RoomPitTimeAdapter(time) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
time= mutableListOf()
|
||||
time.clear()
|
||||
time.add("5分钟")
|
||||
time.add("10分钟")
|
||||
time.add("15分钟")
|
||||
time.add("20分钟")
|
||||
time.add("25分钟")
|
||||
time.add("30分钟")
|
||||
adapter = RoomTalentAdapter(time) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -60,7 +60,7 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
performInputDialog?.show(t[position])
|
||||
performInputDialog?.setOnConfirmListener { content ->
|
||||
// TODO: 这里表演内容的回调
|
||||
t[position].new_gift_name=content
|
||||
t[position].gift_remark_name=content
|
||||
RetrofitClient.getInstance().setCustomGift(t[position].gift_id,content,object : BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user