fix: 2024/10/11-验收问题 https://jira.shanqu.cc/browse/GHZSCY-6780
This commit is contained in:
@ -72,7 +72,7 @@ android_build:
|
||||
only:
|
||||
- dev
|
||||
- release
|
||||
- feat/GHZSCY-6708
|
||||
- feat/GHZSCY-6780
|
||||
|
||||
# 代码检查
|
||||
sonarqube_analysis:
|
||||
@ -158,4 +158,4 @@ oss-upload&send-email:
|
||||
only:
|
||||
- dev
|
||||
- release
|
||||
- feat/GHZSCY-6708
|
||||
- feat/GHZSCY-6780
|
||||
|
||||
@ -132,8 +132,8 @@ data class SubjectEntity(
|
||||
|
||||
val subjectType: SubjectData.SubjectType get() = when {
|
||||
isQQColumn -> SubjectData.SubjectType.QQ_GAME
|
||||
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
|
||||
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
|
||||
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
|
||||
else -> SubjectData.SubjectType.NORMAL
|
||||
}
|
||||
|
||||
|
||||
@ -73,6 +73,8 @@ class CustomPageData(
|
||||
val qqMiniGameColumn: SubjectEntity? = null,
|
||||
@SerializedName("link_wechat_game_column_detail")
|
||||
val wechatMiniGameColumn: SubjectEntity? = null,
|
||||
@SerializedName("link_wechat_game_cpm_column_detail")
|
||||
val wechatMiniGameCPMColumn: SubjectEntity? = null,
|
||||
@SerializedName("link_common_collection")
|
||||
val linkCommonCollection: CommonContentCollection? = null,
|
||||
@SerializedName("link_qq_game_recently_played")
|
||||
@ -82,8 +84,8 @@ class CustomPageData(
|
||||
val gameSubjectEntity: SubjectEntity?
|
||||
get() = when (link.type) {
|
||||
CustomPageItem.CUSTOM_LINK_TYPE_QQ_MINI_GAME_COLUMN_DETAIL -> qqMiniGameColumn
|
||||
CustomPageItem.CUSTOM_LINK_TYPE_WECHAT_MINI_GAME_COLUMN_DETAIL,
|
||||
CustomPageItem.CUSTOM_LINK_TYPE_WECHAT_WECHAT_GAME_CPM_COLUMN_DETAIL -> wechatMiniGameColumn
|
||||
CustomPageItem.CUSTOM_LINK_TYPE_WECHAT_MINI_GAME_COLUMN_DETAIL -> wechatMiniGameColumn
|
||||
CustomPageItem.CUSTOM_LINK_TYPE_WECHAT_WECHAT_GAME_CPM_COLUMN_DETAIL -> wechatMiniGameCPMColumn
|
||||
else -> linkColumn
|
||||
}
|
||||
|
||||
|
||||
@ -233,14 +233,12 @@ class CustomPageRepository private constructor(
|
||||
|
||||
private fun transformRawDataIntoItemData(data: CustomPageData, reloadDiscoverData: Boolean): List<CustomPageItem> {
|
||||
val list = arrayListOf<CustomPageItem>()
|
||||
var position = pageInfo.position
|
||||
var componentPosition = pageInfo.componentPosition
|
||||
|
||||
data.customsComponents
|
||||
.forEachIndexed { _, item ->
|
||||
// 如果当前item不是展开大图,并且上一个item为展开大图,则说明展开大图组件已结束
|
||||
if (lastComponentType == CUSTOM_LINK_TYPE_GAME && item.link.type != CUSTOM_LINK_TYPE_GAME) {
|
||||
componentPosition++
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
when {
|
||||
@ -257,7 +255,7 @@ class CustomPageRepository private constructor(
|
||||
}
|
||||
// 如果当前item为展开大图,并且上一个item也是展开大图,但是组件id不同,则说明这是一个新的并且连续的展开大图组件
|
||||
if (lastComponentType == item.link.type && lastSubjectId != item.linkColumn?.id) {
|
||||
componentPosition++
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
item.game.gameLocation = GameEntity.GameLocation.INDEX
|
||||
list.add(
|
||||
@ -266,12 +264,12 @@ class CustomPageRepository private constructor(
|
||||
item.game,
|
||||
item.linkColumn,
|
||||
gameChildPosition,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
gameChildPosition++
|
||||
position++
|
||||
pageInfo.positionIncrement()
|
||||
|
||||
lastSubjectId = item.linkColumn?.id ?: ""
|
||||
}
|
||||
@ -281,15 +279,15 @@ class CustomPageRepository private constructor(
|
||||
|| item.link.type == CUSTOM_LINK_TYPE_QQ_MINI_GAME_COLUMN_DETAIL
|
||||
|| item.link.type == CUSTOM_LINK_TYPE_WECHAT_MINI_GAME_COLUMN_DETAIL -> {
|
||||
val subItems = convertColumnDetailSubjectItems(
|
||||
position,
|
||||
componentPosition,
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition,
|
||||
item.link,
|
||||
item.gameSubjectEntity
|
||||
)
|
||||
if (subItems.isNotEmpty()) {
|
||||
list.addAll(subItems)
|
||||
position += subItems.size
|
||||
componentPosition++
|
||||
pageInfo.positionGetAndAdd(subItems.size)
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,11 +299,11 @@ class CustomPageRepository private constructor(
|
||||
item.link,
|
||||
MiniGameRecentlyPlayUseCase.getRecentlyPlayedMiniGameList(Constants.QQ_MINI_GAME),
|
||||
linkQqGameRecentlyPlayed,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
).also(list::add)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
}
|
||||
@ -315,11 +313,11 @@ class CustomPageRepository private constructor(
|
||||
recentWechatItem = CustomRecentWeChatMiniGamesItem(
|
||||
item.link,
|
||||
MiniGameRecentlyPlayUseCase.getRecentlyPlayedMiniGameList(Constants.WECHAT_MINI_GAME),
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
).also(list::add)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
// 微信小游戏CPM专题
|
||||
@ -329,13 +327,13 @@ class CustomPageRepository private constructor(
|
||||
CustomWeChatMiniGamesCPMSubjectItem(
|
||||
item.link,
|
||||
subject,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
wGameSubjectCPMListUseCase.getWechatMiniGameCPMList(subject.id)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,12 +373,12 @@ class CustomPageRepository private constructor(
|
||||
CustomSubjectCollectionItem(
|
||||
item.link,
|
||||
item.linkColumnCollection,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,12 +398,12 @@ class CustomPageRepository private constructor(
|
||||
CustomSubjectCollectionItem(
|
||||
item.link,
|
||||
item.linkGameListCollection,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
}
|
||||
@ -418,8 +416,8 @@ class CustomPageRepository private constructor(
|
||||
) {
|
||||
val subItems = convertSplitCommonContentCollection(item)
|
||||
list.addAll(subItems)
|
||||
position += subItems.size
|
||||
componentPosition++
|
||||
pageInfo.positionGetAndAdd(subItems.size)
|
||||
pageInfo.componentPositionIncrement()
|
||||
} else {
|
||||
var show = true
|
||||
when (layout) {
|
||||
@ -454,12 +452,12 @@ class CustomPageRepository private constructor(
|
||||
CustomCommonContentCollectionItem(
|
||||
item.link,
|
||||
item.linkCommonCollection,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
|
||||
@ -474,12 +472,12 @@ class CustomPageRepository private constructor(
|
||||
CustomRecentGamesItem(
|
||||
item.link,
|
||||
entities,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
).also {
|
||||
list.add(it)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
}
|
||||
|
||||
@ -489,8 +487,8 @@ class CustomPageRepository private constructor(
|
||||
CustomPluginItem(item.link, pluginGameList, pageInfo.position, pageInfo.componentPosition)
|
||||
.also {
|
||||
list.add(it)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
}
|
||||
@ -501,12 +499,12 @@ class CustomPageRepository private constructor(
|
||||
CustomGameTestV2Item(
|
||||
item.link,
|
||||
item.homeItemTestV2,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
item.link.type == CUSTOM_LINK_TYPE_HALO_RECOMMEND -> {
|
||||
@ -516,19 +514,19 @@ class CustomPageRepository private constructor(
|
||||
CustomDiscoverCardItem(
|
||||
item.link,
|
||||
discoverCardEntity,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
.also {
|
||||
list.add(it)
|
||||
position++
|
||||
pageInfo.positionIncrement()
|
||||
}
|
||||
// 刷新光环推荐
|
||||
if (reloadDiscoverData || discoverCardEntity == null) {
|
||||
shareRepository.loadDiscoverCard()
|
||||
}
|
||||
|
||||
componentPosition++
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
item.contentCard != null -> {
|
||||
@ -537,12 +535,12 @@ class CustomPageRepository private constructor(
|
||||
CustomContentCardItem(
|
||||
item.link,
|
||||
item.contentCard,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
|
||||
item.linkTopGameComments != null -> {
|
||||
@ -596,12 +594,12 @@ class CustomPageRepository private constructor(
|
||||
CustomAmwayItem(
|
||||
item.link,
|
||||
comments,
|
||||
position,
|
||||
componentPosition
|
||||
pageInfo.position,
|
||||
pageInfo.componentPosition
|
||||
)
|
||||
)
|
||||
position++
|
||||
componentPosition++
|
||||
pageInfo.positionIncrement()
|
||||
pageInfo.componentPositionIncrement()
|
||||
}
|
||||
}
|
||||
|
||||
@ -612,14 +610,6 @@ class CustomPageRepository private constructor(
|
||||
lastComponentType = item.link.type ?: ""
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
pageInfo.positionGetAndAdd(position)
|
||||
}
|
||||
|
||||
if (componentPosition > 0) {
|
||||
pageInfo.componentPositionGetAndAdd(componentPosition)
|
||||
}
|
||||
|
||||
pageInfo.nextPage()
|
||||
|
||||
return list
|
||||
@ -886,6 +876,14 @@ class CustomPageRepository private constructor(
|
||||
_page++
|
||||
}
|
||||
|
||||
fun positionIncrement() {
|
||||
positionGetAndAdd(1)
|
||||
}
|
||||
|
||||
fun componentPositionIncrement() {
|
||||
componentPositionGetAndAdd(1)
|
||||
}
|
||||
|
||||
fun positionGetAndAdd(value: Int) {
|
||||
_position.getAndAdd(value)
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ class SearchSubjectItemViewHolder(var binding: SearchSubjectItemBinding) : Recyc
|
||||
|
||||
binding.run {
|
||||
subjectRv.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
|
||||
subjectRv.adapter = SearchSubjectAdapter(context, entity.getFilterGame(), "($type-专题)") {
|
||||
subjectRv.adapter = SearchSubjectAdapter(context, entity.getFilterGame(), "($type-专题)", key) {
|
||||
dao?.add(key)
|
||||
if (itemData.adConfig != null) {
|
||||
NewFlatLogUtils.logClickGameAd(
|
||||
|
||||
@ -14,6 +14,7 @@ class SearchSubjectAdapter(
|
||||
context: Context,
|
||||
private val mList: List<GameEntity>,
|
||||
private val mEntrance: String,
|
||||
private val mKey: String,
|
||||
private val clickCallback: ((GameEntity) -> Unit)
|
||||
) : BaseRecyclerAdapter<GameHorizontalSimpleItemViewHolder>(context) {
|
||||
|
||||
@ -37,6 +38,11 @@ class SearchSubjectAdapter(
|
||||
clickCallback.invoke(gameEntity)
|
||||
if (gameEntity.isMiniGame()) {
|
||||
MiniGameItemHelper.launchMiniGame(gameEntity)
|
||||
MiniGameItemHelper.trackMiniGameClick(
|
||||
gameEntity = gameEntity,
|
||||
location = "小游戏搜索结果列表",
|
||||
searchContent = mKey,
|
||||
)
|
||||
} else {
|
||||
GameDetailActivity.startGameDetailActivity(mContext, gameEntity.id, mEntrance, gameEntity.exposureEvent)
|
||||
}
|
||||
|
||||
@ -91,13 +91,6 @@ object MiniGameItemHelper {
|
||||
gameName = gameEntity.name ?: "",
|
||||
)
|
||||
}
|
||||
Constants.WECHAT_MINI_GAME_CPM -> {
|
||||
WGameSubjectCPMListReportHelper.reportClick(
|
||||
miniAppId = gameEntity.miniGameAppId,
|
||||
operateTime = System.currentTimeMillis() / 1000,
|
||||
recommendId = gameEntity.miniGameRecommendId
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
SensorsBridge.trackWechatGameClick(
|
||||
bottomTab = bottomTab,
|
||||
@ -115,6 +108,13 @@ object MiniGameItemHelper {
|
||||
gameId = gameEntity.id,
|
||||
gameName = gameEntity.name ?: ""
|
||||
)
|
||||
if (gameEntity.miniGameType == Constants.WECHAT_MINI_GAME_CPM) {
|
||||
WGameSubjectCPMListReportHelper.reportClick(
|
||||
miniAppId = gameEntity.miniGameAppId,
|
||||
operateTime = System.currentTimeMillis() / 1000,
|
||||
recommendId = gameEntity.miniGameRecommendId
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user