网站
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

89 行
2.9 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "newApi", 'swiper'], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //焦点图数据
  9. focusListTop: [],
  10. newsInformationList:''
  11. },
  12. };
  13. var tools = new Tools();
  14. module.init = function (page) {
  15. //获取焦点图信息
  16. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  17. //底部友情链接
  18. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  19. console.log(getQueryVariable('id'))
  20. var titName = getQueryVariable('type')
  21. if(titName == 'zcfg'){
  22. document.getElementById('titIndex').innerText = '政策法规'
  23. }
  24. if(titName == 'jygz'){
  25. document.getElementById('titIndex').innerText = '交易规则'
  26. }
  27. if(titName == 'zlxz'){
  28. document.getElementById('titIndex').innerText = '资料下载'
  29. }
  30. //新闻资讯
  31. tools.doGet(newDetail + '/'+getQueryVariable('id'), {}, module.NewsInformation,true);
  32. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  33. tools.getWebConfig();
  34. };
  35. //焦点图数据
  36. module.focusNewsTop = function (data) {
  37. if (data.code == 200) {
  38. module.data.focusListTop = data.data;
  39. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  40. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  41. new Swiper('#bannerFocusWrapTop', {
  42. paginationClickable: true,
  43. autoplay : 4000,
  44. loop:true
  45. })
  46. }
  47. }
  48. //底部友情链接
  49. module.bottomFriendsLinks = function (data) {
  50. if (data.code == 200) {
  51. var content = data.data;
  52. console.log(content)
  53. module.data.friendsLinksList = content;
  54. var friendsLinksData = template('friendsLinksData', module.data);
  55. $("#friendsLinksContent").html(friendsLinksData);
  56. }
  57. }
  58. //获取地址栏参数
  59. function getQueryVariable(variable){
  60. var query = window.location.search.substring(1);
  61. var vars = query.split("&");
  62. for (var i=0;i<vars.length;i++) {
  63. var pair = vars[i].split("=");
  64. if(pair[0] == variable){return pair[1];}
  65. }
  66. return(false);
  67. }
  68. //新闻资讯数据
  69. module.NewsInformation = function (data) {
  70. console.log(data)
  71. if (data.code == 200) {
  72. var content = data.data;
  73. $("#newTitle").html(content.title);
  74. $("#newTime").html(content.newsTime);
  75. $("#newCome").html(content.createBy);
  76. $("#newContent").html(content.content);
  77. }
  78. }
  79. return module;
  80. });