网站
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.
 
 
 

40 lines
1.1 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "newApi"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //新闻列表
  9. newsInformationList:'',
  10. //页码
  11. pageNum: 1,
  12. //总页数
  13. pageList: 0,
  14. //每页数量
  15. pageSize: 1,
  16. },
  17. };
  18. var tools = new Tools();
  19. module.init = function (page) {
  20. //新闻资讯
  21. tools.doGet(newList, {number:2,deptId:100,pageNum:module.data.pageNum,pageSize:1}, module.NewsInformation);
  22. };
  23. //新闻资讯数据
  24. module.NewsInformation = function (data) {
  25. console.log(data)
  26. if (data.code == 200) {
  27. var content = data.rows;
  28. module.data.newsInformationList = content;
  29. var NewsInformationData = template('NewsInformationData', module.data);
  30. $("#NewsInformationContent").html(NewsInformationData);
  31. module.data.pageList = data.total/module.data.pageSize;
  32. }
  33. }
  34. return module;
  35. });