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

610 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. console.log(content)
  269. $("#webConfigName").html(content[0].configValue);
  270. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  271. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  272. }
  273. }
  274. //查询挂牌项目浏览总次数
  275. module.allViewCount = function (data) {
  276. if (data.code == 200) {
  277. var content = data.data;
  278. module.data.allViewCountList = content.toString().split("");
  279. var allViewCountData = template('allViewCountData', module.data);
  280. $("#allViewCount").html(allViewCountData);
  281. }
  282. }
  283. //底部友情链接
  284. module.bottomFriendsLinks = function (data) {
  285. if (data.code == 200) {
  286. var content = data.data;
  287. console.log(content)
  288. module.data.friendsLinksList = content;
  289. var friendsLinksData = template('friendsLinksData', module.data);
  290. $("#friendsLinksContent").html(friendsLinksData);
  291. }
  292. }
  293. //土地林地四荒地
  294. module.landList = function (data) {
  295. if (data.code == 200) {
  296. module.data.serverApi = serverApi;
  297. var content = data.data;
  298. module.data.landListList = content;
  299. var landListData = template('landListData', module.data);
  300. $("#landListContent").html(landListData);
  301. }
  302. }
  303. //集体资产
  304. module.collectiveAssets = function (data) {
  305. if (data.code == 200) {
  306. module.data.serverApi = serverApi;
  307. var content = data.data;
  308. module.data.collectiveAssetsList = content;
  309. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  310. $("#collectiveAssetsContent").html(collectiveAssetsData);
  311. }
  312. }
  313. //小型水利设施
  314. module.waterConservancyFacilities = function (data) {
  315. if (data.code == 200) {
  316. module.data.serverApi = serverApi;
  317. var content = data.data;
  318. module.data.waterConservancyFacilitiesList = content;
  319. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  320. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  321. }
  322. }
  323. //农业生产设备
  324. module.productionEquipment = function (data) {
  325. if (data.code == 200) {
  326. module.data.serverApi = serverApi;
  327. var content = data.data;
  328. module.data.productionEquipmentList = content;
  329. var productionEquipmentData = template('productionEquipmentData', module.data);
  330. $("#productionEquipmentContent").html(productionEquipmentData);
  331. }
  332. }
  333. //成交公示列表
  334. module.announcementList = function (data) {
  335. if (data.code == 200) {
  336. var content = data.data;
  337. module.data.announcementListList = content;
  338. var announcementListData = template('announcementListData', module.data);
  339. $("#announcementListContent").html(announcementListData);
  340. }
  341. }
  342. //鉴证公告列表
  343. module.attestationList = function (data) {
  344. if (data.code == 200) {
  345. var content = data.data;
  346. module.data.attestationList = content;
  347. var attestationData = template('attestationData', module.data);
  348. $("#attestationContent").html(attestationData);
  349. }
  350. }
  351. //竞价大厅列表
  352. module.biddingHallList = function (data) {
  353. if (data.code == 200) {
  354. var content = data.data;
  355. console.log(content)
  356. module.data.biddingHallListList = content;
  357. for(var i = 0 ; i < content.length ; i++){
  358. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  359. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  360. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  361. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  362. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  363. var nowTime = Date.parse(new Date());
  364. var leftTime = Date.parse(biddingStopTime)-nowTime;
  365. var rightTime = Date.parse(biddingStartTime)-nowTime;
  366. console.log(biddingStopTime)
  367. console.log(leftTime)
  368. if(leftTime>0){
  369. console.log('进行中')
  370. content[i].timeType = '进行中'
  371. }
  372. if(leftTime<0){
  373. console.log('已结束')
  374. content[i].timeType = '已结束'
  375. }
  376. if(rightTime>0){
  377. console.log('未开始')
  378. content[i].timeType = '未开始'
  379. }
  380. }
  381. console.log(content)
  382. var biddingHallListData = template('biddingHallListData', module.data);
  383. $("#biddingHallListContent").html(biddingHallListData);
  384. }
  385. }
  386. ///竞价大厅-滚动
  387. module.hallRolling = function () {
  388. var divScroll = document.getElementById('tableList');
  389. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  390. module.timeInter(divScroll);
  391. divScroll.onmouseover = function () {
  392. clearInterval(time);
  393. }
  394. divScroll.onmouseout = function () {
  395. module.timeInter(divScroll);
  396. }
  397. }
  398. //个人供求
  399. module.supplyDemand = function (data) {
  400. if (data.code == 200) {
  401. console.log(data)
  402. var content = data.data;
  403. module.data.supplyDemandList = content;
  404. var supplyDemandData = template('supplyDemandData', module.data);
  405. $("#supply").html(supplyDemandData);
  406. }
  407. }
  408. //个人供求
  409. module.supplyDemand2 = function (data) {
  410. if (data.code == 200) {
  411. console.log(data)
  412. var content = data.data;
  413. module.data.supplyDemand2List = content;
  414. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  415. $("#demand").html(supplyDemand2Data);
  416. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  417. }
  418. }
  419. module.supplyDemandRecommend = function(data){
  420. var focusListNext = module.data.focusListNext;
  421. for (var i = 0; i < data.data.length; i++) {
  422. var imgStrs = data.data[i].fileUrl
  423. if (imgStrs != null && imgStrs != '') {
  424. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName})
  425. }
  426. }
  427. console.log(focusListNext)
  428. module.data.focusListNext = focusListNext;
  429. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  430. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  431. new Swiper('#bannerFocusNextWrap', {
  432. paginationClickable: true
  433. })
  434. }
  435. module.supplyImages = function(){
  436. var focusListNext = module.data.focusListNext;
  437. console.log(module.data.supplyDemandList)
  438. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  439. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  440. var title = module.data.supplyDemandList[i].projectName
  441. if (imgStrs != null && imgStrs != '') {
  442. focusListNext.push({img:imgStrs[0],title:title})
  443. }
  444. }
  445. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  446. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  447. var title = module.data.supplyDemand2List[i].projectName
  448. if (imgStrs != null && imgStrs != '') {
  449. focusListNext.push({img:imgStrs[0],title:title})
  450. }
  451. }
  452. module.data.focusListNext = focusListNext;
  453. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  454. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  455. new Swiper('#bannerFocusNextWrap', {
  456. pagination: '.page-pagination1',
  457. paginationClickable: true
  458. })
  459. }
  460. module.timeInter = function (divScroll) {
  461. time = setInterval(function () {
  462. var oldTop = divScroll.scrollTop;
  463. var newTop = oldTop + 1;
  464. divScroll.scrollTop = newTop;
  465. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  466. if (1 > counst) {
  467. divScroll.scrollTop = 0;
  468. }
  469. }, 30)
  470. }
  471. //证书查询
  472. goSearchKeyWord = function(){
  473. var type = $('input[name="transaction"]:checked').val();
  474. var searchKeyWord = $('#searchKeyWord').val();
  475. if(type == 'warrant'){
  476. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  477. }else{
  478. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  479. }
  480. }
  481. //项目查询
  482. searchProject = function(){
  483. var projectNum = $('#projectNum').val();
  484. var projectName = $('#projectName').val();
  485. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  486. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  487. }
  488. //标的物类型
  489. module.deptTypeSelect = function (data) {
  490. if (data.code == 200) {
  491. console.log(data);
  492. var content = data.data ;
  493. module.data.deptTypeSelectList = content;
  494. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  495. $("#deptTypeSelectContent").html(deptTypeSelectData);
  496. }
  497. }
  498. //切换
  499. tabCheck = function (type) {
  500. if(type == 'supply'){
  501. document.getElementById('demand').style.display = 'none';
  502. document.getElementById('demandBtn').className = '';
  503. }
  504. if(type == 'demand'){
  505. document.getElementById('supply').style.display = 'none';
  506. document.getElementById('supplyBtn').className = '';
  507. }
  508. document.getElementById(type).style.display = 'inline-table';
  509. document.getElementById(type+'Btn').className = 'active';
  510. }
  511. goDetail = function (id) {
  512. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  513. }
  514. goUserInteract = function () {
  515. tools.skip('view/user/user.html?type=goInteract')
  516. }
  517. goListing = function () {
  518. tools.skip('view/listingItems/itemsList.html');
  519. }
  520. goAnnouncementList = function (type) {
  521. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  522. }
  523. goNewList = function () {
  524. tools.skip('view/new/newList.html');
  525. }
  526. goPolicy = function (type) {
  527. tools.skip('view/policy/policy.html?type='+type);
  528. }
  529. goBidding = function(){
  530. tools.skip('view/bidding/biddingList.html');
  531. }
  532. goDemand = function(){
  533. tools.skip('view/demand/demand.html');
  534. }
  535. goInteraction = function(){
  536. tools.skip('view/interact/interactList.html');
  537. }
  538. goInteractSearch = function(){
  539. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  540. }
  541. return module;
  542. });