コード例 #1
0
        public void init(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils, Action <XsollaManagerSubDetails> pLinkAction)
        {
            mUtils          = pUtils;
            mSubDetail      = pSubDetail;
            mPartTitle.text = pUtils.GetTranslations().Get("user_subscription_payment_title");

            if (pSubDetail.mPaymentMethodType != "notify" && pSubDetail.mPaymentMethodName != "")
            {
                mUnLinkBtn.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_unlink_payment_account");
            }
            else
            {
                mUnLinkBtn.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_add");
            }
            getUnlinkBtn().onClick.AddListener(() => pLinkAction(pSubDetail));

            // добавляем поля датализации
            List <LabelValue> listFileds = getImportDetails();

            foreach (LabelValue item in listFileds)
            {
                GameObject           obj        = Instantiate(Resources.Load(mLabeltextPrefab)) as GameObject;
                LabelValueController controller = obj.GetComponent <LabelValueController>();
                controller.init(item.label, item.value, item.actionLabel, item.action);
                obj.transform.SetParent(mDetailsContainer.transform);
            }
        }
コード例 #2
0
        public void initScreen(XsollaManagerSubDetails pSubDetail, XsollaUtils pUtils)
        {
            mUtils             = pUtils;
            mSubDetail         = pSubDetail;
            mPartTitle.text    = pUtils.GetTranslations().Get("user_subscription_details_title");
            mBtnRenewName.text = pUtils.GetTranslations().Get("user_subscription_renew");

            mLinkUnhold.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_unhold");
            //mLinkHoldCancel.GetComponent<Text>().text = pUtils.GetTranslations().Get("user_subscription_hold");
            mLinkHoldCancel.GetComponent <Text>().text = pUtils.GetTranslations().Get("hold_subscription_cancel_label");            // TODO вернуть обратно при реализации заморозки
            mLinkChangePlan.GetComponent <Text>().text = pUtils.GetTranslations().Get("user_subscription_change_plan");

            // кнопка обновления
            mBtnRenew.gameObject.SetActive(mSubDetail.mIsRenewPossible);
            // Unhold
            mLinkUnhold.SetActive(mSubDetail.mStatus == "freeze");
            // Hold or Cancel
            mLinkHoldCancel.SetActive((mSubDetail.mIsHoldPossible || mSubDetail.mStatus != "non_renewing") && (mSubDetail.mStatus != "freeze"));
            // TODO реализуем в последующих итерациях
            // Change Plan
            //mLinkChangePlan.SetActive(mSubDetail.mIsChangePlanAllowed);
            mLinkChangePlan.SetActive(false);

            // добавляем поля датализации
            List <LabelValue> listFileds = getImportDetails();

            foreach (LabelValue item in listFileds)
            {
                GameObject           obj        = Instantiate(Resources.Load(mLabeltextPrefab)) as GameObject;
                LabelValueController controller = obj.GetComponent <LabelValueController>();
                controller.init(item.label, item.value, item.actionLabel, item.action);
                obj.transform.SetParent(mDetailsContainer.transform);
            }
        }