农燊高科官方网站
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

540 рядки
19 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. }
  96. };
  97. var tools = new Tools();
  98. module.init = function (page) {
  99. //获取焦点图信息
  100. tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews , true);
  101. //新闻资讯
  102. tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation , true);
  103. //政策法规
  104. tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations , true);
  105. //交易规则
  106. tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules , true);
  107. //资料下载
  108. tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload, true);
  109. //标的物所在地
  110. tools.doGet(webDept, {deptId:''}, module.deptLocation , true);
  111. //标的物类型
  112. tools.doGet(webDeptType+"/project_type", {}, module.deptType, true);
  113. //标的物类型下拉菜单
  114. tools.doGet(webDeptType+"/project_type", {}, module.deptTypeSelect, true);
  115. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  116. tools.getWebConfig();
  117. //底部友情链接
  118. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  119. //土地
  120. tools.doGet(webListing + '/1,2,3/0/3', {}, module.landList, true);
  121. //集体资产
  122. tools.doGet(webListing + '/4/0/3', {}, module.collectiveAssets, true);
  123. //农业生产设备
  124. tools.doGet(webListing + '/5/0/3', {}, module.productionEquipment, true);
  125. //小型水利设施
  126. tools.doGet(webListing + '/6/0/3', {}, module.waterConservancyFacilities, true);
  127. //查询挂牌项目浏览总次数
  128. tools.doGet(allViewCount + '/100', {}, module.allViewCount, true);
  129. //查询挂牌项目浏览总次数
  130. tools.doGet(announcementList + '/0/4', {}, module.announcementList, true);
  131. //查询挂牌项目浏览总次数
  132. tools.doGet(biddingHallList + '/0/10', {}, module.biddingHallList, true);
  133. //查询挂牌项目浏览总次数
  134. tools.doGet(attestationList + '/0/5', {}, module.attestationList, true);
  135. //个人供求
  136. tools.doGet(supplyDemand + '/100/1/5', {}, module.supplyDemand, true);
  137. tools.doGet(supplyDemand + '/100/2/5', {}, module.supplyDemand2, true);
  138. //互动交流
  139. tools.doGet(communicateList + '/100/5', {}, module.communicateList, true);
  140. //土地挂牌价格走势统计图
  141. tools.doGet(statistics, {deptId: 100}, module.statisticsContent, true);
  142. //竞价大厅-滚动
  143. //module.hallRolling();
  144. };
  145. //焦点图数据
  146. module.focusNews = function (data) {
  147. if (data.code == 200) {
  148. var content = data.data;
  149. var focusList = [];
  150. for (var i = 0; i < content.length; i++) {
  151. var imgStrs = content[i].content.match(/<img.*?>/g)
  152. var title = content[i].title
  153. if (imgStrs != null && imgStrs != '') {
  154. focusList.push({img:imgStrs[0],title:title})
  155. }
  156. }
  157. console.log(focusList)
  158. module.data.focusList = focusList;
  159. var bannerFocusData = template('bannerFocusData', module.data);
  160. $("#bannerFocusContent").html(bannerFocusData);
  161. new Swiper('#bannerFocusWrap', {
  162. pagination: '.page-pagination',
  163. paginationClickable: true
  164. })
  165. }
  166. }
  167. module.statisticsContent = function(data){
  168. console.log(module.option)
  169. console.log(data)
  170. module.data.nowPriceAvg = data.nowPriceAvg;
  171. module.data.priceRate = data.priceRate;
  172. var statisticsData = template('statisticsData', module.data);
  173. $("#statisticsContent").html(statisticsData);
  174. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  175. module.option.xAxis.data[i] = data.priceAvgList[i].year
  176. module.option.series[0].data[i] = data.priceAvgList[i].price
  177. }
  178. // 柱状图绘制
  179. var chartDom = document.getElementById('chart');
  180. var myChart = echarts.init(chartDom);
  181. module.option && myChart.setOption(module.option);
  182. }
  183. //互动交流
  184. module.communicateList = function (data) {
  185. if (data.code == 200) {
  186. console.log(data.data)
  187. var content = data.data;
  188. module.data.communicateList = content;
  189. var communicateData = template('communicateData', module.data);
  190. $("#communicateContent").html(communicateData);
  191. }
  192. }
  193. //新闻资讯数据
  194. module.NewsInformation = function (data) {
  195. if (data.code == 200) {
  196. var content = data.data;
  197. console.log(content)
  198. module.data.newsInformationList = content;
  199. var NewsInformationData = template('NewsInformationData', module.data);
  200. $("#NewsInformationContent").html(NewsInformationData);
  201. }
  202. }
  203. //政策法规
  204. module.policiesRegulations = function (data) {
  205. if (data.code == 200) {
  206. var content = data.data;
  207. module.data.policiesRegulationsList = content;
  208. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  209. $("#policiesRegulationsContent").html(policiesRegulationsData);
  210. }
  211. }
  212. //交易规则
  213. module.tradingRules = function (data) {
  214. if (data.code == 200) {
  215. var content = data.data;
  216. module.data.tradingRulesList = content;
  217. var tradingRulesData = template('tradingRulesData', module.data);
  218. $("#tradingRulesContent").html(tradingRulesData);
  219. }
  220. }
  221. //资料下载
  222. module.dataDownload = function (data) {
  223. if (data.code == 200) {
  224. var content = data.data;
  225. module.data.dataDownloadList = content;
  226. var dataDownloadData = template('dataDownloadData', module.data);
  227. $("#dataDownloadContent").html(dataDownloadData);
  228. }
  229. }
  230. //标的物所在地
  231. module.deptLocation = function (data) {
  232. console.log(data)
  233. if (data.code == 200) {
  234. var content = data.data ;
  235. var contentList = [];
  236. for (var i = 0 ; i < 5 ; i++){
  237. contentList[i] = content[i];
  238. }
  239. module.data.deptLocationList = contentList;
  240. var deptLocationData = template('deptLocationData', module.data);
  241. $("#deptLocationContent").html(deptLocationData);
  242. }
  243. }
  244. //标的物类型
  245. module.deptType = function (data) {
  246. if (data.code == 200) {
  247. var content = [] ;
  248. for (var i = 0 ; i < 4 ; i++){
  249. content[i] = data.data[i];
  250. }
  251. module.data.deptTypeList = content;
  252. var deptTypeData = template('deptTypeData', module.data);
  253. $("#deptTypeContent").html(deptTypeData);
  254. }
  255. }
  256. //网站配置信息
  257. module.webConfigInformation = function (data) {
  258. if (data.code == 200) {
  259. var content = data.data;
  260. $("#webConfigName").html(content[0].configValue);
  261. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  262. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  263. }
  264. }
  265. //查询挂牌项目浏览总次数
  266. module.allViewCount = function (data) {
  267. if (data.code == 200) {
  268. var content = data.data;
  269. module.data.allViewCountList = content.toString().split("");
  270. var allViewCountData = template('allViewCountData', module.data);
  271. $("#allViewCount").html(allViewCountData);
  272. }
  273. }
  274. //底部友情链接
  275. module.bottomFriendsLinks = function (data) {
  276. if (data.code == 200) {
  277. var content = data.data;
  278. module.data.friendsLinksList = content;
  279. var friendsLinksData = template('friendsLinksData', module.data);
  280. $("#friendsLinksContent").html(friendsLinksData);
  281. }
  282. }
  283. //土地林地四荒地
  284. module.landList = function (data) {
  285. if (data.code == 200) {
  286. module.data.serverApi = serverApi;
  287. var content = data.data;
  288. module.data.landListList = content;
  289. var landListData = template('landListData', module.data);
  290. $("#landListContent").html(landListData);
  291. }
  292. }
  293. //集体资产
  294. module.collectiveAssets = function (data) {
  295. if (data.code == 200) {
  296. module.data.serverApi = serverApi;
  297. var content = data.data;
  298. module.data.collectiveAssetsList = content;
  299. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  300. $("#collectiveAssetsContent").html(collectiveAssetsData);
  301. }
  302. }
  303. //小型水利设施
  304. module.waterConservancyFacilities = function (data) {
  305. if (data.code == 200) {
  306. module.data.serverApi = serverApi;
  307. var content = data.data;
  308. module.data.waterConservancyFacilitiesList = content;
  309. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  310. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  311. }
  312. }
  313. //农业生产设备
  314. module.productionEquipment = function (data) {
  315. if (data.code == 200) {
  316. module.data.serverApi = serverApi;
  317. var content = data.data;
  318. module.data.productionEquipmentList = content;
  319. var productionEquipmentData = template('productionEquipmentData', module.data);
  320. $("#productionEquipmentContent").html(productionEquipmentData);
  321. }
  322. }
  323. //成交公示列表
  324. module.announcementList = function (data) {
  325. if (data.code == 200) {
  326. var content = data.data;
  327. module.data.announcementListList = content;
  328. var announcementListData = template('announcementListData', module.data);
  329. $("#announcementListContent").html(announcementListData);
  330. }
  331. }
  332. //鉴证公告列表
  333. module.attestationList = function (data) {
  334. if (data.code == 200) {
  335. var content = data.data;
  336. module.data.attestationList = content;
  337. var attestationData = template('attestationData', module.data);
  338. $("#attestationContent").html(attestationData);
  339. }
  340. }
  341. //竞价大厅列表
  342. module.biddingHallList = function (data) {
  343. if (data.code == 200) {
  344. var content = data.data;
  345. console.log(content)
  346. module.data.biddingHallListList = content;
  347. var biddingHallListData = template('biddingHallListData', module.data);
  348. $("#biddingHallListContent").html(biddingHallListData);
  349. }
  350. }
  351. ///竞价大厅-滚动
  352. module.hallRolling = function () {
  353. var divScroll = document.getElementById('tableList');
  354. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  355. module.timeInter(divScroll);
  356. divScroll.onmouseover = function () {
  357. clearInterval(time);
  358. }
  359. divScroll.onmouseout = function () {
  360. module.timeInter(divScroll);
  361. }
  362. }
  363. //个人供求
  364. module.supplyDemand = function (data) {
  365. if (data.code == 200) {
  366. console.log(data)
  367. var content = data.data;
  368. var focusListNext = module.data.focusListNext;
  369. for (var i = 0; i < content.length; i++) {
  370. var imgStrs = content[i].projectContent.match(/<img.*?>/g)
  371. var title = content[i].projectName
  372. if (imgStrs != null && imgStrs != '') {
  373. focusListNext.push({img:imgStrs[0],title:title})
  374. }
  375. }
  376. module.data.focusListNext = focusListNext;
  377. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  378. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  379. new Swiper('#bannerFocusNextWrap', {
  380. pagination: '.page-pagination1',
  381. paginationClickable: true
  382. })
  383. module.data.supplyDemandList = content;
  384. var supplyDemandData = template('supplyDemandData', module.data);
  385. $("#supply").html(supplyDemandData);
  386. }
  387. }
  388. //个人供求
  389. module.supplyDemand2 = function (data) {
  390. if (data.code == 200) {
  391. console.log(data)
  392. var content = data.data;
  393. var focusListNext = module.data.focusListNext;
  394. for (var i = 0; i < content.length; i++) {
  395. var imgStrs = content[i].projectContent.match(/<img.*?>/g)
  396. var title = content[i].projectName
  397. if (imgStrs != null && imgStrs != '') {
  398. focusListNext.push({img:imgStrs[0],title:title})
  399. }
  400. }
  401. module.data.focusListNext = focusListNext;
  402. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  403. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  404. new Swiper('#bannerFocusNextWrap', {
  405. pagination: '.page-pagination1',
  406. paginationClickable: true
  407. })
  408. module.data.supplyDemand2List = content;
  409. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  410. $("#demand").html(supplyDemand2Data);
  411. }
  412. }
  413. module.timeInter = function (divScroll) {
  414. time = setInterval(function () {
  415. var oldTop = divScroll.scrollTop;
  416. var newTop = oldTop + 1;
  417. divScroll.scrollTop = newTop;
  418. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  419. if (1 > counst) {
  420. divScroll.scrollTop = 0;
  421. }
  422. }, 30)
  423. }
  424. //证书查询
  425. goSearchKeyWord = function(){
  426. var type = $('input[name="transaction"]:checked').val();
  427. var searchKeyWord = $('#searchKeyWord').val();
  428. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  429. }
  430. //项目查询
  431. searchProject = function(){
  432. var projectNum = $('#projectNum').val();
  433. var projectName = $('#projectName').val();
  434. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  435. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  436. }
  437. //标的物类型
  438. module.deptTypeSelect = function (data) {
  439. if (data.code == 200) {
  440. console.log(data);
  441. var content = data.data ;
  442. module.data.deptTypeSelectList = content;
  443. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  444. $("#deptTypeSelectContent").html(deptTypeSelectData);
  445. }
  446. }
  447. //切换
  448. tabCheck = function (type) {
  449. if(type == 'supply'){
  450. document.getElementById('demand').style.display = 'none';
  451. document.getElementById('demandBtn').className = '';
  452. }
  453. if(type == 'demand'){
  454. document.getElementById('supply').style.display = 'none';
  455. document.getElementById('supplyBtn').className = '';
  456. }
  457. document.getElementById(type).style.display = 'inline-table';
  458. document.getElementById(type+'Btn').className = 'active';
  459. }
  460. goDetail = function (id) {
  461. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  462. }
  463. goListing = function () {
  464. tools.skip('view/listingItems/itemsList.html');
  465. }
  466. goAnnouncementList = function (type) {
  467. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  468. }
  469. goNewList = function () {
  470. tools.skip('view/new/newList.html');
  471. }
  472. goPolicy = function (type) {
  473. tools.skip('view/policy/policy.html?type='+type);
  474. }
  475. return module;
  476. });