private void List_Render(int index, GObject go) { bool isVisible = SetListCSS(go, listData.ToArray(), index); if (isVisible) { Dictionary <string, object> d = (Dictionary <string, object>)(listData[index]); string name = (string)d["name"]; string head_use = (string)d["head_use"]; GTextField lv = go.asCom.GetChild("n4").asCom.GetChild("n2").asTextField; GButton photo = go.asCom.GetChild("n4").asCom.GetChild("n0").asButton; go.asCom.GetChild("n10").asTextField.visible = false; Dictionary <string, object> gift = (Dictionary <string, object>)d["content"]; Dictionary <string, object> cardCfg = DataManager.inst.card; // Debug.LogError("name "+d["name"].ToString()+" || "+"uid "+d["uid"].ToString()+" || "+"head_use "+ d["head_use"].ToString()); GButton head = go.asCom.GetChild("n4").asCom.GetChild("n0").asButton; GButton btn_att = go.asCom.GetChild("n5").asButton; btn_att.text = Tools.GetMessageById("13147"); string giftName = ""; string gifts = ""; //if(index == 0 || index % 2 == 0) { // go.asCom.GetChild("itemBg").visible = false; //} else { // go.asCom.GetChild("itemBg").visible = true; //} lv.text = d["lv"].ToString(); Tools.SetLoaderButtonUrl(photo, ModelUser.GetHeadUrl(head_use)); //contecnt foreach (string s in gift.Keys) { giftName = s; if (giftName == Config.ASSET_CARD) { foreach (string cid in ((Dictionary <string, object>)(gift[Config.ASSET_CARD])).Keys) { Dictionary <string, object> cardidcfg = (Dictionary <string, object>)cardCfg[cid]; if (gifts == "") { gifts += " [" + giftName + (int)cardidcfg["rarity"] + "2]" + " x " + "[color=#f38917]" + (int)(((Dictionary <string, object>)gift[giftName])[cid]) + "[/color]"; } else { gifts += " [" + giftName + (int)cardidcfg["rarity"] + "2]" + " x " + "[color=#f38917]" + (int)(((Dictionary <string, object>)gift[giftName])[cid]) + "[/color]"; } } } else { if (gifts == "") { gifts = "[" + giftName + "2]" + " x " + "[color=#f38917]" + (int)gift[giftName] + "[/color] " + gifts; } else { gifts = "[" + giftName + "2]" + " x " + "[color=#f38917]" + (int)gift[giftName] + "[/color] " + gifts; } } } if (name == null) { name = d["uid"] + ""; } string str = Tools.GetMessageById("12002", new string[] { "[color=#f38917]" + name + "[/color] ", gifts }); go.asCom.GetChild("n0").asRichTextField.text = BaseUbbParser.inst.Parse(str); //AttentionBtn //if(!(bool)d["if_black"] && !(bool)d["if_friend"] && !(bool)d["request_sign"] || d["uid"].ToString() == userModel.uid) { // btn_att.visible = false; //} else { // btn_att.visible = true; //} if ((bool)d["request_sign"]) { if ((bool)d["if_black"] || (bool)d["if_friend"]) { btn_att.visible = false; } else { btn_att.visible = true; } } else { btn_att.visible = false; } if (d["uid"].ToString() == userModel.uid) { btn_att.visible = false; } if ((bool)d["if_friend"]) { btn_att.visible = false; go.asCom.GetChild("n10").asTextField.visible = true; go.asCom.GetChild("n10").asTextField.text = Tools.GetMessageById("13018"); } if (btn_att.visible) { if (LocalStore.GetFriendUID().IndexOf(d["uid"].ToString() + ",") > -1) { btn_att.visible = false; go.asCom.GetChild("n10").asTextField.visible = true; go.asCom.GetChild("n10").asTextField.text = Tools.GetMessageById("13018"); } else { btn_att.visible = true; } } btn_att.onClick.Add(() => { Dictionary <string, object> dataAtt = new Dictionary <string, object>(); dataAtt["fuid"] = d["uid"]; NetHttp.inst.Send(NetBase.HTTP_FOLLOW, dataAtt, (VoHttp vo) => { if ((bool)vo.data == true) { roleModel.AddAttentionFight(d["uid"].ToString()); btn_att.visible = false; go.asCom.GetChild("n10").asTextField.visible = true; go.asCom.GetChild("n10").asTextField.text = Tools.GetMessageById("13018"); LocalStore.SetFriendUID(d["uid"].ToString()); } }); }); } }