大圣购买修改
parent
cb37edbba0
commit
274f315d2b
|
@ -31,7 +31,6 @@ end
|
|||
--绑定事件(用于子类重写)
|
||||
function UpStarPre:BindEvent()
|
||||
Util.AddOnceClick(self.btnBuy.gameObject, function()
|
||||
LogGreen("self.data.state:"..self.data.state)
|
||||
if self.data.state == 0 then
|
||||
PopupTipPanel.ShowTip("神将达指定星级后解锁")
|
||||
return
|
||||
|
@ -51,46 +50,6 @@ function UpStarPre:BindEvent()
|
|||
end)
|
||||
end
|
||||
|
||||
--购买点击事件
|
||||
function UpStarPre:BuyAction(costId, costNum, shopType, itemId)
|
||||
local haveNum = BagManager.GetItemCountById(costId)
|
||||
local costName = ConfigManager.GetConfigData(ConfigName.ItemConfig, costId).Name
|
||||
--Log("需要消耗的道具ID" .. costId)
|
||||
if haveNum < costNum then
|
||||
NotEnoughPopup:Show(costId)
|
||||
else
|
||||
local func = function(shopType, itemId)
|
||||
ShopManager.RequestBuyShopItem(shopType, itemId, 1, function()
|
||||
self.parent:RefreshData(nil,false,false)
|
||||
CheckRedPointStatus(RedPointType.DailyGift)
|
||||
CheckRedPointStatus(RedPointType.GrowthPackage)
|
||||
if shopType==20 and (itemId==1107 or itemId==1110 or itemId==1111 or itemId==1108 )then
|
||||
PlayerPrefs.SetString(PlayerManager.uid..PlayerManager.serverInfo.server_id.."supermeMan",666)
|
||||
end
|
||||
end)
|
||||
end
|
||||
local isPopUp = RedPointManager.PlayerPrefsGetStr(PlayerManager.uid .. shopType)
|
||||
local currentTime = os.date("%Y%m%d", PlayerManager.serverTime)
|
||||
if (isPopUp ~= currentTime and costNum ~= 0) then
|
||||
local str = string.format(Language[11360], costNum, costName)
|
||||
MsgPanel.ShowTwo(str, function()
|
||||
end, function(isShow)
|
||||
if (isShow) then
|
||||
local currentTime = os.date("%Y%m%d", PlayerManager.serverTime)
|
||||
RedPointManager.PlayerPrefsSetStr(PlayerManager.uid .. shopType, currentTime)
|
||||
end
|
||||
func(shopType, itemId)
|
||||
end,
|
||||
Language[10731],
|
||||
Language[10732],
|
||||
nil,
|
||||
true)
|
||||
else
|
||||
func(shopType, itemId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function UpStarPre:AddListener()
|
||||
end
|
||||
|
@ -180,7 +139,7 @@ function UpStarPre:SetBtn()
|
|||
|
||||
self.price.text = MoneyUtil.GetMoneyUnitNameWithMoney(self.data.giftConfig.Price)
|
||||
self.buyInfo.text = string.format("限购%s次",self.data.giftConfig.Limit)
|
||||
if self.data.giftData.buyTimes > 0 then
|
||||
if self.data.giftData and self.data.giftData.buyTimes > 0 then
|
||||
self.buyInfo.text = ""
|
||||
self.price.text = "已购买"
|
||||
self.btnBuy.enabled = false
|
||||
|
|
Loading…
Reference in New Issue