void SetQuestionsInfo(QuestionsReplyInfo info) { QuestionsReplyInfo.PathType pathType = QuestionsReplyInfo.PathType.NONE; string path = string.Empty; string text = string.Empty; if (info != null) { pathType = info.GetPathType; path = info.GetPath(pathType); } else { info = new QuestionsReplyInfo(); pathType = QuestionsReplyInfo.PathType.QUESTIONSALL; path = info.GetPath(pathType); } if (path.Equals(string.Empty)) { return; } GetQuestionsInfo(path, (x) => { text = x; if (string.IsNullOrEmpty(text)) { Debug.LogError("下载客服数据失败,路径= :" + path); return; } int reportid = 0; switch (pathType) { case QuestionsReplyInfo.PathType.QUESTIONSALL: // Debug.Log("text = " + text); LitJson.JsonData jsonData = LitJson.JsonMapper.ToObject(text); if (jsonData != null && text.Contains("result")) { if ((int)jsonData["result"] != 0) { Debug.LogError("下载客服数据失败 :" + text); return; } } if (text.Contains("count")) { int count = (int)jsonData["count"]; if (text.Contains("reports")) { LitJson.JsonData reports = jsonData["reports"]; for (int i = 0; i < count; i++) { LitJson.JsonData reportsEty = reports[i]; int id = (int)reportsEty["reportId"]; string infodes = (string)reportsEty["info"]; string time = (string)reportsEty["reportTime"]; string reply = (string)reportsEty["reply"]; int type = (int)reportsEty["type"]; int assess = (int)reportsEty["assess"]; QuestionsReplyInfo question = new QuestionsReplyInfo(id, assess, type, time, reply, infodes); GameCenter.mainPlayerMng.AddQuestion(question); } } } ShowList(); break; case QuestionsReplyInfo.PathType.EVALUATE: GameCenter.mainPlayerMng.UpdateQuestion(info.ID, info.Evaluation); ShowList(); break; case QuestionsReplyInfo.PathType.REPLY: reportid = 0; string replydes = string.Empty; if (reportid > 0) { GameCenter.mainPlayerMng.UpdateQuestion(reportid, replydes); } List <QuestionsReplyInfo> dataList = GameCenter.mainPlayerMng.QuestionList; QuestionsReplyUI ety = null; if (grid != null) { grid.maxPerLine = dataList.Count; } int j = 0; for (; j < dataList.Count; j++) { if (gameList.Count > j) { gameList[j].DataInfo = dataList[j]; } } break; case QuestionsReplyInfo.PathType.REPROT: string[] strReport = text.Split('|'); if (strReport.Length >= 3) { if (!strReport[0].Equals("0")) { return; } info.Update(strReport[1], strReport[2]); GameCenter.mainPlayerMng.AddQuestion(info); ShowList(); } break; default: break; } }); }