MyMesg.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. {include file="Application/Home/View/Public/header.blade.php"}
  2. {include file="Application/Home/View/Public/userLeft.blade.php"}
  3. <link rel="stylesheet" href="/Public/Home/css/center.css"/>
  4. {literal}
  5. <style type="text/css">
  6. /* CSS样式制作 */
  7. *{padding:0px; margin:0px;}
  8. #tab{
  9. overflow: hidden;
  10. }
  11. .hide{
  12. display: none;
  13. }
  14. #tab div{
  15. width: 90%;
  16. line-height:24px;
  17. border-top:none;
  18. padding:1px;
  19. /*border:1px solid #336699;*/
  20. padding:10px;
  21. }
  22. #tab a{
  23. display: block;
  24. width: 100%;
  25. text-decoration:none;
  26. color:black;
  27. }
  28. #tab a:hover{
  29. text-decoration:none;
  30. color:#336699;
  31. }
  32. .hide{display:none;}
  33. #magNumber{
  34. width: 20px;
  35. height: 20px;
  36. border-radius:100%;
  37. text-align: center;
  38. background-color: #0cc936;
  39. color: white;
  40. }
  41. dd {
  42. display: block;
  43. margin: 0;
  44. padding: 0;
  45. }
  46. .ky-messageWin {
  47. line-height: 30px;
  48. }
  49. .ky-messageWin ul {
  50. margin: 0;
  51. padding: 0;
  52. width: 100%;
  53. display: block;
  54. margin-bottom: 20px;
  55. }
  56. .ky-nonmsgtype {
  57. list-style-type: none;
  58. }
  59. .ky-nonmsgtype ul {
  60. display: block;
  61. margin: 10px 0 0 0;
  62. padding-left: 10px;
  63. }
  64. .ky-messageWin dl dt {
  65. display: block;
  66. margin-left: 10px;
  67. }
  68. .ky-messageWin dt {
  69. border-width: 0px 0px 1px 0px;
  70. border-style: solid;
  71. border-color: rgba(193, 184, 184, 0.58);
  72. }
  73. .ky-nonmsgtype li{
  74. cursor: pointer;
  75. }
  76. .ky-nonmsgtype li,
  77. .ky-content li {
  78. display: inline-block;
  79. margin-right: 10px;
  80. font-size: 14px;
  81. line-height: 30px;
  82. }
  83. .ky-content {
  84. margin: 10px 10px 0 15px;
  85. }
  86. .ky-content li {
  87. display: block;
  88. margin-bottom: 10px;
  89. border: 1px dashed;
  90. border-width: 0 0 1px 0;
  91. line-height: 45px;
  92. }
  93. .ky-content li a, .ky-content li a:hover {
  94. font-weight: 400;
  95. font-size: 14px;
  96. color: #051321;
  97. text-decoration: none;
  98. }
  99. .ky-content .noread a {
  100. color: red;
  101. font-weight: 800;
  102. text-decoration: none;
  103. font-size: 15px;
  104. }
  105. .noread a {
  106. color: red;
  107. font-weight: 800;
  108. text-decoration: none;
  109. font-size: 15px;
  110. }
  111. .ky-content a:hover {
  112. color: blue;
  113. text-decoration: underline;
  114. font-size: 16px;
  115. }
  116. .ky-nonmsgtype li a {
  117. color: #051321;
  118. text-decoration: none;
  119. }
  120. .ky-messageWin {
  121. width: 90%;
  122. /*border: 1px solid grey;*/
  123. }
  124. .ky-messageWin dt {
  125. border-width: 0px 0px 1px 0px;
  126. border-style: solid;
  127. border-color: rgba(193, 184, 184, 0.58);
  128. }
  129. .ky-nonmsgtype .current {
  130. color: red;
  131. font-weight: 800;
  132. font-size: 17px;
  133. }
  134. .ky-show-title {
  135. font-size: 18px;
  136. font-weight: 800;
  137. display: block;
  138. line-height: 40px;
  139. text-align: center;
  140. }
  141. .ky-show-date {
  142. display: block;
  143. text-align: right;
  144. margin-right: 50px;
  145. }
  146. </style>
  147. {/literal}
  148. {literal}
  149. <div class="member-content">
  150. <div class="content_h">
  151. <div class="ky-messageWin">
  152. <dl id = "tab">
  153. <dt class="ky-nonmsgtype" >
  154. <ul >
  155. <li class="current"><a href="/Home-Account/myMesg">所有消息</a></li>
  156. <li class="off"><a href="/Home-Account/myMesgone">系统通知</a></li>
  157. </ul>
  158. </dt>
  159. <dd >
  160. <!--所有-->
  161. <div class="ky-content" id="Page1" class="show">
  162. <ul>
  163. <template v-for="li in list['data']">
  164. <template v-if="li.hasread == 0">
  165. <li class="noread" >
  166. <a href="#" style="color: red;display: inline-block;width: 90%;" onclick="bb({{ li.id }})"><span>【未读】</span>
  167. <span style="float: left;" v-if="li.type == 1">[普通消息]</span>
  168. <span style="float: left;" v-if="li.type == 2">[系统消息]</span>
  169. <span style="float: left;" v-if="li.type == 3">[系统通知]</span>
  170. <span v-text='li.title'></span><span style="float:right" v-text='li.add_time'>2017-05-25 12:20</span></a>
  171. <!-- <span style="display: inline-block;float:right;margin-left: 20px;color: red;font-size: 15px;font-weight: 800;cursor: pointer;" onclick="del({{ li.id }})">删除</span> -->
  172. </li>
  173. </template>
  174. <template v-else>
  175. <li class="">
  176. <a href="#" style="color: black;display: inline-block;width: 90%;" onclick="bb({{ li.id }})"><span>【已读】</span>
  177. <span style="float: left;" v-if="li.type == 1">[普通消息]</span>
  178. <span style="float: left;" v-if="li.type == 2">[系统消息]</span>
  179. <span style="float: left;" v-if="li.type == 3">[系统通知]</span>
  180. <span v-text='li.title'></span><span style="float:right" v-text='li.add_time'>2017-05-25 12:20</span>
  181. </a>
  182. <span style="display: inline-block;float:right;margin-left: 20px;color: black;font-size: 15px;font-weight: 800;cursor: pointer;" onclick="del({{ li.id }})">删除</span>
  183. </li>
  184. </template>
  185. </template>
  186. </ul>
  187. <span style="float: left;text-decoration: none;"><a href="#" onclick="message(1)">上一页</a></span><span style="float: right;text-decoration: none;"><a href="#" onclick="message(2)">下一页</a></span>
  188. </div>
  189. </dd>
  190. </dl>
  191. </div>
  192. </div>
  193. </div>
  194. {/literal}
  195. </div>
  196. </div>
  197. <script src="/Public/Home/js/checkToken.js"></script>
  198. <script src="/Public/Home/js/jqPaginator.js"></script>
  199. {literal}
  200. <script type="text/javascript">
  201. function del(e){
  202. console.log(e);
  203. apiAjax('/Api-Other/DelMessageRed',{'id':e},function(data){
  204. if (data.status==1) {
  205. alert('成功');
  206. }else{
  207. alert('失败');
  208. }
  209. window.location.href="/Home-Account/myMesg";
  210. });
  211. }
  212. $(".leftList>li").removeClass('active');
  213. $(".leftList>li li").removeClass('active');
  214. $(".leftList>li").eq(1).addClass('active');
  215. $(".leftList>li.active").find('li').eq(2).addClass('active');
  216. function bb(id) {
  217. apiAjax('/Api-Other/MessageRed',{'id':id},function(data){
  218. });
  219. window.location.href="/home/account/messge?id="+id;
  220. }
  221. // JS实现选项卡切换
  222. // window.onload = function(){
  223. // var myTab = document.getElementById("tab"); //整个div
  224. // var myUl = myTab.getElementsByTagName("ul")[0];//一个节点
  225. // var myLi = myUl.getElementsByTagName("li"); //数组
  226. // var myDiv = myTab.getElementsByTagName("div"); //数组
  227. // for(var i = 0; i<myLi.length;i++){
  228. // myLi[i].index = i;
  229. // myLi[i].onclick = function(){
  230. // for(var j = 0; j < myLi.length; j++){
  231. // myLi[j].className="off";
  232. // $(myDiv[j]).removeClass('show');
  233. // $(myDiv[j]).addClass("hide");
  234. // }
  235. // this.className = "current";
  236. // $(myDiv[this.index]).removeClass('hide');
  237. // $(myDiv[this.index]).addClass("show");
  238. // }
  239. // }
  240. // };
  241. //去除消息通知的点号
  242. $('#msg').hide();
  243. //获取消息列表
  244. var ALLReade=new Vue({
  245. el:'#Page1',
  246. data:{
  247. list:[],
  248. num:[],
  249. page:1,
  250. }
  251. });
  252. //未读消息
  253. var noReade=new Vue({
  254. el:'#firstPage',
  255. data:{
  256. list:[],
  257. }
  258. });
  259. //已读
  260. var readed=new Vue({
  261. el:'#secondPage',
  262. data:{
  263. list:[],
  264. }
  265. });
  266. //系统消息
  267. var system=new Vue({
  268. el:'#thirdPage',
  269. data:{
  270. list:[],
  271. }
  272. });
  273. function message(pa,type) {
  274. if (pa == 1){
  275. var page = (ALLReade.page)-1;
  276. }else {
  277. var page = (ALLReade.page)+1;
  278. }
  279. // console.log(page);
  280. apiAjax('/api/other/AllMessage',{page:page,type:type},function (data) {
  281. if(data.status==1){
  282. val=data.data.data;
  283. ALLReade.list=data.data;
  284. ALLReade.page=data.data.page;
  285. val.forEach(function (e) {
  286. if(e.status!=1){
  287. noReade.list.push(e);
  288. }else{
  289. readed.list.push(e);
  290. }
  291. if(e.type == 3){
  292. system.list.push(e);
  293. }
  294. })
  295. }
  296. });
  297. }
  298. apiAjax('/api/other/AllMessage',{},function (data) {
  299. if(data.status==1){
  300. val=data.data.data;
  301. ALLReade.list=data.data;
  302. ALLReade.page=data.data.page;
  303. val.forEach(function (e) {
  304. if(e.status!=1){
  305. noReade.list.push(e);
  306. }else{
  307. readed.list.push(e);
  308. }
  309. if(e.type == 3){
  310. system.list.push(e);
  311. }
  312. })
  313. }
  314. });
  315. </script>
  316. {/literal}
  317. {include file="Application/Home/View/Public/footer.php"}