feat : 修复麦位UI异常, 信誉等级 提交

This commit is contained in:
eggmanQQQ
2024-12-25 15:01:50 +08:00
parent c9e43aff77
commit ef052fff6c
5 changed files with 96 additions and 66 deletions

View File

@@ -196,9 +196,12 @@ class MeFragment : BaseFragment(), View.OnClickListener {
private fun setDonation(userInfo: UserInfo) {
val initInfo = InitialModel.get().cacheInitInfo
val diamondList = initInfo?.giveDiamondErbanNoList
val giftList = initInfo?.giveGiftErbanNoList
val levelSep = userInfo.userLevelVo.experLevelSeq
if (diamondList?.contains(userInfo.erbanNo) == true
|| giftList?.contains(userInfo.erbanNo) == true
|| levelSep >= (initInfo?.giveDiamondExperLevel ?: 0)
@@ -208,6 +211,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
} else {
meViewModel.updateDonationMenuVisible(false)
}
}
private fun copyName(erbanNo: String) {

View File

@@ -17,16 +17,24 @@ import com.chwl.app.common.EmptyViewHelper
import com.chwl.app.databinding.ActivityGiveGoldBinding
import com.chwl.app.pay.GiveGoldModel
import com.chwl.app.pay.adapter.LatelyGiveAdapter
import com.chwl.app.ui.bean.RechargeUserInfo
import com.chwl.app.ui.utils.RVDelegate
import com.chwl.app.ui.utils.load
import com.chwl.app.ui.utils.loadAvatar
import com.chwl.core.bean.response.ServiceResult
import com.chwl.core.gift.GiftModel
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.DiamondGiveHistoryInfo
import com.chwl.core.utils.net.RxHelper
import com.chwl.library.common.util.ClickUtils.click
import com.chwl.library.common.util.doLog
import com.chwl.library.common.util.setViewWH
import com.chwl.library.net.rxnet.RxNet
import com.chwl.library.utils.ResUtil
import com.example.lib_utils.ktx.getString
import com.netease.nim.uikit.StatusBarUtil
import io.reactivex.Single
import retrofit2.http.GET
/**
* 轉贈鉆石頁面
@@ -111,25 +119,39 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
}
}
binding.more.click {
//todo do 待完善: 规则h5
UserModel.get().cacheLoginUserInfo?.let { user->
binding.enbanNo.text = R.string.text_user_id.getString(user.erbanNo)
binding.charmLevel.load(user.userLevelVo?.charmUrl?:"")
binding.userLevel.load(user.userLevelVo?.experUrl?:"")
binding.nick.text = user.nick
binding.avatar.loadAvatar(user.avatar)
binding.starLayout.removeAllViews()
for (i in 0 until 5) {
val star = ImageView(context)
star.setViewWH(15, 15)
star.setImageResource( if (true) R.drawable.c_draw_un else R.drawable.c_draw_un)
binding.starLayout.addView(star)
}
}
getRechargeUserInfo()
.compose(bindToLifecycle())
.doOnSuccess {
" data = $it".doLog()
UserModel.get().cacheLoginUserInfo?.let { user->
binding.enbanNo.text = R.string.text_user_id.getString(user.erbanNo)
binding.charmLevel.load(user.userLevelVo?.charmUrl?:"")
binding.userLevel.load(user.userLevelVo?.experUrl?:"")
binding.nick.text = user.nick
binding.avatar.loadAvatar(user.avatar)
binding.starLayout.removeAllViews()
if (it != null) {
for (i in 0 until 5) {
val star = ImageView(context)
star.setViewWH(15, 15)
//todo do 待完善: 信誉等级 星星图片
star.setImageResource( if (i < it.starLevel) R.drawable.c_draw_focused else R.drawable.c_draw_un)
binding.starLayout.addView(star)
}
}
}
}.subscribe()
}
override fun onResume() {
@@ -155,4 +177,18 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
return true
}
private fun getRechargeUserInfo(): Single<RechargeUserInfo> {
return api.getRechargeUserInfo()
.compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers())
}
private val api: Api = RxNet.create(Api::class.java);
interface Api {
@GET("/recharge/user/info")
fun getRechargeUserInfo(): Single<ServiceResult<RechargeUserInfo>>
}
}

View File

@@ -0,0 +1,16 @@
package com.chwl.app.ui.bean;
import lombok.Data;
@Data
public class RechargeUserInfo {
public long id;
public long uid;
public long type;
public int starLevel;
public long erbanNo;
public String nick;
public String avatar;
public int isOnline;
}

View File

@@ -1,19 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_gravity="center"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:layout_height="wrap_content">
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:layout_gravity="center"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="@dimen/dp_10"
@@ -23,16 +24,18 @@
android:id="@+id/micro_layout"
android:layout_width="@dimen/dp_66"
android:layout_height="@dimen/dp_66"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_centerHorizontal="true"
tools:background="#3F51B5">
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/iv_halo"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
tools:layout_gravity="center" />
tools:background="#FF5722"
android:layout_gravity="center" />
<ImageView
android:id="@+id/avatar"

View File

@@ -2,46 +2,17 @@
"code": 200,
"message": "success",
"data": {
"roomVal": 60576.5,
"currentLevelIcon": "https://image.pekolive.com/63room_lv.png",
"currnetLevel": 63,
"currentLevelExp": 0,
"nextLevel": 0,
"nextLevelExp": 0,
"micEffects": [
{
"id": 4,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micEffect1.svga"
},
{
"id": 5,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micEffect2.svga"
},
{
"id": 6,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micEffect3.svga"
}
],
"micSkins": [
{
"id": 1,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micSkin1.png"
},
{
"id": 2,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micSkin2.png"
},
{
"id": 3,
"reachLevel": 1,
"dressUrl": "https://image.pekolive.com/micSkin3.png"
}
]
"id": 2083,
"uid": 3224,
"type": 64,
"starLevel": 5,
"createTime": "2024-12-24 18:15:43",
"updateTime": 1735035343000,
"erbanNo": "6228657",
"nick": "Molistar",
"avatar": "https://image.pekolive.com/bfed3b08-1ebe-42dc-b9a4-619cb2da0e43.gif",
"isOnline": 0,
"seq": 0
},
"timestamp": 1734946769207
"timestamp": 1735109388648
}