[Modify]修改礼物页面报网络错误的bug

This commit is contained in:
wushaocheng
2023-01-30 09:23:08 +08:00
parent 3247739411
commit 8fa408aa3d
2 changed files with 8 additions and 9 deletions

View File

@@ -127,7 +127,8 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
.subscribe(new BeanObserver<List<GiftWallInfo>>() {
@Override
public void onErrorMsg(String error) {
onRequestGiftWallFail(error);
Log.i("UserInfoGiftFragment:", error);
// onRequestGiftWallFail(error);
}
@Override

View File

@@ -28,7 +28,7 @@ import com.yizhuan.xchat_android_core.statistic.StatisticManager
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr
import com.yizhuan.xchat_android_core.user.UserModel
import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
import com.yizhuan.xchat_android_core.utils.StarUtils
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver
@@ -50,30 +50,27 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
override fun init() {
EventBus.getDefault().register(this)
vm.userInfoData.observe(this) {
initInfoData(it)
}
vm.hallData.observe(this) {
initPersonalData(it)
}
vm.userInfoDetailData.observe(this) {
initInfoData(it)
initDynamicList(it.dynamicInfo)
}
}
private fun initInfoData(userInfo: UserInfo) {
private fun initInfoData(bean: UserDetailInfo.DataBean) {
//设置星座
val star = StarUtils.getConstellation(Date(userInfo.birth))
val star = StarUtils.getConstellation(Date(bean.birth))
if (null == star) {
binding.tvConstellation.visibility = View.GONE
} else {
binding.tvConstellation.text = star
binding.tvConstellation.visibility = View.VISIBLE
}
val birth = TimeUtil.getDateTimeString(userInfo.birth, "yyyy-MM-dd")
val birth = TimeUtil.getDateTimeString(bean.birth, "yyyy-MM-dd")
binding.tvBirth.text = birth
}
@@ -239,6 +236,7 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
fun onDynamicRefreshEvent(event: DynamicRefreshEvent?) {
if (isResumed) {
vm.userInfoDetailData.observe(this) {
initInfoData(it)
initDynamicList(it.dynamicInfo)
}
}