private void OnPressBtn(GameObject go) { string mTemp = null; NoticeTitle not = null; if (mLastObj == null) { return; } else { if (mLastObj.mObjParent == go) { return; } if (!mLastObj.mObjParent || !go) { return; } mNoticeContent.TryGetValue(go, out mTemp); if (mTemp == null || string.IsNullOrEmpty(mTemp)) { return; } } mLastObj.mHighlight.SetActive(false); mNoticeTitle.TryGetValue(go, out not); if (not == null) { return; } mLastObj = not; mLastObj.mObjParent = go; mLastObj.mHighlight.SetActive(true); mContent.text = mTemp; }
private async void SaveNoticeInfo(string saveType) { try { if (_noticeId == 0 && saveType.Equals("C")) { await Navigation.PopAsync(); return; } //通知标题 if (string.IsNullOrEmpty(NoticeTitle) || NoticeTitle.Trim() == "") { _commonFun.AlertLongText("请输入通知标题"); return; } //通知有效期 if (Convert.ToDateTime(StartNoticeDate.ToString("yyyy-MM-dd")) > Convert.ToDateTime(EndNoticeDate.ToString("yyyy-MM-dd"))) { _commonFun.AlertLongText("开始日期不能大于结束日期"); return; } //通知对象 if (!DisHasSelect) { _commonFun.AlertLongText("请选择经销商"); return; } //if (!DepHasSelect) //{ // _commonFun.AlertLongText("请选择部门"); // return; //} //结果反馈 //通知内容 if (string.IsNullOrEmpty(NoticeContent) || NoticeContent.Trim() == "") { _commonFun.AlertLongText("请输入通知内容"); return; } _commonFun.ShowLoading("保存中..."); if (_commonHelper.IsNetWorkConnected() == true) { try { List <MultiSelectDto> saveDepList = new List <MultiSelectDto>(); if (AllDepItems == null || AllDepItems.Count == 0) { saveDepList.Add(new MultiSelectDto() { DisCode = "0", DisName = "" }); } else { saveDepList = AllDepItems; } string disdepList = CommonUtil.DisAndDepToString(AllDisItems, saveDepList); var result = await _notifiMngService.SaveMadeNotifi(NoticeTitle, StartNoticeDate.ToString("yyyyMMdd"), EndNoticeDate.ToString("yyyyMMdd"), disdepList, ReplySelected == 0? "0" : "1", NoticeContent, NotifiAttachmentList, saveType.ToString(), _noticeId, Convert.ToInt32(CommonContext.Account.UserId)); if (result.ResultCode == Module.ResultType.Success) { _noticeId = 0; //发条消息让 审批查询,通知结果查询查询 MessagingCenter.Send <string>("", MessageConst.NOTIFI_SAVEREFRESH_GO); await Navigation.PopAsync(true); _commonFun.AlertLongText("保存成功"); } else { _commonFun.HideLoading(); _commonFun.AlertLongText("保存失败,请重试。 " + result.Msg); } } catch (OperationCanceledException) { _commonFun.HideLoading(); _commonFun.AlertLongText("请求超时。"); } catch (Exception) { _commonFun.HideLoading(); _commonFun.AlertLongText("保存失败,请重试。"); } finally { _commonFun.HideLoading(); } } else { _commonFun.AlertLongText("网络连接异常。"); } } catch (Exception) { _commonFun.AlertLongText("操作异常,请重试。-->NotifiMngViewModel"); return; } }
//string[] sssss = { "[1313ff] 公告后台参考邮件后台\n,可采用相同模式。\n1.可选渠道and区服2.时间选定——上架/下架\n3.公告排序 ——升序/降序\n4.具备预览功能——前端显示匹配\n5.文本具备居中/左对齐/右对齐选择", "特点:登入游戏后弹出,左右两侧分栏显示,左侧为公告标题,右侧为公告正文区域,\n两侧皆可 上下滑动。", "左上角为公告属性,包括“活动”,“促销”,“维护”等字眼;", "右下角为公告状态,包括“NEW(新)”,“HOT(火爆)”字眼" }; void SetAllNotice() { mLastObj = null; if (mNoticeTitle.Count > 0) { for (int i = 0; i < mNoticeTitle.Count - 1; i++) { UnityEngine.GameObject.DestroyImmediate(mNoticeTitle.ElementAt(i).Key); mNoticeTitle.Remove(mNoticeTitle.ElementAt(i).Key); } for (int i = 0; i < mNoticeContent.Count - 1; i++) { UnityEngine.GameObject.DestroyImmediate(mNoticeContent.ElementAt(i).Key); mNoticeContent.Remove(mNoticeContent.ElementAt(i).Key); } } int index = 100000; foreach (var item in SystemNoticeData.Instance.systemNotList) { ResourceUnit objUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.LoadNoticeTitleUI, ResourceType.PREFAB); GameObject obj = GameObject.Instantiate(objUnit.Asset) as GameObject; obj.transform.parent = mGrid.transform; obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; obj.name = item.mNoticeSort + "_" + item.mNoticChildSort; NoticeTitle not = null; if (!mNoticeTitle.TryGetValue(obj, out not)) { not = new NoticeTitle(); not.mHot = obj.transform.FindChild("Status/Hot").gameObject; not.mNew = obj.transform.FindChild("Status/New").gameObject; not.mActivities = obj.transform.FindChild("Tip/Activities").gameObject; not.mDiscount = obj.transform.FindChild("Tip/Discount").gameObject; not.mNotify = obj.transform.FindChild("Tip/Notify").gameObject; not.mHighlight = obj.transform.FindChild("Highlight").gameObject; not.mNoticeName = obj.transform.FindChild("Name").GetComponent <UILabel>(); mNoticeTitle.Add(obj, not); mNoticeContent.Add(obj, item.mNoticeContent); } not.mHot.SetActive(item.mNoticeState == NoticeState.NoticeHot); not.mNew.SetActive(item.mNoticeState == NoticeState.NoticeNew); not.mActivities.SetActive(item.mNoticeIdentify == NoticeIdentify.NoticIdentifyActivity); not.mDiscount.SetActive(item.mNoticeIdentify == NoticeIdentify.NoticIdentifyDiscount); not.mNotify.SetActive(item.mNoticeIdentify == NoticeIdentify.NoticIdentifyNotify); if (item.mNoticeTitle.Length > 8) { not.mNoticeName.text = item.mNoticeTitle.Substring(0, 8); } else { not.mNoticeName.text = item.mNoticeTitle; } UIEventListener.Get(obj).onClick += OnPressBtn; if (item.mNoticeSort < index && item.mNoticChildSort == 0) { if (mLastObj != null) { mLastObj.mHighlight.SetActive(false); } index = item.mNoticeSort; not.mHighlight.gameObject.SetActive(true); not.mObjParent = obj; mLastObj = not; mContent.text = item.mNoticeContent; } } mContent.gameObject.SetActive(SystemNoticeData.Instance.systemNotList.Count != 0); mGrid.repositionNow = true; mGrid.Reposition(); }