网站
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 13 KiB

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