Merge branch 'master_test_hw' into master_tishen_hw
commit
5fb448cef3
|
|
@ -9,9 +9,11 @@ namespace GameLogic
|
||||||
{
|
{
|
||||||
|
|
||||||
public string appid = "";
|
public string appid = "";
|
||||||
|
public string channel = "";
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
TapDBManager.Instance.SetAppId(appid);
|
TapDBManager.Instance.SetAppId(appid);
|
||||||
|
TapDBManager.Instance.SetChannel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnApplicationPause(bool pauseStatus)
|
void OnApplicationPause(bool pauseStatus)
|
||||||
|
|
@ -39,11 +41,11 @@ namespace GameLogic
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
string channel = VersionManager.Instance.GetVersionInfo("channel");
|
//string channel = VersionManager.Instance.GetVersionInfo("channel");
|
||||||
string subChannel = VersionManager.Instance.GetVersionInfo("subChannel");
|
//string subChannel = VersionManager.Instance.GetVersionInfo("subChannel");
|
||||||
string version = VersionManager.Instance.GetVersionInfo("version");
|
string version = VersionManager.Instance.GetVersionInfo("version");
|
||||||
|
|
||||||
TapDBManager.channel = channel + "_" + subChannel;
|
//TapDBManager.channel = channel + "_" + subChannel;
|
||||||
TapDBManager.version = version;
|
TapDBManager.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,6 +61,11 @@ namespace GameLogic
|
||||||
{
|
{
|
||||||
TapDBManager.appId = appId;
|
TapDBManager.appId = appId;
|
||||||
}
|
}
|
||||||
|
public void SetChannel(string channel)
|
||||||
|
{
|
||||||
|
TapDBManager.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void OnStart()
|
public void OnStart()
|
||||||
|
|
|
||||||
|
|
@ -1109,7 +1109,7 @@ RectTransform:
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0.00000065565, y: -99.69507}
|
m_AnchoredPosition: {x: 0.00000065565, y: -99.69507}
|
||||||
m_SizeDelta: {x: 112, y: 44}
|
m_SizeDelta: {x: 132, y: 44}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &222986977202393806
|
--- !u!222 &222986977202393806
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|
@ -4304,7 +4304,7 @@ RectTransform:
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0.000010808, y: -0.00000095367}
|
m_AnchoredPosition: {x: 0.000010808, y: -0.00000095367}
|
||||||
m_SizeDelta: {x: 112, y: 44}
|
m_SizeDelta: {x: 132, y: 44}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &3096389263076999085
|
--- !u!222 &3096389263076999085
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|
@ -4344,8 +4344,8 @@ MonoBehaviour:
|
||||||
m_Alignment: 4
|
m_Alignment: 4
|
||||||
m_AlignByGeometry: 0
|
m_AlignByGeometry: 0
|
||||||
m_RichText: 1
|
m_RichText: 1
|
||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 1
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 1
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: "\xA56"
|
m_Text: "\xA56"
|
||||||
--- !u!1 &3130579941747738974
|
--- !u!1 &3130579941747738974
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,8 @@ local ManagerNames = {
|
||||||
"MapFight/FightUIManager",
|
"MapFight/FightUIManager",
|
||||||
-- 通用对象池
|
-- 通用对象池
|
||||||
"Common/Pool/CommonPool",
|
"Common/Pool/CommonPool",
|
||||||
|
-- 货币管理
|
||||||
|
"Common/MoneyUtil",
|
||||||
--幸运转盘
|
--幸运转盘
|
||||||
"LuckyTurnTable/LuckyTurnTableManager",
|
"LuckyTurnTable/LuckyTurnTableManager",
|
||||||
--手机绑定
|
--手机绑定
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ ConfigName = {
|
||||||
RaceTowerConfig = "RaceTowerConfig",
|
RaceTowerConfig = "RaceTowerConfig",
|
||||||
RaceTowerRewardConfig = "RaceTowerRewardConfig",
|
RaceTowerRewardConfig = "RaceTowerRewardConfig",
|
||||||
HeroSacrifice = "HeroSacrifice",
|
HeroSacrifice = "HeroSacrifice",
|
||||||
|
ExchangeRate = "ExchangeRate",
|
||||||
}
|
}
|
||||||
|
|
||||||
require "Framework/GameDataBase"
|
require "Framework/GameDataBase"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
MoneyUtil = {}
|
||||||
|
local this = MoneyUtil
|
||||||
|
|
||||||
|
|
||||||
|
this.RMB2O = {}
|
||||||
|
this.MT = 1
|
||||||
|
|
||||||
|
|
||||||
|
function this.Initialize()
|
||||||
|
this.MT = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 79).Value
|
||||||
|
local er = ConfigManager.GetConfig(ConfigName.ExchangeRate)
|
||||||
|
for _, v in ConfigPairs(er) do
|
||||||
|
this.RMB2O[v.Price_1] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 获取相应的金额
|
||||||
|
function this.GetMoney(rmbp)
|
||||||
|
if not this.RMB2O[rmbp] then
|
||||||
|
LogError("表 ExchangeRate 错误: 不包含档位:"..tostring(rmbp))
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
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
|
||||||
|
|
||||||
|
local _t2m = {
|
||||||
|
[1] = "¥",
|
||||||
|
[2] = "$",
|
||||||
|
}
|
||||||
|
-- 获取货币符号
|
||||||
|
function this.GetMoneyMark(mt)
|
||||||
|
if not mt then
|
||||||
|
mt = this.MT
|
||||||
|
end
|
||||||
|
mt = tonumber(mt)
|
||||||
|
if _t2m[mt] then
|
||||||
|
return _t2m[mt]
|
||||||
|
end
|
||||||
|
return _t2m[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 获取货币单位名称
|
||||||
|
local _t2n = {
|
||||||
|
[1] = "元",
|
||||||
|
[2] = "美元",
|
||||||
|
}
|
||||||
|
function this.GetMoneyUnitName(mt)
|
||||||
|
if not mt then
|
||||||
|
mt = this.MT
|
||||||
|
end
|
||||||
|
mt = tonumber(mt)
|
||||||
|
if _t2n[mt] then
|
||||||
|
return _t2n[mt]
|
||||||
|
end
|
||||||
|
return _t2n[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return MoneyUtil
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3c4ecabbff8da494c805cf9f8ec77e2a
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -29,25 +29,18 @@ function this.Pay(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.RequestPay(context)
|
function this.RequestPay(context)
|
||||||
|
|
||||||
|
local price = MoneyUtil.GetMoney(context.Price)
|
||||||
|
|
||||||
SDKMgr.onPayCallback = function(payResp)
|
SDKMgr.onPayCallback = function(payResp)
|
||||||
Log("onPayCallback::"..payResp)
|
Log("onPayCallback::"..payResp)
|
||||||
local str = string.split(payResp, "#")
|
local str = string.split(payResp, "#")
|
||||||
local result = tonumber(str[1])
|
local result = tonumber(str[1])
|
||||||
-- local orderId = str[2]
|
-- local orderId = str[2]
|
||||||
if result == SDK_RESULT.SUCCESS then
|
if result == SDK_RESULT.SUCCESS then
|
||||||
DataCenterManager.CommitPayStatus(
|
|
||||||
"IN_GAME_"..context.Type,
|
|
||||||
-- SDKMgr:GetPayOrderID(),
|
|
||||||
"VALID",
|
|
||||||
tostring(context.Price)
|
|
||||||
)
|
|
||||||
elseif result == SDK_RESULT.FAILED then
|
elseif result == SDK_RESULT.FAILED then
|
||||||
DataCenterManager.CommitPayStatus(
|
|
||||||
"IN_GAME_"..context.Type,
|
|
||||||
-- SDKMgr:GetPayOrderID(),
|
|
||||||
"INVALID",
|
|
||||||
tostring(context.Price)
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
--PopupTipPanel.ShowTip("取消充值" .. result)
|
--PopupTipPanel.ShowTip("取消充值" .. result)
|
||||||
-- DataCenterManager.CommitPayStatus(
|
-- DataCenterManager.CommitPayStatus(
|
||||||
|
|
@ -62,7 +55,7 @@ function this.RequestPay(context)
|
||||||
params.productId = context.Id
|
params.productId = context.Id
|
||||||
params.productName = context.Name or ""
|
params.productName = context.Name or ""
|
||||||
params.productDesc = context.Desc or ""
|
params.productDesc = context.Desc or ""
|
||||||
params.price = context.Price * 100 -- 以分为单位
|
params.price = price * 100 -- 以分为单位
|
||||||
params.ratio = 1
|
params.ratio = 1
|
||||||
params.buyNum = context.BuyNum or 1
|
params.buyNum = context.BuyNum or 1
|
||||||
params.coinNum = BagManager.GetItemCountById(16)
|
params.coinNum = BagManager.GetItemCountById(16)
|
||||||
|
|
@ -88,7 +81,7 @@ function this.RequestPay(context)
|
||||||
ThinkingAnalyticsManager.Track("create_order", {
|
ThinkingAnalyticsManager.Track("create_order", {
|
||||||
goods_id = context.Id,
|
goods_id = context.Id,
|
||||||
goods_name = context.Name,
|
goods_name = context.Name,
|
||||||
order_money_amount = context.Price,
|
order_money_amount = price,
|
||||||
Bundle_id = AppConst.SdkPackageName,
|
Bundle_id = AppConst.SdkPackageName,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -523,7 +523,7 @@ function this:RechargeShopItemAdapter(shopItem, itemData)
|
||||||
local itemInfo = ShopManager.GetRechargeItemInfo(itemData.goodsId)
|
local itemInfo = ShopManager.GetRechargeItemInfo(itemData.goodsId)
|
||||||
icon.sprite = Util.LoadSprite(GetResourcePath(itemInfo.Resources))
|
icon.sprite = Util.LoadSprite(GetResourcePath(itemInfo.Resources))
|
||||||
num.text = itemInfo.Name
|
num.text = itemInfo.Name
|
||||||
price.text = "$" .. itemInfo.Price
|
price.text = MoneyUtil.GetMoneyMark() .. MoneyUtil.GetMoney(itemInfo.Price)
|
||||||
-- 判断首充赠送
|
-- 判断首充赠送
|
||||||
local curBuyCount = itemData.buyTimes
|
local curBuyCount = itemData.buyTimes
|
||||||
first:SetActive(curBuyCount < 1)
|
first:SetActive(curBuyCount < 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue