网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 1 месец
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 1 месец
преди 1 месец
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 1 месец
преди 1 месец
преди 2 седмици
преди 1 месец
преди 1 месец
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 1 месец
преди 1 месец
преди 1 месец
преди 1 месец
преди 1 месец
преди 1 месец
преди 1 месец
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 1 месец
преди 2 седмици
преди 1 месец
преди 1 месец
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 2 седмици
преди 1 месец
преди 1 месец
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", 'swiper'], function ($, template, Tools, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. newImgList:[],
  14. newList1:[],
  15. newList2:[],
  16. newList3:[],
  17. newList4:[],
  18. newList5:[],
  19. newList6:[],
  20. newList7:[],
  21. newList8:[],
  22. newList9:[],
  23. newList10:[],
  24. pageNum1: 1,
  25. pageNum2: 1,
  26. pageNum3: 1,
  27. pageNum4: 1,
  28. pageNum5: 1,
  29. pageNum6: 1,
  30. pageNum7: 1,
  31. pageNum8: 1,
  32. pageNum9: 1,
  33. pageNum10: 1,
  34. },
  35. };
  36. var tools = new Tools();
  37. module.init = function (page) {
  38. // //新闻列表
  39. // tools.doGet(listSiyigongkai, {
  40. // pageNum:1,
  41. // pageSize:10,
  42. // bookId: JSON.parse(tools.getCookie('user')).bookId,
  43. // deptId: JSON.parse(tools.getCookie('user')).deptId
  44. // }, module.newsList4 , true);
  45. tools.doGet(webList, {}, module.webList , true);
  46. // new Swiper('#bannerFocusNextWrap', {
  47. // paginationClickable: true,
  48. // pagination: '.a2',
  49. // autoplay : 2000,
  50. // loop:true
  51. // })
  52. console.log(JSON.parse(tools.getCookie('user')))
  53. $("#deptName").html(JSON.parse(tools.getCookie('user')).deptName);
  54. if (tools.getCookie('user')){
  55. $("#loginF").css('display','none');
  56. $("#listB").css('display','flex');
  57. changeList('1');
  58. }
  59. var ulbox1 = document.getElementById("review_box1");
  60. ulbox1.scrollTop = 0; // 开始无滚动时设为0
  61. ulbox1.addEventListener('scroll', function() {
  62. if (ulbox1.scrollHeight - ulbox1.scrollTop === ulbox1.clientHeight) {
  63. module.data.pageNum1 += 1;
  64. changeList('1');
  65. }
  66. });
  67. var ulbox2 = document.getElementById("review_box2");
  68. ulbox2.scrollTop = 0; // 开始无滚动时设为0
  69. ulbox2.addEventListener('scroll', function() {
  70. if (ulbox2.scrollHeight - ulbox2.scrollTop === ulbox2.clientHeight) {
  71. module.data.pageNum2 += 1;
  72. changeList('2');
  73. }
  74. });
  75. var ulbox3 = document.getElementById("review_box3");
  76. ulbox3.scrollTop = 0; // 开始无滚动时设为0
  77. ulbox3.addEventListener('scroll', function() {
  78. if (ulbox3.scrollHeight - ulbox3.scrollTop === ulbox3.clientHeight) {
  79. module.data.pageNum3 += 1;
  80. changeList('3');
  81. }
  82. });
  83. var ulbox4 = document.getElementById("review_box4");
  84. ulbox4.scrollTop = 0; // 开始无滚动时设为0
  85. ulbox4.addEventListener('scroll', function() {
  86. if (ulbox4.scrollHeight - ulbox4.scrollTop === ulbox4.clientHeight) {
  87. module.data.pageNum4 += 1;
  88. changeList('4');
  89. }
  90. });
  91. var ulbox5 = document.getElementById("review_box5");
  92. ulbox5.scrollTop = 0; // 开始无滚动时设为0
  93. ulbox5.addEventListener('scroll', function() {
  94. if (ulbox5.scrollHeight - ulbox5.scrollTop === ulbox5.clientHeight) {
  95. module.data.pageNum5 += 1;
  96. changeList('5');
  97. }
  98. });
  99. var ulbox6 = document.getElementById("review_box6");
  100. ulbox6.scrollTop = 0; // 开始无滚动时设为0
  101. ulbox6.addEventListener('scroll', function() {
  102. if (ulbox6.scrollHeight - ulbox6.scrollTop === ulbox6.clientHeight) {
  103. module.data.pageNum6 += 1;
  104. changeList('6');
  105. }
  106. });
  107. var ulbox7 = document.getElementById("review_box7");
  108. ulbox7.scrollTop = 0; // 开始无滚动时设为0
  109. ulbox7.addEventListener('scroll', function() {
  110. if (ulbox7.scrollHeight - ulbox7.scrollTop === ulbox7.clientHeight) {
  111. module.data.pageNum7 += 1;
  112. changeList('7');
  113. }
  114. });
  115. var ulbox8 = document.getElementById("review_box8");
  116. ulbox8.scrollTop = 0; // 开始无滚动时设为0
  117. ulbox8.addEventListener('scroll', function() {
  118. if (ulbox8.scrollHeight - ulbox8.scrollTop === ulbox8.clientHeight) {
  119. module.data.pageNum8 += 1;
  120. changeList('8');
  121. }
  122. });
  123. var ulbox9 = document.getElementById("review_box9");
  124. ulbox9.scrollTop = 0; // 开始无滚动时设为0
  125. ulbox9.addEventListener('scroll', function() {
  126. if (ulbox9.scrollHeight - ulbox9.scrollTop === ulbox9.clientHeight) {
  127. module.data.pageNum9 += 1;
  128. changeList('9');
  129. }
  130. });
  131. var ulbox10 = document.getElementById("review_box10");
  132. ulbox10.scrollTop = 0; // 开始无滚动时设为0
  133. ulbox10.addEventListener('scroll', function() {
  134. if (ulbox10.scrollHeight - ulbox10.scrollTop === ulbox10.clientHeight) {
  135. module.data.pageNum10 += 1;
  136. changeList('10');
  137. }
  138. });
  139. };
  140. module.newsList4 = function (data) {
  141. if (data.code == 200) {
  142. var content = data.rows;
  143. if (module.data.newList4.length >= data.total){
  144. return;
  145. }else{
  146. for (let i = 0 ; i < content.length ; i++){
  147. module.data.newList4.push(content[i]);
  148. }
  149. }
  150. // module.data.newList4 = content;
  151. var newListData4 = template('newListData4', module.data);
  152. $("#newListContent_ul_4").html(newListData4);
  153. }
  154. }
  155. module.newsList10 = function (data) {
  156. if (data.code == 200) {
  157. var content = data.rows;
  158. if (module.data.newList10.length >= data.total){
  159. console.log(111111111111)
  160. return;
  161. }else{
  162. console.log(222222222222)
  163. for (let i = 0 ; i < content.length ; i++){
  164. module.data.newList10.push(content[i]);
  165. }
  166. }
  167. console.log(module.data.newList10)
  168. // module.data.newList4 = content;
  169. var newListData10 = template('newListData10', module.data);
  170. $("#newListContent_ul_10").html(newListData10);
  171. }
  172. }
  173. module.newsList7 = function (data) {
  174. if (data.code == 200) {
  175. var content = data.rows;
  176. if (module.data.newList7.length >= data.total){
  177. return;
  178. }else{
  179. for (let i = 0 ; i < content.length ; i++){
  180. module.data.newList7.push(content[i]);
  181. }
  182. }
  183. // module.data.newList7 = content;
  184. var newListData7 = template('newListData7', module.data);
  185. $("#newListContent_ul_7").html(newListData7);
  186. }
  187. }
  188. module.newsList8 = function (data) {
  189. if (data.code == 200) {
  190. var content = data.rows;
  191. if (module.data.newList8.length >= data.total){
  192. return;
  193. }else{
  194. for (let i = 0 ; i < content.length ; i++){
  195. module.data.newList8.push(content[i]);
  196. }
  197. }
  198. // module.data.newList8 = content;
  199. var newListData8 = template('newListData8', module.data);
  200. $("#newListContent_ul_8").html(newListData8);
  201. }
  202. }
  203. module.newsList9 = function (data) {
  204. if (data.code == 200) {
  205. var content = data.rows;
  206. if (module.data.newList9.length >= data.total){
  207. return;
  208. }else{
  209. for (let i = 0 ; i < content.length ; i++){
  210. module.data.newList9.push(content[i]);
  211. }
  212. }
  213. // module.data.newList9 = content;
  214. var newListData9 = template('newListData9', module.data);
  215. $("#newListContent_ul_9").html(newListData9);
  216. }
  217. }
  218. module.webList = function (data) {
  219. if (data.code == 200) {
  220. var content = data.data;
  221. module.data.webList = content;
  222. var webData = template('webData', module.data);
  223. $("#webContent").html(webData);
  224. var titData = template('titData', module.data);
  225. $("#titContent").html(titData);
  226. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  227. }
  228. }
  229. searchChange = function () {
  230. console.log(1111111111);
  231. tools.doGet(listSiyigongkai, {pageNum:1,pageSize:8,openName:$("#searchInput").val()}, module.newsList , true);
  232. }
  233. submitUser = function () {
  234. tools.doPost(checkFarmer, {memberName:$("#userName").val(),idcard:$("#password").val()}, module.checkFarmer , true);
  235. }
  236. clearCook = function () {
  237. tools.setCookie('user','');
  238. tools.setCookie('farmerCode','');
  239. $('#loginF').css('display','flex');
  240. $('#listB').css('display','none');
  241. }
  242. module.checkFarmer = function (data) {
  243. if (data.code == 200) {
  244. let seconds = 3600;
  245. let expires = new Date(new Date() * 1 + seconds * 1000);
  246. tools.setCookie("user", JSON.stringify(data.data), { expires: expires });
  247. tools.doGet(familyMember, {idcard:$("#password").val(),familyStatus:"02"}, module.familyMember , true);
  248. }
  249. }
  250. module.familyMember = function (data) {
  251. if (data.code == 200) {
  252. const farmerCode = data.rows[0].farmerCode;
  253. tools.setCookie("farmerCode",farmerCode, { expires: 30 });
  254. $('#loginF').css('display','none');
  255. $('#listB').css('display','flex');
  256. changeList('1');
  257. }
  258. }
  259. changeList = function (type) {
  260. $('#new_list_1').css('display','none');
  261. $('#new_list_2').css('display','none');
  262. $('#new_list_3').css('display','none');
  263. $('#new_list_4').css('display','none');
  264. $('#new_list_5').css('display','none');
  265. $('#new_list_6').css('display','none');
  266. $('#new_list_7').css('display','none');
  267. $('#new_list_8').css('display','none');
  268. $('#new_list_9').css('display','none');
  269. $('#new_list_10').css('display','none');
  270. switch (type) {
  271. case '1':
  272. $('#new_list_1').css('display','block');
  273. $("#nowDateNYR1").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  274. tools.doGet(financePublicList, {
  275. pageNum:module.data.pageNum1,
  276. pageSize:10,
  277. orderByColumn: 'openNy',
  278. isAsc: 'desc',
  279. bookId: JSON.parse(tools.getCookie('user')).bookId,
  280. deptId: JSON.parse(tools.getCookie('user')).deptId
  281. }, module.newsList1 , true);
  282. break;
  283. case '2':
  284. $('#new_list_2').css('display','block');
  285. $("#nowDateNYR2").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  286. tools.doGet(contractionList, {
  287. pageNum:module.data.pageNum2,
  288. pageSize:10,
  289. orderByColumn: 'buildingTime',
  290. translate_dict: 1,
  291. isAsc: 'desc',
  292. bookId: JSON.parse(tools.getCookie('user')).bookId,
  293. deptId: JSON.parse(tools.getCookie('user')).deptId
  294. }, module.newsList2 , true);
  295. break;
  296. case '3':
  297. $('#new_list_3').css('display','block');
  298. $("#nowDateNYR3").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  299. tools.doGet(majorEventPublicList, {
  300. pageNum:module.data.pageNum3,
  301. pageSize:10,
  302. orderByColumn: 'openNy',
  303. isAsc: 'desc',
  304. bookId: JSON.parse(tools.getCookie('user')).bookId,
  305. deptId: JSON.parse(tools.getCookie('user')).deptId
  306. }, module.newsList3 , true);
  307. break;
  308. case '4':
  309. $('#new_list_4').css('display','block');
  310. $("#nowDateNYR4").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  311. tools.doGet(listSiyigongkai, {
  312. pageNum:module.data.pageNum4,
  313. pageSize:10,
  314. bookId: JSON.parse(tools.getCookie('user')).bookId,
  315. deptId: JSON.parse(tools.getCookie('user')).deptId
  316. }, module.newsList4 , true);
  317. break;
  318. case '5':
  319. $('#new_list_5').css('display','block');
  320. $("#nowDateNYR5").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  321. break;
  322. case '6':
  323. $('#new_list_6').css('display','block');
  324. $("#nowDateNYR6").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  325. break;
  326. case '7':
  327. tools.doGet(orcodeList, {
  328. translate_dict:1,
  329. orderByColumn: 'code',
  330. isAsc: 'asc',
  331. pageNum:module.data.pageNum7,
  332. pageSize:10,
  333. bookId: JSON.parse(tools.getCookie('user')).bookId,
  334. deptId: JSON.parse(tools.getCookie('user')).deptId
  335. }, module.newsList7 , true);
  336. $('#new_list_7').css('display','block');
  337. $("#nowDateNYR7").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  338. break;
  339. case '8':
  340. tools.doGet(assetresourceOrcodeList, {
  341. translate_dict:1,
  342. orderByColumn: 'code',
  343. isAsc: 'asc',
  344. pageNum:module.data.pageNum8,
  345. pageSize:10,
  346. bookId: JSON.parse(tools.getCookie('user')).bookId
  347. }, module.newsList8 , true);
  348. $('#new_list_8').css('display','block');
  349. $("#nowDateNYR8").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  350. break;
  351. case '9':
  352. tools.doGet(tempWorkerPublicList, {
  353. translate_dict:1,
  354. orderByColumn: 'openNy',
  355. isAsc: 'asc',
  356. pageNum:module.data.pageNum9,
  357. pageSize:10,
  358. bookId: JSON.parse(tools.getCookie('user')).bookId,
  359. deptId: JSON.parse(tools.getCookie('user')).deptId
  360. }, module.newsList9 , true);
  361. $('#new_list_9').css('display','block');
  362. $("#nowDateNYR9").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  363. break;
  364. case '10':
  365. $('#new_list_10').css('display','block');
  366. $("#nowDateNYR10").html(new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate());
  367. tools.doGet(otherPublicList, {
  368. pageNum:module.data.pageNum10,
  369. pageSize:10,
  370. bookId: JSON.parse(tools.getCookie('user')).bookId,
  371. deptId: JSON.parse(tools.getCookie('user')).deptId,
  372. otherType: 13
  373. }, module.newsList10 , true);
  374. break;
  375. default:
  376. break;
  377. }
  378. }
  379. module.newsList1 = function (data) {
  380. if (data.code == 200) {
  381. var content = data.rows;
  382. if (module.data.newList1.length >= data.total){
  383. return;
  384. }else{
  385. for (let i = 0 ; i < content.length ; i++){
  386. module.data.newList1.push(content[i]);
  387. }
  388. }
  389. var newListData1 = template('newListData1', module.data);
  390. $("#newListContent_ul_1").html(newListData1);
  391. }
  392. }
  393. module.newsList2 = function (data) {
  394. if (data.code == 200) {
  395. var content = data.rows;
  396. if (module.data.newList2.length >= data.total){
  397. return;
  398. }else{
  399. for (let i = 0 ; i < content.length ; i++){
  400. module.data.newList2.push(content[i]);
  401. }
  402. }
  403. var newListData2 = template('newListData2', module.data);
  404. $("#newListContent_ul_2").html(newListData2);
  405. }
  406. }
  407. module.newsList3 = function (data) {
  408. if (data.code == 200) {
  409. var content = data.rows;
  410. if (module.data.newList3.length >= data.total){
  411. return;
  412. }else{
  413. for (let i = 0 ; i < content.length ; i++){
  414. module.data.newList3.push(content[i]);
  415. }
  416. }
  417. // module.data.newList3 = content;
  418. var newListData3 = template('newListData3', module.data);
  419. $("#newListContent_ul_3").html(newListData3);
  420. }
  421. }
  422. function roll(t) {
  423. var ul1 = document.getElementById("newListContent");
  424. var ul2 = document.getElementById("newListContent2");
  425. var ulbox = document.getElementById("review_box");
  426. ul2.innerHTML = ul1.innerHTML;
  427. ulbox.scrollTop = 0; // 开始无滚动时设为0
  428. var timer = setInterval(rollStart, t); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
  429. // 鼠标移入div时暂停滚动
  430. ulbox.onmouseover = function () {
  431. clearInterval(timer);
  432. }
  433. // 鼠标移出div后继续滚动
  434. ulbox.onmouseout = function () {
  435. timer = setInterval(rollStart, t);
  436. }
  437. }
  438. // 开始滚动函数
  439. function rollStart() {
  440. // 上面声明的DOM对象为局部对象需要再次声明
  441. var ul1 = document.getElementById("newListContent");
  442. var ul2 = document.getElementById("newListContent2");
  443. var ulbox = document.getElementById("review_box");
  444. // 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
  445. console.log(ulbox.scrollTop+'--------'+ul1.scrollHeight)
  446. if (ulbox.scrollTop >= ul1.scrollHeight) {
  447. ulbox.scrollTop = 0;
  448. } else {
  449. ulbox.scrollTop += 1;
  450. }
  451. }
  452. return module;
  453. });