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

624 行
23 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. setTimeout(function(){
  152. //主题图片切换
  153. module.switchTheme();
  154. },500)
  155. };
  156. //主题图片切换
  157. module.switchTheme = function(){
  158. if(themeColor == 'red'){
  159. document.getElementById('centerBanner').src = './static/images/centerBanner_red.jpg'
  160. document.getElementById('bannerBottom').src = './static/images/bannerBottom_red.jpg'
  161. }else if(themeColor == 'green'){
  162. document.getElementById('centerBanner').src = './static/images/centerBanner.jpg'
  163. document.getElementById('bannerBottom').src = './static/images/bannerBottom.jpg'
  164. }
  165. }
  166. //焦点图数据
  167. module.focusNews = function (data) {
  168. if (data.code == 200) {
  169. var content = data.data;
  170. var focusList = [];
  171. for (var i = 0; i < content.length; i++) {
  172. var imgStrs = content[i].content.match(/<img.*?>/g)
  173. var title = content[i].title;
  174. var id = content[i].id;
  175. if (imgStrs != null && imgStrs != '') {
  176. focusList.push({img:imgStrs[0],title:title,id:id})
  177. }
  178. }
  179. console.log(focusList)
  180. module.data.focusList = focusList;
  181. var bannerFocusData = template('bannerFocusData', module.data);
  182. $("#bannerFocusContent").html(bannerFocusData);
  183. new Swiper('#bannerFocusWrap', {
  184. pagination: '.page-pagination',
  185. paginationClickable: true
  186. })
  187. }
  188. }
  189. module.statisticsContent = function(data){
  190. console.log(module.option)
  191. console.log(data)
  192. module.data.nowPriceAvg = data.nowPriceAvg;
  193. module.data.priceRate = data.priceRate;
  194. var statisticsData = template('statisticsData', module.data);
  195. $("#statisticsContent").html(statisticsData);
  196. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  197. module.option.xAxis.data[i] = data.priceAvgList[i].year
  198. module.option.series[0].data[i] = data.priceAvgList[i].price
  199. }
  200. // 柱状图绘制
  201. var chartDom = document.getElementById('chart');
  202. var myChart = echarts.init(chartDom);
  203. module.option && myChart.setOption(module.option);
  204. }
  205. //互动交流
  206. module.communicateList = function (data) {
  207. if (data.code == 200) {
  208. console.log(data.data)
  209. var content = data.data;
  210. module.data.communicateList = content;
  211. var communicateData = template('communicateData', module.data);
  212. $("#communicateContent").html(communicateData);
  213. }
  214. }
  215. //新闻资讯数据
  216. module.NewsInformation = function (data) {
  217. if (data.code == 200) {
  218. var content = data.data;
  219. console.log(content)
  220. module.data.newsInformationList = content;
  221. var NewsInformationData = template('NewsInformationData', module.data);
  222. $("#NewsInformationContent").html(NewsInformationData);
  223. }
  224. }
  225. //政策法规
  226. module.policiesRegulations = function (data) {
  227. if (data.code == 200) {
  228. var content = data.data;
  229. module.data.policiesRegulationsList = content;
  230. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  231. $("#policiesRegulationsContent").html(policiesRegulationsData);
  232. }
  233. }
  234. //交易规则
  235. module.tradingRules = function (data) {
  236. if (data.code == 200) {
  237. var content = data.data;
  238. module.data.tradingRulesList = content;
  239. var tradingRulesData = template('tradingRulesData', module.data);
  240. $("#tradingRulesContent").html(tradingRulesData);
  241. }
  242. }
  243. //资料下载
  244. module.dataDownload = function (data) {
  245. if (data.code == 200) {
  246. var content = data.data;
  247. module.data.dataDownloadList = content;
  248. var dataDownloadData = template('dataDownloadData', module.data);
  249. $("#dataDownloadContent").html(dataDownloadData);
  250. }
  251. }
  252. //标的物所在地
  253. module.deptLocation = function (data) {
  254. console.log(data)
  255. if (data.code == 200) {
  256. var content = data.data ;
  257. var contentList = [];
  258. for (var i = 0 ; i < 5 ; i++){
  259. contentList[i] = content[i];
  260. }
  261. module.data.deptLocationList = contentList;
  262. var deptLocationData = template('deptLocationData', module.data);
  263. $("#deptLocationContent").html(deptLocationData);
  264. }
  265. }
  266. //标的物类型
  267. module.deptType = function (data) {
  268. if (data.code == 200) {
  269. var content = [] ;
  270. for (var i = 0 ; i < 4 ; i++){
  271. content[i] = data.data[i];
  272. }
  273. module.data.deptTypeList = content;
  274. var deptTypeData = template('deptTypeData', module.data);
  275. $("#deptTypeContent").html(deptTypeData);
  276. }
  277. }
  278. //网站配置信息
  279. module.webConfigInformation = function (data) {
  280. if (data.code == 200) {
  281. var content = data.data;
  282. console.log(content)
  283. $("#webConfigName").html(content[0].configValue);
  284. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  285. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  286. }
  287. }
  288. //查询挂牌项目浏览总次数
  289. module.allViewCount = function (data) {
  290. if (data.code == 200) {
  291. var content = data.data;
  292. module.data.allViewCountList = content.toString().split("");
  293. var allViewCountData = template('allViewCountData', module.data);
  294. $("#allViewCount").html(allViewCountData);
  295. }
  296. }
  297. //底部友情链接
  298. module.bottomFriendsLinks = function (data) {
  299. if (data.code == 200) {
  300. var content = data.data;
  301. console.log(content)
  302. module.data.friendsLinksList = content;
  303. var friendsLinksData = template('friendsLinksData', module.data);
  304. $("#friendsLinksContent").html(friendsLinksData);
  305. }
  306. }
  307. //土地林地四荒地
  308. module.landList = function (data) {
  309. if (data.code == 200) {
  310. module.data.serverApi = serverApi;
  311. var content = data.data;
  312. module.data.landListList = content;
  313. var landListData = template('landListData', module.data);
  314. $("#landListContent").html(landListData);
  315. }
  316. }
  317. //集体资产
  318. module.collectiveAssets = function (data) {
  319. if (data.code == 200) {
  320. module.data.serverApi = serverApi;
  321. var content = data.data;
  322. module.data.collectiveAssetsList = content;
  323. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  324. $("#collectiveAssetsContent").html(collectiveAssetsData);
  325. }
  326. }
  327. //小型水利设施
  328. module.waterConservancyFacilities = function (data) {
  329. if (data.code == 200) {
  330. module.data.serverApi = serverApi;
  331. var content = data.data;
  332. module.data.waterConservancyFacilitiesList = content;
  333. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  334. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  335. }
  336. }
  337. //农业生产设备
  338. module.productionEquipment = function (data) {
  339. if (data.code == 200) {
  340. module.data.serverApi = serverApi;
  341. var content = data.data;
  342. module.data.productionEquipmentList = content;
  343. var productionEquipmentData = template('productionEquipmentData', module.data);
  344. $("#productionEquipmentContent").html(productionEquipmentData);
  345. }
  346. }
  347. //成交公示列表
  348. module.announcementList = function (data) {
  349. if (data.code == 200) {
  350. var content = data.data;
  351. module.data.announcementListList = content;
  352. var announcementListData = template('announcementListData', module.data);
  353. $("#announcementListContent").html(announcementListData);
  354. }
  355. }
  356. //鉴证公告列表
  357. module.attestationList = function (data) {
  358. if (data.code == 200) {
  359. var content = data.data;
  360. module.data.attestationList = content;
  361. var attestationData = template('attestationData', module.data);
  362. $("#attestationContent").html(attestationData);
  363. }
  364. }
  365. //竞价大厅列表
  366. module.biddingHallList = function (data) {
  367. if (data.code == 200) {
  368. var content = data.data;
  369. console.log(content)
  370. module.data.biddingHallListList = content;
  371. for(var i = 0 ; i < content.length ; i++){
  372. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  373. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  374. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  375. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  376. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  377. var nowTime = Date.parse(new Date());
  378. var leftTime = Date.parse(biddingStopTime)-nowTime;
  379. var rightTime = Date.parse(biddingStartTime)-nowTime;
  380. console.log(biddingStopTime)
  381. console.log(leftTime)
  382. if(leftTime>0){
  383. console.log('进行中')
  384. content[i].timeType = '进行中'
  385. }
  386. if(leftTime<0){
  387. console.log('已结束')
  388. content[i].timeType = '已结束'
  389. }
  390. if(rightTime>0){
  391. console.log('未开始')
  392. content[i].timeType = '未开始'
  393. }
  394. }
  395. console.log(content)
  396. var biddingHallListData = template('biddingHallListData', module.data);
  397. $("#biddingHallListContent").html(biddingHallListData);
  398. }
  399. }
  400. ///竞价大厅-滚动
  401. module.hallRolling = function () {
  402. var divScroll = document.getElementById('tableList');
  403. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  404. module.timeInter(divScroll);
  405. divScroll.onmouseover = function () {
  406. clearInterval(time);
  407. }
  408. divScroll.onmouseout = function () {
  409. module.timeInter(divScroll);
  410. }
  411. }
  412. //个人供求
  413. module.supplyDemand = function (data) {
  414. if (data.code == 200) {
  415. console.log(data)
  416. var content = data.data;
  417. module.data.supplyDemandList = content;
  418. var supplyDemandData = template('supplyDemandData', module.data);
  419. $("#supply").html(supplyDemandData);
  420. }
  421. }
  422. //个人供求
  423. module.supplyDemand2 = function (data) {
  424. if (data.code == 200) {
  425. console.log(data)
  426. var content = data.data;
  427. module.data.supplyDemand2List = content;
  428. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  429. $("#demand").html(supplyDemand2Data);
  430. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  431. }
  432. }
  433. module.supplyDemandRecommend = function(data){
  434. var focusListNext = module.data.focusListNext;
  435. for (var i = 0; i < data.data.length; i++) {
  436. var imgStrs = data.data[i].fileUrl
  437. if (imgStrs != null && imgStrs != '') {
  438. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName})
  439. }
  440. }
  441. console.log(focusListNext)
  442. module.data.focusListNext = focusListNext;
  443. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  444. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  445. new Swiper('#bannerFocusNextWrap', {
  446. paginationClickable: true
  447. })
  448. }
  449. module.supplyImages = function(){
  450. var focusListNext = module.data.focusListNext;
  451. console.log(module.data.supplyDemandList)
  452. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  453. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  454. var title = module.data.supplyDemandList[i].projectName
  455. if (imgStrs != null && imgStrs != '') {
  456. focusListNext.push({img:imgStrs[0],title:title})
  457. }
  458. }
  459. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  460. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  461. var title = module.data.supplyDemand2List[i].projectName
  462. if (imgStrs != null && imgStrs != '') {
  463. focusListNext.push({img:imgStrs[0],title:title})
  464. }
  465. }
  466. module.data.focusListNext = focusListNext;
  467. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  468. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  469. new Swiper('#bannerFocusNextWrap', {
  470. pagination: '.page-pagination1',
  471. paginationClickable: true
  472. })
  473. }
  474. module.timeInter = function (divScroll) {
  475. time = setInterval(function () {
  476. var oldTop = divScroll.scrollTop;
  477. var newTop = oldTop + 1;
  478. divScroll.scrollTop = newTop;
  479. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  480. if (1 > counst) {
  481. divScroll.scrollTop = 0;
  482. }
  483. }, 30)
  484. }
  485. //证书查询
  486. goSearchKeyWord = function(){
  487. var type = $('input[name="transaction"]:checked').val();
  488. var searchKeyWord = $('#searchKeyWord').val();
  489. if(type == 'warrant'){
  490. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  491. }else{
  492. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  493. }
  494. }
  495. //项目查询
  496. searchProject = function(){
  497. var projectNum = $('#projectNum').val();
  498. var projectName = $('#projectName').val();
  499. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  500. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  501. }
  502. //标的物类型
  503. module.deptTypeSelect = function (data) {
  504. if (data.code == 200) {
  505. console.log(data);
  506. var content = data.data ;
  507. module.data.deptTypeSelectList = content;
  508. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  509. $("#deptTypeSelectContent").html(deptTypeSelectData);
  510. }
  511. }
  512. //切换
  513. tabCheck = function (type) {
  514. if(type == 'supply'){
  515. document.getElementById('demand').style.display = 'none';
  516. document.getElementById('demandBtn').className = '';
  517. }
  518. if(type == 'demand'){
  519. document.getElementById('supply').style.display = 'none';
  520. document.getElementById('supplyBtn').className = '';
  521. }
  522. document.getElementById(type).style.display = 'inline-table';
  523. document.getElementById(type+'Btn').className = 'active';
  524. }
  525. goDetail = function (id) {
  526. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  527. }
  528. goUserInteract = function () {
  529. tools.skip('view/user/user.html?type=goInteract')
  530. }
  531. goListing = function (clickType,dictSort,dictCode) {
  532. tools.skip('view/listingItems/itemsList.html?clickType='+clickType+'&dictSort='+dictSort+'&dictCode='+dictCode);
  533. }
  534. goAnnouncementList = function (type) {
  535. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  536. }
  537. goNewList = function () {
  538. tools.skip('view/new/newList.html');
  539. }
  540. goPolicy = function (type) {
  541. tools.skip('view/policy/policy.html?type='+type);
  542. }
  543. goBidding = function(){
  544. tools.skip('view/bidding/biddingList.html');
  545. }
  546. goDemand = function(){
  547. tools.skip('view/demand/demand.html');
  548. }
  549. goInteraction = function(){
  550. tools.skip('view/interact/interactList.html');
  551. }
  552. goInteractSearch = function(){
  553. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  554. }
  555. return module;
  556. });