解决返回的时间秒数格式不对引起查看CP邀请时候的闪退问题

This commit is contained in:
yitao_hello
2022-02-25 19:36:43 +08:00
parent d2a4a27286
commit ffc8fc4f94
3 changed files with 9 additions and 8 deletions

View File

@@ -6,10 +6,10 @@ import com.yizhuan.xchat_android_core.relation.cp.UserCpListEntity
object CpDataParser {
fun inviteMsg2cpListEntity(msgEntity: CpInviteInfo) = UserCpListEntity(
msgEntity.acceptUid, msgEntity.acceptAvatar, msgEntity.acceptNick,
msgEntity.acceptGender, msgEntity.replyExpireTime.toString(), msgEntity.declaration,
msgEntity.cpId, msgEntity.inviteUid, msgEntity.inviteAvatar, msgEntity.inviteNick,
msgEntity.acceptGender, msgEntity.replyExpireTime.toLong(), msgEntity.declaration,
msgEntity.cpId,msgEntity.replyExpireTime,0, msgEntity.inviteUid, msgEntity.inviteAvatar, msgEntity.inviteNick,
msgEntity.inviteGender, 0, msgEntity.propsId, msgEntity.propsImg,
msgEntity.propsName, msgEntity.propsPrice, 0, 0, msgEntity.replyExpireTime.toString()
msgEntity.propsName, msgEntity.propsPrice, 0, 0, msgEntity.replyExpireTime.toLong()
)
/**

View File

@@ -47,7 +47,6 @@ class CpInviteReplyDialog(context: Context) :
0,
data.inviteUserNick.length
)
CpViewHelper.setInviteTimeRemain(data.updateTime, binding.tvTime)
CpViewHelper.setInviteGiftPriceStyle(context, data.propsPrice, binding.tvPrice)
binding.tvDeclaration.text = data.declaration
ImageLoadUtilsV2.loadImage(binding.ivGift, cpInviteData?.propsImg)
@@ -70,8 +69,8 @@ class CpInviteReplyDialog(context: Context) :
override fun onAttachedToWindow() {
super.onAttachedToWindow()
cpInviteData?.updateTime?.let {
countDown(it.toInt())
cpInviteData?.replyExpireTime?.let {
countDown(it)
}
}

View File

@@ -5,9 +5,11 @@ data class UserCpListEntity(
val acceptUserAvatar: String = "",
val acceptUserNick: String = "",
val acceptUserSex: Int = 0,//1-男 2女
val createTime: String = "",
val createTime: Long=0,
val declaration: String = "",//关系誓言
val cpId: Int = 0,//邀请记录id
val replyExpireTime: Int = 0,
val acceptTime:Long=0,
val inviteUid: Long = 0,//邀请人uid
val inviteUserAvatar: String = "",//邀请方头像
val inviteUserNick: String = "",
@@ -19,5 +21,5 @@ data class UserCpListEntity(
val propsPrice: String = "",
val state: Int = 0,//状态1-邀请中2-CP中3-拒绝4-解绑中5-解绑完成
val unboundUid: Int = 0,//解绑人
val updateTime: String = ""
val updateTime: Long = 0
)