From 1965f6135bb8ebd56258c532322697c24a8f436c Mon Sep 17 00:00:00 2001 From: "DESKTOP-RH64908\\Administrator" <1545929779@qq.com> Date: Thu, 19 Dec 2024 20:35:44 +0800 Subject: [PATCH] 1 --- .../~Lua/Modules/Operating/GMChangePanel.lua | 2 +- .../~Lua/Modules/Pay/PayManager.lua | 21 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Operating/GMChangePanel.lua b/Assets/ManagedResources/~Lua/Modules/Operating/GMChangePanel.lua index 5acec7d231..5943d56652 100644 --- a/Assets/ManagedResources/~Lua/Modules/Operating/GMChangePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Operating/GMChangePanel.lua @@ -94,7 +94,7 @@ end function GMChangePanel:ShowTopInfo() local num=BagManager.GetItemCountById(1367) - this.info.text="使用1元直充卡可增加余额今日还可存入" + --this.info.text="使用1元直充卡可增加余额今日还可存入" local allTimes = PrivilegeManager.GetPrivilegeNumber(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME) local useTime=PrivilegeManager.GetPrivilegeUsedTimes(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME) local leftTimes = PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME) diff --git a/Assets/ManagedResources/~Lua/Modules/Pay/PayManager.lua b/Assets/ManagedResources/~Lua/Modules/Pay/PayManager.lua index 2eae953a57..cf11114acf 100644 --- a/Assets/ManagedResources/~Lua/Modules/Pay/PayManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Pay/PayManager.lua @@ -66,21 +66,12 @@ function this.Pay(id, func) local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, id) if rechargeConfig.OtherBuy1 then local yhqNum = BagManager.GetItemCountById(1342) - local useTime = PrivilegeManager.GetPrivilegeUsedTimes(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME) - local missions = ActivityGiftManager.GetActivityInfoByType(ActivityTypeDef.shuaChongTeQuan).mission - local index = 1 - if missions then - for i = 1, #missions do - if missions[i].state ~= 0 then - index = i - end - end - end - local privile = ConfigManager.GetConfigData(ConfigName.PrivilegeTypeConfig, 2101) - local maxnum = privile.Condition[index][2] - if yhqNum >= rechargeConfig.Price and rechargeConfig.Price > 0 and (maxnum - useTime) >= rechargeConfig.Price then + local leftTimes = PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME) + if yhqNum >= rechargeConfig.Price and rechargeConfig.Price > 0 and leftTimes >= rechargeConfig.Price then local sureFunc = function() - NetManager.SendYHQBuyGoodRequest(id, 1) + NetManager.SendYHQBuyGoodRequest(id, 1,function() + PrivilegeManager.SetPrivilegeUsedTimes(PRIVILEGE_TYPE.GM_YI_YUAN_UP_TIME,rechargeConfig.Price) + end) end local cancelFunc = function() if AppConst.isSDKLogin and rechargeConfig.Price > 0 then @@ -93,7 +84,7 @@ function this.Pay(id, func) end local args = {} args[1] = "该礼包可通过消耗现金券获得,是否继续充值" .. - "\n现金券剩余:" .. yhqNum .. "\n可用余额" .. (maxnum - useTime) + "\n现金券剩余:" .. yhqNum .. "\n可用余额" .. leftTimes args[2] = "现金券购买" args[3] = "直接充值" args[4] = sureFunc