农燊高科官方网站
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

45 linhas
1.2 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "newApi"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. newsInformationList:''
  9. },
  10. };
  11. var tools = new Tools();
  12. module.init = function (page) {
  13. console.log(getQueryVariable('id'))
  14. //新闻资讯
  15. tools.doGet(newDetail + '/'+getQueryVariable('id'), {}, module.NewsInformation);
  16. };
  17. function getQueryVariable(variable)
  18. {
  19. var query = window.location.search.substring(1);
  20. var vars = query.split("&");
  21. for (var i=0;i<vars.length;i++) {
  22. var pair = vars[i].split("=");
  23. if(pair[0] == variable){return pair[1];}
  24. }
  25. return(false);
  26. }
  27. //新闻资讯数据
  28. module.NewsInformation = function (data) {
  29. console.log(data)
  30. if (data.code == 200) {
  31. var content = data.data;
  32. $("#newTitle").html(content.title);
  33. $("#newTime").html(content.newsTime);
  34. $("#newCome").html(content.createBy);
  35. $("#newContent").html(content.content);
  36. }
  37. }
  38. return module;
  39. });