精选 内容
var page404 = '/cities/404.htm'; var baseUrl='http://cities.qqdayu.com/qindex/'; var area=GetRequest().area; if(window.location.host!='henan.qq.com'){ baseUrl=window.location.protocol+'//'+window.location.host+'/qindex/'; page404=window.location.protocol+'//'+window.location.host+'/cities/404.html'; } //baseUrl='http://testcities.qqdayu.com/qindex/'; var vm = avalon.define({ $id: 'app', area_info: {name:''}, news_latest: [], banner_items: [], ads_top3: [], tag:['home','house','food','activity'], index:0, page:[1, 1, 1, 1], list: [[],[],[],[]], changeTab:function(index){ if(index==vm.index){ return false; } vm.index=index; if(vm.$model.page[index]==1){ vm.getList(index); } }, getList:function(index){ /* 获取标签页信息流 */ $.ajax({ type: "post", url: baseUrl + 'list', data: { area: area, page: vm.page[index], tag: vm.tag[index] }, dataType: 'json', success: function (res) { if(res.errCode == 0){ if (res.data.list_items.length>0) { var list=vm.$model.list; list[index]=list[index].concat(res.data.list_items); vm.list=list; vm.page[index 5b4 ]++; }else{ $('.more').eq(index).text("无更多数据"); } } }, fail: function (err) { console.log(err); } }) } }); /* 没有下面这句代码 ie8下会出现不渲染数据的情况 */ avalon.scan(document.body); /*初始化默认新闻列表*/ vm.getList(0); /* 轮播逻辑 */ function slider(){ jQuery(".banner").slide({ mainCell: ".bd ul", effect: "leftLoop", autoPlay: true }); } /* 右侧五条新闻的逻辑 */ function rightList(){ $(".right .cont li:gt(3)").find('a').css({ "font-size": "16px", "color": "#333", }); $(".right .cont li:gt(3)").css({ "margin-top": "16px" }); $(".right .cont li").eq(3).css({ "border-bottom": "1px solid #efefef", "padding-bottom": "15px" }); $(".right .cont li:gt(3)").find('a').mouseover(function () { $(this).css( 260 { "color": "#cb0d0d" }) }) $(".right .cont li:gt(3)").find('a').mouseleave(function () { $(this).css({ "color": "#333" }) }) $(".right .cont li").find('i').css({ "top": "12px", "margin-top": 0 }); $(".right .cont li:gt(3)").find('i').css({ "background": "#000", "top": "10px" }); } 6d2 setTimeout(function () { c_top.home=true; $.ajax({ type: "get", url: baseUrl+"index", data: {area: area}, dataType: "json", success: function (res) { if(res.errCode==0){ document.title = '管家婆彩图大豫网 ' + res.data.area_info.name + '生活'; vm.area_info = res.data.area_info; vm.news_latest = res.data.news_latest; vm.banner_items = res.data.banner_items; vm.ads_top3 = res.data.ads_top3; //轮播图启动 if(res.data.banner_items.length>1){ slider(); } //右侧五条新闻的逻辑 rightList(); c_top.name = res.data.area_info.name; c_top.homePath = 'javascript:;'; if(res.data.area_info.name_en){ c_top.housePath = '/cities/house.htm?area='+res.data.area_info.name_en; }else{ c_top.housePath = '/cities/house.htm?area='+res.data.area_info.id; } }else{ window.location.href=page404; console.log(res) } } }); }, 0);
0