Merge branch 'dev_ios' into dev
This commit is contained in:
commit
d3bb4c3698
@ -109,6 +109,18 @@ function PayManager:getGiftConfigInfo(purchaseType, id)
|
|||||||
return cfg[id]
|
return cfg[id]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function PayManager:getPackageRechargeId(purchaseType, id)
|
||||||
|
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[purchaseType]
|
||||||
|
if not cfgName then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local cfg = ConfigManager:getConfig(cfgName)
|
||||||
|
if not cfg or not cfg[id] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return cfg[id].recharge_id
|
||||||
|
end
|
||||||
|
|
||||||
function PayManager:purchasePackage(id, purchaseType)
|
function PayManager:purchasePackage(id, purchaseType)
|
||||||
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[purchaseType]
|
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[purchaseType]
|
||||||
if not cfgName then
|
if not cfgName then
|
||||||
@ -133,9 +145,12 @@ function PayManager:purchasePackage(id, purchaseType)
|
|||||||
self:checkAndPay(productId, id, purchaseType, rechargeId)
|
self:checkAndPay(productId, id, purchaseType, rechargeId)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PayManager:requestRewards(purchaseToken, orderId, originOrderId, notShowRewardsBox)
|
function PayManager:requestRewards(purchaseToken, orderId, originOrderId, notShowRewardsBox, callback)
|
||||||
self:sendMsgToServer(purchaseToken, orderId, function(binder, msgData)
|
self:sendMsgToServer(purchaseToken, orderId, originOrderId, function(binder, msgData)
|
||||||
if msgData.status == 0 then
|
if msgData.status == 0 then
|
||||||
|
if Platform:isIosPlatform() then
|
||||||
|
SDKManager:delIosPayInfo(purchaseToken)
|
||||||
|
end
|
||||||
local showRewards = not notShowRewardsBox
|
local showRewards = not notShowRewardsBox
|
||||||
if DataManager.TutorialData and DataManager.TutorialData:getIsInTutorial() then -- 引导时不弹
|
if DataManager.TutorialData and DataManager.TutorialData:getIsInTutorial() then -- 引导时不弹
|
||||||
showRewards = false
|
showRewards = false
|
||||||
@ -173,6 +188,7 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, notSho
|
|||||||
if rechargeCfg then
|
if rechargeCfg then
|
||||||
BIReport:postPurchase(rechargeCfg.price, rechargeCfg.payId, originOrderId, orderId)
|
BIReport:postPurchase(rechargeCfg.price, rechargeCfg.payId, originOrderId, orderId)
|
||||||
end
|
end
|
||||||
|
BIReport:postAdjustSimpleTrackEvent("rumq9q", {})
|
||||||
end
|
end
|
||||||
|
|
||||||
local data = {}
|
local data = {}
|
||||||
@ -198,6 +214,9 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, notSho
|
|||||||
}
|
}
|
||||||
GFunc.showMessageBox(params)
|
GFunc.showMessageBox(params)
|
||||||
end
|
end
|
||||||
|
if callback then
|
||||||
|
callback()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -210,7 +229,7 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
|
|||||||
if msgData.uuid and msgData.uuid ~= GConst.EMPTY_STRING then
|
if msgData.uuid and msgData.uuid ~= GConst.EMPTY_STRING then
|
||||||
local giftType = PayManager:getGiftType(purchaseType, id)
|
local giftType = PayManager:getGiftType(purchaseType, id)
|
||||||
BIReport:postPayTurn(giftType, id, rechargeId)
|
BIReport:postPayTurn(giftType, id, rechargeId)
|
||||||
SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, id, function(purchaseToken, orderId, originOrderId)
|
SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, purchaseType, id, function(purchaseToken, orderId, originOrderId)
|
||||||
if purchaseToken and orderId then
|
if purchaseToken and orderId then
|
||||||
self:requestRewards(purchaseToken, orderId, originOrderId)
|
self:requestRewards(purchaseToken, orderId, originOrderId)
|
||||||
end
|
end
|
||||||
@ -234,12 +253,20 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PayManager:sendMsgToServer(purchaseToken, orderId, callback)
|
function PayManager:sendMsgToServer(purchaseToken, orderId, originOrderId, callback)
|
||||||
local args = {
|
local args = {
|
||||||
uuid = {orderId},
|
uuid = {orderId},
|
||||||
channel = SDKManager:getSDKPayType(),
|
channel = SDKManager:getSDKPayType(),
|
||||||
pay_token = purchaseToken
|
|
||||||
}
|
}
|
||||||
|
if Platform:isIosPlatform() then
|
||||||
|
local purchaseTokenObj = json.decode(purchaseToken)
|
||||||
|
if purchaseTokenObj == nil then
|
||||||
|
return -- 解析错误
|
||||||
|
end
|
||||||
|
args.pay_token = purchaseTokenObj.Payload
|
||||||
|
else
|
||||||
|
args.pay_token = purchaseToken
|
||||||
|
end
|
||||||
if EDITOR_MODE then
|
if EDITOR_MODE then
|
||||||
args.channel = SDKManager.PAY_TYPE.DEBUG
|
args.channel = SDKManager.PAY_TYPE.DEBUG
|
||||||
end
|
end
|
||||||
|
|||||||
@ -87,7 +87,7 @@ end
|
|||||||
function Platform:getPlatformStr()
|
function Platform:getPlatformStr()
|
||||||
if self.platformStr == nil then
|
if self.platformStr == nil then
|
||||||
if self:isIosPlatform() then
|
if self:isIosPlatform() then
|
||||||
self.platformStr = "IOS"
|
self.platformStr = "iOS"
|
||||||
elseif self:isAndroidPlatform() then
|
elseif self:isAndroidPlatform() then
|
||||||
self.platformStr = "Android"
|
self.platformStr = "Android"
|
||||||
else
|
else
|
||||||
|
|||||||
@ -166,14 +166,26 @@ function SDKManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SDKManager:doUncompletePay(callback)
|
function SDKManager:doUncompletePay(callback)
|
||||||
SDKPayMgr:doUncompletePay(callback)
|
SDKPayMgr:doUncompletePay(callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SDKManager:getIosPayInfo(transactionID)
|
||||||
|
if SDKPayMgr.getIosPayInfo then
|
||||||
|
return SDKPayMgr:getIosPayInfo(transactionID)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SDKManager:delIosPayInfo(transactionID)
|
||||||
|
if SDKPayMgr.delIosPayInfo then
|
||||||
|
return SDKPayMgr:delIosPayInfo(transactionID)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- 支付相关接口 ********************************************************************** 结束
|
-- 支付相关接口 ********************************************************************** 结束
|
||||||
|
|
||||||
-- 获取设备语言
|
-- 获取设备语言
|
||||||
|
|||||||
@ -45,7 +45,7 @@ function SDKPayDefaultManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
callback("", orderId)
|
callback("", orderId)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -125,7 +125,10 @@ function SDKPayGoogleManager:reqPayReward(uncompleteList, productId, callback)
|
|||||||
elseif uncompleteOrder.purchaseToken then
|
elseif uncompleteOrder.purchaseToken then
|
||||||
-- 去服务器验证
|
-- 去服务器验证
|
||||||
if uncompleteOrder.obfuscatedAccountId then
|
if uncompleteOrder.obfuscatedAccountId then
|
||||||
PayManager:requestRewards(uncompleteOrder.purchaseToken, uncompleteOrder.obfuscatedAccountId, uncompleteOrder.orderId, true)
|
PayManager:requestRewards(uncompleteOrder.purchaseToken, uncompleteOrder.obfuscatedAccountId, uncompleteOrder.orderId, true, function()
|
||||||
|
index = index + 1
|
||||||
|
handleOrder(uncompleteList[index])
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
SDKManager:consumePurchase(uncompleteOrder.purchaseToken, function()
|
SDKManager:consumePurchase(uncompleteOrder.purchaseToken, function()
|
||||||
index = index + 1
|
index = index + 1
|
||||||
@ -313,8 +316,8 @@ function SDKPayGoogleManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
self:doGooglePay(productId, orderId, rechargeId, giftType, giftId, callback)
|
self:doGooglePay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 连接Google商店
|
-- 连接Google商店
|
||||||
@ -326,7 +329,7 @@ function SDKPayGoogleManager:connectGoogleStore(callback)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
local payType = PAY_TYPE_IN_APP
|
local payType = PAY_TYPE_IN_APP
|
||||||
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
|
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
|
||||||
if rechargeCfg.subscribe then
|
if rechargeCfg.subscribe then
|
||||||
|
|||||||
@ -26,39 +26,44 @@ function SDKPayiOSManager:initPay(callback)
|
|||||||
|
|
||||||
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
||||||
if isSuccess then
|
if isSuccess then
|
||||||
-- if self.handleUncompleteIosOrder then
|
if self.handleUncompleteIosOrder then
|
||||||
-- local payParams = self.iosPayInfos[result.transactionID]
|
local payParams = self.iosPayInfos[result.transactionID]
|
||||||
-- local needConsumePurchase = true
|
local needConsumePurchase = true
|
||||||
-- if payParams ~= nil and payParams.order then
|
if payParams ~= nil and payParams.order then
|
||||||
-- PayManager:requestRewards(result.receipt, payParams.order)
|
PayManager:requestRewards(result.receipt, payParams.order, result.transactionID)
|
||||||
-- needConsumePurchase = false
|
needConsumePurchase = false
|
||||||
-- end
|
end
|
||||||
-- if needConsumePurchase then
|
if needConsumePurchase then
|
||||||
-- self:delIosPayInfo(result.transactionID)
|
self:delIosPayInfo(result.transactionID)
|
||||||
-- self:delIosOrder(result.definition.id)
|
self:delIosOrder(result.definition.id)
|
||||||
-- self:consumePurchase(result.definition.id)
|
self:consumePurchase(result.definition.id)
|
||||||
-- BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "error order")
|
local arr = string.split(payParams.order, "|")
|
||||||
-- end
|
local giftId = tonumber(arr[2])
|
||||||
-- else
|
local purchaseType = tonumber(arr[1])
|
||||||
-- -- 回调时机太早的话,就先保存起来,等后续补单的时候一起补
|
local giftType = PayManager:getGiftType(purchaseType, giftId)
|
||||||
-- local order = self.iosOrders[result.definition.id]
|
local rechargeId = PayManager:getPackageRechargeId(purchaseType, giftId)
|
||||||
-- if order then
|
BIReport:postPayFailed(result.definition.id, result.transactionID, rechargeId, "error order", giftType, giftId)
|
||||||
-- self:saveIosPayInfo(result.transactionID, result.receipt, order, result.definition.id)
|
end
|
||||||
-- self:delIosOrder(result.definition.id)
|
|
||||||
-- else
|
|
||||||
-- -- 之前没有记录只能算掉单了
|
|
||||||
-- self:delIosPayInfo(result.transactionID)
|
|
||||||
-- self:delIosOrder(result.definition.id)
|
|
||||||
-- self:consumePurchase(result.definition.id)
|
|
||||||
-- BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "not have order")
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
else
|
else
|
||||||
-- if errorStr and errorStr ~= "" then
|
-- 回调时机太早的话,就先保存起来,等后续补单的时候一起补
|
||||||
-- BIReport:postPayFailed(result.definition.id, result.transactionID, nil, errorStr)
|
local order = self.iosOrders[result.definition.id]
|
||||||
-- else
|
if order then
|
||||||
-- BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "1")
|
self:saveIosPayInfo(result.transactionID, result.receipt, order, result.definition.id)
|
||||||
-- end
|
self:delIosOrder(result.definition.id)
|
||||||
|
else
|
||||||
|
-- 之前没有记录只能算掉单了
|
||||||
|
self:delIosPayInfo(result.transactionID)
|
||||||
|
self:delIosOrder(result.definition.id)
|
||||||
|
self:consumePurchase(result.definition.id)
|
||||||
|
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "not have order")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if errorStr and errorStr ~= "" then
|
||||||
|
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, errorStr)
|
||||||
|
else
|
||||||
|
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "1")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -110,7 +115,10 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId)
|
|||||||
end
|
end
|
||||||
-- 去服务器验证
|
-- 去服务器验证
|
||||||
if uncompleteOrder.order then
|
if uncompleteOrder.order then
|
||||||
PayManager:requestRewards(uncompleteOrder.receipt, uncompleteOrder.order)
|
PayManager:requestRewards(uncompleteOrder.receipt, uncompleteOrder.order, uncompleteOrder.transactionID, true, function()
|
||||||
|
index = index + 1
|
||||||
|
handleOrder(uncompleteList[index])
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
SDKManager:delIosPayInfo(uncompleteOrder.transactionID)
|
SDKManager:delIosPayInfo(uncompleteOrder.transactionID)
|
||||||
SDKManager:delIosOrder(uncompleteOrder.productId)
|
SDKManager:delIosOrder(uncompleteOrder.productId)
|
||||||
@ -227,8 +235,8 @@ function SDKPayiOSManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
self:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
self:doIosPay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sdk将已完成的订单消耗掉
|
-- sdk将已完成的订单消耗掉
|
||||||
@ -239,20 +247,20 @@ function SDKPayiOSManager:consumePurchase(token, callback)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
|
||||||
self.blockTouch = true
|
self.blockTouch = true
|
||||||
UIManager:showWaitNet()
|
UIManager:showWaitPay()
|
||||||
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
||||||
if self.blockTouch then
|
if self.blockTouch then
|
||||||
self.blockTouch = false
|
self.blockTouch = false
|
||||||
UIManager:hideWaitNet()
|
UIManager:hideWaitPay()
|
||||||
end
|
end
|
||||||
if isSuccess then
|
if isSuccess then
|
||||||
Logger.log("ios pay availableToPurchase = %s", result.availableToPurchase)
|
Logger.log("ios pay availableToPurchase = %s", result.availableToPurchase)
|
||||||
Logger.log("ios pay transactionID = %s", result.transactionID)
|
Logger.log("ios pay transactionID = %s", result.transactionID)
|
||||||
Logger.log("ios pay hasReceipt = %s", result.hasReceipt)
|
Logger.log("ios pay hasReceipt = %s", result.hasReceipt)
|
||||||
Logger.log("ios pay receipt = %s", result.receipt)
|
Logger.log("ios pay receipt = %s", result.receipt)
|
||||||
self:saveIosPayInfo(result.transactionID, result.receipt, orderId, productId)
|
self:saveIosPayInfo(result.transactionID, result.receipt, purchaseType .. "|" .. giftId, productId)
|
||||||
if callback then
|
if callback then
|
||||||
callback(result.receipt, orderId, result.transactionID)
|
callback(result.receipt, orderId, result.transactionID)
|
||||||
end
|
end
|
||||||
@ -265,7 +273,7 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, gif
|
|||||||
end
|
end
|
||||||
self:delIosOrder(productId)
|
self:delIosOrder(productId)
|
||||||
end
|
end
|
||||||
self:saveIosOrder(productId, orderId)
|
self:saveIosOrder(productId, purchaseType .. "|" .. giftId)
|
||||||
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Buy(productId, orderId)
|
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Buy(productId, orderId)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -301,6 +309,16 @@ function SDKPayiOSManager:saveIosPayInfo(transactionID, receipt, order, productI
|
|||||||
LocalData:save()
|
LocalData:save()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SDKPayiOSManager:delIosPayInfo(transactionID)
|
||||||
|
self.iosPayInfos[transactionID] = nil
|
||||||
|
LocalData:setIosPayInfo(self.iosPayInfos)
|
||||||
|
LocalData:save()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SDKPayiOSManager:getIosPayInfo(transactionID)
|
||||||
|
return self.iosPayInfos[transactionID]
|
||||||
|
end
|
||||||
|
|
||||||
function SDKPayiOSManager:saveIosOrder(productId, order)
|
function SDKPayiOSManager:saveIosOrder(productId, order)
|
||||||
self.iosOrders[productId] = order
|
self.iosOrders[productId] = order
|
||||||
LocalData:setIosOrders(self.iosOrders)
|
LocalData:setIosOrders(self.iosOrders)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
local recharge = {
|
local recharge = {
|
||||||
[1]={
|
[1]={
|
||||||
["payId"]="com.knight.connect.rpg.0.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.0.99dollar",
|
||||||
["price"]=0.99,
|
["price"]=0.99,
|
||||||
["price_cn"]=6,
|
["price_cn"]=6,
|
||||||
["same_price"]=1,
|
["same_price"]=1,
|
||||||
@ -8,7 +8,7 @@ local recharge = {
|
|||||||
["score"]=1
|
["score"]=1
|
||||||
},
|
},
|
||||||
[2]={
|
[2]={
|
||||||
["payId"]="com.knight.connect.rpg.1.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.1.99dollar",
|
||||||
["price"]=1.99,
|
["price"]=1.99,
|
||||||
["price_cn"]=12,
|
["price_cn"]=12,
|
||||||
["same_price"]=2,
|
["same_price"]=2,
|
||||||
@ -16,7 +16,7 @@ local recharge = {
|
|||||||
["score"]=2
|
["score"]=2
|
||||||
},
|
},
|
||||||
[3]={
|
[3]={
|
||||||
["payId"]="com.knight.connect.rpg.2.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.2.99dollar",
|
||||||
["price"]=2.99,
|
["price"]=2.99,
|
||||||
["price_cn"]=18,
|
["price_cn"]=18,
|
||||||
["same_price"]=3,
|
["same_price"]=3,
|
||||||
@ -24,7 +24,7 @@ local recharge = {
|
|||||||
["score"]=3
|
["score"]=3
|
||||||
},
|
},
|
||||||
[4]={
|
[4]={
|
||||||
["payId"]="com.knight.connect.rpg.3.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.3.99dollar",
|
||||||
["price"]=3.99,
|
["price"]=3.99,
|
||||||
["price_cn"]=24,
|
["price_cn"]=24,
|
||||||
["same_price"]=4,
|
["same_price"]=4,
|
||||||
@ -32,7 +32,7 @@ local recharge = {
|
|||||||
["score"]=4
|
["score"]=4
|
||||||
},
|
},
|
||||||
[5]={
|
[5]={
|
||||||
["payId"]="com.knight.connect.rpg.4.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.4.99dollar",
|
||||||
["price"]=4.99,
|
["price"]=4.99,
|
||||||
["price_cn"]=30,
|
["price_cn"]=30,
|
||||||
["same_price"]=5,
|
["same_price"]=5,
|
||||||
@ -40,7 +40,7 @@ local recharge = {
|
|||||||
["score"]=5
|
["score"]=5
|
||||||
},
|
},
|
||||||
[6]={
|
[6]={
|
||||||
["payId"]="com.knight.connect.rpg.5.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.5.99dollar",
|
||||||
["price"]=5.99,
|
["price"]=5.99,
|
||||||
["price_cn"]=38,
|
["price_cn"]=38,
|
||||||
["same_price"]=6,
|
["same_price"]=6,
|
||||||
@ -48,7 +48,7 @@ local recharge = {
|
|||||||
["score"]=6
|
["score"]=6
|
||||||
},
|
},
|
||||||
[7]={
|
[7]={
|
||||||
["payId"]="com.knight.connect.rpg.6.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.6.99dollar",
|
||||||
["price"]=6.99,
|
["price"]=6.99,
|
||||||
["price_cn"]=45,
|
["price_cn"]=45,
|
||||||
["same_price"]=7,
|
["same_price"]=7,
|
||||||
@ -56,7 +56,7 @@ local recharge = {
|
|||||||
["score"]=7
|
["score"]=7
|
||||||
},
|
},
|
||||||
[8]={
|
[8]={
|
||||||
["payId"]="com.knight.connect.rpg.7.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.7.99dollar",
|
||||||
["price"]=7.99,
|
["price"]=7.99,
|
||||||
["price_cn"]=52,
|
["price_cn"]=52,
|
||||||
["same_price"]=8,
|
["same_price"]=8,
|
||||||
@ -64,7 +64,7 @@ local recharge = {
|
|||||||
["score"]=8
|
["score"]=8
|
||||||
},
|
},
|
||||||
[9]={
|
[9]={
|
||||||
["payId"]="com.knight.connect.rpg.8.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.8.99dollar",
|
||||||
["price"]=8.99,
|
["price"]=8.99,
|
||||||
["price_cn"]=60,
|
["price_cn"]=60,
|
||||||
["same_price"]=9,
|
["same_price"]=9,
|
||||||
@ -72,7 +72,7 @@ local recharge = {
|
|||||||
["score"]=9
|
["score"]=9
|
||||||
},
|
},
|
||||||
[10]={
|
[10]={
|
||||||
["payId"]="com.knight.connect.rpg.9.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.9.99dollar",
|
||||||
["price"]=9.99,
|
["price"]=9.99,
|
||||||
["price_cn"]=68,
|
["price_cn"]=68,
|
||||||
["same_price"]=10,
|
["same_price"]=10,
|
||||||
@ -80,7 +80,7 @@ local recharge = {
|
|||||||
["score"]=10
|
["score"]=10
|
||||||
},
|
},
|
||||||
[11]={
|
[11]={
|
||||||
["payId"]="com.knight.connect.rpg.11.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.11.99dollar",
|
||||||
["price"]=11.99,
|
["price"]=11.99,
|
||||||
["price_cn"]=78,
|
["price_cn"]=78,
|
||||||
["same_price"]=12,
|
["same_price"]=12,
|
||||||
@ -88,7 +88,7 @@ local recharge = {
|
|||||||
["score"]=12
|
["score"]=12
|
||||||
},
|
},
|
||||||
[12]={
|
[12]={
|
||||||
["payId"]="com.knight.connect.rpg.14.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.14.99dollar",
|
||||||
["price"]=14.99,
|
["price"]=14.99,
|
||||||
["price_cn"]=98,
|
["price_cn"]=98,
|
||||||
["same_price"]=15,
|
["same_price"]=15,
|
||||||
@ -96,7 +96,7 @@ local recharge = {
|
|||||||
["score"]=15
|
["score"]=15
|
||||||
},
|
},
|
||||||
[13]={
|
[13]={
|
||||||
["payId"]="com.knight.connect.rpg.19.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.19.99dollar",
|
||||||
["price"]=19.99,
|
["price"]=19.99,
|
||||||
["price_cn"]=128,
|
["price_cn"]=128,
|
||||||
["same_price"]=20,
|
["same_price"]=20,
|
||||||
@ -104,7 +104,7 @@ local recharge = {
|
|||||||
["score"]=20
|
["score"]=20
|
||||||
},
|
},
|
||||||
[14]={
|
[14]={
|
||||||
["payId"]="com.knight.connect.rpg.24.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.24.99dollar",
|
||||||
["price"]=24.99,
|
["price"]=24.99,
|
||||||
["price_cn"]=168,
|
["price_cn"]=168,
|
||||||
["same_price"]=25,
|
["same_price"]=25,
|
||||||
@ -112,7 +112,7 @@ local recharge = {
|
|||||||
["score"]=25
|
["score"]=25
|
||||||
},
|
},
|
||||||
[15]={
|
[15]={
|
||||||
["payId"]="com.knight.connect.rpg.29.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.29.99dollar",
|
||||||
["price"]=29.99,
|
["price"]=29.99,
|
||||||
["price_cn"]=198,
|
["price_cn"]=198,
|
||||||
["same_price"]=30,
|
["same_price"]=30,
|
||||||
@ -120,7 +120,7 @@ local recharge = {
|
|||||||
["score"]=30
|
["score"]=30
|
||||||
},
|
},
|
||||||
[16]={
|
[16]={
|
||||||
["payId"]="com.knight.connect.rpg.49.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.49.99dollar",
|
||||||
["price"]=49.99,
|
["price"]=49.99,
|
||||||
["price_cn"]=328,
|
["price_cn"]=328,
|
||||||
["same_price"]=50,
|
["same_price"]=50,
|
||||||
@ -128,7 +128,7 @@ local recharge = {
|
|||||||
["score"]=50
|
["score"]=50
|
||||||
},
|
},
|
||||||
[17]={
|
[17]={
|
||||||
["payId"]="com.knight.connect.rpg.69.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.69.99dollar",
|
||||||
["price"]=69.99,
|
["price"]=69.99,
|
||||||
["price_cn"]=448,
|
["price_cn"]=448,
|
||||||
["same_price"]=70,
|
["same_price"]=70,
|
||||||
@ -136,7 +136,7 @@ local recharge = {
|
|||||||
["score"]=70
|
["score"]=70
|
||||||
},
|
},
|
||||||
[18]={
|
[18]={
|
||||||
["payId"]="com.knight.connect.rpg.99.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.99.99dollar",
|
||||||
["price"]=99.99,
|
["price"]=99.99,
|
||||||
["price_cn"]=648,
|
["price_cn"]=648,
|
||||||
["same_price"]=100,
|
["same_price"]=100,
|
||||||
@ -144,7 +144,7 @@ local recharge = {
|
|||||||
["score"]=100
|
["score"]=100
|
||||||
},
|
},
|
||||||
[19]={
|
[19]={
|
||||||
["payId"]="com.knight.connect.rpg.199.99dollar",
|
["payId"]="com.combo.heroes.puzzle.rpg.199.99dollar",
|
||||||
["price"]=199.99,
|
["price"]=199.99,
|
||||||
["price_cn"]=1298,
|
["price_cn"]=1298,
|
||||||
["same_price"]=200,
|
["same_price"]=200,
|
||||||
|
|||||||
@ -265,7 +265,8 @@ GConst.DOTWEEN_IDS = {
|
|||||||
WAIT_NET = 4,
|
WAIT_NET = 4,
|
||||||
TUTORIAL = 5,
|
TUTORIAL = 5,
|
||||||
TASK_TOAST = 6,
|
TASK_TOAST = 6,
|
||||||
BATTLE_UI = 7
|
BATTLE_UI = 7,
|
||||||
|
WAIT_PAY = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
GConst.MESSAGE_BOX_TYPE = {
|
GConst.MESSAGE_BOX_TYPE = {
|
||||||
|
|||||||
@ -23,7 +23,6 @@ end
|
|||||||
---- 登录界面资源加载完毕后调用
|
---- 登录界面资源加载完毕后调用
|
||||||
function LoginManager:loginGame()
|
function LoginManager:loginGame()
|
||||||
-- adjust 打开应用事件识别码
|
-- adjust 打开应用事件识别码
|
||||||
BIReport:postAdjustSimpleTrackEvent("xbszrl", {})
|
|
||||||
ModuleManager.MaincityManager:firstEnterMainCity()
|
ModuleManager.MaincityManager:firstEnterMainCity()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -708,7 +708,7 @@ function NetManager:onReceive(msgId, data)
|
|||||||
if NOT_PUBLISH then
|
if NOT_PUBLISH then
|
||||||
Logger.printTable(responseData)
|
Logger.printTable(responseData)
|
||||||
end
|
end
|
||||||
if pbData.rewards then
|
if pbData.err_code == GConst.ERROR_STR.SUCCESS and pbData.rewards then
|
||||||
local getType = receiveCallback.getType
|
local getType = receiveCallback.getType
|
||||||
if sendMsgName == "ActPayReq" then
|
if sendMsgName == "ActPayReq" then
|
||||||
getType = PayManager:getItemGetType(pbData.act_type, pbData.id)
|
getType = PayManager:getItemGetType(pbData.act_type, pbData.id)
|
||||||
@ -719,6 +719,13 @@ function NetManager:onReceive(msgId, data)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elseif sendMsgName == "AppStorePaidReq" then -- ios支付上报统一处理
|
||||||
|
if pbData.gift then
|
||||||
|
for _, gift in ipairs(pbData.gift) do
|
||||||
|
getType = PayManager:getItemGetType(gift.act_type, gift.id)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if EDITOR_MODE and not getType then
|
if EDITOR_MODE and not getType then
|
||||||
@ -727,7 +734,7 @@ function NetManager:onReceive(msgId, data)
|
|||||||
|
|
||||||
GFunc.addRewards(pbData.rewards, getType)
|
GFunc.addRewards(pbData.rewards, getType)
|
||||||
end
|
end
|
||||||
if pbData.costs and not self:getNotAddCostsRsp(msgName) then
|
if pbData.err_code == GConst.ERROR_STR.SUCCESS and pbData.costs and not self:getNotAddCostsRsp(msgName) then
|
||||||
local getType = receiveCallback.getType
|
local getType = receiveCallback.getType
|
||||||
if sendMsgName == "ActPayReq" then
|
if sendMsgName == "ActPayReq" then
|
||||||
getType = PayManager:getItemGetType(pbData.mall_type, pbData.id)
|
getType = PayManager:getItemGetType(pbData.mall_type, pbData.id)
|
||||||
|
|||||||
@ -753,6 +753,33 @@ function UIManager:getUICameraComponent()
|
|||||||
return self.uiCamera:getComponent(GConst.TYPEOF_UNITY_CLASS.CAMERA)
|
return self.uiCamera:getComponent(GConst.TYPEOF_UNITY_CLASS.CAMERA)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UIManager:showWaitPay()
|
||||||
|
if self.waitNetCount == 0 then
|
||||||
|
if self.waitPaySeq == nil then
|
||||||
|
local seq = DOTweenManager:createSeqWithIntId(GConst.DOTWEEN_IDS.WAIT_PAY)
|
||||||
|
seq:SetAutoKill(false)
|
||||||
|
seq:AppendInterval(1)
|
||||||
|
seq:AppendCallback(function()
|
||||||
|
self.netCanvas:setActive(true)
|
||||||
|
end)
|
||||||
|
self.waitPaySeq = seq
|
||||||
|
elseif not self.waitPaySeq:IsPlaying() then
|
||||||
|
self.waitPaySeq:Restart()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.waitNetCount = self.waitNetCount + 1
|
||||||
|
self:disableTouch()
|
||||||
|
end
|
||||||
|
|
||||||
|
function UIManager:hideWaitPay()
|
||||||
|
self:hideWaitNet()
|
||||||
|
if self.waitNetCount <= 0 then
|
||||||
|
if self.waitPaySeq then
|
||||||
|
self.waitPaySeq:Pause()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function UIManager:showWaitNet(forceRestart)
|
function UIManager:showWaitNet(forceRestart)
|
||||||
if self.waitNetCount == 0 or forceRestart then
|
if self.waitNetCount == 0 or forceRestart then
|
||||||
if self.waitNetSeq == nil then
|
if self.waitNetSeq == nil then
|
||||||
@ -1190,7 +1217,8 @@ if NOT_PUBLISH then
|
|||||||
[BaseUI.disableUITouch] = true,
|
[BaseUI.disableUITouch] = true,
|
||||||
[BaseScene.disableTouch] = true,
|
[BaseScene.disableTouch] = true,
|
||||||
[UIManager.showLoading] = true,
|
[UIManager.showLoading] = true,
|
||||||
[UIManager.showWaitNet] = true
|
[UIManager.showWaitNet] = true,
|
||||||
|
[UIManager.showWaitPay] = true
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local currFunc = debug.getinfo(2, "f").func
|
local currFunc = debug.getinfo(2, "f").func
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user