'use strict' var investorVue = new Vue({ el: '#investor-cont', data: { topMsg: { nav: "鎶曡祫鑰呭叧绯? }, hoverNav: "", inestorNews: [], currentPage: 1, inestorNews1: [], currentPage1: 1 }, computed: { stockMsg: function () { return []; }, hoverSubNav: function () { return getNav(this.hoverNav); }, mobileNav: function () { var mobileNav = []; mobileNav.push(getNav('01')); mobileNav.push(getNav('02')); mobileNav.push(getNav('04')); mobileNav.push({ h: "鏂伴椈鍔ㄦ€?, href: "news.html", nav: [] }); mobileNav.push(getNav('05')); mobileNav.push(getNav('06')); console.log(mobileNav); return mobileNav; } }, methods: { mEnter: function (id, $event) { this.hoverNav = id; $(".nav-detail").addClass("showSub"); this.mouseOver = "bar"; $(".public-top .top-title").addClass("blur"); $(".hover-li").removeClass("hover-li"); $event.target.className = "hover-li"; }, mLeave: function ($event) { this.mouseOver = ""; setTimeout(this.checkLeave, 100); }, detailEnter: function ($event) { this.mouseOver = "detail"; }, detaileLeave: function ($event) { this.mouseOver = ""; setTimeout(this.checkLeave, 100); }, checkLeave: function () { if (this.mouseOver.length === 0) { this.hoverNav = ""; $(".nav-detail").removeClass("showSub"); $(".public-top .width-1200").removeClass("blur"); $(".hover-li").removeClass("hover-li"); } }, showText: function (str) { var len = str.length, i = 0, strHtml = ""; for (; i < len; i++) { var x = str[i]; if (x === " ") x = " "; strHtml += "" + x + ""; } return strHtml; }, scrollFun: function () { this.hoverNav = ""; $(".nav-detail").removeClass("showSub"); $(".public-top .width-1200").removeClass("blur"); $(".hover-li").removeClass("hover-li"); }, preNew: function () { var page = this.currentPage - 1; if (page != 0) { var _this = this; var jyear = $(".year-select").val(); $.post('investor.php', {page: page,jyear: jyear}, function(data, textStatus){ if (JSON.parse(data).length == 0) { } else { _this.currentPage -= 1; _this.inestorNews = JSON.parse(data); } }); } }, nextNew: function () { var page = this.currentPage + 1; var _this = this; var jyear = $(".year-select").val(); $.post('investor.php', {page: page,jyear: jyear}, function(data, textStatus){ if (JSON.parse(data).length == 0) { } else { _this.currentPage += 1; _this.inestorNews = JSON.parse(data); } }); }, changeYear: function () { var _this = this; var jyear = $(".year-select").val(); $.post('investor.php', {page: 1,jyear: jyear}, function(data, textStatus){ _this.inestorNews = JSON.parse(data); }); }, preNew1: function () { var page1 = this.currentPage1 - 1; if (page1 != 0) { var _this = this; var jyear1 = $(".year-select1").val(); $.post('investor.php', {page1: page1,jyear1: jyear1}, function(data, textStatus){ if (JSON.parse(data).length == 0) { } else { _this.currentPage1 -= 1; _this.inestorNews1 = JSON.parse(data); } }); } }, nextNew1: function () { var page1 = this.currentPage1 + 1; var _this = this; var jyear1 = $(".year-select1").val(); $.post('investor.php', {page1: page1,jyear1: jyear1}, function(data, textStatus){ if (JSON.parse(data).length == 0) { } else { _this.currentPage1 += 1; _this.inestorNews1 = JSON.parse(data); } }); }, changeYear1: function () { var _this = this; var jyear1 = $(".year-select1").val(); $.post('investor.php', {page1: 1,jyear1: jyear1}, function(data, textStatus){ _this.inestorNews1 = JSON.parse(data); }); } }, created: function () { $(".top-title h1").html(this.showText($(".top-title h1").html())); $(".top-title p").html(this.showText($(".top-title p").html())); }, mounted: function () { $(".show-num").countUp({ delay: 10, time: 1500 }); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ (function(){ window.scrollReveal = new scrollReveal({reset: true}); })(); }; window.addEventListener('scroll', this.scrollFun); var _this = this; var jyear = $(".year-select").val(); $.post('investor.php', {page: 1,jyear:jyear}, function(data, textStatus){ _this.inestorNews = JSON.parse(data); }); var jyear1 = $(".year-select1").val(); $.post('investor.php', {page1: 1,jyear1:jyear1}, function(data, textStatus){ _this.inestorNews1 = JSON.parse(data); }); } }) function placeholder(target) { $(target).val($(target).attr("data-default")).addClass("inp"); $(target).focus(function() { if($(this).val() == $(this).attr("data-default")) { $(this).val("").removeClass("inp"); } }) $(target).blur(function() { if($(this).val() == "" || $(this).val() == $(this).attr("data-default")) { $(this).val($(target).attr("data-default")).addClass("inp"); } }) } placeholder(".input-name"); placeholder(".input-qq"); placeholder(".input-phone"); placeholder(".input-email"); placeholder(".input-content");