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

608 line
22 KiB

  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. focusListNext:[],
  14. //新闻资讯数据
  15. newsInformationList: [],
  16. //政策法规数据
  17. policiesRegulationsList: [],
  18. //交易规则数据
  19. tradingRulesList: [],
  20. //资料下载数据
  21. dataDownloadList: [],
  22. //标的物所在地
  23. deptLocationList:[],
  24. //标的物类型
  25. deptTypeList:[],
  26. //网站配置信息
  27. webConfigInformationList:[],
  28. //底部友情链接
  29. friendsLinksList:[],
  30. //土地林地四荒地数据
  31. landListList:[],
  32. //集体资产数据
  33. collectiveAssetsList:[],
  34. //小型水利设施数据
  35. waterConservancyFacilitiesList:[],
  36. //农业生产设备数据
  37. productionEquipmentList:[],
  38. //挂牌项目总浏览次数
  39. allViewCountList:[],
  40. //成交公示数据
  41. announcementListList:[],
  42. //鉴证公告数据
  43. attestationList:[]
  44. },
  45. //柱状图参数
  46. option: {
  47. xAxis: {
  48. type: 'category',
  49. axisLine: {
  50. show: true,
  51. lineStyle: {
  52. width: 1,
  53. type: "solid"
  54. }
  55. },
  56. axisLabel: { //设置x轴的字
  57. show: true,
  58. interval: 0,//使x轴横坐标全部显示
  59. textStyle: {//x轴字体样式
  60. margin: 15
  61. }
  62. },
  63. data: []
  64. },
  65. yAxis: {
  66. type: 'value',
  67. min: 400,
  68. max: 1000,
  69. splitNumber: 7,
  70. splitLine: {
  71. lineStyle: {
  72. type: 'dashed'
  73. }
  74. },
  75. axisLine: {
  76. show: true,
  77. lineStyle: {
  78. width: 1,
  79. type: "solid"
  80. }
  81. },
  82. },
  83. series: [{
  84. data: [],//实际值减300
  85. type: 'bar',
  86. itemStyle: {
  87. color: '#007b76'
  88. }
  89. }],
  90. grid: {
  91. height: 200,
  92. width: 280,
  93. top: '-5px'
  94. },
  95. tooltip: {
  96. trigger: "axis",
  97. axisPointer: {
  98. // 坐标轴指示器,坐标轴触发有效
  99. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  100. },
  101. },
  102. }
  103. };
  104. var tools = new Tools();
  105. module.init = function (page) {
  106. //获取焦点图信息
  107. tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews , true);
  108. //新闻资讯
  109. tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation , true);
  110. //政策法规
  111. tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations , true);
  112. //交易规则
  113. tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules , true);
  114. //资料下载
  115. tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload, true);
  116. //标的物所在地
  117. tools.doGet(webDept, {deptId:''}, module.deptLocation , true);
  118. //标的物类型
  119. tools.doGet(webDeptType+"/project_type", {}, module.deptType, true);
  120. //标的物类型下拉菜单
  121. tools.doGet(webDeptType+"/project_type", {}, module.deptTypeSelect, true);
  122. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  123. tools.getWebConfig();
  124. //底部友情链接
  125. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  126. //土地
  127. tools.doGet(webListing + '/1,2,3/0/3', {}, module.landList, true);
  128. //集体资产
  129. tools.doGet(webListing + '/4/0/3', {}, module.collectiveAssets, true);
  130. //农业生产设备
  131. tools.doGet(webListing + '/5/0/3', {}, module.productionEquipment, true);
  132. //小型水利设施
  133. tools.doGet(webListing + '/6/0/3', {}, module.waterConservancyFacilities, true);
  134. //查询挂牌项目浏览总次数
  135. tools.doGet(allViewCount + '/100', {}, module.allViewCount, true);
  136. //查询挂牌项目浏览总次数
  137. tools.doGet(announcementList + '/0/4', {}, module.announcementList, true);
  138. //查询挂牌项目浏览总次数
  139. tools.doGet(biddingHallList + '/0/10', {}, module.biddingHallList, true);
  140. //查询挂牌项目浏览总次数
  141. tools.doGet(attestationList + '/0/5', {}, module.attestationList, true);
  142. //个人供求
  143. tools.doGet(supplyDemand + '/100/1/5', {}, module.supplyDemand, true);
  144. tools.doGet(supplyDemand + '/100/2/5', {}, module.supplyDemand2, true);
  145. //互动交流
  146. tools.doGet(communicateList + '/100/5', {}, module.communicateList, true);
  147. //土地挂牌价格走势统计图
  148. tools.doGet(statistics, {deptId: 100}, module.statisticsContent, true);
  149. //竞价大厅-滚动
  150. module.hallRolling();
  151. };
  152. //焦点图数据
  153. module.focusNews = function (data) {
  154. if (data.code == 200) {
  155. var content = data.data;
  156. var focusList = [];
  157. for (var i = 0; i < content.length; i++) {
  158. var imgStrs = content[i].content.match(/<img.*?>/g)
  159. var title = content[i].title;
  160. var id = content[i].id;
  161. if (imgStrs != null && imgStrs != '') {
  162. focusList.push({img:imgStrs[0],title:title,id:id})
  163. }
  164. }
  165. console.log(focusList)
  166. module.data.focusList = focusList;
  167. var bannerFocusData = template('bannerFocusData', module.data);
  168. $("#bannerFocusContent").html(bannerFocusData);
  169. new Swiper('#bannerFocusWrap', {
  170. pagination: '.page-pagination',
  171. paginationClickable: true
  172. })
  173. }
  174. }
  175. module.statisticsContent = function(data){
  176. console.log(module.option)
  177. console.log(data)
  178. module.data.nowPriceAvg = data.nowPriceAvg;
  179. module.data.priceRate = data.priceRate;
  180. var statisticsData = template('statisticsData', module.data);
  181. $("#statisticsContent").html(statisticsData);
  182. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  183. module.option.xAxis.data[i] = data.priceAvgList[i].year
  184. module.option.series[0].data[i] = data.priceAvgList[i].price
  185. }
  186. // 柱状图绘制
  187. var chartDom = document.getElementById('chart');
  188. var myChart = echarts.init(chartDom);
  189. module.option && myChart.setOption(module.option);
  190. }
  191. //互动交流
  192. module.communicateList = function (data) {
  193. if (data.code == 200) {
  194. console.log(data.data)
  195. var content = data.data;
  196. module.data.communicateList = content;
  197. var communicateData = template('communicateData', module.data);
  198. $("#communicateContent").html(communicateData);
  199. }
  200. }
  201. //新闻资讯数据
  202. module.NewsInformation = function (data) {
  203. if (data.code == 200) {
  204. var content = data.data;
  205. console.log(content)
  206. module.data.newsInformationList = content;
  207. var NewsInformationData = template('NewsInformationData', module.data);
  208. $("#NewsInformationContent").html(NewsInformationData);
  209. }
  210. }
  211. //政策法规
  212. module.policiesRegulations = function (data) {
  213. if (data.code == 200) {
  214. var content = data.data;
  215. module.data.policiesRegulationsList = content;
  216. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  217. $("#policiesRegulationsContent").html(policiesRegulationsData);
  218. }
  219. }
  220. //交易规则
  221. module.tradingRules = function (data) {
  222. if (data.code == 200) {
  223. var content = data.data;
  224. module.data.tradingRulesList = content;
  225. var tradingRulesData = template('tradingRulesData', module.data);
  226. $("#tradingRulesContent").html(tradingRulesData);
  227. }
  228. }
  229. //资料下载
  230. module.dataDownload = function (data) {
  231. if (data.code == 200) {
  232. var content = data.data;
  233. module.data.dataDownloadList = content;
  234. var dataDownloadData = template('dataDownloadData', module.data);
  235. $("#dataDownloadContent").html(dataDownloadData);
  236. }
  237. }
  238. //标的物所在地
  239. module.deptLocation = function (data) {
  240. console.log(data)
  241. if (data.code == 200) {
  242. var content = data.data ;
  243. var contentList = [];
  244. for (var i = 0 ; i < 5 ; i++){
  245. contentList[i] = content[i];
  246. }
  247. module.data.deptLocationList = contentList;
  248. var deptLocationData = template('deptLocationData', module.data);
  249. $("#deptLocationContent").html(deptLocationData);
  250. }
  251. }
  252. //标的物类型
  253. module.deptType = function (data) {
  254. if (data.code == 200) {
  255. var content = [] ;
  256. for (var i = 0 ; i < 4 ; i++){
  257. content[i] = data.data[i];
  258. }
  259. module.data.deptTypeList = content;
  260. var deptTypeData = template('deptTypeData', module.data);
  261. $("#deptTypeContent").html(deptTypeData);
  262. }
  263. }
  264. //网站配置信息
  265. module.webConfigInformation = function (data) {
  266. if (data.code == 200) {
  267. var content = data.data;
  268. $("#webConfigName").html(content[0].configValue);
  269. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  270. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  271. }
  272. }
  273. //查询挂牌项目浏览总次数
  274. module.allViewCount = function (data) {
  275. if (data.code == 200) {
  276. var content = data.data;
  277. module.data.allViewCountList = content.toString().split("");
  278. var allViewCountData = template('allViewCountData', module.data);
  279. $("#allViewCount").html(allViewCountData);
  280. }
  281. }
  282. //底部友情链接
  283. module.bottomFriendsLinks = function (data) {
  284. if (data.code == 200) {
  285. var content = data.data;
  286. module.data.friendsLinksList = content;
  287. var friendsLinksData = template('friendsLinksData', module.data);
  288. $("#friendsLinksContent").html(friendsLinksData);
  289. }
  290. }
  291. //土地林地四荒地
  292. module.landList = function (data) {
  293. if (data.code == 200) {
  294. module.data.serverApi = serverApi;
  295. var content = data.data;
  296. module.data.landListList = content;
  297. var landListData = template('landListData', module.data);
  298. $("#landListContent").html(landListData);
  299. }
  300. }
  301. //集体资产
  302. module.collectiveAssets = function (data) {
  303. if (data.code == 200) {
  304. module.data.serverApi = serverApi;
  305. var content = data.data;
  306. module.data.collectiveAssetsList = content;
  307. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  308. $("#collectiveAssetsContent").html(collectiveAssetsData);
  309. }
  310. }
  311. //小型水利设施
  312. module.waterConservancyFacilities = function (data) {
  313. if (data.code == 200) {
  314. module.data.serverApi = serverApi;
  315. var content = data.data;
  316. module.data.waterConservancyFacilitiesList = content;
  317. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  318. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  319. }
  320. }
  321. //农业生产设备
  322. module.productionEquipment = function (data) {
  323. if (data.code == 200) {
  324. module.data.serverApi = serverApi;
  325. var content = data.data;
  326. module.data.productionEquipmentList = content;
  327. var productionEquipmentData = template('productionEquipmentData', module.data);
  328. $("#productionEquipmentContent").html(productionEquipmentData);
  329. }
  330. }
  331. //成交公示列表
  332. module.announcementList = function (data) {
  333. if (data.code == 200) {
  334. var content = data.data;
  335. module.data.announcementListList = content;
  336. var announcementListData = template('announcementListData', module.data);
  337. $("#announcementListContent").html(announcementListData);
  338. }
  339. }
  340. //鉴证公告列表
  341. module.attestationList = function (data) {
  342. if (data.code == 200) {
  343. var content = data.data;
  344. module.data.attestationList = content;
  345. var attestationData = template('attestationData', module.data);
  346. $("#attestationContent").html(attestationData);
  347. }
  348. }
  349. //竞价大厅列表
  350. module.biddingHallList = function (data) {
  351. if (data.code == 200) {
  352. var content = data.data;
  353. console.log(content)
  354. module.data.biddingHallListList = content;
  355. for(var i = 0 ; i < content.length ; i++){
  356. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  357. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  358. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  359. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  360. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  361. var nowTime = Date.parse(new Date());
  362. var leftTime = Date.parse(biddingStopTime)-nowTime;
  363. var rightTime = Date.parse(biddingStartTime)-nowTime;
  364. console.log(biddingStopTime)
  365. console.log(leftTime)
  366. if(leftTime>0){
  367. console.log('进行中')
  368. content[i].timeType = '进行中'
  369. }
  370. if(leftTime<0){
  371. console.log('已结束')
  372. content[i].timeType = '已结束'
  373. }
  374. if(rightTime>0){
  375. console.log('未开始')
  376. content[i].timeType = '未开始'
  377. }
  378. }
  379. console.log(content)
  380. var biddingHallListData = template('biddingHallListData', module.data);
  381. $("#biddingHallListContent").html(biddingHallListData);
  382. }
  383. }
  384. ///竞价大厅-滚动
  385. module.hallRolling = function () {
  386. var divScroll = document.getElementById('tableList');
  387. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  388. module.timeInter(divScroll);
  389. divScroll.onmouseover = function () {
  390. clearInterval(time);
  391. }
  392. divScroll.onmouseout = function () {
  393. module.timeInter(divScroll);
  394. }
  395. }
  396. //个人供求
  397. module.supplyDemand = function (data) {
  398. if (data.code == 200) {
  399. console.log(data)
  400. var content = data.data;
  401. module.data.supplyDemandList = content;
  402. var supplyDemandData = template('supplyDemandData', module.data);
  403. $("#supply").html(supplyDemandData);
  404. }
  405. }
  406. //个人供求
  407. module.supplyDemand2 = function (data) {
  408. if (data.code == 200) {
  409. console.log(data)
  410. var content = data.data;
  411. module.data.supplyDemand2List = content;
  412. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  413. $("#demand").html(supplyDemand2Data);
  414. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  415. }
  416. }
  417. module.supplyDemandRecommend = function(data){
  418. var focusListNext = module.data.focusListNext;
  419. for (var i = 0; i < data.data.length; i++) {
  420. var imgStrs = data.data[i].fileUrl
  421. if (imgStrs != null && imgStrs != '') {
  422. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName})
  423. }
  424. }
  425. console.log(focusListNext)
  426. module.data.focusListNext = focusListNext;
  427. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  428. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  429. new Swiper('#bannerFocusNextWrap', {
  430. paginationClickable: true
  431. })
  432. }
  433. module.supplyImages = function(){
  434. var focusListNext = module.data.focusListNext;
  435. console.log(module.data.supplyDemandList)
  436. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  437. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  438. var title = module.data.supplyDemandList[i].projectName
  439. if (imgStrs != null && imgStrs != '') {
  440. focusListNext.push({img:imgStrs[0],title:title})
  441. }
  442. }
  443. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  444. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  445. var title = module.data.supplyDemand2List[i].projectName
  446. if (imgStrs != null && imgStrs != '') {
  447. focusListNext.push({img:imgStrs[0],title:title})
  448. }
  449. }
  450. module.data.focusListNext = focusListNext;
  451. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  452. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  453. new Swiper('#bannerFocusNextWrap', {
  454. pagination: '.page-pagination1',
  455. paginationClickable: true
  456. })
  457. }
  458. module.timeInter = function (divScroll) {
  459. time = setInterval(function () {
  460. var oldTop = divScroll.scrollTop;
  461. var newTop = oldTop + 1;
  462. divScroll.scrollTop = newTop;
  463. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  464. if (1 > counst) {
  465. divScroll.scrollTop = 0;
  466. }
  467. }, 30)
  468. }
  469. //证书查询
  470. goSearchKeyWord = function(){
  471. var type = $('input[name="transaction"]:checked').val();
  472. var searchKeyWord = $('#searchKeyWord').val();
  473. if(type == 'warrant'){
  474. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  475. }else{
  476. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  477. }
  478. }
  479. //项目查询
  480. searchProject = function(){
  481. var projectNum = $('#projectNum').val();
  482. var projectName = $('#projectName').val();
  483. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  484. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  485. }
  486. //标的物类型
  487. module.deptTypeSelect = function (data) {
  488. if (data.code == 200) {
  489. console.log(data);
  490. var content = data.data ;
  491. module.data.deptTypeSelectList = content;
  492. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  493. $("#deptTypeSelectContent").html(deptTypeSelectData);
  494. }
  495. }
  496. //切换
  497. tabCheck = function (type) {
  498. if(type == 'supply'){
  499. document.getElementById('demand').style.display = 'none';
  500. document.getElementById('demandBtn').className = '';
  501. }
  502. if(type == 'demand'){
  503. document.getElementById('supply').style.display = 'none';
  504. document.getElementById('supplyBtn').className = '';
  505. }
  506. document.getElementById(type).style.display = 'inline-table';
  507. document.getElementById(type+'Btn').className = 'active';
  508. }
  509. goDetail = function (id) {
  510. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  511. }
  512. goUserInteract = function () {
  513. tools.skip('view/user/user.html?type=goInteract')
  514. }
  515. goListing = function () {
  516. tools.skip('view/listingItems/itemsList.html');
  517. }
  518. goAnnouncementList = function (type) {
  519. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  520. }
  521. goNewList = function () {
  522. tools.skip('view/new/newList.html');
  523. }
  524. goPolicy = function (type) {
  525. tools.skip('view/policy/policy.html?type='+type);
  526. }
  527. goBidding = function(){
  528. tools.skip('view/bidding/biddingList.html');
  529. }
  530. goDemand = function(){
  531. tools.skip('view/demand/demand.html');
  532. }
  533. goInteraction = function(){
  534. tools.skip('view/interact/interactList.html');
  535. }
  536. goInteractSearch = function(){
  537. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  538. }
  539. return module;
  540. });