local ActBaseUI = require "app/ui/activity/common/act_base_ui"
local ActMainUI = class("ActMainUI", ActBaseUI)

local PAGE_BTN_NORMAL = {
	"act_common_btn_34_2",
	"act_common_btn_27_2",
	"act_common_btn_28_2",
	"act_common_btn_29_2",
}
local PAGE_BTN_LIGHT = {
	"act_common_btn_34_1",
	"act_common_btn_27_1",
	"act_common_btn_28_1",
	"act_common_btn_29_1",
}
local PAGE_BTN_DESC = {
	"ACT_GOGOGO_DESC_1",
	"ACT_GOGOGO_DESC_20",
	"ACT_GOGOGO_DESC_10",
	"ACT_GOGOGO_DESC_11",
}

function ActMainUI:showCommonBG()
	return false
end

function ActMainUI:onPressBackspace()
	self:closeUI()
end

function ActMainUI:currencyParams()
	self.params = {}
	self.params.showType = GConst.CURRENCY_TYPE.HORIZONTAL
	if self.curPage == 3 then
		self.params.itemIds = {
			GConst.ItemConst.ITEM_ID_GEM,
		}
	else
		self.params.itemIds = {}
	end
	return self.params, true
end

function ActMainUI:ctor()
	self.actId = DataManager[self:getActDataType()]:getActId()
	self.curPage = self:getRpPage()
end

function ActMainUI:getPrefabPath()
	return "assets/prefabs/ui/activity/act_sprint/act_main_ui.prefab"
end

function ActMainUI:getRpPage()
	for i = 1, 4 do
		if DataManager[self:getActDataType()]:getRpByPage(i) then
			return i
		end
	end
	return 1
end

-- region 活动功能接口
function ActMainUI:getActConst()
	return GConst.ActSprintConst
end

function ActMainUI:getActDataType()
	return "ActSprintSummonDataAll"
end

function ActMainUI:getGiftAdType()
	return BIReport.ADS_CLICK_TYPE.AD_NEW_NEW_GIFT
end

function ActMainUI:getBountyLvRes(active)
	if active then
		return GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_dec_4"
	else
		return GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_dec_3"
	end
end

function ActMainUI:getCellName(page)
	page = page or self.page
	return I18N:getGlobalText(PAGE_BTN_DESC[page])
end

function ActMainUI:showGamePreviewUI()
	local params = {}
	params.dataKey = self:getActDataType()
	params.parentUI = self
	ModuleManager.ActivityManager:showFishPreviewUI(params)
end

function ActMainUI:getPageBtnName(index, light)
	if light then
		return PAGE_BTN_LIGHT[index]
	else
		return PAGE_BTN_NORMAL[index]
	end
end

function ActMainUI:getShowBountyBg()
	return false
end

function ActMainUI:isShowBannerLine1()
	return false
end

function ActMainUI:getBountyBanner()
	return "assets/arts/textures/background/act_newnew/act_newnew_bg_2.png"
end

--@endregion

-- region 活动消息
function ActMainUI:reqActivityGameDo(score)
	ModuleManager.ActNewNewManager:reqActivityGameDo(score)
end

function ActMainUI:reqActivityGameTarget(id)
	ModuleManager.ActNewNewManager:reqActivityGameTarget(0)
end

function ActMainUI:reqActivityTarget(id)
	ModuleManager.ActNewNewManager:reqActivityTarget(id)
end

function ActMainUI:reqActivityPlay(count, isFree)
	ModuleManager.ActNewNewManager:reqActivityPlay(count, isFree)
end

function ActMainUI:onClaimAllRewards()
	ModuleManager.ActNewNewManager:onClaimAllRewards()
end

function ActMainUI:onUnlockProReward(gear)
	ModuleManager.ActNewNewManager:onUnlockProReward(gear)
end
--@endregion
return ActMainUI