农燊高科官方网站
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.

announcementDetail.js 4.3 KiB

4 年之前
3 年之前
3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "announApi", "paging"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. announcementInformationDetail:'',
  9. },
  10. };
  11. var tools = new Tools();
  12. module.init = function (page) {
  13. //成交公告
  14. tools.doGet(announDetail+'/'+getQueryVariable('id'), {}, module.announInformation,true);
  15. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  16. tools.getWebConfig();
  17. };
  18. //底部友情链接
  19. module.bottomFriendsLinks = function (data) {
  20. if (data.code == 200) {
  21. var content = data.data;
  22. //console.log(content)
  23. module.data.friendsLinksList = content;
  24. var friendsLinksData = template('friendsLinksData', module.data);
  25. $("#friendsLinksContent").html(friendsLinksData);
  26. }
  27. }
  28. //获取地址栏参数
  29. function getQueryVariable(variable){
  30. var query = window.location.search.substring(1);
  31. var vars = query.split("&");
  32. for (var i=0;i<vars.length;i++) {
  33. var pair = vars[i].split("=");
  34. if(pair[0] == variable){return pair[1];}
  35. }
  36. return(false);
  37. }
  38. //项目公告数据
  39. module.announInformation = function (data) {
  40. if (data.code == 200) {
  41. //console.log(data)
  42. var content = data.data;
  43. module.data.announcementInformationDetail = content;
  44. var announcementInformationData = template('announcementInformationData', module.data);
  45. $("#announcementInformationContent").html(announcementInformationData);
  46. //流转方向字典
  47. tools.doGet(Dictionaries+'/rollout_type', {}, module.circulationDictionaries,true);
  48. //交易方式字典
  49. tools.doGet(Dictionaries+'/deal_type', {}, module.transactionDictionaries,true);
  50. //面积单位字典
  51. tools.doGet(Dictionaries+'/area_unit', {}, module.areaDictionaries,true);
  52. //成交价格字典
  53. tools.doGet(Dictionaries+'/price_unit', {}, module.unitDictionaries,true);
  54. }
  55. }
  56. //流转方向
  57. module.circulationDictionaries = function (data) {
  58. if (data.code == 200) {
  59. var content = data.data;
  60. var rollout = content[(module.data.announcementInformationDetail.rollout-1)].dictLabel;
  61. module.data.announcementInformationDetail.rollout = rollout;
  62. var announcementInformationData = template('announcementInformationData', module.data);
  63. $("#announcementInformationContent").html(announcementInformationData);
  64. }
  65. }
  66. //交易方式
  67. module.transactionDictionaries = function (data) {
  68. if (data.code == 200) {
  69. var content = data.data;
  70. //console.log(content)
  71. var dealType = content[(module.data.announcementInformationDetail.dealType-1)].dictLabel;
  72. module.data.announcementInformationDetail.dealType = dealType;
  73. var announcementInformationData = template('announcementInformationData', module.data);
  74. $("#announcementInformationContent").html(announcementInformationData);
  75. }
  76. }
  77. //面积单位
  78. module.areaDictionaries = function (data) {
  79. if (data.code == 200) {
  80. var content = data.data;
  81. var allCountUnit = content[(module.data.announcementInformationDetail.allCountUnit-1)].dictLabel;
  82. module.data.announcementInformationDetail.allCountUnit = allCountUnit;
  83. var announcementInformationData = template('announcementInformationData', module.data);
  84. $("#announcementInformationContent").html(announcementInformationData);
  85. }
  86. }
  87. //成交价格单位
  88. module.unitDictionaries = function (data) {
  89. if (data.code == 200) {
  90. var content = data.data;
  91. var unit = content[(module.data.announcementInformationDetail.unit-1)].dictLabel;
  92. module.data.announcementInformationDetail.unit = unit;
  93. var announcementInformationData = template('announcementInformationData', module.data);
  94. $("#announcementInformationContent").html(announcementInformationData);
  95. }
  96. }
  97. return module;
  98. });