网站
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

238 行
10 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. //公告列表
  11. announcementInformationList:'',
  12. //鉴证列表
  13. attestationInformationList:'',
  14. //鉴证列表
  15. winTheBiddingInformationList:'',
  16. //鉴证列表
  17. inviteTendersInformationList:'',
  18. //页码
  19. pageNum: 1,
  20. //页码集合
  21. pageList: [],
  22. //每页数量
  23. pageSize: 50,
  24. //总页数
  25. pageCount:0,
  26. //选中卡ID
  27. clickType:'announcement'
  28. },
  29. };
  30. var tools = new Tools();
  31. module.init = function (page) {
  32. //获取焦点图信息
  33. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  34. //底部友情链接
  35. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  36. //成交公告
  37. tools.doGet(announList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.announInformation,true);
  38. var type = getQueryVariable('type');
  39. var keyWord = getQueryVariable('searchKeyWord');
  40. if(type != undefined && type != ''){
  41. //console.log('搜索进入')
  42. tabList(type);
  43. tools.doGet(jzsSearch, {deptId:100, jzsNum:keyWord,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.attestationInformation,true);
  44. }else{
  45. //console.log('正常进入')
  46. //鉴证公告
  47. tools.doGet(attestationList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.attestationInformation,true);
  48. tools.doGet(tenderList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.inviteTendersInformation,true);
  49. tools.doGet(winList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.winTheBiddingInformation,true);
  50. }
  51. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  52. tools.getWebConfig();
  53. };
  54. //焦点图数据
  55. module.focusNewsTop = function (data) {
  56. if (data.code == 200) {
  57. module.data.focusListTop = data.data;
  58. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  59. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  60. new Swiper('#bannerFocusWrapTop', {
  61. paginationClickable: true,
  62. autoplay : 4000,
  63. loop:true
  64. })
  65. }
  66. }
  67. //底部友情链接
  68. module.bottomFriendsLinks = function (data) {
  69. if (data.code == 200) {
  70. var content = data.data;
  71. //console.log(content)
  72. module.data.friendsLinksList = content;
  73. var friendsLinksData = template('friendsLinksData', module.data);
  74. $("#friendsLinksContent").html(friendsLinksData);
  75. }
  76. }
  77. //获取地址栏参数
  78. function getQueryVariable(variable){
  79. var query = window.location.search.substring(1);
  80. var vars = query.split("&");
  81. for (var i=0;i<vars.length;i++) {
  82. var pair = vars[i].split("=");
  83. if(pair[0] == variable){return pair[1];}
  84. }
  85. return(false);
  86. }
  87. //项目公告数据
  88. module.announInformation = function (data) {
  89. if (data.code == 200) {
  90. var content = data.rows;
  91. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  92. if (pageCount < 1){
  93. pageCount = 1;
  94. }
  95. if(module.data.announcementInformationList == ''){
  96. // 初始化 分页器
  97. var page_s1=createPage('.page_s1');
  98. // 设置分页
  99. setPage(page_s1,{
  100. pageTotal: data.total, // 数据总条数
  101. pageSize: module.data.pageSize, // 每页显示条数
  102. pageCurrent: 1, // 当前页
  103. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  104. })
  105. $('#page_s1').html('共'+pageCount+'页')
  106. }
  107. module.data.pageCount = pageCount;
  108. module.data.announcementInformationList = content;
  109. var announcementInformationData = template('announcementInformationData', module.data);
  110. $("#announcementInformationContent").html(announcementInformationData);
  111. }
  112. }
  113. //鉴证公告数据
  114. module.attestationInformation = function (data) {
  115. if (data.code == 200) {
  116. var content = data.rows;
  117. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  118. if (pageCount < 1){
  119. pageCount = 1;
  120. }
  121. if(module.data.attestationInformationList == ''){
  122. // 初始化 分页器
  123. var page_s1=createPage('.page_s2');
  124. // 设置分页
  125. setPage(page_s1,{
  126. pageTotal: data.total, // 数据总条数
  127. pageSize: module.data.pageSize, // 每页显示条数
  128. pageCurrent: 1, // 当前页
  129. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  130. })
  131. $('#page_s2').html('共'+pageCount+'页')
  132. }
  133. module.data.pageCount = pageCount;
  134. module.data.attestationInformationList = content;
  135. var attestationInformationData = template('attestationInformationData', module.data);
  136. $("#attestationInformationContent").html(attestationInformationData);
  137. }
  138. }
  139. //招标公告数据
  140. module.inviteTendersInformation = function (data) {
  141. if (data.code == 200) {
  142. var content = data.rows;
  143. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  144. if (pageCount < 1){
  145. pageCount = 1;
  146. }
  147. if(module.data.inviteTendersInformationList == ''){
  148. // 初始化 分页器
  149. var page_s1=createPage('.page_s3');
  150. // 设置分页
  151. setPage(page_s1,{
  152. pageTotal: data.toqtal, // 数据总条数
  153. pageSize: module.data.pageSize, // 每页显示条数
  154. pageCurrent: 1, // 当前页
  155. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  156. })
  157. $('#page_s3').html('共'+pageCount+'页')
  158. }
  159. module.data.pageCount = pageCount;
  160. module.data.inviteTendersInformationList = content;
  161. var inviteTendersInformationData = template('inviteTendersInformationData', module.data);
  162. $("#inviteTendersInformationContent").html(inviteTendersInformationData);
  163. }
  164. }
  165. //中标公告数据
  166. module.winTheBiddingInformation = function (data) {
  167. if (data.code == 200) {
  168. var content = data.rows;
  169. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  170. if (pageCount < 1){
  171. pageCount = 1;
  172. }
  173. if(module.data.winTheBiddingInformationList == ''){
  174. // 初始化 分页器
  175. var page_s1=createPage('.page_s4');
  176. // 设置分页
  177. setPage(page_s1,{
  178. pageTotal: data.total, // 数据总条数
  179. pageSize: module.data.pageSize, // 每页显示条数
  180. pageCurrent: 1, // 当前页
  181. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  182. })
  183. $('#page_s4').html('共'+pageCount+'页')
  184. }
  185. module.data.pageCount = pageCount;
  186. module.data.winTheBiddingInformationList = content;
  187. var winTheBiddingInformationData = template('winTheBiddingInformationData', module.data);
  188. $("#winTheBiddingInformationContent").html(winTheBiddingInformationData);
  189. }
  190. }
  191. tabList = function(type){
  192. //console.log(type)
  193. document.getElementById('attestationInformationContent').style.display = 'none';
  194. document.getElementById('announcementInformationContent').style.display = 'none';
  195. document.getElementById('inviteTendersInformationContent').style.display = 'none';
  196. document.getElementById('winTheBiddingInformationContent').style.display = 'none';
  197. document.getElementById(type+'InformationContent').style.display = 'block';
  198. document.getElementById('attestation').className = '';
  199. document.getElementById('announcement').className = '';
  200. document.getElementById('inviteTenders').className = '';
  201. document.getElementById('winTheBidding').className = '';
  202. document.getElementById(type).className = 'active';
  203. document.getElementById('attestationNum').style.display = 'none';
  204. document.getElementById('announcementNum').style.display = 'none';
  205. document.getElementById('inviteTendersNum').style.display = 'none';
  206. document.getElementById('winTheBiddingNum').style.display = 'none';
  207. document.getElementById(type+'Num').style.display = 'block';
  208. module.data.clickType = type;
  209. module.data.pageNum = 1 ;
  210. }
  211. turnThePage = function (pageNum) {
  212. module.data.pageNum = pageNum ;
  213. if(module.data.clickType == 'attestation'){
  214. if(getQueryVariable('searchKeyWord')!=undefined&&getQueryVariable('searchKeyWord')!=''){
  215. tools.doGet(jzsSearch, {deptId:100,projectName:getQueryVariable('searchKeyWord'),pageNum:pageNum,pageSize:module.data.pageSize}, module.attestationInformation,true);
  216. }
  217. tools.doGet(attestationList, {deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.attestationInformation,true);
  218. }
  219. if(module.data.clickType == 'announcement'){
  220. tools.doGet(announList, {deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.announInformation,true);
  221. }
  222. }
  223. return module;
  224. });