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

index.js 29 KiB

1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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. focusListTop: [],
  14. //底部焦点图
  15. focusListNext:[],
  16. //新闻资讯数据
  17. newsInformationList: [],
  18. //政策法规数据
  19. policiesRegulationsList: [],
  20. //交易规则数据
  21. tradingRulesList: [],
  22. //资料下载数据
  23. dataDownloadList: [],
  24. //标的物所在地
  25. deptLocationList:[],
  26. //标的物类型
  27. deptTypeList:[],
  28. //网站配置信息
  29. webConfigInformationList:[],
  30. //底部友情链接
  31. friendsLinksList:[],
  32. //土地林地四荒地数据
  33. landListList:[],
  34. //集体资产数据
  35. collectiveAssetsList:[],
  36. //小型水利设施数据
  37. waterConservancyFacilitiesList:[],
  38. //农业生产设备数据
  39. productionEquipmentList:[],
  40. //交易项目总浏览次数
  41. allViewCountList:[],
  42. //成交公示数据
  43. announcementListList:[],
  44. //鉴证公告数据
  45. attestationList:[],
  46. //供应列表
  47. supplyDemandList:[],
  48. //需求列表
  49. supplyDemand2List:[]
  50. },
  51. //柱状图参数
  52. option: {
  53. xAxis: {
  54. type: 'category',
  55. axisLine: {
  56. show: true,
  57. lineStyle: {
  58. width: 1,
  59. type: "solid"
  60. }
  61. },
  62. axisLabel: { //设置x轴的字
  63. show: true,
  64. interval: 0,//使x轴横坐标全部显示
  65. textStyle: {//x轴字体样式
  66. margin: 15
  67. }
  68. },
  69. data: []
  70. },
  71. yAxis: {
  72. type: 'value',
  73. min: 400,
  74. max: 1000,
  75. splitNumber: 7,
  76. splitLine: {
  77. lineStyle: {
  78. type: 'dashed'
  79. }
  80. },
  81. axisLine: {
  82. show: true,
  83. lineStyle: {
  84. width: 1,
  85. type: "solid"
  86. }
  87. },
  88. },
  89. series: [{
  90. data: [],//实际值减300
  91. type: 'bar',
  92. itemStyle: {
  93. color: '#007b76'
  94. }
  95. }],
  96. grid: {
  97. height: 200,
  98. width: 230,
  99. top: '-5px'
  100. },
  101. tooltip: {
  102. trigger: "axis",
  103. axisPointer: {
  104. // 坐标轴指示器,坐标轴触发有效
  105. type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
  106. },
  107. },
  108. }
  109. };
  110. var tools = new Tools();
  111. module.init = function (page) {
  112. //获取焦点图信息
  113. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  114. //获取焦点图信息
  115. tools.doGet(websitePicture, {picType:2,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsPC , true);
  116. //获取焦点图信息
  117. //tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews , true);
  118. //新闻资讯
  119. //tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation , true);
  120. //政策法规
  121. //tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations , true);
  122. //交易规则
  123. //tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules , true);
  124. //资料下载
  125. //tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload, true);
  126. //标的物所在地
  127. // tools.doGet(webDept, {deptId:''}, module.deptLocation , true);
  128. //标的物类型
  129. //tools.doGet(webDeptType+"/project_type", {}, module.deptType, true);
  130. //标的物类型下拉菜单
  131. // tools.doGet(webDeptType+"/project_type", {}, module.deptTypeSelect, true);
  132. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  133. tools.getWebConfig();
  134. //底部友情链接
  135. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  136. //供应项目
  137. tools.doGet(itemsList, {projectNumber:'',pageSize:'4',pageNum:'1'}, module.itemList, true);
  138. //需求项目
  139. tools.doGet(needProjectList, {projectNumber:'',pageSize:'4',pageNum:'1'}, module.itemLists, true);
  140. //农业生产设备
  141. // tools.doGet(webListing + '/9/0/5', {}, module.productionEquipment, true);
  142. //小型水利设施
  143. // tools.doGet(webListing + '/8/0/5', {}, module.waterConservancyFacilities, true);
  144. //查询交易项目浏览总次数
  145. // tools.doGet(allViewCount + '/100', {}, module.allViewCount, true);
  146. //查询交易项目浏览总次数
  147. tools.doGet(announcementList + '/0/4', {}, module.announcementList, true);
  148. //查询交易项目浏览总次数
  149. tools.doGet(biddingHallList + '/0/100', {}, module.biddingHallList, true);
  150. //查询交易项目浏览总次数
  151. tools.doGet(attestationList + '/0/5', {}, module.attestationList, true);
  152. //个人供求
  153. //tools.doGet(supplyDemand + '/100/1/5', {}, module.supplyDemand, true);
  154. //tools.doGet(supplyDemand + '/100/2/5', {}, module.supplyDemand2, true);
  155. //互动交流
  156. //tools.doGet(communicateList + '/100/5/notnull', {}, module.communicateList, true);
  157. //土地挂牌价格走势统计图
  158. // tools.doGet(statistics, {deptId: 100}, module.statisticsContent, true);
  159. //竞价大厅-滚动
  160. module.hallRolling();
  161. setTimeout(function(){
  162. //主题图片切换
  163. module.switchTheme();
  164. },500)
  165. };
  166. //主题图片切换
  167. module.switchTheme = function(){
  168. if(themeColor == 'red'){
  169. document.getElementById('centerBanner').src = './static/images/centerBanner_red.jpg'
  170. document.getElementById('bannerBottom').src = './static/images/bannerBottom_red.jpg'
  171. }else if(themeColor == 'green'){
  172. document.getElementById('centerBanner').src = './static/images/centerBanner.jpg'
  173. document.getElementById('bannerBottom').src = './static/images/bannerBottom.jpg'
  174. }
  175. }
  176. //焦点图数据
  177. module.focusNewsTop = function (data) {
  178. if (data.code == 200) {
  179. let focusArray = [];
  180. if(data.data.length<1){
  181. focusArray.push({
  182. img:'../static/images/banner320.jpg'
  183. })
  184. }else{
  185. data.data.forEach(res=>{
  186. focusArray.push({
  187. img:'/api'+res.picUrl
  188. })
  189. })
  190. }
  191. module.data.focusList = focusArray;
  192. var bannerFocusData = template('bannerFocusData', module.data);
  193. $("#bannerFocusContent").html(bannerFocusData);
  194. new Swiper('#bannerFocusWrap', {
  195. pagination: '.page-pagination',
  196. paginationClickable: true,
  197. autoplay : 5000,
  198. loop:true
  199. })
  200. }
  201. }
  202. //焦点图数据
  203. module.focusNewsPC = function (data) {
  204. if (data.code == 200) {
  205. module.data.focusListPC = data.data;
  206. var bannerFocusDataPC = template('bannerFocusDataPC', module.data);
  207. $("#bannerFocusPCContent").html(bannerFocusDataPC);
  208. }
  209. }
  210. //焦点图数据
  211. module.focusNews = function (data) {
  212. if (data.code == 200) {
  213. var content = data.data;
  214. var focusList = [];
  215. for (var i = 0; i < content.length; i++) {
  216. var imgStrs = content[i].content.match(/<img.*?>/g)
  217. var title = content[i].title;
  218. var id = content[i].id;
  219. if (imgStrs != null && imgStrs != '') {
  220. focusList.push({img:imgStrs[0],title:title,id:id})
  221. }
  222. }
  223. //console.log(focusList)
  224. module.data.focusList = focusList;
  225. var bannerFocusData = template('bannerFocusData', module.data);
  226. $("#bannerFocusContent").html(bannerFocusData);
  227. new Swiper('#bannerFocusWrap', {
  228. pagination: '.page-pagination',
  229. paginationClickable: true,
  230. autoplay : 2000,
  231. loop:true
  232. })
  233. }
  234. }
  235. module.statisticsContent = function(data){
  236. //console.log(module.option)
  237. //console.log(data)
  238. module.data.nowPriceAvg = data.nowPriceAvg;
  239. module.data.priceRate = data.priceRate;
  240. var statisticsData = template('statisticsData', module.data);
  241. $("#statisticsContent").html(statisticsData);
  242. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  243. module.option.xAxis.data[i] = data.priceAvgList[i].year
  244. module.option.series[0].data[i] = data.priceAvgList[i].price
  245. }
  246. // 柱状图绘制
  247. var chartDom = document.getElementById('chart');
  248. var myChart = echarts.init(chartDom);
  249. module.option && myChart.setOption(module.option);
  250. }
  251. //互动交流
  252. module.communicateList = function (data) {
  253. if (data.code == 200) {
  254. //console.log(data.data)
  255. var content = data.data;
  256. module.data.communicateList = content;
  257. var communicateData = template('communicateData', module.data);
  258. $("#communicateContent").html(communicateData);
  259. }
  260. }
  261. //新闻资讯数据
  262. module.NewsInformation = function (data) {
  263. if (data.code == 200) {
  264. var content = data.data;
  265. //console.log(content)
  266. module.data.newsInformationList = content;
  267. var NewsInformationData = template('NewsInformationData', module.data);
  268. $("#NewsInformationContent").html(NewsInformationData);
  269. }
  270. }
  271. //政策法规
  272. module.policiesRegulations = function (data) {
  273. if (data.code == 200) {
  274. var content = data.data;
  275. module.data.policiesRegulationsList = content;
  276. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  277. $("#policiesRegulationsContent").html(policiesRegulationsData);
  278. }
  279. }
  280. //交易规则
  281. module.tradingRules = function (data) {
  282. if (data.code == 200) {
  283. var content = data.data;
  284. module.data.tradingRulesList = content;
  285. var tradingRulesData = template('tradingRulesData', module.data);
  286. $("#tradingRulesContent").html(tradingRulesData);
  287. }
  288. }
  289. //资料下载
  290. module.dataDownload = function (data) {
  291. if (data.code == 200) {
  292. var content = data.data;
  293. module.data.dataDownloadList = content;
  294. var dataDownloadData = template('dataDownloadData', module.data);
  295. $("#dataDownloadContent").html(dataDownloadData);
  296. }
  297. }
  298. //标的物所在地
  299. module.deptLocation = function (data) {
  300. //console.log(data)
  301. if (data.code == 200) {
  302. var content = data.data ;
  303. var contentList = [];
  304. for (var i = 0 ; i < 5&&i<content.length ; i++){
  305. contentList[i] = content[i];
  306. }
  307. module.data.deptLocationList = contentList;
  308. var deptLocationData = template('deptLocationData', module.data);
  309. $("#deptLocationContent").html(deptLocationData);
  310. }
  311. }
  312. //标的物类型
  313. module.deptType = function (data) {
  314. if (data.code == 200) {
  315. var content = data.data ;
  316. // for (var i = 0 ; i < 4 ; i++){
  317. // content[i] = data.data[i];
  318. // }
  319. module.data.deptTypeList = content;
  320. var deptTypeData = template('deptTypeData', module.data);
  321. $("#deptTypeContent").html(deptTypeData);
  322. module.data.deptTypeList1 = content;
  323. var deptTypeData1 = template('deptTypeData1', module.data);
  324. $("#deptTypeContent1").html(deptTypeData1);
  325. }
  326. }
  327. //网站配置信息
  328. module.webConfigInformation = function (data) {
  329. if (data.code == 200) {
  330. var content = data.data;
  331. //console.log(content)
  332. $("#webConfigName").html(content[0].configValue);
  333. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  334. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  335. }
  336. }
  337. //查询交易项目浏览总次数
  338. module.allViewCount = function (data) {
  339. if (data.code == 200) {
  340. var content = data.data;
  341. module.data.allViewCountList = content.toString().split("");
  342. var allViewCountData = template('allViewCountData', module.data);
  343. $("#allViewCount").html(allViewCountData);
  344. }
  345. }
  346. //底部友情链接
  347. module.bottomFriendsLinks = function (data) {
  348. if (data.code == 200) {
  349. var content = data.data;
  350. //console.log(content)
  351. module.data.friendsLinksList = content;
  352. var friendsLinksData = template('friendsLinksData', module.data);
  353. $("#friendsLinksContent").html(friendsLinksData);
  354. }
  355. }
  356. //土地林地四荒地
  357. module.landList = function (data) {
  358. if (data.code == 200) {
  359. module.data.serverApi = serverApi;
  360. var content = data.data;
  361. for (let i = 0 ; i < 5 ; i++){
  362. if (content[i]==undefined){
  363. module.data.landListList.push({
  364. projectShowStatus:'',
  365. projectName :'',
  366. price :'',
  367. unit :'',
  368. outName :'',
  369. signupStopTime :'',
  370. biddingStopTime :'',
  371. locationName:'',
  372. });
  373. }else{
  374. module.data.landListList.push(content[i]);
  375. }
  376. }
  377. // module.data.landListList = content;
  378. var landListData = template('landListData', module.data);
  379. $("#landListContent").html(landListData);
  380. }
  381. }
  382. module.itemList = function (data) {
  383. if (data.code == 200) {
  384. //console.log(data)
  385. module.data.serverApi = serverApi;
  386. var content = data.rows;
  387. module.data.landListList = content;
  388. var landListData = template('landListData', module.data);
  389. $("#landListContent").html(landListData);
  390. }
  391. }
  392. module.itemLists = function (data) {
  393. if (data.code == 200) {
  394. //console.log(data)
  395. module.data.serverApi = serverApi;
  396. var content = data.rows;
  397. module.data.collectiveAssetsList = content;
  398. // module.data.collectiveAssetsList = content;
  399. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  400. $("#collectiveAssetsContent").html(collectiveAssetsData);
  401. }
  402. }
  403. //土地林地四荒地
  404. goListingChange = function (id) {
  405. module.data.landListList = [];
  406. $('#deptTypeContent').children('span').removeClass('active') ;
  407. document.getElementById('tab'+id).className = 'm-r-20 active';
  408. if (id == 0){
  409. tools.doGet(itemsList, {projectNumber:'',pageSize:'5',pageNum:'1'}, module.itemList, true);
  410. }else{
  411. //土地
  412. tools.doGet(webListing + '/'+id+'/0/5', {}, module.landList, true);
  413. }
  414. }
  415. //土地林地四荒地
  416. goListingChanges = function (id) {
  417. module.data.collectiveAssetsList = [];
  418. $('#deptTypeContent1').children('span').removeClass('active');
  419. document.getElementById('tabs'+id).className = 'm-r-20 active';
  420. tools.doGet(needProjectList, {projectNumber:id==0?'':id,pageSize:'5',pageNum:'1'}, module.itemLists, true);
  421. }
  422. //集体资产
  423. module.collectiveAssets = function (data) {
  424. if (data.code == 200) {
  425. module.data.serverApi = serverApi;
  426. var content = data.data;
  427. module.data.collectiveAssetsList = content;
  428. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  429. $("#collectiveAssetsContent").html(collectiveAssetsData);
  430. }
  431. }
  432. //小型水利设施
  433. module.waterConservancyFacilities = function (data) {
  434. if (data.code == 200) {
  435. module.data.serverApi = serverApi;
  436. var content = data.data;
  437. module.data.waterConservancyFacilitiesList = content;
  438. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  439. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  440. }
  441. }
  442. //农业生产设备
  443. module.productionEquipment = function (data) {
  444. if (data.code == 200) {
  445. module.data.serverApi = serverApi;
  446. var content = data.data;
  447. module.data.productionEquipmentList = content;
  448. var productionEquipmentData = template('productionEquipmentData', module.data);
  449. $("#productionEquipmentContent").html(productionEquipmentData);
  450. }
  451. }
  452. //成交公示列表
  453. module.announcementList = function (data) {
  454. if (data.code == 200) {
  455. var content = data.data;
  456. module.data.announcementListList = content;
  457. var announcementListData = template('announcementListData', module.data);
  458. $("#announcementListContent").html(announcementListData);
  459. }
  460. }
  461. //鉴证公告列表
  462. module.attestationList = function (data) {
  463. if (data.code == 200) {
  464. var content = data.data;
  465. module.data.attestationList = content;
  466. var attestationData = template('attestationData', module.data);
  467. $("#attestationContent").html(attestationData);
  468. }
  469. }
  470. //竞价大厅列表
  471. module.biddingHallList = function (data) {
  472. if (data.code == 200) {
  473. var content = data.data;
  474. //console.log(content)
  475. for(var i = 0 ; i < content.length ; i++){
  476. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  477. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  478. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  479. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  480. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  481. var nowTime = Date.parse(new Date());
  482. var leftTime = Date.parse(biddingStopTime)-nowTime;
  483. var rightTime = Date.parse(biddingStartTime)-nowTime;
  484. //console.log(biddingStopTime)
  485. //console.log(leftTime)
  486. if(leftTime>0){
  487. //console.log('进行中')
  488. content[i].timeType = '进行中'
  489. }
  490. if(leftTime<0){
  491. //console.log('已结束')
  492. content[i].timeType = '已结束'
  493. }
  494. if(rightTime>0){
  495. //console.log('未开始')
  496. content[i].timeType = '未开始'
  497. }
  498. }
  499. module.data.biddingHallListList = content;
  500. //console.log(content)
  501. var biddingHallListData = template('biddingHallListData', module.data);
  502. $("#biddingHallListContent").html(biddingHallListData);
  503. }
  504. }
  505. ///竞价大厅-滚动
  506. module.hallRolling = function () {
  507. var divScroll = document.getElementById('tableList');
  508. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  509. module.timeInter(divScroll);
  510. divScroll.onmouseover = function () {
  511. clearInterval(time);
  512. }
  513. divScroll.onmouseout = function () {
  514. module.timeInter(divScroll);
  515. }
  516. }
  517. //个人供求
  518. module.supplyDemand = function (data) {
  519. if (data.code == 200) {
  520. //console.log(data)
  521. var content = data.data;
  522. for (let i = 0 ; i < 5 ; i++){
  523. if (content[i]==undefined){
  524. module.data.supplyDemandList.push({
  525. id:'',
  526. projectName:'',
  527. logintime:'',
  528. phone:'',
  529. });
  530. }else{
  531. module.data.supplyDemandList.push(content[i]);
  532. }
  533. }
  534. // module.data.supplyDemandList = content;
  535. var supplyDemandData = template('supplyDemandData', module.data);
  536. $("#supply").html(supplyDemandData);
  537. }
  538. }
  539. //个人供求
  540. module.supplyDemand2 = function (data) {
  541. if (data.code == 200) {
  542. //console.log(data)
  543. var content = data.data;
  544. for (let i = 0 ; i < 5 ; i++){
  545. if (content[i]==undefined){
  546. module.data.supplyDemand2List.push({
  547. id:'',
  548. projectName:'',
  549. logintime:'',
  550. phone:'',
  551. });
  552. }else{
  553. module.data.supplyDemand2List.push(content[i]);
  554. }
  555. }
  556. // module.data.supplyDemand2List = content;
  557. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  558. $("#demand").html(supplyDemand2Data);
  559. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  560. }
  561. }
  562. module.supplyDemandRecommend = function(data){
  563. var focusListNext = module.data.focusListNext;
  564. for (var i = 0; i < data.data.length; i++) {
  565. var imgStrs = data.data[i].fileUrl
  566. if (imgStrs != null && imgStrs != '') {
  567. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName,id:data.data[i].id})
  568. }
  569. }
  570. //console.log(data)
  571. module.data.focusListNext = focusListNext;
  572. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  573. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  574. new Swiper('#bannerFocusNextWrap', {
  575. paginationClickable: true,
  576. pagination: '.a2',
  577. autoplay : 2000,
  578. loop:true
  579. })
  580. }
  581. module.supplyImages = function(){
  582. var focusListNext = module.data.focusListNext;
  583. //console.log(module.data.supplyDemandList)
  584. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  585. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  586. var title = module.data.supplyDemandList[i].projectName
  587. if (imgStrs != null && imgStrs != '') {
  588. focusListNext.push({img:imgStrs[0],title:title})
  589. }
  590. }
  591. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  592. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  593. var title = module.data.supplyDemand2List[i].projectName
  594. if (imgStrs != null && imgStrs != '') {
  595. focusListNext.push({img:imgStrs[0],title:title})
  596. }
  597. }
  598. module.data.focusListNext = focusListNext;
  599. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  600. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  601. new Swiper('#bannerFocusNextWrap', {
  602. pagination: '.page-pagination1',
  603. paginationClickable: true
  604. })
  605. }
  606. module.timeInter = function (divScroll) {
  607. time = setInterval(function () {
  608. var oldTop = divScroll.scrollTop;
  609. var newTop = oldTop + 1;
  610. divScroll.scrollTop = newTop;
  611. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  612. //console.log(counst)
  613. if (2 > counst) {
  614. divScroll.scrollTop = 0;
  615. }
  616. }, 30)
  617. }
  618. //证书查询
  619. goSearchKeyWord = function(){
  620. var type = $('input[name="transaction"]:checked').val();
  621. var searchKeyWord = $('#searchKeyWord').val();
  622. //console.log($('#searchKeyWord').val())
  623. //console.log(type)
  624. if($('#searchKeyWord').val() == '' && type== 'warrant'){
  625. tools.initDialog('提示', '经营权证编号不可为空', function () {
  626. return;
  627. }, '确定')
  628. return;
  629. }
  630. if(type == 'warrant'){
  631. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  632. }else{
  633. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  634. }
  635. }
  636. //项目查询
  637. searchProject = function(){
  638. var projectNum = $('#projectNum').val();
  639. var projectName = $('#projectName').val();
  640. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  641. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  642. }
  643. //标的物类型
  644. module.deptTypeSelect = function (data) {
  645. if (data.code == 200) {
  646. //console.log(data);
  647. var content = data.data ;
  648. module.data.deptTypeSelectList = content;
  649. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  650. $("#deptTypeSelectContent").html(deptTypeSelectData);
  651. }
  652. }
  653. //切换
  654. tabCheck = function (type) {
  655. if(type == 'supply'){
  656. document.getElementById('demand').style.display = 'none';
  657. document.getElementById('demandBtn').className = '';
  658. }
  659. if(type == 'demand'){
  660. document.getElementById('supply').style.display = 'none';
  661. document.getElementById('supplyBtn').className = '';
  662. }
  663. document.getElementById(type).style.display = 'inline-table';
  664. document.getElementById(type+'Btn').className = 'active';
  665. }
  666. //切换
  667. tabClick = function (type) {
  668. document.getElementById('cjgg').style.display = 'none';
  669. document.getElementById('jzgg').style.display = 'none';
  670. document.getElementById('cjggBtn').className = '';
  671. document.getElementById('jzggBtn').className = '';
  672. document.getElementById(type).style.display = 'block';
  673. document.getElementById(type+'Btn').className = 'active';
  674. }
  675. //切换
  676. tabClickGYXQ = function (type) {
  677. document.getElementById('landListContent').style.display = 'none';
  678. document.getElementById('collectiveAssetsContent').style.display = 'none';
  679. document.getElementById('landListBtn').className = '';
  680. document.getElementById('collectiveAssetsBtn').className = '';
  681. document.getElementById(type+'Content').style.display = 'block';
  682. document.getElementById(type+'Btn').className = 'active';
  683. }
  684. goDetail = function (id) {
  685. if (!id)return;
  686. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  687. }
  688. goUserInteract = function () {
  689. tools.skip('view/user/user.html?type=goInteract')
  690. }
  691. goListing = function (clickType,dictSort,dictCode) {
  692. tools.skip('view/listingItems/itemsList.html?clickType='+clickType+'&dictSort='+dictSort+'&dictCode='+dictCode);
  693. }
  694. goAnnouncementList = function (type) {
  695. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  696. }
  697. goNewList = function () {
  698. tools.skip('view/new/newList.html');
  699. }
  700. goPolicy = function (type) {
  701. tools.skip('view/policy/policy.html?type='+type);
  702. }
  703. goBidding = function(){
  704. tools.skip('view/bidding/biddingList.html');
  705. }
  706. goDemand = function(){
  707. tools.skip('view/demand/demand.html');
  708. }
  709. goInteraction = function(){
  710. tools.skip('view/interact/interactList.html');
  711. }
  712. goInteractSearch = function(){
  713. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  714. }
  715. return module;
  716. });