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

221 line
8.6 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "announApi", "paging", 'swiper'], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //焦点图数据
  9. focusListTop: [],
  10. announcementInformationDetail:'',
  11. },
  12. };
  13. var tools = new Tools();
  14. module.init = function (page) {
  15. //获取焦点图信息
  16. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  17. //底部友情链接
  18. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  19. //鉴证公告
  20. tools.doGet(tenderWinDetail+'/'+getQueryVariable('id'), {}, module.announInformation,true);
  21. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  22. tools.getWebConfig();
  23. };
  24. //焦点图数据
  25. module.focusNewsTop = function (data) {
  26. if (data.code == 200) {
  27. let focusArray = [];
  28. if(data.data.length<1){
  29. focusArray.push({
  30. picUrl:'../../../static/images/banner1.png'
  31. },{
  32. picUrl:'../../../static/images/banner2.png'
  33. },{
  34. picUrl:'../../../static/images/banner3.png'
  35. })
  36. }else{
  37. data.data.forEach(res=>{
  38. focusArray.push({
  39. picUrl:'/api'+res.picUrl
  40. })
  41. })
  42. }
  43. module.data.focusListTop = focusArray;
  44. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  45. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  46. new Swiper('#bannerFocusWrapTop', {
  47. paginationClickable: true,
  48. autoplay : 4000,
  49. loop:true
  50. })
  51. }
  52. }
  53. //获取地址栏参数
  54. function getQueryVariable(variable){
  55. var query = window.location.search.substring(1);
  56. var vars = query.split("&");
  57. for (var i=0;i<vars.length;i++) {
  58. var pair = vars[i].split("=");
  59. if(pair[0] == variable){return pair[1];}
  60. }
  61. return(false);
  62. }
  63. //底部友情链接
  64. module.bottomFriendsLinks = function (data) {
  65. if (data.code == 200) {
  66. var content = data.data;
  67. //console.log(content)
  68. module.data.friendsLinksList = content;
  69. var friendsLinksData = template('friendsLinksData', module.data);
  70. $("#friendsLinksContent").html(friendsLinksData);
  71. }
  72. }
  73. //竞价方式
  74. module.biddingTypeDictionaries = function (data) {
  75. if (data.code == 200) {
  76. var content = data.data;
  77. if (module.data.announcementInformationDetail.biddingType){
  78. var biddingType = content[(module.data.announcementInformationDetail.biddingType-1)].dictLabel;
  79. module.data.announcementInformationDetail.biddingType = biddingType;
  80. }
  81. var announcementInformationData = template('announcementInformationData', module.data);
  82. $("#announcementInformationContent").html(announcementInformationData);
  83. }
  84. }
  85. //项目公告数据
  86. module.announInformation = function (data) {
  87. if (data.code == 200) {
  88. //console.log(data)
  89. var content = data.data;
  90. module.data.announcementInformationDetail = content;
  91. let query = {
  92. tableName: 't_transaction_tender_win',
  93. bizPath: 'transaction',
  94. tableId:content.id
  95. }
  96. tools.doGet(attachmentQuery, query, module.attachmentQuery,true);
  97. tools.doGet(tenderDetail+'/'+content.tenderId, {}, module.tenderQuery,true);
  98. }
  99. }
  100. module.tenderQuery = function (data) {
  101. if (data.code == 200) {
  102. var content = data.data;
  103. module.data.announcementInformationDetail.biddingType = content.biddingType;
  104. //竞价方式字典
  105. tools.doGet(Dictionaries+'/tenderbid_type', {}, module.biddingTypeDictionaries,true);
  106. //中标情况字典
  107. tools.doGet(Dictionaries+'/tender_deal_type', {}, module.dealTypeDictionaries,true);
  108. }
  109. }
  110. //中标情况
  111. module.dealTypeDictionaries = function (data) {
  112. if (data.code == 200) {
  113. var content = data.data;
  114. if (module.data.announcementInformationDetail.dealType){
  115. var dealType = content[(module.data.announcementInformationDetail.dealType-1)].dictLabel;
  116. module.data.announcementInformationDetail.dealType = dealType;
  117. if(dealType == '未成功'){
  118. //失败原因字典
  119. tools.doGet(Dictionaries+'/deal_fail_reason', {}, module.dealFailReasonDictionaries,true);
  120. }
  121. }
  122. var announcementInformationData = template('announcementInformationData', module.data);
  123. $("#announcementInformationContent").html(announcementInformationData);
  124. }
  125. }
  126. //失败原因
  127. module.dealFailReasonDictionaries = function (data) {
  128. if (data.code == 200) {
  129. var content = data.data;
  130. if (module.data.announcementInformationDetail.dealFailReason){
  131. var dealFailReason = content[(module.data.announcementInformationDetail.dealFailReason-1)].dictLabel;
  132. module.data.announcementInformationDetail.dealFailReason = dealFailReason;
  133. var announcementInformationData = template('announcementInformationData', module.data);
  134. $("#announcementInformationContent").html(announcementInformationData);
  135. }
  136. }
  137. }
  138. module.attachmentQuery = function (data) {
  139. if (data.code == 200) {
  140. var content = data.rows;
  141. module.data.attachmentList = content;
  142. var attachmentListData = template('attachmentListData', module.data);
  143. $("#attachmentListContent").html(attachmentListData);
  144. }
  145. }
  146. //流转方向
  147. module.circulationDictionaries = function (data) {
  148. if (data.code == 200) {
  149. var content = data.data;
  150. var rollout = content[(module.data.announcementInformationDetail.rollout-1)].dictLabel;
  151. module.data.announcementInformationDetail.rollout = rollout;
  152. var announcementInformationData = template('announcementInformationData', module.data);
  153. $("#announcementInformationContent").html(announcementInformationData);
  154. }
  155. }
  156. //公司性质
  157. module.companyDictionaries = function (data) {
  158. if (data.code == 200) {
  159. var content = data.data;
  160. var companyNature = content[(module.data.announcementInformationDetail.companyNature-1)].dictLabel;
  161. module.data.announcementInformationDetail.companyNature = companyNature;
  162. var announcementInformationData = template('announcementInformationData', module.data);
  163. $("#announcementInformationContent").html(announcementInformationData);
  164. }
  165. }
  166. //交易方式
  167. module.transactionDictionaries = function (data) {
  168. if (data.code == 200) {
  169. var content = data.data;
  170. var dealType = content[(module.data.announcementInformationDetail.dealType-1)].dictLabel;
  171. module.data.announcementInformationDetail.dealType = dealType;
  172. var announcementInformationData = template('announcementInformationData', module.data);
  173. $("#announcementInformationContent").html(announcementInformationData);
  174. }
  175. }
  176. //面积单位
  177. module.areaDictionaries = function (data) {
  178. if (data.code == 200) {
  179. var content = data.data;
  180. var allCountUnit = content[(module.data.announcementInformationDetail.allCountUnit-1)].dictLabel;
  181. module.data.announcementInformationDetail.allCountUnit = allCountUnit;
  182. var announcementInformationData = template('announcementInformationData', module.data);
  183. $("#announcementInformationContent").html(announcementInformationData);
  184. }
  185. }
  186. //成交价格单位
  187. module.unitDictionaries = function (data) {
  188. if (data.code == 200) {
  189. var content = data.data;
  190. var unit = content[(module.data.announcementInformationDetail.unit-1)].dictLabel;
  191. module.data.announcementInformationDetail.unit = unit;
  192. var announcementInformationData = template('announcementInformationData', module.data);
  193. $("#announcementInformationContent").html(announcementInformationData);
  194. }
  195. }
  196. return module;
  197. });