|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
- //数据存储
- var module = {
- data: {
- //服务器地址
- serverApi:'',
- //焦点图数据
- focusList: [],
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- //新闻管理列表
- tools.doGet(news + '/003/7', {}, module.focusNews , true);
- };
-
- //焦点图数据
- module.focusNews = function (data) {
- if (data.code == 200) {
- var content = data.data;
- var focusList = [];
- for (var i = 0; i < content.length; i++) {
- var imgStrs = content[i].content.match(/<img.*?>/g)
- var title = content[i].title;
- var id = content[i].id;
- if (imgStrs != null && imgStrs != '') {
- focusList.push({img:imgStrs[0],title:title,id:id})
- }
- }
- //console.log(focusList)
- module.data.focusList = focusList;
- var bannerFocusData = template('bannerFocusData', module.data);
- $("#bannerFocusContent").html(bannerFocusData);
- new Swiper('#bannerFocusWrap', {
- pagination: '.page-pagination',
- paginationClickable: true,
- autoplay : 2000,
- loop:true
- })
-
- }
- }
-
- goInteractSearch = function(){
- tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
- }
- return module;
- });
|