index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $(function() {
  2. var blogUrl = '';
  3. var dataUrl = '';
  4. function AjaxFan(pagenum) {
  5. dataUrl = getServerHttp() + '/nx/o/list/org';
  6. $.ajax({
  7. url: dataUrl,
  8. type: 'post',
  9. cache: false,
  10. dataType: 'json',
  11. data: { p: pagenum },
  12. success: function(data) {
  13. var data = ajaxDataParames(data);
  14. layui.laypage.render({
  15. elem: 'paging',
  16. count: data.page.totalRow,
  17. limit: 10,
  18. first: '首页',
  19. last: '尾页',
  20. curr: pagenum,
  21. groups: 5,
  22. jump: function(obj, first) {
  23. var doms = '';
  24. var list = data.data;
  25. for (var i = 0; i < list.length; i++) {
  26. if (window.location.protocol == 'http:' || window.location.protocol == 'https:') {
  27. blogUrl = '/blog/' + list[i].admin_id
  28. } else {
  29. blogUrl = 'http://192.168.1.50:8080/blog/' + list[i].admin_id + '.htm'
  30. }
  31. doms += '<li><a href="javascript:void(0)" target="_blank"><img src="./images/a' + (i + 1) + '.jpg" alt=""><span><h6>' + list[i].name + '</h6><i>营业执照:' + list[i].business_license_code + '</i></span></a></li>'
  32. }
  33. $('.SettleIn-content-box ul').html(doms);
  34. if (!first) {
  35. AjaxFan(obj.curr);
  36. }
  37. }
  38. });
  39. }
  40. })
  41. }
  42. AjaxFan(1);
  43. })