阜外心血管项目前端

noticeList.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. mui.init({})
  2. var state=1;
  3. var openid = helper.cookies.get("openid");
  4. var Itype = helper.request.queryString("Itype");
  5. var turn = helper.request.queryString("turn");
  6. $(function () {
  7. if (turn) {
  8. $(".mui-nav").show();
  9. }else{
  10. $("#OA_task").css("margin-top","0px");
  11. }
  12. Ajax();
  13. })
  14. function Ajax() {
  15. //$(".order").remove();
  16. $.ajax({
  17. url: huayi.config.callcenter_url + 'WxLogin/GetNoticeList',
  18. data: {
  19. openid: openid, //微信openid,
  20. //openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE',
  21. },
  22. async: true,
  23. dataType: 'json',
  24. type: 'get', //HTTP请求类型
  25. success: function(data) {
  26. if(data.rows && data.rows.length > 0) {
  27. $(".noinfor").text("");
  28. $("#OA_task").empty();
  29. $(data.rows).each(function(i, n) {
  30. $('<li class="mui-table-view-cell order" data-index="' + n.F_NoticeId + '">' +
  31. '<div class="mui-table">' +
  32. '<div class="mui-table-cell mui-col-xs-10">' +
  33. '<h4 class="mui-ellipsis">' + n.F_Title +
  34. '</h4><h5>' + n.F_CreateOn +
  35. '</h5></div>'+
  36. '<div class="mui-table-cell mui-col-xs-2 mui-text-right">'+
  37. '<span class="mui-h5">'+
  38. '</span></div></div></li>').appendTo('#OA_task');
  39. });
  40. //工单跳转
  41. $('.order').on('tap', function() {
  42. var index = $(this).attr('data-index');
  43. window.location.href = "noticeDetail.html?id=" + index+'&type='+state;
  44. });
  45. } else {
  46. $(".noinfor").text("暂无信息");
  47. }
  48. },
  49. error: function(xhr, type, errorThrown) {
  50. //异常处理;
  51. }
  52. })
  53. }