tcx_xiyou_yueNan
parent
400db99795
commit
43b2b39991
|
|
@ -27,23 +27,42 @@ end
|
|||
|
||||
-- 获取相应的金额
|
||||
function this.GetMoney(_rmbp)
|
||||
--[[
|
||||
local rmbp = tonumber(_rmbp)
|
||||
if rmbp <= 0 then
|
||||
return rmbp
|
||||
end
|
||||
if not this.RMB2O[rmbp] then
|
||||
LogError("表 ExchangeRate 错误: 不包含档位:"..tostring(rmbp))
|
||||
LogError("表 ExchangeRate 错误: 不包含档位:" .. tostring(rmbp))
|
||||
return 0
|
||||
end
|
||||
LogError("当前挡位:"..this.MT)
|
||||
local m = this.RMB2O[rmbp]["Price_"..this.MT]
|
||||
LogError("当前挡位:" .. this.MT)
|
||||
local m = this.RMB2O[rmbp]["Price_" .. this.MT]
|
||||
if not m then
|
||||
LogError("表 ExchangeRate 错误: 档位:"..tostring(rmbp).." , 未找到对应的货币类型 "..this.MT)
|
||||
LogError("表 ExchangeRate 错误: 档位:" .. tostring(rmbp) .. " , 未找到对应的货币类型 " .. this.MT)
|
||||
return 0
|
||||
end
|
||||
return m
|
||||
]]
|
||||
return _rmbp
|
||||
end
|
||||
function this.GetMoney2(_rmbp)
|
||||
local rmbp = tonumber(_rmbp)
|
||||
if rmbp <= 0 then
|
||||
return rmbp
|
||||
end
|
||||
if not this.RMB2O[rmbp] then
|
||||
LogError("表 ExchangeRate 错误: 不包含档位:" .. tostring(rmbp))
|
||||
return 0
|
||||
end
|
||||
LogError("当前挡位:" .. this.MT)
|
||||
local m = this.RMB2O[rmbp]["Price_" .. this.MT]
|
||||
if not m then
|
||||
LogError("表 ExchangeRate 错误: 档位:" .. tostring(rmbp) .. " , 未找到对应的货币类型 " .. this.MT)
|
||||
return 0
|
||||
end
|
||||
return m
|
||||
end
|
||||
|
||||
function this.GetCurMoneyType()
|
||||
return this.MT
|
||||
end
|
||||
|
|
@ -67,22 +86,34 @@ end
|
|||
local _t2n = {
|
||||
[MoneyType.RMB] = Language[10444],
|
||||
[MoneyType.USD] = "$%s",
|
||||
[MoneyType.MM] = "$%s",
|
||||
[MoneyType.THAI] = "$%s",
|
||||
}
|
||||
function this.GetMoneyUnitName(mt)
|
||||
|
||||
if not mt then
|
||||
mt = this.MT
|
||||
end
|
||||
--[[
|
||||
if _t2n[mt] then
|
||||
return _t2n[mt]
|
||||
end
|
||||
return _t2n[MoneyType.RMB]
|
||||
return _t2n[MoneyType.USD]
|
||||
]]
|
||||
return "%s" .. GetLanguageStrById("现金点券")
|
||||
end
|
||||
|
||||
function this.GetMoneyUnitNameWithMoney(money)
|
||||
local formater = this.GetMoneyUnitName(this.Mt)
|
||||
return string.format(formater, this.GetMoney(money))
|
||||
end
|
||||
|
||||
function this.GetMoneyUnitNameWithMoney2(money)
|
||||
if _t2n[this.MT] then
|
||||
return string.format(_t2n[this.MT], this.GetMoney2(money))
|
||||
else
|
||||
return string.format(_t2n[this.USD], this.GetMoney2(money))
|
||||
end
|
||||
end
|
||||
-- 获取货币单位名称
|
||||
local _t2n2 = {
|
||||
[MoneyType.RMB] = Language[10445],
|
||||
|
|
@ -97,10 +128,10 @@ function this.GetMoneyUnitName1(mt)
|
|||
end
|
||||
return _t2n2[MoneyType.RMB]
|
||||
end
|
||||
|
||||
function this.GetMoneyUnitNameWithMoney1(money)
|
||||
local formater = this.GetMoneyUnitName1()
|
||||
return string.format(formater, this.GetMoney(money))
|
||||
end
|
||||
|
||||
|
||||
return MoneyUtil
|
||||
|
|
@ -468,12 +468,13 @@ function this.ShowDayDataGiftBag()
|
|||
local freetimes = rechargeData.dynamicBuyTimes - rechargeData.buyTimes
|
||||
local imageStr = (freetimes > 0 and isCurGetState) and "s_slbz_1anniuongse" or "s_slbz_1anniuhuise"
|
||||
getBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(imageStr)
|
||||
btnText.text = string.format(Language[10444], MoneyUtil.GetMoney(rechargecommodityData.Price))
|
||||
btnText.text = string.format(MoneyUtil.GetMoneyUnitName(), MoneyUtil.GetMoney(data.finalNum))
|
||||
if isOpenLock then --是否到天数
|
||||
Util.SetGray(getBtn, false)
|
||||
getBtn:GetComponent("Button").enabled = true
|
||||
if freetimes > 0 and isCurGetState then
|
||||
btnText.text = string.format(Language[10444], MoneyUtil.GetMoney(rechargecommodityData.Price))
|
||||
btnText.text = string.format(MoneyUtil.GetMoneyUnitName(),
|
||||
MoneyUtil.GetMoney(rechargecommodityData.Price))
|
||||
elseif freetimes <= 0 then
|
||||
btnText.text = Language[10491]
|
||||
getBtn:GetComponent("Button").enabled = false
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ function SurpriseBox:ShowSingleData(item,data,index)
|
|||
tip:SetActive(false)
|
||||
tipText.text = string.format(Language[12884], data.otherData.BuyDay - self.actData.value)
|
||||
price:SetActive(true)
|
||||
priceText.text = string.format(Language[10444],MoneyUtil.GetMoney(data.otherData.Price))
|
||||
priceText.text = string.format(MoneyUtil.GetMoneyUnitName(), MoneyUtil.GetMoney(data.otherData.Price))
|
||||
lock:SetActive(false)
|
||||
light1:SetActive(false)
|
||||
light2:SetActive(false)
|
||||
|
|
|
|||
|
|
@ -196,8 +196,8 @@ function this:SetScrollPre(root, data)
|
|||
itemList[i].Name = Util.GetGameObject(itemList[i].go, "Name"):GetComponent("Text")
|
||||
end
|
||||
local config = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, data.Id)
|
||||
title.text = string.format(Language[12924], MoneyUtil.GetMoneyUnitNameWithMoney1(config.Rebate),
|
||||
MoneyUtil.GetMoneyUnitNameWithMoney1(config.Price))
|
||||
title.text = string.format(Language[12924], MoneyUtil.GetMoneyUnitNameWithMoney(config.Rebate),
|
||||
MoneyUtil.GetMoneyUnitNameWithMoney(config.Price))
|
||||
local rewardArray = data.RewardShow
|
||||
if not itemsGrid then
|
||||
itemsGrid = {}
|
||||
|
|
|
|||
|
|
@ -696,8 +696,12 @@ function this:RechargeShopItemAdapter(shopItem, itemData)
|
|||
--end
|
||||
icon.sprite = self.spLoader:LoadSprite(GetResourcePath(itemInfo.Resources))
|
||||
num.text = GetLanguageStrById(itemInfo.BaseReward[1][2])
|
||||
local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, itemData.goodsId)
|
||||
if rechargeConfig.OtherBuy1 == nil then
|
||||
price.text = MoneyUtil.GetMoneyUnitNameWithMoney2(itemInfo.Price) --.. MoneyUtil.GetMoney(itemInfo.Price)
|
||||
else
|
||||
price.text = MoneyUtil.GetMoneyUnitNameWithMoney(itemInfo.Price) --.. MoneyUtil.GetMoney(itemInfo.Price)
|
||||
|
||||
end
|
||||
-- 判断首充赠送
|
||||
local curBuyCount = itemData.buyTimes
|
||||
if itemInfo.FirstMultiple[1][2] == 0 then
|
||||
|
|
|
|||
Loading…
Reference in New Issue