protected static GlobalUserInfo m_pGlobalUserInfo; //用户信息 //函数定义 //构造函数 private GlobalUserInfo() { m_GlobalUserData = new tagGlobalUserData(); m_IndividualUserData = new tagIndividualUserData(); m_UserInsureInfo = new tagUserInsureInfo(); m_GrowLevelParameter = new tagGrowLevelParameter(); m_SpreadersInfo = new tagSpreadersInfo(); m_ChildrenPaymentInfo = new tagChildrenPaymentInfo(); }
public void OnButtonCashOut() { if (SurrogateMoneyWin == null) { return; } var transTotalMoney = SurrogateMoneyWin.transform.Find("TotalMoney"); if (transTotalMoney != null) { Text textTotalMoney = transTotalMoney.GetComponent <Text>(); if (textTotalMoney != null) { //string strTotalMoney = textTotalMoney.text; //string strPurTotalMoney = strTotalMoney.Replace("可提现金额:",""); //double dTotalMoney = double.Parse(strPurTotalMoney); GameNet.GlobalUserInfo pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance(); GameNet.tagChildrenPaymentInfo pGlobalChildrenPaymentInfo = pGlobalUserInfo.GetChildrenPaymentInfo(); uint dwPayment = (uint)(pGlobalChildrenPaymentInfo.dTotalLeftCash * 100.0);//pGlobalChildrenPaymentInfo.dTotalLeftCash*100.0 单位:分 if (dwPayment > 0) { GameNet.UserInfo.getInstance().AddEnterprisePay(dwPayment); if (CashOutButton != null) { CashOutButton.enabled = false; } } else { ShowLog("提现金额低于最小金额"); } } } }
public void UpdateChildrenPaymentListView() { if (SurrogateMoneyWin == null) { return; } var viewportContent = SurrogateMoneyWin.transform.Find("SurrogateInfo/Viewport/Content"); if (viewportContent == null) { return; } //设置Content的Bottom Vector2 offsetMin = viewportContent.GetComponent <RectTransform>().offsetMin; offsetMin.y = -400.0f; viewportContent.GetComponent <RectTransform>().offsetMin = offsetMin; var Surrogate_1 = viewportContent.Find("Surrogate_1"); if (Surrogate_1 == null) { return; } Surrogate_1.gameObject.SetActive(false); GameNet.GlobalUserInfo pGlobalUserInfo = GameNet.GlobalUserInfo.GetInstance(); GameNet.tagChildrenPaymentInfo pGlobalChildrenPaymentInfo = pGlobalUserInfo.GetChildrenPaymentInfo(); Debug.Log("Surrogate:UpdateChildrenPaymentListView:wItemCount=" + pGlobalChildrenPaymentInfo.wItemCount); //填充数据 float curAnchoredPosY = Surrogate_1.GetComponent <RectTransform>().anchoredPosition.y; float posStep = 50; int nItemNum = pGlobalChildrenPaymentInfo.wItemCount;// *10; if (m_paymentInfoItemObjList.Count < nItemNum) { for (int j = m_paymentInfoItemObjList.Count; j < nItemNum; j++) { var infoItemObj = Instantiate(Surrogate_1.gameObject); infoItemObj.transform.SetParent(viewportContent); infoItemObj.transform.localScale = Surrogate_1.localScale; //infoItemObj.SetActive(false); m_paymentInfoItemObjList.Add(infoItemObj); } } for (int i = 0; i < m_paymentInfoItemObjList.Count; i++) { m_paymentInfoItemObjList[i].SetActive(false); } m_dTotalGrantFromChildrenBuy = 0.0; for (int i = 0; i < nItemNum; i++) { GameNet.PaymentInfoItem paymentInfoItem = pGlobalChildrenPaymentInfo.PaymentInfoItems[i]; GameObject infoItemObj = m_paymentInfoItemObjList[i]; if (infoItemObj == null) { continue; } infoItemObj.SetActive(true); //序号 var numObj = infoItemObj.transform.Find("SurrogateNum"); if (numObj != null) { numObj.GetComponent <Text>().text = Convert.ToString(i + 1); } //姓名 var nameObj = infoItemObj.transform.Find("SurrogateName"); if (nameObj != null) { nameObj.GetComponent <Text>().text = paymentInfoItem.UserId.ToString();; } //操作 var operateObj = infoItemObj.transform.Find("SurrogateOperation"); if (operateObj != null) { operateObj.GetComponent <Text>().text = "充值"; } //当前操作金额 var totalObj = infoItemObj.transform.Find("SurrogateTotal"); if (totalObj != null) { double curTotalGrant = paymentInfoItem.Payment * paymentInfoItem.PaymentGrantRate; m_dTotalGrantFromChildrenBuy += curTotalGrant; totalObj.GetComponent <Text>().text = curTotalGrant.ToString(); } //Set Pos Vector3 anchoredPos = Surrogate_1.GetComponent <RectTransform>().anchoredPosition; anchoredPos.y = curAnchoredPosY; infoItemObj.GetComponent <RectTransform>().anchoredPosition = anchoredPos; curAnchoredPosY -= posStep; //设置Content的Bottom Vector2 offsetMinTmp = viewportContent.GetComponent <RectTransform>().offsetMin; offsetMinTmp.y -= posStep; viewportContent.GetComponent <RectTransform>().offsetMin = offsetMinTmp; } var transTotalMoney = SurrogateMoneyWin.transform.Find("TotalMoney"); if (transTotalMoney != null) { Text textTotalMoney = transTotalMoney.GetComponent <Text>(); if (textTotalMoney != null) { textTotalMoney.text = string.Format("可提现金额:{0}", pGlobalChildrenPaymentInfo.dTotalLeftCash); } } Surrogate_1.gameObject.SetActive(false); }