lcy
6 天以前 f36e315c3074ebd2ce2147b6b380d038d81517e8
Main/SDK/SDKUtils.cs
@@ -939,49 +939,51 @@
    /// 
    public void FreePlatformPay(string title, float money, string cpInfo)
    {
        // 提示是否使用代金券
        var gameCash = UIHelper.GetAllVourcher();
        bool isBuyGameCash = false; //代金券本身的充值不能用代金券购买 造成循环
        // 代金券/现金礼券本身的充值不能使用代金券购买 造成循环
        bool isBuyGameCash = false;
        int ctgID = RechargeManager.Instance.orderInfoToCTGID[cpInfo];
        if (ctgID != 0)
        {
            isBuyGameCash = CTGConfig.Get(ctgID).PayType == 17;
            var payType = CTGConfig.Get(ctgID).PayType;
            isBuyGameCash = (payType == 17 || payType == 27);
        }
        if (!isBuyGameCash && gameCash >= money * 100)
        if (isBuyGameCash)
        {
            FreePlatformPayEx(title, money, cpInfo);
            return;
        }
        long needMoney = (long)(money * 100);  // money是元,needMoney是分
        long cashVoucher = UIHelper.GetMoneyCnt(97);
        long diamond = UIHelper.GetMoneyCnt(99);
        bool hasEnoughVoucher = cashVoucher >= needMoney;
        bool hasEnoughDiamond = diamond >= needMoney;
        if (hasEnoughVoucher || hasEnoughDiamond)
        {
            // 弹出支付方式选择框(现金礼券/玄玉二选一)
            UIManager.Instance.CloseWindow<GotoChargeWin>();
            if (DayRemind.Instance.GetDayRemind(DayRemind.DJQTip))
            {
                var pack = new CA125_tagCMCoinBuyOrderInfo();
                pack.AppID = VersionConfig.Get().appId;
                pack.AppIDLen = (byte)pack.AppID.Length;
                pack.OrderInfo = cpInfo;
                pack.OrderInfoLen = (byte)pack.OrderInfo.Length;
                GameNetSystem.Instance.SendInfo(pack);
            }
            else
            {
                ConfirmCancel.ShowPopConfirm(
                    Language.Get("Mail101"),
                    Language.Get("GameCashRule1", money, title),
                    (bool isOk) =>
            int defaultMoneyType = hasEnoughVoucher ? 97 : 99;
            ConfirmCancel.ShowPayMethodConfirm(
                97, (int)needMoney, Language.Get("Recharge8"),     // 现金礼券
                99, (int)needMoney, Language.Get("Recharge7"),     // 玄玉
                Language.Get("Recharge6", UIHelper.GetIconNameWithMoneyType(defaultMoneyType), money, title),
                money, title,
                (bool isOk, int selectedMoneyType) =>
                {
                    if (isOk)
                    {
                        if (isOk)
                        {
                            var pack = new CA125_tagCMCoinBuyOrderInfo();
                            pack.AppID = VersionConfig.Get().appId;
                            pack.AppIDLen = (byte)pack.AppID.Length;
                            pack.OrderInfo = cpInfo;
                            pack.OrderInfoLen = (byte)pack.OrderInfo.Length;
                            GameNetSystem.Instance.SendInfo(pack);
                        }
                    });
            }
                        var pack = new CA125_tagCMCoinBuyOrderInfo();
                        pack.AppID = VersionConfig.Get().appId;
                        pack.AppIDLen = (byte)pack.AppID.Length;
                        pack.OrderInfo = cpInfo;
                        pack.OrderInfoLen = (byte)pack.OrderInfo.Length;
                        pack.UseMoneyType = (byte)selectedMoneyType;
                        GameNetSystem.Instance.SendInfo(pack);
                    }
                });
        }
        else
        {
@@ -1293,7 +1295,7 @@
            SendGaoreEvent(dataType, pageType, pageName, pageItemId, money, orderID);
            return;
        }
        else if (appID == "sghy")
        else if (appID == "sghy" && dataType == 7)
        {
            SendOverSeaTraceEvent("tutorial_complete");
        }