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

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