网站
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.
 
 
 

77 line
2.3 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", 'swiper', 'dateTime'], function ($, template, Tools, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. newImgList:[]
  14. },
  15. };
  16. var tools = new Tools();
  17. module.init = function (page) {
  18. tools.doGet(webList, { configKey: 'web.open' }, module.webList , true);
  19. $("#signStartTimeStr").datetime({
  20. type: "date",
  21. value: [new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate()],
  22. success: function (res) {
  23. //console.log(res)
  24. }
  25. })
  26. };
  27. module.newsList = function (data) {
  28. if (data.code == 200) {
  29. var content = data.rows;
  30. module.data.newList = content;
  31. var newListData = template('newListData', module.data);
  32. $("#newListContent").html(newListData);
  33. var newImgList = [];
  34. content.map(rr=>{
  35. if (rr.infoImg!=null&&rr.infoImg!=""){
  36. newImgList.push(rr.infoImg);
  37. }
  38. })
  39. module.data.newImgList = newImgList;
  40. var newListDataImg = template('newListDataImg', module.data);
  41. $("#bannerFocusNextContent").html(newListDataImg);
  42. }
  43. }
  44. module.webList = function (data) {
  45. if (data.code == 200) {
  46. var content = data.rows;
  47. content.map(rr=>{
  48. if (rr.configKey == 'web.open.technique'){
  49. $("#zcdw").html(rr.configValue);
  50. }
  51. if (rr.configKey == "web.open.phone"){
  52. $("#phone").html(rr.configValue);
  53. }
  54. if (rr.configKey == "web.open.qrcode"){
  55. $('#ewm').attr('src', rr.configValue);
  56. }
  57. if (rr.configKey == "web.open.title"){
  58. $("#tt").html(rr.configValue);
  59. }
  60. })
  61. }
  62. }
  63. searchChange = function () {
  64. tools.doGet(newsList, {pageNum:1,pageSize:8,infoName:$("#searchInput").val()}, module.newsList , true);
  65. }
  66. return module;
  67. });