You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

184 lines
7.1 KiB

  1. @*@{
  2. ViewBag.Title = "未读消息";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <div class="lr-layout " >
  6. <div class="lr-layout-center">
  7. <div class="lr-layout-wrap lr-layout-wrap-notitle ">
  8. <div class="lr-layout-body" id="content"></div>
  9. </div>
  10. </div>
  11. </div>*@
  12. <!DOCTYPE html>
  13. <html>
  14. <head>
  15. <meta name="viewport" content="width=device-width" />
  16. <title>未读消息提醒</title>
  17. <script src="~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js"></script>
  18. <script src="~/Content/jquery/plugin/jquery-ui/jquery-ui.min.js"></script>
  19. <script src="~/Content/jquery/plugin/fullcalendar/js/fullcalendar.min.js"></script>
  20. <link href="~/Content/jquery/plugin/fullcalendar/css/fullcalendar.css" rel="stylesheet" />
  21. @Html.AppendCssFile(
  22. "/Views/LR_Content/style/lr-common.css",
  23. "/Views/LR_Content/style/lr-iframe-index.css",
  24. "~/Content/jquery/plugin/toastr/toastr.css"
  25. )
  26. <style>
  27. #allRead {
  28. display: inline-block;
  29. padding: 5px 10px;
  30. color: blue;
  31. border: 1px solid blue;
  32. border-radius: 3px;
  33. cursor: pointer;
  34. margin-bottom: 5px;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <div id="allRead" class="btn btn-default">全部已读</div>
  40. <div id='content'>
  41. </div>
  42. @Html.AppendJsFile(
  43. "~/Content/jquery/plugin/toastr/toastr.min.js",
  44. "~/Views/LR_Content/script/lr-admin.js",
  45. "~/Views/LR_Content/script/lr-clientdata.js",
  46. "~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js",
  47. "~/Areas/LR_Desktop/Views/MessageRind/Index.js"
  48. )
  49. <script type='text/javascript'>
  50. var name = '@(ViewBag.Name)';
  51. $(document).ready(function () {
  52. getdata();
  53. function getdata() {
  54. $.ajax({
  55. url: top.$.rootUrl + '/LR_Desktop/MessageRind/GetListForUnread',
  56. type: "get",
  57. dataType: "json",
  58. async: false,
  59. success: function (data) {
  60. //console.log(data);
  61. var content = "";
  62. if (data.length > 0) {
  63. content += "<ul id='uldata'>";
  64. for (var i = 0; i < data.length; i++) {
  65. //data[i]["SenderName"]
  66. //content += "<li>" + "&nbsp;&nbsp;&nbsp;" + name + "的消息:" + "</li>";
  67. var theContent = data[i]["TheContent"];
  68. //可显示的最长长度
  69. var maxlen = 50;
  70. if (theContent.length > maxlen) {
  71. theContent = theContent.substring(0, maxlen - 3) + "...";
  72. }
  73. var param = data[i]["TheTitle"] + "、" + data[i]["InstanceId"] + "、" + data[i]["MessageId"] + "、" + data[i]["ConnectionUrl"];
  74. content += "<li>";
  75. if (data[i]["TheTitle"].indexOf('心理咨询') != -1 || data[i]["TheTitle"].indexOf('心理回复') != -1) {
  76. if (data[i]["isReply"] == 1) {
  77. //已回复绿色显示
  78. content += "<span style='color:green;'>";
  79. content += "&nbsp;&nbsp;&nbsp;&nbsp;【" + data[i]["TheTitle"] + "】" + theContent + "&nbsp;&nbsp;";
  80. content += "</span>";
  81. } else {
  82. //待回复红色显示
  83. content += "<span style='color:red;'>";
  84. content += "&nbsp;&nbsp;&nbsp;&nbsp;【" + data[i]["TheTitle"] + "】" + theContent + "&nbsp;&nbsp;";
  85. content += "</span>";
  86. }
  87. } else {
  88. content += "&nbsp;&nbsp;&nbsp;&nbsp;【" + data[i]["TheTitle"] + "】" + theContent + "&nbsp;&nbsp;";
  89. }
  90. content += '<a id="' + param + '" href="javascript:void(0);" class="lr-item" style="color:blue;textDecoration:underline">点击查看>>';
  91. content += "</a>";
  92. content += "</li>";
  93. }
  94. content += "</ul>";
  95. }
  96. else {
  97. content = "暂无未读消息";
  98. }
  99. $("#content").html(content);
  100. }
  101. });
  102. }
  103. $('#uldata .lr-item').on('click', function () {
  104. var $obj = $(this);
  105. var params = ($obj.attr('id')).split('、');
  106. //更改状态为已读
  107. var MessageId = params[2];
  108. var title = params[0];
  109. if (top.learun.checkrow(MessageId)) {
  110. $.ajax({
  111. url: top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSigns?title=' + title,
  112. type: "post",
  113. data: { keyValue: MessageId },
  114. dataType: "json",
  115. async: false,
  116. success: function (data) {
  117. //弹窗查看详情
  118. var keyValue = params[1];
  119. var ConnectionUrl = params[3];
  120. if (top.learun.checkrow(keyValue)) {
  121. top.learun.layerForm({
  122. id: 'formview',
  123. title: title,
  124. url: top.$.rootUrl + ConnectionUrl + keyValue,
  125. width: 1000,
  126. height: 650,
  127. maxmin: true,
  128. btn: null,
  129. });
  130. }
  131. }
  132. })
  133. }
  134. });
  135. //点击“全部已读”
  136. $('#allRead').on('click', function () {
  137. $.ajax({
  138. url: top.$.rootUrl + '/LR_Desktop/MessageRind/SaveReadSignsByUserId',
  139. type: "post",
  140. data: { },
  141. dataType: "json",
  142. async: false,
  143. success: function (data) {
  144. location.reload();
  145. }
  146. })
  147. });
  148. });
  149. //function funLook(param) {
  150. // var id = "433d5658-40b0-4e2d-b736-c4e8561d017e";//$obj.attr('id');
  151. // var _module = top.learun.clientdata.get(['modulesMap', id]);
  152. // switch (_module.F_Target) {
  153. // case 'iframe':// 窗口
  154. // if (top.learun.validator.isNotNull(_module.F_UrlAddress).code) {
  155. // top.learun.frameTab.open(_module);
  156. // }
  157. // break;
  158. // case 'open':// 窗口
  159. // var newWin = window.open(_module.F_UrlAddress);
  160. // newWin.location.replace(_module.F_UrlAddress);
  161. // break;
  162. // }
  163. //}
  164. </script>
  165. </body>
  166. </html>