网站
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.js 30 KiB

1 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  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:'5',pageNum:'1'}, module.itemList, true);
  138. //需求项目
  139. tools.doGet(needProjectList, {projectNumber:'',pageSize:'5',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. picUrl:'../static/images/banner1.png'
  183. },{
  184. picUrl:'../static/images/banner2.png'
  185. },{
  186. picUrl:'../static/images/banner3.png'
  187. })
  188. }else{
  189. data.data.forEach(res=>{
  190. focusArray.push({
  191. picUrl:'/api'+res.picUrl
  192. })
  193. })
  194. }
  195. module.data.focusListTop = focusArray;
  196. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  197. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  198. new Swiper('#bannerFocusWrapTop', {
  199. paginationClickable: true,
  200. autoplay : 4000,
  201. loop:true
  202. })
  203. }
  204. }
  205. //焦点图数据
  206. module.focusNewsPC = function (data) {
  207. if (data.code == 200) {
  208. module.data.focusListPC = data.data;
  209. var bannerFocusDataPC = template('bannerFocusDataPC', module.data);
  210. $("#bannerFocusPCContent").html(bannerFocusDataPC);
  211. }
  212. }
  213. //焦点图数据
  214. module.focusNews = function (data) {
  215. if (data.code == 200) {
  216. var content = data.data;
  217. var focusList = [];
  218. for (var i = 0; i < content.length; i++) {
  219. var imgStrs = content[i].content.match(/<img.*?>/g)
  220. var title = content[i].title;
  221. var id = content[i].id;
  222. if (imgStrs != null && imgStrs != '') {
  223. focusList.push({img:imgStrs[0],title:title,id:id})
  224. }
  225. }
  226. //console.log(focusList)
  227. module.data.focusList = focusList;
  228. var bannerFocusData = template('bannerFocusData', module.data);
  229. $("#bannerFocusContent").html(bannerFocusData);
  230. new Swiper('#bannerFocusWrap', {
  231. pagination: '.page-pagination',
  232. paginationClickable: true,
  233. autoplay : 2000,
  234. loop:true
  235. })
  236. }
  237. }
  238. module.statisticsContent = function(data){
  239. //console.log(module.option)
  240. //console.log(data)
  241. module.data.nowPriceAvg = data.nowPriceAvg;
  242. module.data.priceRate = data.priceRate;
  243. var statisticsData = template('statisticsData', module.data);
  244. $("#statisticsContent").html(statisticsData);
  245. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  246. module.option.xAxis.data[i] = data.priceAvgList[i].year
  247. module.option.series[0].data[i] = data.priceAvgList[i].price
  248. }
  249. // 柱状图绘制
  250. var chartDom = document.getElementById('chart');
  251. var myChart = echarts.init(chartDom);
  252. module.option && myChart.setOption(module.option);
  253. }
  254. //互动交流
  255. module.communicateList = function (data) {
  256. if (data.code == 200) {
  257. //console.log(data.data)
  258. var content = data.data;
  259. module.data.communicateList = content;
  260. var communicateData = template('communicateData', module.data);
  261. $("#communicateContent").html(communicateData);
  262. }
  263. }
  264. //新闻资讯数据
  265. module.NewsInformation = function (data) {
  266. if (data.code == 200) {
  267. var content = data.data;
  268. //console.log(content)
  269. module.data.newsInformationList = content;
  270. var NewsInformationData = template('NewsInformationData', module.data);
  271. $("#NewsInformationContent").html(NewsInformationData);
  272. }
  273. }
  274. //政策法规
  275. module.policiesRegulations = function (data) {
  276. if (data.code == 200) {
  277. var content = data.data;
  278. module.data.policiesRegulationsList = content;
  279. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  280. $("#policiesRegulationsContent").html(policiesRegulationsData);
  281. }
  282. }
  283. //交易规则
  284. module.tradingRules = function (data) {
  285. if (data.code == 200) {
  286. var content = data.data;
  287. module.data.tradingRulesList = content;
  288. var tradingRulesData = template('tradingRulesData', module.data);
  289. $("#tradingRulesContent").html(tradingRulesData);
  290. }
  291. }
  292. //资料下载
  293. module.dataDownload = function (data) {
  294. if (data.code == 200) {
  295. var content = data.data;
  296. module.data.dataDownloadList = content;
  297. var dataDownloadData = template('dataDownloadData', module.data);
  298. $("#dataDownloadContent").html(dataDownloadData);
  299. }
  300. }
  301. //标的物所在地
  302. module.deptLocation = function (data) {
  303. //console.log(data)
  304. if (data.code == 200) {
  305. var content = data.data ;
  306. var contentList = [];
  307. for (var i = 0 ; i < 5&&i<content.length ; i++){
  308. contentList[i] = content[i];
  309. }
  310. module.data.deptLocationList = contentList;
  311. var deptLocationData = template('deptLocationData', module.data);
  312. $("#deptLocationContent").html(deptLocationData);
  313. }
  314. }
  315. //标的物类型
  316. module.deptType = function (data) {
  317. if (data.code == 200) {
  318. var content = data.data ;
  319. // for (var i = 0 ; i < 4 ; i++){
  320. // content[i] = data.data[i];
  321. // }
  322. module.data.deptTypeList = content;
  323. var deptTypeData = template('deptTypeData', module.data);
  324. $("#deptTypeContent").html(deptTypeData);
  325. module.data.deptTypeList1 = content;
  326. var deptTypeData1 = template('deptTypeData1', module.data);
  327. $("#deptTypeContent1").html(deptTypeData1);
  328. }
  329. }
  330. //网站配置信息
  331. module.webConfigInformation = function (data) {
  332. if (data.code == 200) {
  333. var content = data.data;
  334. //console.log(content)
  335. $("#webConfigName").html(content[0].configValue);
  336. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  337. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  338. }
  339. }
  340. //查询交易项目浏览总次数
  341. module.allViewCount = function (data) {
  342. if (data.code == 200) {
  343. var content = data.data;
  344. module.data.allViewCountList = content.toString().split("");
  345. var allViewCountData = template('allViewCountData', module.data);
  346. $("#allViewCount").html(allViewCountData);
  347. }
  348. }
  349. //底部友情链接
  350. module.bottomFriendsLinks = function (data) {
  351. if (data.code == 200) {
  352. var content = data.data;
  353. //console.log(content)
  354. module.data.friendsLinksList = content;
  355. var friendsLinksData = template('friendsLinksData', module.data);
  356. $("#friendsLinksContent").html(friendsLinksData);
  357. }
  358. }
  359. //土地林地四荒地
  360. module.landList = function (data) {
  361. if (data.code == 200) {
  362. module.data.serverApi = serverApi;
  363. var content = data.data;
  364. for (let i = 0 ; i < 5 ; i++){
  365. if (content[i]==undefined){
  366. module.data.landListList.push({
  367. projectShowStatus:'',
  368. projectName :'',
  369. price :'',
  370. unit :'',
  371. outName :'',
  372. signupStopTime :'',
  373. biddingStopTime :'',
  374. locationName:'',
  375. });
  376. }else{
  377. module.data.landListList.push(content[i]);
  378. }
  379. }
  380. // module.data.landListList = content;
  381. var landListData = template('landListData', module.data);
  382. $("#landListContent").html(landListData);
  383. }
  384. }
  385. module.itemList = function (data) {
  386. if (data.code == 200) {
  387. //console.log(data)
  388. module.data.serverApi = serverApi;
  389. var content = data.rows;
  390. for (let i = 0 ; i < 5 ; i++){
  391. if (content[i]==undefined){
  392. module.data.landListList.push({
  393. projectShowStatus:'',
  394. projectName :'',
  395. price :'',
  396. unit :'',
  397. outName :'',
  398. signupStopTime :'',
  399. biddingStopTime :'',
  400. locationName:'',
  401. });
  402. }else{
  403. module.data.landListList.push(content[i]);
  404. }
  405. }
  406. // module.data.landListList = content;
  407. var landListData = template('landListData', module.data);
  408. $("#landListContent").html(landListData);
  409. }
  410. }
  411. module.itemLists = function (data) {
  412. if (data.code == 200) {
  413. //console.log(data)
  414. module.data.serverApi = serverApi;
  415. var content = data.rows;
  416. for (let i = 0 ; i < 5 ; i++){
  417. //console.log(content[i])
  418. if (content[i]==undefined){
  419. //console.log('aaaaaaaaaa')
  420. module.data.collectiveAssetsList.push({
  421. id :'',
  422. projectName :'',
  423. price :'',
  424. needname :'',
  425. needStartTime :'',
  426. needStopTime :'',
  427. phone:'',
  428. });
  429. }else{
  430. module.data.collectiveAssetsList.push(content[i]);
  431. }
  432. }
  433. // module.data.collectiveAssetsList = content;
  434. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  435. $("#collectiveAssetsContent").html(collectiveAssetsData);
  436. }
  437. }
  438. //土地林地四荒地
  439. goListingChange = function (id) {
  440. module.data.landListList = [];
  441. $('#deptTypeContent').children('span').removeClass('active') ;
  442. document.getElementById('tab'+id).className = 'm-r-20 active';
  443. if (id == 0){
  444. tools.doGet(itemsList, {projectNumber:'',pageSize:'5',pageNum:'1'}, module.itemList, true);
  445. }else{
  446. //土地
  447. tools.doGet(webListing + '/'+id+'/0/5', {}, module.landList, true);
  448. }
  449. }
  450. //土地林地四荒地
  451. goListingChanges = function (id) {
  452. module.data.collectiveAssetsList = [];
  453. $('#deptTypeContent1').children('span').removeClass('active');
  454. document.getElementById('tabs'+id).className = 'm-r-20 active';
  455. tools.doGet(needProjectList, {projectNumber:id==0?'':id,pageSize:'5',pageNum:'1'}, module.itemLists, true);
  456. }
  457. //集体资产
  458. module.collectiveAssets = function (data) {
  459. if (data.code == 200) {
  460. module.data.serverApi = serverApi;
  461. var content = data.data;
  462. module.data.collectiveAssetsList = content;
  463. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  464. $("#collectiveAssetsContent").html(collectiveAssetsData);
  465. }
  466. }
  467. //小型水利设施
  468. module.waterConservancyFacilities = function (data) {
  469. if (data.code == 200) {
  470. module.data.serverApi = serverApi;
  471. var content = data.data;
  472. module.data.waterConservancyFacilitiesList = content;
  473. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  474. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  475. }
  476. }
  477. //农业生产设备
  478. module.productionEquipment = function (data) {
  479. if (data.code == 200) {
  480. module.data.serverApi = serverApi;
  481. var content = data.data;
  482. module.data.productionEquipmentList = content;
  483. var productionEquipmentData = template('productionEquipmentData', module.data);
  484. $("#productionEquipmentContent").html(productionEquipmentData);
  485. }
  486. }
  487. //成交公示列表
  488. module.announcementList = function (data) {
  489. if (data.code == 200) {
  490. var content = data.data;
  491. module.data.announcementListList = content;
  492. var announcementListData = template('announcementListData', module.data);
  493. $("#announcementListContent").html(announcementListData);
  494. }
  495. }
  496. //鉴证公告列表
  497. module.attestationList = function (data) {
  498. if (data.code == 200) {
  499. var content = data.data;
  500. module.data.attestationList = content;
  501. var attestationData = template('attestationData', module.data);
  502. $("#attestationContent").html(attestationData);
  503. }
  504. }
  505. //竞价大厅列表
  506. module.biddingHallList = function (data) {
  507. if (data.code == 200) {
  508. var content = data.data;
  509. //console.log(content)
  510. for(var i = 0 ; i < content.length ; i++){
  511. if(content[i].biddingStopTime == null || content[i].biddingStartTime == null){continue;}
  512. var endTimes=content[i].biddingStopTime.substring(0,10).split('-');
  513. var biddingStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+content[i].biddingStopTime.substring(10,19);
  514. var startTimes=content[i].biddingStartTime.substring(0,10).split('-');
  515. var biddingStartTime=startTimes[1]+'/'+startTimes[2]+'/'+startTimes[0]+' '+content[i].biddingStartTime.substring(10,19);
  516. var nowTime = Date.parse(new Date());
  517. var leftTime = Date.parse(biddingStopTime)-nowTime;
  518. var rightTime = Date.parse(biddingStartTime)-nowTime;
  519. //console.log(biddingStopTime)
  520. //console.log(leftTime)
  521. if(leftTime>0){
  522. //console.log('进行中')
  523. content[i].timeType = '进行中'
  524. }
  525. if(leftTime<0){
  526. //console.log('已结束')
  527. content[i].timeType = '已结束'
  528. }
  529. if(rightTime>0){
  530. //console.log('未开始')
  531. content[i].timeType = '未开始'
  532. }
  533. }
  534. module.data.biddingHallListList = content;
  535. //console.log(content)
  536. var biddingHallListData = template('biddingHallListData', module.data);
  537. $("#biddingHallListContent").html(biddingHallListData);
  538. }
  539. }
  540. ///竞价大厅-滚动
  541. module.hallRolling = function () {
  542. var divScroll = document.getElementById('tableList');
  543. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  544. module.timeInter(divScroll);
  545. divScroll.onmouseover = function () {
  546. clearInterval(time);
  547. }
  548. divScroll.onmouseout = function () {
  549. module.timeInter(divScroll);
  550. }
  551. }
  552. //个人供求
  553. module.supplyDemand = function (data) {
  554. if (data.code == 200) {
  555. //console.log(data)
  556. var content = data.data;
  557. for (let i = 0 ; i < 5 ; i++){
  558. if (content[i]==undefined){
  559. module.data.supplyDemandList.push({
  560. id:'',
  561. projectName:'',
  562. logintime:'',
  563. phone:'',
  564. });
  565. }else{
  566. module.data.supplyDemandList.push(content[i]);
  567. }
  568. }
  569. // module.data.supplyDemandList = content;
  570. var supplyDemandData = template('supplyDemandData', module.data);
  571. $("#supply").html(supplyDemandData);
  572. }
  573. }
  574. //个人供求
  575. module.supplyDemand2 = function (data) {
  576. if (data.code == 200) {
  577. //console.log(data)
  578. var content = data.data;
  579. for (let i = 0 ; i < 5 ; i++){
  580. if (content[i]==undefined){
  581. module.data.supplyDemand2List.push({
  582. id:'',
  583. projectName:'',
  584. logintime:'',
  585. phone:'',
  586. });
  587. }else{
  588. module.data.supplyDemand2List.push(content[i]);
  589. }
  590. }
  591. // module.data.supplyDemand2List = content;
  592. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  593. $("#demand").html(supplyDemand2Data);
  594. tools.doGet(supplyDemandRecommend + '/100/5', {}, module.supplyDemandRecommend, true);
  595. }
  596. }
  597. module.supplyDemandRecommend = function(data){
  598. var focusListNext = module.data.focusListNext;
  599. for (var i = 0; i < data.data.length; i++) {
  600. var imgStrs = data.data[i].fileUrl
  601. if (imgStrs != null && imgStrs != '') {
  602. focusListNext.push({img:serverApi+imgStrs,title:data.data[i].projectName,id:data.data[i].id})
  603. }
  604. }
  605. //console.log(data)
  606. module.data.focusListNext = focusListNext;
  607. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  608. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  609. new Swiper('#bannerFocusNextWrap', {
  610. paginationClickable: true,
  611. pagination: '.a2',
  612. autoplay : 2000,
  613. loop:true
  614. })
  615. }
  616. module.supplyImages = function(){
  617. var focusListNext = module.data.focusListNext;
  618. //console.log(module.data.supplyDemandList)
  619. for (var i = 0; i < module.data.supplyDemandList.length; i++) {
  620. var imgStrs = module.data.supplyDemandList[i].projectContent.match(/<img.*?>/g)
  621. var title = module.data.supplyDemandList[i].projectName
  622. if (imgStrs != null && imgStrs != '') {
  623. focusListNext.push({img:imgStrs[0],title:title})
  624. }
  625. }
  626. for (var i = 0; i < module.data.supplyDemand2List.length; i++) {
  627. var imgStrs = module.data.supplyDemand2List[i].projectContent.match(/<img.*?>/g)
  628. var title = module.data.supplyDemand2List[i].projectName
  629. if (imgStrs != null && imgStrs != '') {
  630. focusListNext.push({img:imgStrs[0],title:title})
  631. }
  632. }
  633. module.data.focusListNext = focusListNext;
  634. var bannerFocusBottomData = template('bannerFocusBottomData', module.data);
  635. $("#bannerFocusNextContent").html(bannerFocusBottomData);
  636. new Swiper('#bannerFocusNextWrap', {
  637. pagination: '.page-pagination1',
  638. paginationClickable: true
  639. })
  640. }
  641. module.timeInter = function (divScroll) {
  642. time = setInterval(function () {
  643. var oldTop = divScroll.scrollTop;
  644. var newTop = oldTop + 1;
  645. divScroll.scrollTop = newTop;
  646. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  647. //console.log(counst)
  648. if (2 > counst) {
  649. divScroll.scrollTop = 0;
  650. }
  651. }, 30)
  652. }
  653. //证书查询
  654. goSearchKeyWord = function(){
  655. var type = $('input[name="transaction"]:checked').val();
  656. var searchKeyWord = $('#searchKeyWord').val();
  657. //console.log($('#searchKeyWord').val())
  658. //console.log(type)
  659. if($('#searchKeyWord').val() == '' && type== 'warrant'){
  660. tools.initDialog('提示', '经营权证编号不可为空', function () {
  661. return;
  662. }, '确定')
  663. return;
  664. }
  665. if(type == 'warrant'){
  666. tools.skip('view/announcement/warrantDetail.html?type='+type+'&searchKeyWord='+searchKeyWord)
  667. }else{
  668. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  669. }
  670. }
  671. //项目查询
  672. searchProject = function(){
  673. var projectNum = $('#projectNum').val();
  674. var projectName = $('#projectName').val();
  675. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  676. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  677. }
  678. //标的物类型
  679. module.deptTypeSelect = function (data) {
  680. if (data.code == 200) {
  681. //console.log(data);
  682. var content = data.data ;
  683. module.data.deptTypeSelectList = content;
  684. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  685. $("#deptTypeSelectContent").html(deptTypeSelectData);
  686. }
  687. }
  688. //切换
  689. tabCheck = function (type) {
  690. if(type == 'supply'){
  691. document.getElementById('demand').style.display = 'none';
  692. document.getElementById('demandBtn').className = '';
  693. }
  694. if(type == 'demand'){
  695. document.getElementById('supply').style.display = 'none';
  696. document.getElementById('supplyBtn').className = '';
  697. }
  698. document.getElementById(type).style.display = 'inline-table';
  699. document.getElementById(type+'Btn').className = 'active';
  700. }
  701. //切换
  702. tabClick = function (type) {
  703. document.getElementById('cjgg').style.display = 'none';
  704. document.getElementById('jzgg').style.display = 'none';
  705. document.getElementById('cjggBtn').className = '';
  706. document.getElementById('jzggBtn').className = '';
  707. document.getElementById(type).style.display = 'block';
  708. document.getElementById(type+'Btn').className = 'active';
  709. }
  710. goDetail = function (id) {
  711. if (!id)return;
  712. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  713. }
  714. goUserInteract = function () {
  715. tools.skip('view/user/user.html?type=goInteract')
  716. }
  717. goListing = function (clickType,dictSort,dictCode) {
  718. tools.skip('view/listingItems/itemsList.html?clickType='+clickType+'&dictSort='+dictSort+'&dictCode='+dictCode);
  719. }
  720. goAnnouncementList = function (type) {
  721. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  722. }
  723. goNewList = function () {
  724. tools.skip('view/new/newList.html');
  725. }
  726. goPolicy = function (type) {
  727. tools.skip('view/policy/policy.html?type='+type);
  728. }
  729. goBidding = function(){
  730. tools.skip('view/bidding/biddingList.html');
  731. }
  732. goDemand = function(){
  733. tools.skip('view/demand/demand.html');
  734. }
  735. goInteraction = function(){
  736. tools.skip('view/interact/interactList.html');
  737. }
  738. goInteractSearch = function(){
  739. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  740. }
  741. return module;
  742. });