.swiper-pagination-bullet{background:white;opacity: 1;} .swiper-pagination-bullet-active{background:red;}
Vue.prototype.$http = axios; var vm = new Vue({ el: '#app', components: { 'cheader': component_header, 'cmenu': component_menu, 'cbmenu': component_bottomMenu, 'cfooter': component_footer, 'department': component_department, 'head-news': component_headNews, 'ad': component_ad, 'friend-link': component_friendLink, 'swiper-news': component_swiperNews, 'module-swiper-news': component_moduleSwiperNews, 'module-list': component_moduleList, 'cblock': component_block }, data: { menu: null, machineList: ['wangLuoDianShi', 'weiShiPin', 'cdNews', 'hbNews', 'gnNews', 'hyNews', 'cdNewsPaper', 'tourismList', 'carList', 'financeList', 'indexZhuanTi', 'indexAnnouncement', 'swiperNews', 'seechengde' ], multipleNews: { headNews: { content: [] }, moduleSwiperNews: { content: [] }, wangLuoDianShi: { content: [] }, weiShiPin: { content: [] }, cdNews: { content: [] }, hbNews: { content: [] }, gnNews: { content: [] }, hyNews: { content: [] }, cdNewsPaper: { content: [] }, seechengde: { content: [] }, tourismList: { content: [] }, carList: { content: [] }, financeList: { content: [] }, indexZhuanTi: { content: [] }, indexWeibo: { content: [] }, indexAnnouncement: { content: [] }, indexAct: { content: [] }, swiperNews: { content: [] }, }, searchContent: '', logo: { svalue: '' }, }, mounted: function () { this.getMenuList(); this.getHeadNews(); this.getModuleSwiperNews(); this.getIndexWeibo(); this.getMultipleNews(this.machineList); this.getSiteConfig(); }, methods: { getMenuList: function () { this.$http.get(config.base_url + '/c/menu/main').then((res) => { this.menu = res.data[0] }) }, getSiteConfig: function () { this.$http.get(config.base_url + '/c/site').then((res) => { if (res.data) { for (var i = 0; i < res.data.length; i++) { if (res.data[i].skey == 'logo') { this.logo = res.data[i]; } } } }) }, getHeadNews: function () { this.$http.get(config.base_url + '/c/newsf/1').then((res) => { this.multipleNews.headNews = res.data; }) }, getModuleSwiperNews: function () { this.$http.get(config.base_url + '/c/newsf/2').then((res) => { this.multipleNews.moduleSwiperNews = res.data; this.$nextTick(() => { var ModuleSwiperNews = new Swiper('#image_news', { autoplay: true, //可选选项,自动滑动 effect: 'fade', on: { click: function (e) { console.log(e); } }, pagination: { el: '.swiper-pagination', clickable: true, } }) }) }) }, getWangLuoDianShi: function () { this.$http.get(config.base_url + '/c/listnt/wangLuoDianShi').then((res) => { this.wangLuoDianShi = res.data; }) }, getCdNews: function () { this.$http.get(config.base_url + '/c/listnt/cdNews').then((res) => { this.cdNews = res.data; }) }, getMsNews: function () { this.$http.get(config.base_url + '/c/listnt/msNews').then((res) => { this.msNews = res.data; }) }, getGnNews: function () { this.$http.get(config.base_url + '/c/listnt/gnNews').then((res) => { this.gnNews = res.data; }) }, getHyNews: function () { this.$http.get(config.base_url + '/c/listnt/hyNews').then((res) => { this.hyNews = res.data; }) }, getCdNewsPaper: function () { this.$http.get(config.base_url + '/c/listnt/cdNewsPaper').then((res) => { this.cdNewsPaper = res.data; }) }, getIndexTourism: function () { this.$http.get(config.base_url + '/c/listnt/indexTourism').then((res) => { this.indexTourism = res.data; }) }, getIndexCar: function () { this.$http.get(config.base_url + '/c/listnt/indexCar').then((res) => { this.indexCar = res.data; }) }, getIndexFinance: function () { this.$http.get(config.base_url + '/c/listnt/indexFinance').then((res) => { this.indexFinance = res.data; }) }, getIndexZhuanTi: function () { this.$http.get(config.base_url + '/c/listnt/indexZhuanTi').then((res) => { this.indexZhuanTi = res.data; }) }, getIndexWeibo: function () { this.$http.get(config.base_url + '/weibo').then((res) => { if(res.data){ var arr = []; for(var i = 0; i < res.data.length; i++){ var temptitle = res.data[i].text; //temptitle = temptitle.replace('
', ''); //temptitle = temptitle.replace('
', ''); // var url = temptitle.substring(temptitle.indexOf('全文')) var url = res.data[i].href; //var readContent = temptitle.substring(temptitle.indexOf('全文')+8) //console.log('readContent',readContent) //temptitle = temptitle.replace(readContent, ''); // if((temptitle.substr(temptitle.indexOf('>'), temptitle.length)).length > 40){ // temptitle = temptitle.substr(0, 40) // } // temptitle = temptitle + '阅读' arr.push({ timg: res.data[i].timg, title: temptitle, url: url }) } console.log(arr) this.multipleNews.indexWeibo['content'] = arr; } }) }, getIndexAnnouncement: function () { this.$http.get(config.base_url + '/c/listnt/indexAnnouncement').then((res) => { this.indexAnnouncement = res.data; }) }, getIndexAct: function () { this.$http.get(config.base_url + '/c/listnt/indexAct').then((res) => { this.indexAct = res.data; }) }, getSwiperNews: function () { this.$http.get(config.base_url + '/c/listnt/swiperNews').then((res) => { this.swiperNews = res.data; this.$nextTick(() => { var swiper = new Swiper('#image_news100', { slidesPerView: 6.5, spaceBetween: 30, keyboard: { enabled: true, }, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); }) }) }, getMultipleNews: function (machineList) { if (machineList) { var machineStr = ''; for (var i = 0; i < machineList.length; i++) { if (machineStr == '') { machineStr = machineList[i]; } else { machineStr = machineStr + ',' + machineList[i]; } } this.$http.get(config.base_url + '/c/nta/' + machineStr).then((res) => { // this.multipleNews = res.data; for (var key in res.data) { this.multipleNews[key]['content'] = res.data[key]; } this.$nextTick(() => { var swiper = new Swiper('#image_news100', { spaceBetween: 30, keyboard: { enabled: true, }, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, on: { click: function (e) { console.log(e); } } }); }) }) } }, bindSearch: function () { if (this.searchContent != null && this.searchContent != '') { window.open('/search.html?kw=' + encodeURIComponent(this.searchContent)); } } } });