农燊高科官方网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

72 行
2.6 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "interactApi", "paging"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //互动交流列表
  9. interactInformationList:'',
  10. //页码
  11. pageNum: 1,
  12. //页码集合
  13. pageList: [],
  14. //每页数量
  15. pageSize: 5,
  16. //总页数
  17. pageCount:0
  18. },
  19. };
  20. var tools = new Tools();
  21. module.init = function (page) {
  22. //互动交流
  23. tools.doGet(interactList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.interactInformation,true);
  24. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  25. tools.getWebConfig();
  26. };
  27. //新闻资讯数据
  28. module.interactInformation = function (data) {
  29. if (data.code == 200) {
  30. console.log(data)
  31. var content = data.rows;
  32. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  33. if (pageCount < 1){
  34. pageCount = 1;
  35. }
  36. if(module.data.interactInformationList == ''){
  37. // 初始化 分页器
  38. var page_s1=createPage('.page_s1');
  39. // 设置分页
  40. setPage(page_s1,{
  41. pageTotal: data.total, // 数据总条数
  42. pageSize: module.data.pageSize, // 每页显示条数
  43. pageCurrent: 1, // 当前页
  44. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  45. })
  46. $('#page_s1').html('共'+pageCount+'页')
  47. }
  48. module.data.pageCount = pageCount;
  49. module.data.interactInformationList = content;
  50. var interactInformationData = template('interactInformationData', module.data);
  51. $("#interactInformationContent").html(interactInformationData);
  52. }
  53. }
  54. goSearch = function () {
  55. var searchTitle = $('#searchTitle').val();
  56. var searchContent = $('#searchContent').val();
  57. console.log(searchContent)
  58. console.log(searchTitle)
  59. tools.doGet(interactSearch, {deptId:100,title:searchTitle,content:searchContent,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.interactInformation,true)
  60. }
  61. turnThePage = function (pageNum) {
  62. module.data.pageNum = pageNum ;
  63. tools.doGet(interactList, {deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.interactInformation,true);
  64. }
  65. return module;
  66. });