feat: 游戏详情改版补充优化1—客户端(1) https://jira.shanqu.cc/browse/GHZSCY-7568

This commit is contained in:
叶子维
2025-03-18 11:14:49 +08:00
parent 60f35a89b4
commit 3cd70b5b8f
3 changed files with 13 additions and 9 deletions

View File

@ -120,14 +120,14 @@ class GameDetailInfoItemViewHolder(
nameTv.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(context))
infoTv.setTextColor(if (data.name == TYPE_ICP) com.gh.gamecenter.common.R.color.text_theme.toColor(context) else com.gh.gamecenter.common.R.color.text_secondary.toColor(context))
actionTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))
nameTv.text = if (data.name == TYPE_CONTACT) data.contact?.hint else normalTypeNameMap[data.name]
nameTv.text = if (data.name == TYPE_CONTACT) data.text else normalTypeNameMap[data.name]
infoTv.text = when (data.name) {
TYPE_INTERNET -> if (data.value == "yes") "" else ""
TYPE_UPDATE_TIME -> data.value.toLongOrNull()?.let { TimeUtils.getFormatTime(it) }
else -> data.value
}
actionTv.goneIf(data.name != TYPE_CONTACT || data.contact == null) {
val actionString = if (data.contact?.type == "qq") ACTION_CONTACT else if (data.contact?.key.isNullOrEmpty()) ACTION_COPY else ACTION_JOIN
actionTv.goneIf(data.name != TYPE_CONTACT) {
val actionString = if (data.type == "qq") ACTION_CONTACT else if (data.key.isNotEmpty()) ACTION_JOIN else ACTION_COPY
actionTv.text = actionString
actionTv.setOnClickListener {
when (actionString) {
@ -141,7 +141,7 @@ class GameDetailInfoItemViewHolder(
ACTION_JOIN -> {
if (ShareUtils.isQQClientAvailable(context)) {
DirectUtils.directToQqGroup(context, data.contact?.key)
DirectUtils.directToQqGroup(context, data.key)
} else {
data.value.copyTextAndToast("已复制")
}
@ -191,11 +191,11 @@ class GameDetailInfoItemViewHolder(
const val TYPE_CREDIT_CODE = "credit_code"
const val TYPE_SIZE = "size"
const val TYPE_SUPPLIER = "supplier"
const val TYPE_CONTACT = "contact"
const val TYPE_CONTACT = "qq/qq_qun"
const val ACTION_COPY = "复制"
const val ACTION_JOIN = "加入"
const val ACTION_CONTACT = "咨询"
const val ACTION_CONTACT = "添加"
// 固定信息类型
val staticTypeNameMap = mapOf(

View File

@ -408,12 +408,14 @@ data class GameDetailInfo(
@Parcelize
data class InfoItem(
val name: String = "",
val type: String = "",
val text: String = "",
val key: String = "", // QQ群KEY
val value: String = "",
@SerializedName("is_first")
val isFirst: Boolean = true, // 是否显示在一级页面
val order: Int = -1, // 排序
val permissions: List<Permission>? = null,
val contact: Contact? = null
): Parcelable
}