public void InitPrize()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;
        int             totalYB = payData.MonthCardYBTotal;

        if (totalYB == 0)
        {
            m_ProcessBar.value = 0;
        }
        else
        {
            m_ProcessBar.value = (float)totalYB / (30 * 50);
        }
        m_TotalYBLabel.text = StrDictionary.GetClientDictionaryString("#{5104}", totalYB);

        if (payData.IsMonthCardFlag() == true &&        //已经触发月卡
            payData.IsMonthCardOver() == false &&       //月卡未领取结束
            payData.IsMonthCardTodayFlag() == false)    //今日未领取月卡
        {
            m_GetButton.isEnabled = true;
            m_RemainTips.gameObject.SetActive(true);
        }
        else
        {
            m_GetButton.isEnabled = false;
            m_RemainTips.gameObject.SetActive(false);
        }

        if (ChargeActivityLogic.Instance() != null)
        {
            ChargeActivityLogic.Instance().UpdateRemainTips();
        }
    }
Example #2
0
    public void UpdateRechargeList()
    {
        GCGame.Utils.CleanGrid(m_TransRechargeGrid.gameObject);

        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (null == mainPlayer)
        {
            LogModule.ErrorLog("main player is not init");
            return;
        }

        for (int i = 0; i < TableManager.GetRecharge().Count; i++)
        {
            Tab_Recharge curTabRecharge = TableManager.GetRechargeByID(i, 0);
            if (null == curTabRecharge)
            {
                continue;
            }

            if (!RechargeData.m_dicGoodInfos.ContainsKey(curTabRecharge.RegisterID))
            {
                continue;
            }

            RechargeData.GoodInfo curGoodInfo = RechargeData.m_dicGoodInfos[curTabRecharge.RegisterID];

            string          iconName     = "";
            string          goodName     = curGoodInfo.goods_number + "#y";
            bool            bEnableTimes = false;
            PayActivityData payData      = GameManager.gameManager.PlayerDataPool.PayActivity;
            if (curTabRecharge.Type == 1 && payData.IsMonthCardFlag())
            {
                // 月卡并且已经生效
                // TT9809 月卡也显示
                //continue;
            }
            if (curTabRecharge.Type == 2 && (payData.IsGrowUpFlag() || mainPlayer.BaseAttr.Level >= payData.GrowUpLevel))
            {
                // 成长基金并且已经生效或者玩家已经大于50级
                continue;
            }
            else if (curTabRecharge.Type == 3)
            {
                bEnableTimes = true;
            }
            iconName = curTabRecharge.IconName;
            goodName = curTabRecharge.GoodName;

            RechargeItem.CreateItem(m_ObjRechargeItem, m_TransRechargeGrid, curGoodInfo.goods_register_id, iconName, curGoodInfo.goods_price, goodName, curTabRecharge.HotLabelTip, bEnableTimes);
        }

        UIGrid curGrid = m_TransRechargeGrid.GetComponent <UIGrid>();

        if (null != curGrid)
        {
            curGrid.repositionNow = true;
        }
    }
    public static bool IsMonthCardCanGet()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (payData.IsMonthCardFlag() == true &&        //已经触发月卡
            payData.IsMonthCardOver() == false &&       //月卡未领取结束
            payData.IsMonthCardTodayFlag() == false)    //今日未领取月卡
        {
            return(true);
        }
        return(false);
    }
    public void InitPage()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (payData.IsGrowUpFlag())
        {
            m_SubPageHov.gameObject.SetActive(true);
            m_SubPageNor.gameObject.SetActive(false);
            InitPrizeButton();
        }
        else
        {
            m_SubPageHov.gameObject.SetActive(false);
            m_SubPageNor.gameObject.SetActive(true);
        }
    }
    void OnClickGet()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (payData.IsMonthCardFlag() == false)
        {
            return;
        }

        if (payData.IsMonthCardOver() == true)
        {
            return;
        }

        if (payData.IsMonthCardTodayFlag() == true)
        {
            return;
        }
        //发包领奖
        payData.SendMonthCardPacket();
    }
    void InitButton()
    {
        m_ShouChongButton.gameObject.SetActive(false);
        m_ShouZhouButton.gameObject.SetActive(false);
        m_ShouYueButton.gameObject.SetActive(false);
        m_ChengZhangButton.gameObject.SetActive(false);
        m_WishingWellButton.gameObject.SetActive(false);
        m_CostRebateButton.gameObject.SetActive(false);
        m_SpecialTimePayRebateButton.gameObject.SetActive(false);
        m_DayCardButton.gameObject.SetActive(false);

        PayActivityData payData        = GameManager.gameManager.PlayerDataPool.PayActivity;
        int             playerLevel    = GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level;
        TabButton       m_SelectButton = null;

        //首充
        if (payData.IsFirstTimeFlag() == false)
        {
            m_ShouChongButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouChongButton;
            }
        }
        //首周
        if (payData.IsFirstWeekOver() == false && payData.IsFirstTimeFlag() == true)
        {
            m_ShouZhouButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouZhouButton;
            }
        }
        //招财进宝 可重复购买 界面一直有
        {
            m_ShouYueButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_ShouYueButton;
            }
        }
        //成长
        if (payData.IsGrowUpFlag() == true)
        {
            if (payData.IsGrowUpOver() == false)
            {
                m_ChengZhangButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_ChengZhangButton;
                }
            }
        }
        else
        {
            if (playerLevel < payData.GrowUpLevel)
            {
                m_ChengZhangButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_ChengZhangButton;
                }
            }
        }
        //许愿池
        if (GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_WISHING))
        {
            int intime = GameManager.gameManager.PlayerDataPool.WishingWell_InTime;
            if (intime > 0)
            {
                m_WishingWellButton.gameObject.SetActive(true);
                if (m_SelectButton == null)
                {
                    m_SelectButton = m_WishingWellButton;
                }
            }
        }
        //消费返利
        CostRebateData costRebate = GameManager.gameManager.PlayerDataPool.CostRebate;

        if (costRebate.CostRebateOpen == true)
        {
            m_CostRebateButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_CostRebateButton;
            }
        }

        SpecialTimePayRebateData specialPayRebate = GameManager.gameManager.PlayerDataPool.SpecailTimePayRebate;

        if (specialPayRebate.SpecialTimePayRebateOpen == true)
        {
            m_SpecialTimePayRebateButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_SpecialTimePayRebateButton;
            }
        }

        //日卡
        if (payData.DayCardOpen && payData.IsDayCardFlag() == false)
        {
            m_DayCardButton.gameObject.SetActive(true);
            if (m_SelectButton == null)
            {
                m_SelectButton = m_DayCardButton;
            }
        }

        m_ButtonGrid.repositionNow = true;
        if (null != m_SelectButton)
        {
            m_TabController.OnTabClicked(m_SelectButton);
        }

        if (m_ShouZhouButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivitySZ = true;
        }
        if (m_ShouYueButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivitySY = true;
        }
        if (m_ChengZhangButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickChargeActivityCZ = true;
        }
        if (m_WishingWellButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickWishingWell = true;
        }
        if (m_CostRebateButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickCostRebate = true;
        }
        if (m_SpecialTimePayRebateButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickSpecialTimePayRebate = true;
        }
        if (m_DayCardButton.gameObject.activeSelf == false)
        {
            GameManager.gameManager.PlayerDataPool.IsClickDayCard = true;
        }
        UpdateRemainTips();
    }
    public static bool IsGrowUpCanGet()
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        if (Singleton <ObjManager> .GetInstance().MainPlayer == null)
        {
            return(false);
        }
        int playerLevel = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level;

        if (payData.IsGrowUpFlag() == true)
        {
            //40级按钮
            if (payData.IsGrowUp40Flag() == false)
            {
                if (playerLevel >= 40)
                {
                    return(true);
                }
            }
            //50级按钮
            if (payData.IsGrowUp50Flag() == false)
            {
                if (playerLevel >= 50)
                {
                    return(true);
                }
            }
            //60级按钮
            if (payData.IsGrowUp60Flag() == false)
            {
                if (playerLevel >= 60)
                {
                    return(true);
                }
            }
            //70级按钮
            if (payData.IsGrowUp70Flag() == false)
            {
                if (playerLevel >= 70)
                {
                    return(true);
                }
            }
            //80级按钮
            if (payData.IsGrowUp80Flag() == false)
            {
                if (playerLevel >= 80)
                {
                    return(true);
                }
            }
            //90级按钮
            if (payData.IsGrowUp90Flag() == false)
            {
                if (playerLevel >= 90)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
    void OnClickGet(int level)
    {
        PayActivityData payData = GameManager.gameManager.PlayerDataPool.PayActivity;

        payData.SendGrowUpPacket(level);
    }
    void InitPrizeButton()
    {
        PayActivityData payData     = GameManager.gameManager.PlayerDataPool.PayActivity;
        int             playerLevel = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level;

        //40级按钮
        if (payData.IsGrowUp40Flag() == false)
        {
            if (playerLevel >= 40)
            {
                m_GetPrize40.isEnabled = true;
                m_PrizeLabel40.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize40.isEnabled = false;
                m_PrizeLabel40.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize40.isEnabled = false;
            m_PrizeLabel40.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
        //50级按钮
        if (payData.IsGrowUp50Flag() == false)
        {
            if (playerLevel >= 50)
            {
                m_GetPrize50.isEnabled = true;
                m_PrizeLabel50.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize50.isEnabled = false;
                m_PrizeLabel50.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize50.isEnabled = false;
            m_PrizeLabel50.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
        //60级按钮
        if (payData.IsGrowUp60Flag() == false)
        {
            if (playerLevel >= 60)
            {
                m_GetPrize60.isEnabled = true;
                m_PrizeLabel60.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize60.isEnabled = false;
                m_PrizeLabel60.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize60.isEnabled = false;
            m_PrizeLabel60.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
        //70级按钮
        if (payData.IsGrowUp70Flag() == false)
        {
            if (playerLevel >= 70)
            {
                m_GetPrize70.isEnabled = true;
                m_PrizeLabel70.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize70.isEnabled = false;
                m_PrizeLabel70.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize70.isEnabled = false;
            m_PrizeLabel70.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
        //80级按钮
        if (payData.IsGrowUp80Flag() == false)
        {
            if (playerLevel >= 80)
            {
                m_GetPrize80.isEnabled = true;
                m_PrizeLabel80.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize80.isEnabled = false;
                m_PrizeLabel80.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize80.isEnabled = false;
            m_PrizeLabel80.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
        //90级按钮
        if (payData.IsGrowUp90Flag() == false)
        {
            if (playerLevel >= 90)
            {
                m_GetPrize90.isEnabled = true;
                m_PrizeLabel90.text    = StrDictionary.GetClientDictionaryString("#{1378}"); //领取
            }
            else
            {
                m_GetPrize90.isEnabled = false;
                m_PrizeLabel90.text    = StrDictionary.GetClientDictionaryString("#{1379}"); //未领取
            }
        }
        else
        {
            m_GetPrize90.isEnabled = false;
            m_PrizeLabel90.text    = StrDictionary.GetClientDictionaryString("#{1380}"); //已领取
        }
    }
Example #10
0
    // 支付
    public static void MakePay()
    {
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            if (GetChannelType() == ChannelType.IOS_APPSTORE || GetChannelType() == ChannelType.IOS_APPSTORE_TEST)
            {
#if UNITY_IPHONE && !UNITY_EDITOR
                IOSHelper.makePay(string.Format("{0:X16}", PlayerPreferenceData.LastRoleGUID), PlayerPreferenceData.LastServer.ToString());
#endif
                return;
            }
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (GameManager.gameManager == null || GameManager.gameManager.PlayerDataPool == null)
            {
                return;
            }
            PayActivityData payActivityData = GameManager.gameManager.PlayerDataPool.PayActivity;

            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            JsonWriter writer            = new JsonWriter(sb);
            writer.WriteObjectStart();
            writer.WritePropertyName("ROLEID");
            writer.Write(string.Format("{0:X16}", PlayerPreferenceData.LastRoleGUID));
            writer.WritePropertyName("UID");
            writer.Write(LoginData.accountData.m_userID);
            writer.WritePropertyName("SERVERID");
            writer.Write(PlayerPreferenceData.LastServer.ToString());
            writer.WritePropertyName("OID");
            writer.Write(LoginData.accountData.m_oid);
            writer.WritePropertyName("TOKEN");
            writer.Write(LoginData.accountData.m_accessToken);
            writer.WritePropertyName("ROLENAME");
            writer.Write(LoginData.m_sRoleName);
            if (PlatformHelper.IsChannelTW())
            {
                // 成长基金
                writer.WritePropertyName("CZJJ_SHOWFLAG");
                writer.Write(payActivityData.IsGrowUpFlag() == true ? "0" : "1");
                // 招财进宝
                writer.WritePropertyName("ZCJB_SHOWFLAG");
                writer.Write(payActivityData.IsMonthCardFlag() == true ? "0" : "1");
                writer.WritePropertyName("ZCJB_SURPLUSDAY");
                writer.Write(payActivityData.GetMonthCardLeftDay().ToString());
            }
            LoginData.PlayerRoleData curRole = LoginData.GetPlayerRoleData(PlayerPreferenceData.LastRoleGUID);
            if (null != curRole)
            {
                writer.WritePropertyName("ROLELEVEL");
                writer.Write(curRole.level.ToString());
            }
            writer.WriteObjectEnd();

            AndroidHelper.doSdk("doOrder", sb.ToString());
#endif
            return;
        }

        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;
        if (null != mainPlayer)
        {
            mainPlayer.SendNoticMsg(false, "#{2136}");
        }
    }