$(document).ready(function(){ let Focus = new Swiper('#focus', { autoplay: true,//å¯é€‰é€‰é¡¹åQŒè‡ªåŠ¨æ»‘åŠ? loop:true, pagination: { el: '.swiper-pagination', }, navigation: { nextEl: '.leftButtonFoucs', prevEl: '.rightButtonFoucs', } }) //hot list $('.hotList ul li').each(function(i){ $(this).prepend('0'+(i+1)+'') }) $('.messageList h4 span').on('click',function(){ let index = $(this).index(); $('.messageList h4 span').removeClass('active'); $(this).addClass('active'); $('.messageList ul').hide(); $('.messageList ul').eq(index).show(); }) //new object function loadData(){ //this.messageurl = "https://testxbfront.peopletech.cn/pro-dfbbs-front/cms/getStats"; this.replayurl = 'http://wap.premierwestchesterhomes.com/cms/getFidByRequestIP?callback=getFid&callback=getFid&_=1653621537926'; this.mapUrl = "https://messageboard.people.cn/provinceAnswerRate.jsonp" // this.newReplay = "https://testxbfront.peopletech.cn/pro-dfbbs-front/cms/getStats" this.newReplay = 'https://messageboard.people.cn/newIndex_stat.jsonp' this.ipurl = 'http://wap.premierwestchesterhomes.com/cms/getFidByRequestIP?callback=getFid' } loadData.prototype.Message = function(id){ let htmlBox = ""; var localUrl = "https://messageboard.people.cn/new_threads_"+ id +".jsonp" $.ajax({ type: 'GET', url: localUrl, dataType: 'jsonp', jsonpCallback:"IndexThreads", success: function(res) { //console.log('留言数æ®èŽ·å–:',res) let data = res; for (let index = 0; index < 8; index++) { htmlBox += "
  • "+data[index].subject+'

    '+data[index].forumName+'  '+data[index].dateline+'

  • ' } $('#hotMessage').html(htmlBox) } }) } //åŽ†å²æ•°æ® loadData.prototype.lishi = function(){ //æ–°ç‰ˆæ•°æ® $.ajax({ type: 'GET', url:this.newReplay, dataType: 'jsonp', jsonpCallback:"IndexStat", success: function(res) { console.log('åŽ†å²æ•°æ®:',res) $('#totalThreadsNum').html(res.totalAnswersNum) $('#yearThreadsNum').html(res.yearAnswersNum) $('#totalThreadsNum1').html(res.totalAnswersNum) $('#yearThreadsNum1').html(res.yearAnswersNum) } }) } //ip判断 loadData.prototype.ipLoad = function(){ console.log('ip获å–') //æ–°ç‰ˆæ•°æ® $.ajax({ type: 'GET', url:this.ipurl, cache: false, dataType: "jsonp", jsonp: "callback", jsonpCallback: "getFid", async : false, success: function(res) { console.log('˜q”回id:',res) load.Message(res.fid); if(res.fid == "13"){ $('#ipload').show(); } } }) } //åœ°å›¾æ•°æ® loadData.prototype.mapData = function(){ //æ–°ç‰ˆæ•°æ® $.ajax({ type: 'GET', url:"https://messageboard.people.cn/provinceAnswerRate.jsonp", dataType: 'jsonp', jsonpCallback:"answerRate", success: function(res) { console.log('地图数æ®:',res) } }) } //¾_ùN€‰å›žå¤? loadData.prototype.Replay = function(){ let htmlBox = ""; $.ajax({ type: 'GET', url: this.replayurl, dataType: 'json', contentType:'application/json', //data:JSON.stringify({'limit':7}), success: function(res) { console.log('æ•°æ®èŽ·å–:',res) if(res.code == 0){ // let data = res.data.list; // for (let index = 0; index < data.length; index++) { // console.log(index) // htmlBox += '
  • '+data[index].subject+'

    å…Ïx³¨ '+data[index].focusCount+' 阅读é‡?nbsp;'+data[index].clicks+'

  • ' // } // $('#hotMessage').html(htmlBox) } } }) } //最新留­a€ $(".messageReplay .hotBox h3 span.choose").mouseover(function() { $(".province").show(); $(".messageReplay .hotBox h3 span.choose").attr('id','active'); }).mouseout(function() { $(".messageReplay .hotBox h3 span.choose").attr('id','active'); }); $("div.province").mouseover(function(){ $("div.province").show(); $(".messageReplay .hotBox h3 span.choose").attr('id','active'); }).mouseout(function() { $("div.province").hide(); $(".messageReplay .hotBox h3 span.choose").attr('id',''); }); $("div.province a").click(function(){ var localIp = $(this).attr('value'); var localName = $(this).html(); $("div.province").hide(); load.Message(localIp); $(".messageReplay .hotBox h3 span.choose").html(localName); }) //¾l“æŸæœ€æ–°ç•™­a€ let load = new loadData(); load.lishi(); load.ipLoad(); //load.mapData(); $(".login-method h4").click(function(){ var index = $(this).index() $(".login-method h4").eq(index).addClass("active").siblings().removeClass("active") $(".login-main div").eq(index).show().siblings().hide() }) $('.mes1').on('click',function(){ window.open('http://wap.premierwestchesterhomes.com/login','_blank') }) $('.mes2').on('click',function(){ window.open('http://wap.premierwestchesterhomes.com/login','_blank') }) //地图数æ®åŠ è² function initHomeBar (id, chartData) { var getname = chartData.xAxisData var getvalue = chartData.seriesData console.log('æ•°æ®:',getvalue) var option = { title: { subtext: '回å¤çŽ‡ï¼š 留言中被回å¤çš„æ•°é‡å ç•™è¨€æ•°çš„癑ֈ†æ¯?, subtextStyle: { color: '#888888', fontSize: 14 }, itemGap: 20, right: '1%', top: 'top' }, grid: { top: '20%', right: '5%', left: '5%', bottom: '10%' }, tooltip: { trigger: 'axis', axisPointer: { type: 'none' }, extraCssText: 'background:#ffffff;color:#666666' }, xAxis: [{ data: getname.reverse(), axisLabel: { interval: 0, margin: 10, color: 'rgba(0,0,0,0.45)', textStyle: { fontSize: 14, color: '#8C8C8C' } }, axisLine: { lineStyle: { color: '#EFF0F2' } }, axisTick: { show: false } }], yAxis: [{ name: '', max:100, nameTextStyle: { color: 'rgba(0,0,0,0.45)', fontSize: 13, padding: [20, 20, 0, 0] }, axisLabel: { color: 'rgba(0,0,0,0.45)', textStyle: { fontSize: 12, color: '#8C8C8C' } }, axisLine: { show: false, lineStyle: { color: '#EFF0F2' } }, axisTick: { show: false }, splitLine: { lineStyle: { color: '#EFF0F2' // opacity: 0.2 } } }], animation: false, series: [{ name: '', type: 'bar', data: getvalue.reverse(), barWidth: '12px', itemStyle: { normal: { color: '#EB3B2F', barBorderRadius: [100, 100, 100, 100], label:{ formatter: '{c}%', show:true, position:"top", textStyle:{ fontSize:12 } } } } }], tooltip:{ formatter: ' : {c}%' } } var myCharts = echarts.init(document.getElementById(id)) // 1ã€æ¸…除画å¸? myCharts.clear() myCharts.setOption(option) return myCharts } $.ajax({ type: 'GET', //url: "https://testxbfront.peopletech.cn/pro-dfbbs-front/cms/getProvinceRanks", url:"https://messageboard.people.cn/provinceAnswerRate.jsonp", dataType: 'jsonp', scriptCharset:'utf-8', jsonpCallback:"answerRate", success: function(res) { //console.log('地图数æ®1:',res) var chartData = { xAxisData: [], seriesData: [] } res.forEach(item => { let nums = item.num.split('%') chartData.seriesData.push(Math.ceil(nums[0])) chartData.xAxisData.push(item.name) }) initHomeBar('replyChart', chartData) } }) //¾l“æŸåœ°å›¾æ•°æ®åŠ è² //留言入å£åŠ è² $(".login-method h4").click(function(){ var index = $(this).index() $(".login-method h4").eq(index).addClass("active").siblings().removeClass("active") $(".login-main div").eq(index).show().siblings().hide() }) $('#loginShow').on('click',function(){ $('#loginBox').show(); }) $('#closeLogin').on('click',function(){ $('.login-mask').hide(); }) $('#yaoButton').on('click',function(){ $('.popup').css({'display':"flex"}) }) $('.popupClose').on('click',function(){ $('.popup').css({'display':"none"}) }) //¾l“æŸç•™è¨€å…¥å£åŠ è² //vue代ç åŠ è² let vm1 = new Vue({ el: "#app1", data() { return { username:"", userStatus:0, navStatus:0, userType: "" } }, components: { }, mounted() { let that = this; //that.loadUser() }, methods: { shownav(){ let that = this; that.navStatus = 1; }, hiddennav(){ let that = this; that.navStatus = 0; }, loadUser(){ let that = this; let token = Cookies.get('token'); axios.get('http://liuyanuat.peopletech.cn:8006/admin/sys/user/info',{ headers:{ token: token } }).then(({ data: res }) => { if(res.code == 0){ that.userStatus = 1; that.userType = res.data.userType; that.username = res.data.nickName let loginqian = document.getElementById('loginqian'); let loginhou = document.getElementById('loginhou'); if(/Android|iPhone|BlackBerry/i.test(navigator.userAgent)) { loginhou.style.display = "none" loginqian.style.display = "none" }else{ loginhou.style.display = "block" loginqian.style.display = "none" } } }) }, loginout(){ let that = this; that.userStatus = 0; Cookies.remove('token'); Cookies.remove('userType') let loginqian = document.getElementById('loginqian'); let loginhou = document.getElementById('loginhou'); loginhou.style.display = "none" loginqian.style.display = "block" } } }) }) //# sourceMappingURL=app.js.map ¹ú²ú¾«Æ·±ß×öÄÌË®¿ñÅç