网站
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

discussionsDetail_07.js 2.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. $('#location').html('坐落位置:'+(content.location || ''));
  61. $('#east').html('东至:'+(content.east || ''));
  62. $('#west').html('西至:'+(content.west || ''));
  63. $('#south').html('南至:'+(content.south || ''));
  64. $('#north').html('北至:'+(content.north || ''));
  65. $('#settleType').html('面积:'+content.totalArea + '亩');
  66. $('#totalAmount').html('使用情况:'+content.useType);
  67. }
  68. }
  69. module.newsList = function (data) {
  70. if (data.code == 200) {
  71. var content = data.rows;
  72. module.data.newList = content;
  73. var newListData = template('newListData', module.data);
  74. $("#newListContent").html(newListData);
  75. }
  76. }
  77. return module;
  78. });