农燊高科官方网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

policyDetail.js 2.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. //底部友情链接
  14. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  15. console.log(getQueryVariable('id'))
  16. var titName = getQueryVariable('type')
  17. if(titName == 'zcfg'){
  18. document.getElementById('titIndex').innerText = '政策法规'
  19. }
  20. if(titName == 'jygz'){
  21. document.getElementById('titIndex').innerText = '交易规则'
  22. }
  23. if(titName == 'zlxz'){
  24. document.getElementById('titIndex').innerText = '资料下载'
  25. }
  26. //新闻资讯
  27. tools.doGet(newDetail + '/'+getQueryVariable('id'), {}, module.NewsInformation,true);
  28. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  29. tools.getWebConfig();
  30. };
  31. //底部友情链接
  32. module.bottomFriendsLinks = function (data) {
  33. if (data.code == 200) {
  34. var content = data.data;
  35. console.log(content)
  36. module.data.friendsLinksList = content;
  37. var friendsLinksData = template('friendsLinksData', module.data);
  38. $("#friendsLinksContent").html(friendsLinksData);
  39. }
  40. }
  41. //获取地址栏参数
  42. function getQueryVariable(variable){
  43. var query = window.location.search.substring(1);
  44. var vars = query.split("&");
  45. for (var i=0;i<vars.length;i++) {
  46. var pair = vars[i].split("=");
  47. if(pair[0] == variable){return pair[1];}
  48. }
  49. return(false);
  50. }
  51. //新闻资讯数据
  52. module.NewsInformation = function (data) {
  53. console.log(data)
  54. if (data.code == 200) {
  55. var content = data.data;
  56. $("#newTitle").html(content.title);
  57. $("#newTime").html(content.newsTime);
  58. $("#newCome").html(content.createBy);
  59. $("#newContent").html(content.content);
  60. }
  61. }
  62. return module;
  63. });