网站
Você não pode selecionar mais de 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.

1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. //焦点图数据
  13. focusListTop: [],
  14. //底部焦点图
  15. focusListNext:[],
  16. //新闻资讯数据
  17. newsInformationList: [],
  18. //政策法规数据
  19. policiesRegulationsList: [],
  20. //交易规则数据
  21. tradingRulesList: [],
  22. //资料下载数据
  23. dataDownloadList: [],
  24. //标的物所在地
  25. deptLocationList:[],
  26. //标的物类型
  27. deptTypeList:[],
  28. //网站配置信息
  29. webConfigInformationList:[],
  30. //底部友情链接
  31. friendsLinksList:[],
  32. //土地林地四荒地数据
  33. landListList:[],
  34. //集体资产数据
  35. collectiveAssetsList:[],
  36. //小型水利设施数据
  37. waterConservancyFacilitiesList:[],
  38. //农业生产设备数据
  39. productionEquipmentList:[],
  40. //交易项目总浏览次数
  41. allViewCountList:[],
  42. //成交公示数据
  43. announcementListList:[],
  44. //鉴证公告数据
  45. attestationList:[],
  46. //供应列表
  47. supplyDemandList:[],
  48. //需求列表
  49. supplyDemand2List:[]
  50. },
  51. //柱状图参数
  52. option: {
  53. xAxis: {
  54. type: 'category',
  55. axisLine: {
  56. show: true,
  57. lineStyle: {
  58. width: 1,
  59. type: "solid"
  60. }
  61. },
  62. axisLabel: { //设置x轴的字
  63. show: true,
  64. interval: 0,//使x轴横坐标全部显示
  65. textStyle: {//x轴字体样式
  66. margin: 15
  67. }
  68. },
  69. data: []
  70. },
  71. yAxis: {
  72. type: 'value',
  73. min: 400,
  74. max: 1000,
  75. splitNumber: 7,
  76. splitLine: {
  77. lineStyle: {
  78. type: 'dashed'
  79. }
  80. },
  81. axisLine: {
  82. show: true,
  83. lineStyle: {
  84. width: 1,
  85. type: "solid"
  86. }
  87. },
  88. },
  89. series: [{
  90. data: [],//实际值减300
  91. type: 'bar',
  92. itemStyle: {
  93. color: '#007b76'
  94. }
  95. }],
  96. grid: {
  97. height: 200,
  98. width: 230,
  99. top: '-5px'
  100. },
  101. tooltip: {
  102. trigger: "axis",
  103. axisPointer: {
  104. // 坐标轴指示器,坐标轴触发有效
  105. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  106. },
  107. },
  108. }
  109. };
  110. var tools = new Tools();
  111. module.init = function (page) {
  112. //获取焦点图信息
  113. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  114. //获取焦点图信息
  115. tools.doGet(websitePicture, {picType:2,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsPC , true);
  116. //获取焦点图信息
  117. //tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews , true);
  118. //新闻资讯
  119. //tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation , true);
  120. //政策法规
  121. //tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations , true);
  122. //交易规则
  123. //tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules , true);
  124. //资料下载
  125. //tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload, true);
  126. //标的物所在地
  127. // tools.doGet(webDept, {deptId:''}, module.deptLocation , true);
  128. //标的物类型
  129. //tools.doGet(webDeptType+"/project_type", {}, module.deptType, true);
  130. //标的物类型下拉菜单
  131. // tools.doGet(webDeptType+"/project_type", {}, module.deptTypeSelect, true);
  132. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  133. tools.getWebConfig();
  134. //底部友情链接
  135. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  136. //供应项目
  137. tools.doGet(itemsList, {projectNumber:'',pageSize:'4',pageNum:'1',status:'Y'}, module.itemList, true);
  138. //需求项目
  139. tools.doGet(needProjectList, {projectNumber:'',pageSize:'4',pageNum:'1',status:'Y'}, module.itemLists, true);
  140. //农业生产设备
  141. // tools.doGet(webListing + '/9/0/5', {}, module.productionEquipment, true);
  142. //小型水利设施
  143. // tools.doGet(webListing + '/8/0/5', {}, module.waterConservancyFacilities, true);
  144. //查询交易项目浏览总次数
  145. // tools.doGet(allViewCount + '/100', {}, module.allViewCount, true);
  146. //查询交易项目浏览总次数
  147. tools.doGet(announcementList + '/0/4', {}, module.announcementList, true);
  148. //查询交易项目浏览总次数
  149. tools.doGet(biddingHallList + '/0/100', {}, module.biddingHallList, true);
  150. //查询交易项目浏览总次数
  151. tools.doGet(attestationList + '/0/5', {}, module.attestationList, true);
  152. //个人供求
  153. //tools.doGet(supplyDemand + '/100/1/5', {}, module.supplyDemand, true);
  154. //tools.doGet(supplyDemand + '/100/2/5', {}, module.supplyDemand2, true);
  155. //互动交流
  156. //tools.doGet(communicateList + '/100/5/notnull', {}, module.communicateList, true);
  157. //土地挂牌价格走势统计图
  158. // tools.doGet(statistics, {deptId: 100}, module.statisticsContent, true);
  159. tools.doGet(tenderList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.inviteTendersInformation,true);
  160. tools.doGet(winList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.winTheBiddingInformation,true);
  161. //竞价大厅-滚动
  162. module.hallRolling();
  163. setTimeout(function(){
  164. //主题图片切换
  165. module.switchTheme();
  166. },500)
  167. };
  168. //招标公告数据
  169. module.inviteTendersInformation = function (data) {
  170. if (data.code == 200) {
  171. var content = data.rows;
  172. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  173. if (pageCount < 1){
  174. pageCount = 1;
  175. }
  176. if(module.data.inviteTendersInformationList == ''){
  177. // 初始化 分页器
  178. var page_s1=createPage('.page_s3');
  179. // 设置分页
  180. setPage(page_s1,{
  181. pageTotal: data.toqtal, // 数据总条数
  182. pageSize: module.data.pageSize, // 每页显示条数
  183. pageCurrent: 1, // 当前页
  184. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  185. })
  186. $('#page_s3').html('共'+pageCount+'页')
  187. }
  188. module.data.pageCount = pageCount;
  189. module.data.inviteTendersInformationList = content;
  190. var inviteTendersInformationData = template('inviteTendersInformationData', module.data);
  191. $("#inviteTendersInformationContent").html(inviteTendersInformationData);
  192. }
  193. }
  194. //中标公告数据
  195. module.winTheBiddingInformation = function (data) {
  196. if (data.code == 200) {
  197. var content = data.rows;
  198. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  199. if (pageCount < 1){
  200. pageCount = 1;
  201. }
  202. if(module.data.winTheBiddingInformationList == ''){
  203. // 初始化 分页器
  204. var page_s1=createPage('.page_s4');
  205. // 设置分页
  206. setPage(page_s1,{
  207. pageTotal: data.total, // 数据总条数
  208. pageSize: module.data.pageSize, // 每页显示条数
  209. pageCurrent: 1, // 当前页
  210. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  211. })
  212. $('#page_s4').html('共'+pageCount+'页')
  213. }
  214. module.data.pageCount = pageCount;
  215. module.data.winTheBiddingInformationList = content;
  216. var winTheBiddingInformationData = template('winTheBiddingInformationData', module.data);
  217. $("#winTheBiddingInformationContent").html(winTheBiddingInformationData);
  218. }
  219. }
  220. //主题图片切换
  221. module.switchTheme = function(){
  222. if(themeColor == 'red'){
  223. document.getElementById('centerBanner').src = './static/images/centerBanner_red.jpg'
  224. document.getElementById('bannerBottom').src = './static/images/bannerBottom_red.jpg'
  225. }else if(themeColor == 'green'){
  226. document.getElementById('centerBanner').src = './static/images/centerBanner.jpg'
  227. document.getElementById('bannerBottom').src = './static/images/bannerBottom.jpg'
  228. }
  229. }
  230. //焦点图数据
  231. module.focusNewsTop = function (data) {
  232. if (data.code == 200) {
  233. let focusArray = [];
  234. if(data.data.length<1){
  235. focusArray.push({
  236. img:'../static/images/banner320.jpg'
  237. })
  238. }else{
  239. data.data.forEach(res=>{
  240. focusArray.push({
  241. img:'/api'+res.picUrl
  242. })
  243. })
  244. }
  245. module.data.focusList = focusArray;
  246. var bannerFocusData = template('bannerFocusData', module.data);
  247. $("#bannerFocusContent").html(bannerFocusData);
  248. new Swiper('#bannerFocusWrap', {
  249. pagination: '.page-pagination',
  250. paginationClickable: true,
  251. autoplay : 5000,
  252. loop:true
  253. })
  254. }
  255. }
  256. //焦点图数据
  257. module.focusNewsPC = function (data) {
  258. if (data.code == 200) {
  259. module.data.focusListPC = data.data;
  260. var bannerFocusDataPC = template('bannerFocusDataPC', module.data);
  261. $("#bannerFocusPCContent").html(bannerFocusDataPC);
  262. }
  263. }
  264. //焦点图数据
  265. module.focusNews = function (data) {
  266. if (data.code == 200) {
  267. var content = data.data;
  268. var focusList = [];
  269. for (var i = 0; i < content.length; i++) {
  270. var imgStrs = content[i].content.match(/<img.*?>/g)
  271. var title = content[i].title;
  272. var id = content[i].id;
  273. if (imgStrs != null && imgStrs != '') {
  274. focusList.push({img:imgStrs[0],title:title,id:id})
  275. }
  276. }
  277. //console.log(focusList)
  278. module.data.focusList = focusList;
  279. var bannerFocusData = template('bannerFocusData', module.data);
  280. $("#bannerFocusContent").html(bannerFocusData);
  281. new Swiper('#bannerFocusWrap', {
  282. pagination: '.page-pagination',
  283. paginationClickable: true,
  284. autoplay : 2000,
  285. loop:true
  286. })
  287. }
  288. }
  289. module.statisticsContent = function(data){
  290. //console.log(module.option)
  291. //console.log(data)
  292. module.data.nowPriceAvg = data.nowPriceAvg;
  293. module.data.priceRate = data.priceRate;
  294. var statisticsData = template('statisticsData', module.data);
  295. $("#statisticsContent").html(statisticsData);
  296. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  297. module.option.xAxis.data[i] = data.priceAvgList[i].year
  298. module.option.series[0].data[i] = data.priceAvgList[i].price
  299. }
  300. // 柱状图绘制
  301. var chartDom = document.getElementById('chart');
  302. var myChart = echarts.init(chartDom);
  303. module.option && myChart.setOption(module.option);
  304. }
  305. //互动交流
  306. module.communicateList = function (data) {
  307. if (data.code == 200) {
  308. //console.log(data.data)
  309. var content = data.data;
  310. module.data.communicateList = content;
  311. var communicateData = template('communicateData', module.data);
  312. $("#communicateContent").html(communicateData);
  313. }
  314. }
  315. //新闻资讯数据
  316. module.NewsInformation = function (data) {
  317. if (data.code == 200) {
  318. var content = data.data;
  319. //console.log(content)
  320. module.data.newsInformationList = content;
  321. var NewsInformationData = template('NewsInformationData', module.data);
  322. $("#NewsInformationContent").html(NewsInformationData);
  323. }
  324. }
  325. //政策法规
  326. module.policiesRegulations = function (data) {
  327. if (data.code == 200) {
  328. var content = data.data;
  329. module.data.policiesRegulationsList = content;
  330. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  331. $("#policiesRegulationsContent").html(policiesRegulationsData);
  332. }
  333. }
  334. //交易规则
  335. module.tradingRules = function (data) {
  336. if (data.code == 200) {
  337. var content = data.data;
  338. module.data.tradingRulesList = content;
  339. var tradingRulesData = template('tradingRulesData', module.data);
  340. $("#tradingRulesContent").html(tradingRulesData);
  341. }
  342. }
  343. //资料下载
  344. module.dataDownload = function (data) {
  345. if (data.code == 200) {
  346. var content = data.data;
  347. module.data.dataDownloadList = content;
  348. var dataDownloadData = template('dataDownloadData', module.data);
  349. $("#dataDownloadContent").html(dataDownloadData);
  350. }
  351. }
  352. //标的物所在地
  353. module.deptLocation = function (data) {
  354. //console.log(data)
  355. if (data.code == 200) {
  356. var content = data.data ;
  357. var contentList = [];
  358. for (var i = 0 ; i < 5&&i<content.length ; i++){
  359. contentList[i] = content[i];
  360. }
  361. module.data.deptLocationList = contentList;
  362. var deptLocationData = template('deptLocationData', module.data);
  363. $("#deptLocationContent").html(deptLocationData);
  364. }
  365. }
  366. //标的物类型
  367. module.deptType = function (data) {
  368. if (data.code == 200) {
  369. var content = data.data ;
  370. // for (var i = 0 ; i < 4 ; i++){
  371. // content[i] = data.data[i];
  372. // }
  373. module.data.deptTypeList = content;
  374. var deptTypeData = template('deptTypeData', module.data);
  375. $("#deptTypeContent").html(deptTypeData);
  376. module.data.deptTypeList1 = content;
  377. var deptTypeData1 = template('deptTypeData1', module.data);
  378. $("#deptTypeContent1").html(deptTypeData1);
  379. }
  380. }
  381. //网站配置信息
  382. module.webConfigInformation = function (data) {
  383. if (data.code == 200) {
  384. var content = data.data;
  385. //console.log(content)
  386. $("#webConfigName").html(content[0].configValue);
  387. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  388. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  389. }
  390. }
  391. //查询交易项目浏览总次数
  392. module.allViewCount = function (data) {
  393. if (data.code == 200) {
  394. var content = data.data;
  395. module.data.allViewCountList = content.toString().split("");
  396. var allViewCountData = template('allViewCountData', module.data);
  397. $("#allViewCount").html(allViewCountData);
  398. }
  399. }
  400. //底部友情链接
  401. module.bottomFriendsLinks = function (data) {
  402. if (data.code == 200) {
  403. var content = data.data;
  404. //console.log(content)
  405. module.data.friendsLinksList = content;
  406. var friendsLinksData = template('friendsLinksData', module.data);
  407. $("#friendsLinksContent").html(friendsLinksData);
  408. }
  409. }
  410. //土地林地四荒地
  411. module.landList = function (data) {
  412. if (data.code == 200) {
  413. module.data.serverApi = serverApi;
  414. var content = data.data;
  415. for (let i = 0 ; i < 5 ; i++){
  416. if (content[i]==undefined){
  417. module.data.landListList.push({
  418. projectShowStatus:'',
  419. projectName :'',
  420. price :'',
  421. unit :'',
  422. outName :'',
  423. signupStopTime :'',
  424. biddingStopTime :'',
  425. locationName:'',
  426. });
  427. }else{
  428. module.data.landListList.push(content[i]);
  429. }
  430. }
  431. // module.data.landListList = content;
  432. var landListData = template('landListData', module.data);
  433. $("#landListContent").html(landListData);
  434. }
  435. }
  436. module.itemList = function (data) {
  437. if (data.code == 200) {
  438. //console.log(data)
  439. module.data.serverApi = serverApi;
  440. var content = data.rows;
  441. module.data.landListList = content;
  442. var landListData = template('landListData', module.data);
  443. $("#landListContent").html(landListData);
  444. }
  445. }
  446. module.itemLists = function (data) {
  447. if (data.code == 200) {
  448. //console.log(data)
  449. module.data.serverApi = serverApi;
  450. var content = data.rows;
  451. module.data.collectiveAssetsList = content;
  452. // module.data.collectiveAssetsList = content;
  453. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  454. $("#collectiveAssetsContent").html(collectiveAssetsData);
  455. }
  456. }
  457. //土地林地四荒地
  458. goListingChange = function (id) {
  459. module.data.landListList = [];
  460. $('#deptTypeContent').children('span').removeClass('active') ;
  461. document.getElementById('tab'+id).className = 'm-r-20 active';
  462. if (id == 0){
  463. tools.doGet(itemsList, {projectNumber:'',pageSize:'5',pageNum:'1'}, module.itemList, true);
  464. }else{
  465. //土地
  466. tools.doGet(webListing + '/'+id+'/0/5', {}, module.landList, true);
  467. }
  468. }
  469. //土地林地四荒地
  470. goListingChanges = function (id) {
  471. module.data.collectiveAssetsList = [];
  472. $('#deptTypeContent1').children('span').removeClass('active');
  473. document.getElementById('tabs'+id).className = 'm-r-20 active';
  474. tools.doGet(needProjectList, {projectNumber:id==0?'':id,pageSize:'5',pageNum:'1'}, module.itemLists, true);
  475. }
  476. //集体资产
  477. module.collectiveAssets = function (data) {
  478. if (data.code == 200) {
  479. module.data.serverApi = serverApi;
  480. var content = data.data;
  481. module.data.collectiveAssetsList = content;
  482. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  483. $("#collectiveAssetsContent").html(collectiveAssetsData);
  484. }
  485. }
  486. //小型水利设施
  487. module.waterConservancyFacilities = function (data) {
  488. if (data.code == 200) {
  489. module.data.serverApi = serverApi;
  490. var content = data.data;
  491. module.data.waterConservancyFacilitiesList = content;
  492. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  493. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  494. }
  495. }
  496. //农业生产设备
  497. module.productionEquipment = function (data) {
  498. if (data.code == 200) {
  499. module.data.serverApi = serverApi;
  500. var content = data.data;
  501. module.data.productionEquipmentList = content;
  502. var productionEquipmentData = template('productionEquipmentData', module.data);
  503. $("#productionEquipmentContent").html(productionEquipmentData);
  504. }
  505. }
  506. //成交公示列表
  507. module.announcementList = function (data) {
  508. if (data.code == 200) {
  509. var content = data.data;
  510. module.data.announcementListList = content;
  511. var announcementListData = template('announcementListData', module.data);
  512. $("#announcementListContent").html(announcementListData);
  513. }
  514. }
  515. //鉴证公告列表
  516. module.attestationList = function (data) {
  517. if (data.code == 200) {
  518. var content = data.data;
  519. module.data.attestationList = content;
  520. var attestationData = template('attestationData', module.data);
  521. $("#attestationContent").html(attestationData);
  522. }
  523. }
  524. //竞价大厅列表
  525. module.biddingHallList = function (data) {
  526. if (data.code == 200) {
  527. var content = data.data;
  528. //console.log(content)
  529. for(var i = 0 ; i < content.length ; i++){
  530. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  531. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  532. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  533. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  534. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  535. var nowTime = Date.parse(new Date());
  536. var leftTime = Date.parse(biddingStopTime)-nowTime;
  537. var rightTime = Date.parse(biddingStartTime)-nowTime;
  538. //console.log(biddingStopTime)
  539. //console.log(leftTime)
  540. if(leftTime>0){
  541. //console.log('进行中')
  542. content[i].timeType = '进行中'
  543. }
  544. if(leftTime<0){
  545. //console.log('已结束')
  546. content[i].timeType = '已结束'
  547. }
  548. if(rightTime>0){
  549. //console.log('未开始')
  550. content[i].timeType = '未开始'
  551. }
  552. }
  553. module.data.biddingHallListList = content;
  554. //console.log(content)
  555. var biddingHallListData = template('biddingHallListData', module.data);
  556. $("#biddingHallListContent").html(biddingHallListData);
  557. }
  558. }
  559. ///竞价大厅-滚动
  560. module.hallRolling = function () {
  561. var divScroll = document.getElementById('tableList');
  562. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  563. module.timeInter(divScroll);
  564. divScroll.onmouseover = function () {
  565. clearInterval(time);
  566. }
  567. divScroll.onmouseout = function () {
  568. module.timeInter(divScroll);
  569. }
  570. }
  571. //个人供求
  572. module.supplyDemand = function (data) {
  573. if (data.code == 200) {
  574. //console.log(data)
  575. var content = data.data;
  576. for (let i = 0 ; i < 5 ; i++){
  577. if (content[i]==undefined){
  578. module.data.supplyDemandList.push({
  579. id:'',
  580. projectName:'',
  581. logintime:'',
  582. phone:'',
  583. });
  584. }else{
  585. module.data.supplyDemandList.push(content[i]);
  586. }
  587. }
  588. // module.data.supplyDemandList = content;
  589. var supplyDemandData = template('supplyDemandData', module.data);
  590. $("#supply").html(supplyDemandData);
  591. }
  592. }
  593. //个人供求
  594. module.supplyDemand2 = function (data) {
  595. if (data.code == 200) {
  596. //console.log(data)
  597. var content = data.data;
  598. for (let i = 0 ; i < 5 ; i++){
  599. if (content[i]==undefined){
  600. module.data.supplyDemand2List.push({
  601. id:'',
  602. projectName:'',
  603. logintime:'',
  604. phone:'',
  605. });
  606. }else{
  607. module.data.supplyDemand2List.push(content[i]);
  608. }
  609. }
  610. // module.data.supplyDemand2List = content;
  611. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  612. $("#demand").html(supplyDemand2Data);
  613. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  614. }
  615. }
  616. module.supplyDemandRecommend = function(data){
  617. var focusListNext = module.data.focusListNext;
  618. for (var i = 0; i < data.data.length; i++) {
  619. var imgStrs = data.data[i].fileUrl
  620. if (imgStrs != null && imgStrs != '') {
  621. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName,id:data.data[i].id})
  622. }
  623. }
  624. //console.log(data)
  625. module.data.focusListNext = focusListNext;
  626. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  627. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  628. new Swiper('#bannerFocusNextWrap', {
  629. paginationClickable: true,
  630. pagination: '.a2',
  631. autoplay : 2000,
  632. loop:true
  633. })
  634. }
  635. module.supplyImages = function(){
  636. var focusListNext = module.data.focusListNext;
  637. //console.log(module.data.supplyDemandList)
  638. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  639. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  640. var title = module.data.supplyDemandList[i].projectName
  641. if (imgStrs != null && imgStrs != '') {
  642. focusListNext.push({img:imgStrs[0],title:title})
  643. }
  644. }
  645. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  646. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  647. var title = module.data.supplyDemand2List[i].projectName
  648. if (imgStrs != null && imgStrs != '') {
  649. focusListNext.push({img:imgStrs[0],title:title})
  650. }
  651. }
  652. module.data.focusListNext = focusListNext;
  653. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  654. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  655. new Swiper('#bannerFocusNextWrap', {
  656. pagination: '.page-pagination1',
  657. paginationClickable: true
  658. })
  659. }
  660. module.timeInter = function (divScroll) {
  661. time = setInterval(function () {
  662. var oldTop = divScroll.scrollTop;
  663. var newTop = oldTop + 1;
  664. divScroll.scrollTop = newTop;
  665. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  666. //console.log(counst)
  667. if (2 > counst) {
  668. divScroll.scrollTop = 0;
  669. }
  670. }, 30)
  671. }
  672. //证书查询
  673. goSearchKeyWord = function(){
  674. var type = $('input[name="transaction"]:checked').val();
  675. var searchKeyWord = $('#searchKeyWord').val();
  676. //console.log($('#searchKeyWord').val())
  677. //console.log(type)
  678. if($('#searchKeyWord').val() == '' && type== 'warrant'){
  679. tools.initDialog('提示', '经营权证编号不可为空', function () {
  680. return;
  681. }, '确定')
  682. return;
  683. }
  684. if(type == 'warrant'){
  685. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  686. }else{
  687. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  688. }
  689. }
  690. //项目查询
  691. searchProject = function(){
  692. var projectNum = $('#projectNum').val();
  693. var projectName = $('#projectName').val();
  694. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  695. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  696. }
  697. //标的物类型
  698. module.deptTypeSelect = function (data) {
  699. if (data.code == 200) {
  700. //console.log(data);
  701. var content = data.data ;
  702. module.data.deptTypeSelectList = content;
  703. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  704. $("#deptTypeSelectContent").html(deptTypeSelectData);
  705. }
  706. }
  707. //切换
  708. tabCheck = function (type) {
  709. if(type == 'supply'){
  710. document.getElementById('demand').style.display = 'none';
  711. document.getElementById('demandBtn').className = '';
  712. }
  713. if(type == 'demand'){
  714. document.getElementById('supply').style.display = 'none';
  715. document.getElementById('supplyBtn').className = '';
  716. }
  717. document.getElementById(type).style.display = 'inline-table';
  718. document.getElementById(type+'Btn').className = 'active';
  719. }
  720. //切换
  721. tabClick = function (type) {
  722. document.getElementById('cjgg').style.display = 'none';
  723. document.getElementById('jzgg').style.display = 'none';
  724. document.getElementById('zbgg').style.display = 'none';
  725. document.getElementById('zbjg').style.display = 'none';
  726. document.getElementById('cjggBtn').className = '';
  727. document.getElementById('jzggBtn').className = '';
  728. document.getElementById('zbggBtn').className = '';
  729. document.getElementById('zbjgBtn').className = '';
  730. document.getElementById(type).style.display = 'block';
  731. document.getElementById(type+'Btn').className = 'active';
  732. }
  733. //切换
  734. tabClickGYXQ = function (type) {
  735. document.getElementById('landListContent').style.display = 'none';
  736. document.getElementById('collectiveAssetsContent').style.display = 'none';
  737. document.getElementById('landListBtn').className = '';
  738. document.getElementById('collectiveAssetsBtn').className = '';
  739. document.getElementById(type+'Content').style.display = 'block';
  740. document.getElementById(type+'Btn').className = 'active';
  741. }
  742. goDetail = function (id) {
  743. if (!id)return;
  744. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  745. }
  746. goUserInteract = function () {
  747. tools.skip('view/user/user.html?type=goInteract')
  748. }
  749. goListing = function (clickType,dictSort,dictCode) {
  750. tools.skip('view/listingItems/itemsList.html?clickType='+clickType+'&dictSort='+dictSort+'&dictCode='+dictCode);
  751. }
  752. goAnnouncementList = function (type) {
  753. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  754. }
  755. goNewList = function () {
  756. tools.skip('view/new/newList.html');
  757. }
  758. goPolicy = function (type) {
  759. tools.skip('view/policy/policy.html?type='+type);
  760. }
  761. goBidding = function(){
  762. tools.skip('view/bidding/biddingList.html');
  763. }
  764. goDemand = function(){
  765. tools.skip('view/demand/demand.html');
  766. }
  767. goInteraction = function(){
  768. tools.skip('view/interact/interactList.html');
  769. }
  770. goInteractSearch = function(){
  771. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  772. }
  773. return module;
  774. });