网站
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

80 righe
2.5 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools"], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻详情
  18. tools.doGet(assetresourceOrcodeList, {
  19. code:getQueryVariable('id'),
  20. translate_dict: '1',
  21. bookId: JSON.parse(tools.getCookie('user')).bookId
  22. }, module.newsDetail , true);
  23. //新闻列表
  24. tools.doGet(assetresourceOrcodeList, {
  25. translate_dict:1,
  26. orderByColumn: 'code',
  27. isAsc: 'asc',
  28. pageNum:1,
  29. pageSize:10,
  30. bookId: JSON.parse(tools.getCookie('user')).bookId
  31. }, module.newsList , true);
  32. tools.doGet(webList, {}, module.webList , true);
  33. };
  34. //获取地址栏参数
  35. function getQueryVariable(variable){
  36. var query = window.location.search.substring(1);
  37. var vars = query.split("&");
  38. for (var i=0;i<vars.length;i++) {
  39. var pair = vars[i].split("=");
  40. if(pair[0] == variable){return pair[1];}
  41. }
  42. return(false);
  43. }
  44. module.webList = function (data) {
  45. if (data.code == 200) {
  46. var content = data.data;
  47. module.data.webList = content;
  48. var webData = template('webData', module.data);
  49. $("#webContent").html(webData);
  50. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  51. }
  52. }
  53. module.newsDetail = function (data) {
  54. if (data.code == 200) {
  55. var content = data.rows[0];
  56. $('#name').html(content.name);
  57. $('#code').html('资产编码:' + content.code);
  58. $('#biddingType').html('资源分类:'+content.resourceSort);
  59. $('#secondParty').html('资源类型:'+content.resourceType);
  60. $('#settleType').html('面积:'+content.totalArea);
  61. $('#totalAmount').html('使用情况:'+content.useType);
  62. }
  63. }
  64. module.newsList = function (data) {
  65. if (data.code == 200) {
  66. var content = data.rows;
  67. module.data.newList = content;
  68. var newListData = template('newListData', module.data);
  69. $("#newListContent").html(newListData);
  70. }
  71. }
  72. return module;
  73. });