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

402 lines
14 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:'http://192.168.31.107:8080',
  10. //焦点图数据
  11. focusList: [],
  12. //新闻资讯数据
  13. newsInformationList: [],
  14. //政策法规数据
  15. policiesRegulationsList: [],
  16. //交易规则数据
  17. tradingRulesList: [],
  18. //资料下载数据
  19. dataDownloadList: [],
  20. //标的物所在地
  21. deptLocationList:[],
  22. //标的物类型
  23. deptTypeList:[],
  24. //网站配置信息
  25. webConfigInformationList:[],
  26. //底部友情链接
  27. friendsLinksList:[],
  28. //土地林地四荒地数据
  29. landListList:[],
  30. //集体资产数据
  31. collectiveAssetsList:[],
  32. //小型水利设施数据
  33. waterConservancyFacilitiesList:[],
  34. //农业生产设备数据
  35. productionEquipmentList:[],
  36. //挂牌项目总浏览次数
  37. allViewCountList:[],
  38. //成交公示数据
  39. announcementListList:[],
  40. //鉴证公告数据
  41. attestationList:[]
  42. },
  43. //柱状图参数
  44. option: {
  45. xAxis: {
  46. type: 'category',
  47. axisLine: {
  48. show: true,
  49. lineStyle: {
  50. width: 1,
  51. type: "solid"
  52. }
  53. },
  54. axisLabel: { //设置x轴的字
  55. show: true,
  56. interval: 0,//使x轴横坐标全部显示
  57. textStyle: {//x轴字体样式
  58. margin: 15
  59. }
  60. },
  61. data: ['2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021']
  62. },
  63. yAxis: {
  64. type: 'value',
  65. min: 400,
  66. max: 1000,
  67. splitNumber: 7,
  68. splitLine: {
  69. lineStyle: {
  70. type: 'dashed'
  71. }
  72. },
  73. axisLine: {
  74. show: true,
  75. lineStyle: {
  76. width: 1,
  77. type: "solid"
  78. }
  79. },
  80. },
  81. series: [{
  82. data: [490, 520, 650, 600, 700, 640, 680, 600, 660],//实际值减300
  83. type: 'bar',
  84. itemStyle: {
  85. color: '#007b76'
  86. }
  87. }],
  88. grid: {
  89. height: 200,
  90. width: 280,
  91. top: '-5px'
  92. },
  93. }
  94. };
  95. var tools = new Tools();
  96. module.init = function (page) {
  97. //获取焦点图信息
  98. tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews);
  99. //新闻资讯
  100. tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation);
  101. //政策法规
  102. tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations);
  103. //交易规则
  104. tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules);
  105. //资料下载
  106. tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload);
  107. //标的物所在地
  108. tools.doGet(webDept + '/0', {}, module.deptLocation);
  109. //标的物类型
  110. tools.doGet(webDeptType+"/project_type", {}, module.deptType);
  111. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  112. tools.doGet(webConfig, {}, module.webConfigInformation);
  113. //底部友情链接
  114. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks);
  115. //土地
  116. tools.doGet(webListing + '/1,2,3/0/3', {}, module.landList);
  117. //集体资产
  118. tools.doGet(webListing + '/4/0/3', {}, module.collectiveAssets);
  119. //农业生产设备
  120. tools.doGet(webListing + '/5/0/3', {}, module.productionEquipment);
  121. //小型水利设施
  122. tools.doGet(webListing + '/6/0/3', {}, module.waterConservancyFacilities);
  123. //查询挂牌项目浏览总次数
  124. tools.doGet(allViewCount + '/100', {}, module.allViewCount);
  125. //查询挂牌项目浏览总次数
  126. tools.doGet(announcementList + '/0/4', {}, module.announcementList);
  127. //查询挂牌项目浏览总次数
  128. tools.doGet(biddingHallList + '/0/10', {}, module.biddingHallList);
  129. //查询挂牌项目浏览总次数
  130. tools.doGet(attestationList + '/0/5', {}, module.attestationList);
  131. //竞价大厅-滚动
  132. //module.hallRolling();
  133. //用户资料鼠标悬浮
  134. // module.userHover();
  135. // 柱状图绘制
  136. var chartDom = document.getElementById('chart');
  137. var myChart = echarts.init(chartDom);
  138. module.option && myChart.setOption(module.option);
  139. };
  140. //焦点图数据
  141. module.focusNews = function (data) {
  142. if (data.code == 200) {
  143. var content = data.data;
  144. var focusList = [];
  145. for (var i = 0; i < content.length; i++) {
  146. var imgStrs = content[i].content.match(/<img.*?>/g)
  147. var title = content[i].title
  148. if (imgStrs != null && imgStrs != '') {
  149. focusList.push({img:imgStrs[0],title:title})
  150. }
  151. }
  152. module.data.focusList = focusList;
  153. var bannerFocusData = template('bannerFocusData', module.data);
  154. $("#bannerFocusContent").html(bannerFocusData);
  155. new Swiper('#bannerFocusWrap', {
  156. pagination: '.page-pagination',
  157. paginationClickable: true
  158. })
  159. }
  160. }
  161. //新闻资讯数据
  162. module.NewsInformation = function (data) {
  163. if (data.code == 200) {
  164. var content = data.data;
  165. module.data.newsInformationList = content;
  166. var NewsInformationData = template('NewsInformationData', module.data);
  167. $("#NewsInformationContent").html(NewsInformationData);
  168. }
  169. }
  170. //政策法规
  171. module.policiesRegulations = function (data) {
  172. if (data.code == 200) {
  173. var content = data.data;
  174. module.data.policiesRegulationsList = content;
  175. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  176. $("#policiesRegulationsContent").html(policiesRegulationsData);
  177. }
  178. }
  179. //交易规则
  180. module.tradingRules = function (data) {
  181. if (data.code == 200) {
  182. var content = data.data;
  183. module.data.tradingRulesList = content;
  184. var tradingRulesData = template('tradingRulesData', module.data);
  185. $("#tradingRulesContent").html(tradingRulesData);
  186. }
  187. }
  188. //资料下载
  189. module.dataDownload = function (data) {
  190. if (data.code == 200) {
  191. var content = data.data;
  192. module.data.dataDownloadList = content;
  193. var dataDownloadData = template('dataDownloadData', module.data);
  194. $("#dataDownloadContent").html(dataDownloadData);
  195. }
  196. }
  197. //标的物所在地
  198. module.deptLocation = function (data) {
  199. if (data.code == 200) {
  200. var content = [] ;
  201. for (var i = 0 ; i < 7 ; i++){
  202. content[i] = data.data[i];
  203. }
  204. module.data.deptLocationList = content;
  205. var deptLocationData = template('deptLocationData', module.data);
  206. $("#deptLocationContent").html(deptLocationData);
  207. }
  208. }
  209. //标的物类型
  210. module.deptType = function (data) {
  211. if (data.code == 200) {
  212. var content = [] ;
  213. for (var i = 0 ; i < 4 ; i++){
  214. content[i] = data.data[i];
  215. }
  216. module.data.deptTypeList = content;
  217. var deptTypeData = template('deptTypeData', module.data);
  218. $("#deptTypeContent").html(deptTypeData);
  219. }
  220. }
  221. //网站配置信息
  222. module.webConfigInformation = function (data) {
  223. if (data.code == 200) {
  224. var content = data.data;
  225. $("#webConfigName").html(content[0].configValue);
  226. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  227. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  228. }
  229. }
  230. //查询挂牌项目浏览总次数
  231. module.allViewCount = function (data) {
  232. if (data.code == 200) {
  233. var content = data.data;
  234. module.data.allViewCountList = content.toString().split("");
  235. var allViewCountData = template('allViewCountData', module.data);
  236. $("#allViewCount").html(allViewCountData);
  237. }
  238. }
  239. //底部友情链接
  240. module.bottomFriendsLinks = function (data) {
  241. if (data.code == 200) {
  242. var content = data.data;
  243. module.data.friendsLinksList = content;
  244. var friendsLinksData = template('friendsLinksData', module.data);
  245. $("#friendsLinksContent").html(friendsLinksData);
  246. }
  247. }
  248. //土地林地四荒地
  249. module.landList = function (data) {
  250. if (data.code == 200) {
  251. var content = data.data;
  252. module.data.landListList = content;
  253. var landListData = template('landListData', module.data);
  254. $("#landListContent").html(landListData);
  255. }
  256. }
  257. //集体资产
  258. module.collectiveAssets = function (data) {
  259. if (data.code == 200) {
  260. var content = data.data;
  261. module.data.collectiveAssetsList = content;
  262. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  263. $("#collectiveAssetsContent").html(collectiveAssetsData);
  264. }
  265. }
  266. //小型水利设施
  267. module.waterConservancyFacilities = function (data) {
  268. if (data.code == 200) {
  269. var content = data.data;
  270. module.data.waterConservancyFacilitiesList = content;
  271. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  272. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  273. }
  274. }
  275. //农业生产设备
  276. module.productionEquipment = function (data) {
  277. if (data.code == 200) {
  278. var content = data.data;
  279. module.data.productionEquipmentList = content;
  280. var productionEquipmentData = template('productionEquipmentData', module.data);
  281. $("#productionEquipmentContent").html(productionEquipmentData);
  282. }
  283. }
  284. //成交公示列表
  285. module.announcementList = function (data) {
  286. if (data.code == 200) {
  287. var content = data.data;
  288. module.data.announcementListList = content;
  289. var announcementListData = template('announcementListData', module.data);
  290. $("#announcementListContent").html(announcementListData);
  291. }
  292. }
  293. //鉴证公告列表
  294. module.attestationList = function (data) {
  295. if (data.code == 200) {
  296. var content = data.data;
  297. module.data.attestationList = content;
  298. var attestationData = template('attestationData', module.data);
  299. $("#attestationContent").html(attestationData);
  300. }
  301. }
  302. //竞价大厅列表
  303. module.biddingHallList = function (data) {
  304. if (data.code == 200) {
  305. var content = data.data;
  306. console.log(content)
  307. module.data.biddingHallListList = content;
  308. var biddingHallListData = template('biddingHallListData', module.data);
  309. $("#biddingHallListContent").html(biddingHallListData);
  310. }
  311. }
  312. ///竞价大厅-滚动
  313. module.hallRolling = function () {
  314. var divScroll = document.getElementById('tableList');
  315. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  316. module.timeInter(divScroll);
  317. divScroll.onmouseover = function () {
  318. clearInterval(time);
  319. }
  320. divScroll.onmouseout = function () {
  321. module.timeInter(divScroll);
  322. }
  323. }
  324. module.timeInter = function (divScroll) {
  325. time = setInterval(function () {
  326. var oldTop = divScroll.scrollTop;
  327. var newTop = oldTop + 1;
  328. divScroll.scrollTop = newTop;
  329. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  330. if (1 > counst) {
  331. divScroll.scrollTop = 0;
  332. }
  333. }, 30)
  334. }
  335. //切换
  336. tabCheck = function (type) {
  337. document.getElementById('supply').style.display = 'none';
  338. document.getElementById('demand').style.display = 'none';
  339. document.getElementById(type).style.display = 'inline-table';
  340. }
  341. //用户资料鼠标悬浮
  342. module.userHover = function () {
  343. document.getElementById('userName').onmouseover = function(){
  344. document.getElementById('headHover').style.display = 'block';
  345. };
  346. document.getElementById('headHover').onmouseover = function(){
  347. document.getElementById('headHover').style.display = 'block';
  348. };
  349. document.getElementById('userName').onmouseout = function(){
  350. document.getElementById('headHover').style.display = 'none';
  351. };
  352. document.getElementById('headHover').onmouseout = function(){
  353. document.getElementById('headHover').style.display = 'none';
  354. };
  355. }
  356. return module;
  357. });