【按钮优化】充值界面

dev_chengFeng
ZhangBiao 2021-01-27 10:02:58 +08:00
parent 3254df8f6f
commit 7b686298c8
2 changed files with 25 additions and 41 deletions

View File

@ -2185,7 +2185,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 340, y: -20}
m_AnchoredPosition: {x: 340, y: -81.1}
m_SizeDelta: {x: 210, y: 54}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &199908229381191061

View File

@ -469,23 +469,6 @@ function GiftView:RefreshShowData(item, data, buyType, DataTypeIndex)
end
end
--为特权商城加的倒计时
if DataTypeIndex == DataType.Direct and isPrivilegeGift then
local refreshTime = Util.GetGameObject(item,"refreshTime"):GetComponent("Text")
local freshTime = 0
local datalist = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)--当前所有礼包数据
for i = 1, #datalist do
if rechargeCommodityConfig[datalist[i].goodsId].Id == data.goodsId then
if freshTime <= 0 then
freshTime = datalist[i].endTime
table.insert(timerList,{pre=refreshTime,freshTime=freshTime})
end
end
refreshTime.text=Language[10561]..self:SpecialTime(freshTime-GetTimeStamp())
end
end
--滚动条复用重设itemview
if self.ItemList[item] then
@ -528,46 +511,47 @@ function GiftView:RefreshShowData(item, data, buyType, DataTypeIndex)
icon:SetActive(true)
icon:GetComponent("Image").sprite = SetIcon(shopItemData.Cost[1][1])
price.alignment="MiddleRight"
--根据数字位数做效果适配
-- local str=""
-- local index= string.len(tostring(finalNum))
-- if index<2 then
-- str=" "
-- elseif index>=2 and index<4 then
-- str=" "
-- else
-- str=" "
-- end
price.alignment = "MiddleLeft"
price.text = finalNum--..str
else--直购类按钮上的文字位置(空格慎调整!!!)
-- local str=""
-- local index= string.len(tostring(finalNum))
-- if index<2 then
-- str=" "
-- elseif index>=2 and index<4 then
-- str=" "
-- else
-- str=" "
-- end
price.alignment = "MiddleCenter"
icon:SetActive(false)
price.text = string.format(MoneyUtil.GetMoneyUnitName(), finalNum)
end
buyInfo.text = Language[11454]..limitNum - boughtNum .. "/" .. limitNum..Language[11455] --limitNum == -1 and "" or limitNum - boughtNum .. "/" .. limitNum
buyInfo.text = Language[10535]..limitNum - boughtNum..Language[10054]
else
price.alignment="MiddleCenter"
price.text=Language[10526]
buyInfo.text=Language[11454].."<color=red>"..limitNum - boughtNum.."</color>".. "/" .. limitNum..Language[11455]
buyInfo.text = ""
--特权 直购 按钮消失
if DataTypeIndex == DataType.Direct and isPrivilegeGift then
btnBuy:SetActive(false)
-- btnBuy:SetActive(false)
buyInfo.text=""
end
end
-- 请求购买
--为特权商城加的倒计时
local refreshTime = Util.GetGameObject(item,"refreshTime")
if refreshTime then
refreshTime:SetActive(false)
if DataTypeIndex == DataType.Direct and isPrivilegeGift then
local freshTime = 0
local datalist = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)--当前所有礼包数据
for i = 1, #datalist do
if rechargeCommodityConfig[datalist[i].goodsId].Id == data.goodsId then
if freshTime <= 0 then
freshTime = datalist[i].endTime
table.insert(timerList,{pre=refreshTime:GetComponent("Text"),freshTime=freshTime})
end
end
refreshTime:GetComponent("Text").text=Language[10561]..self:SpecialTime(freshTime-GetTimeStamp())
end
refreshTime:SetActive(not isCanBuy)
end
end
-- 请求购买
Util.AddOnceClick(btnBuy, function()
if not isCanBuy then
PopupTipPanel.ShowTip(Language[10540])