Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1
Conflicts: fangija-zsyf/config.js
This commit is contained in:
@@ -76,6 +76,7 @@ var mapConfig = {
|
||||
var $this = $(this);
|
||||
//$this.addClass('current').siblings().removeClass('current');
|
||||
var id = $this.attr('id');
|
||||
that.hidden_all_mark()
|
||||
that.openTypeWrap(id);
|
||||
});
|
||||
|
||||
@@ -392,7 +393,13 @@ var mapConfig = {
|
||||
if (that.house_near_p[key].length > 0) {
|
||||
for (var j = 0; j < that.house_near_p[key].length; j++) {
|
||||
var point = that.house_near_p[key][j];
|
||||
point && (key == type ? point.show() : point.hide());
|
||||
if(point){
|
||||
if(key == type){
|
||||
point.show();
|
||||
}else{
|
||||
point.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,54 @@ var labelFont = 'bold 12px Sans-serif';
|
||||
var dates;
|
||||
var data;
|
||||
var volumes;
|
||||
|
||||
var myChart01 = echarts.init(document.getElementById('chart01'));
|
||||
var curOption;
|
||||
|
||||
|
||||
/* 关注&已关注切换 */
|
||||
$(".collection01").on("click", function () {
|
||||
|
||||
axios.post("/rest/districts/addCollect",{city:city,region:region,name:name,lat:lat,lng:lng,address:address, poiTags:tags}).then(function (response) {
|
||||
var msg = response.data.message
|
||||
if(msg){
|
||||
$.toast(msg);
|
||||
}else{
|
||||
$(".collection01").hide();
|
||||
$(".collection02").show();
|
||||
$.toast("随时掌握小区动态");
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
$(".collection02").on("click", function () {
|
||||
|
||||
axios.post("/rest/districts/removeCollect",{city:city,region:region,name:name}).then(function (response) {
|
||||
var msg = response.data.message
|
||||
if(msg){
|
||||
$.toast(msg);
|
||||
}else{
|
||||
$(".collection02").hide();
|
||||
$(".collection01").show();
|
||||
$.toast("取消关注");
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* button状态切换 */
|
||||
$(".content-block .button").on("click", function () {
|
||||
$(this).parent().children().removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
|
||||
//小区详情
|
||||
function loadDistrictInfo(){
|
||||
axios.get("/rest/districts/detail", {
|
||||
@@ -24,21 +68,23 @@ function loadDistrictInfo(){
|
||||
baseInfo.cityPrice = cityPrice
|
||||
}
|
||||
if(collected){
|
||||
baseInfo.collect = true;
|
||||
$(".collection02").show();
|
||||
$(".collection01").hide();
|
||||
}else{
|
||||
baseInfo.collect = false;
|
||||
$(".collection02").hide();
|
||||
$(".collection01").show();
|
||||
}
|
||||
if(vo){
|
||||
if(vo.avgPrice){
|
||||
lat = vo.lat2;
|
||||
lng = vo.lng2;
|
||||
|
||||
loadMapPoi();
|
||||
//loadMapPoi();
|
||||
|
||||
baseInfo.city = vo.city
|
||||
baseInfo.region = vo.region
|
||||
baseInfo.address = vo.address;
|
||||
baseInfo.districtName = vo.name
|
||||
baseInfo.name = vo.name
|
||||
baseInfo.avgPrice = vo.avgPrice;
|
||||
baseInfo.oneMonthUpDownRange = vo.oneMonthUpDownRange;
|
||||
|
||||
@@ -79,10 +125,9 @@ function loadDistrictInfo(){
|
||||
}
|
||||
}
|
||||
|
||||
loadNearDistrict(vo.lat2, vo.lng2);
|
||||
}else{
|
||||
$("#noDataDiv").show()
|
||||
baseInfo.districtName = "小区详情"
|
||||
baseInfo.name = "小区详情"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +138,7 @@ function loadDistrictInfo(){
|
||||
}
|
||||
|
||||
//附近小区
|
||||
function loadNearDistrict(lat, lng){
|
||||
/*function loadNearDistrict(lat, lng){
|
||||
axios.get("/rest/districts/nearDistrict", {
|
||||
params: {
|
||||
lat: lat,
|
||||
@@ -124,7 +169,7 @@ function loadNearDistrict(lat, lng){
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -77,6 +77,7 @@ $("#login_btn").on("click", function () {
|
||||
// 用户登录成功的TOKEN
|
||||
var data = resData.data;
|
||||
localStorage.setItem("user_token", data.token);
|
||||
localStorage.setItem("user_token_add_time", new Date().getTime());
|
||||
$.toast(resData.message);
|
||||
if (data.firstLogin) {
|
||||
// 显示设置密码页面
|
||||
|
||||
@@ -85,6 +85,7 @@ function login(openid, unionid, accessToken, nickname, headImg, loginFrom, uri)
|
||||
})
|
||||
}else{
|
||||
localStorage.setItem("user_token", resData.data);
|
||||
localStorage.setItem("user_token_add_time", new Date().getTime());
|
||||
back();
|
||||
}
|
||||
}else{
|
||||
|
||||
@@ -11,7 +11,8 @@ var searchDistVue = new Vue({
|
||||
$("[name=name]").val(this.searchDistricts[index].name)
|
||||
$("[name=cityAddress]").val(this.searchDistricts[index].city)
|
||||
$("[name=address]").val(this.searchDistricts[index].address)
|
||||
$.popup(".popup-about02")
|
||||
$.closeModal(".popup-about02");
|
||||
$("input").blur();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -107,7 +108,21 @@ $("body").delegate(".open-about02", "click", function () {
|
||||
$.popup(".popup-about02")
|
||||
$("input").blur()
|
||||
});
|
||||
|
||||
var hotVue = new Vue({
|
||||
el: '#hotList',
|
||||
data: {
|
||||
hotDists: []
|
||||
},methods: {
|
||||
openHotDetail:function(index) {
|
||||
$("#input_address").val(this.hotDists[index].name);
|
||||
$("[name=region]").val(this.hotDists[index].region);
|
||||
$("[name=name]").val(this.hotDists[index].name);
|
||||
$("[name=cityAddress]").val(this.hotDists[index].city);
|
||||
$.closeModal(".popup-about02");
|
||||
$("input").blur();
|
||||
}
|
||||
}
|
||||
})
|
||||
//添加热门小区
|
||||
function addHotDistricts(cityParam){
|
||||
axios.get(BASE_PATH+"/rest/districts/hotDistricts", {
|
||||
@@ -125,14 +140,7 @@ function addHotDistricts(cityParam){
|
||||
var map={city:o.city, region:o.region, name:o.name};
|
||||
dists.push(map);
|
||||
}
|
||||
|
||||
new Vue({
|
||||
el: '#hotList',
|
||||
data: {
|
||||
hotDists: dists
|
||||
}
|
||||
})
|
||||
|
||||
hotVue.$data.hotDists=dists
|
||||
}
|
||||
|
||||
}).catch(function (error) {
|
||||
@@ -151,7 +159,8 @@ var historyVue = new Vue({
|
||||
$("[name=region]").val(this.histories[index].region);
|
||||
$("[name=name]").val(this.histories[index].name);
|
||||
$("[name=cityAddress]").val(this.histories[index].city);
|
||||
$.popup(".popup-about02")
|
||||
$.closeModal(".popup-about02");
|
||||
$("input").blur();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -6,7 +6,12 @@ var searchDistVue = new Vue({
|
||||
},methods: {
|
||||
openDistrictDetail:function(index) {
|
||||
saveHistory({district:this.searchDistricts[index].region,name:this.searchDistricts[index].name,city:this.searchDistricts[index].city})
|
||||
clicked(BASE_PATH+'/district/details?city='+this.searchDistricts[index].city+'®ion='+this.searchDistricts[index].region+'&name='+this.searchDistricts[index].name,true);
|
||||
//clicked(BASE_PATH+'/district/details?city='+this.searchDistricts[index].city+'®ion='+this.searchDistricts[index].region+'&name='+this.searchDistricts[index].name,true);
|
||||
if(cat=="district"){
|
||||
clicked('views/district/detail.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name});
|
||||
}else if(cat == "rent"){
|
||||
clicked('views/rent/rent.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -91,11 +96,21 @@ function recover() {
|
||||
}
|
||||
/* 弹出搜索小区页面 */
|
||||
$("body").delegate(".open-about02", "click", function () {
|
||||
alert("ssss");
|
||||
$("#districtName").val("");
|
||||
if($("#input_city").text()==""){
|
||||
$.toast("请选择城市")
|
||||
return false;
|
||||
}
|
||||
|
||||
var text = $(this).text().trim();
|
||||
|
||||
if(text=="房价查询"){
|
||||
cat = "district"
|
||||
}else if(text=="房租查询"){
|
||||
cat = "rent"
|
||||
}
|
||||
alert("test:"+text+" cat:"+cat)
|
||||
$('.historyList').show();
|
||||
$("#notFound").hide();
|
||||
$('.hotList').show();
|
||||
@@ -145,7 +160,11 @@ var historyVue = new Vue({
|
||||
histories: histories
|
||||
},methods: {
|
||||
openHistoryDetail:function(index) {
|
||||
clicked(BASE_PATH+'/district/details?city='+this.histories[index].city+'®ion='+this.histories[index].region+'&name='+this.histories[index].name,true);
|
||||
if(cat=="district"){
|
||||
clicked('views/district/detail.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name});
|
||||
}else if(cat == "rent"){
|
||||
clicked('views/rent/rent.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
var mc_uid = "162167854504869888";
|
||||
// 加载flag
|
||||
var mc_loading = false;
|
||||
//空置第一次显示
|
||||
var mc_yesterDayDeployFlag = true;
|
||||
|
||||
//分页部分参数定义
|
||||
var mc_page;
|
||||
var mc_pageSize;
|
||||
var mc_totalPages;
|
||||
var mc_totalRecords;
|
||||
// 上次加载的序号
|
||||
var mc_lastIndex;
|
||||
// 每次加载添加多少条目
|
||||
var mc_itemsPerLoad;
|
||||
// 最多可加载的条目
|
||||
var mc_maxItems = 100;
|
||||
|
||||
//初始化init
|
||||
$.init();
|
||||
|
||||
// 注册'infinite'事件处理函数
|
||||
//$(document).on('infinite', '.infinite-scroll-bottom', function() {
|
||||
// // 如果正在加载,则退出
|
||||
// if(mc_loading) return;
|
||||
// // 设置flag
|
||||
// mc_loading = true;
|
||||
// // 模拟1s的加载过程
|
||||
// setTimeout(function() {
|
||||
// // 重置加载flag
|
||||
// mc_loading = false;
|
||||
// //如果当前页大于等于总页数
|
||||
// if(mc_page >= mc_totalPages) {
|
||||
//// // 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
//// $.detachInfiniteScroll($('.infinite-scroll'));
|
||||
// // 删除加载提示符
|
||||
// $('#loadTip3').remove();
|
||||
// return;
|
||||
// }
|
||||
// //控制查询下一页的数据
|
||||
// mc_page = mc_page + 1;
|
||||
// selectNewsCollectList();
|
||||
// //容器发生改变,如果是js滚动,需要刷新滚动
|
||||
// //$.refreshScroller();
|
||||
// }, 1000);
|
||||
//});
|
||||
|
||||
//我的收藏查询请求
|
||||
function selectNewsCollectList(){
|
||||
axios.get(BASE_PATH + "/rest/news/collectList",
|
||||
{
|
||||
params: {
|
||||
uid: mc_uid,
|
||||
page: mc_page,
|
||||
pageSize: mc_pageSize
|
||||
}
|
||||
}).then(function (response) {
|
||||
var resultList = response.data.data.list;
|
||||
if(resultList != null && resultList.length == 0){
|
||||
// 删除加载提示符
|
||||
$('#loadTip3').remove();
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
//$.detachInfiniteScroll($('.infinite-scroll'));
|
||||
return;
|
||||
}
|
||||
if(response.data.data.currentPage == response.data.data.totalPages){
|
||||
//如果此次查询刚好是page = totalPages
|
||||
// 删除加载提示符
|
||||
$('#loadTip3').remove();
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
//$.detachInfiniteScroll($('.infinite-scroll'));
|
||||
}
|
||||
//封装list数据
|
||||
var dataObj = [];
|
||||
for(var i in resultList){
|
||||
dataObj.push(resultList[i])
|
||||
}
|
||||
// 上次加载的序号
|
||||
mc_lastIndex = $('.cardInfo').length;
|
||||
//每次加载添加多少条目
|
||||
mc_itemsPerLoad = resultList.length;
|
||||
//请求后对page进行赋值
|
||||
mc_page = response.data.data.currentPage;
|
||||
mc_pageSize = response.data.data.limit;
|
||||
mc_totalPages = response.data.data.totalPages;
|
||||
mc_totalRecords = response.data.data.totalRecords;
|
||||
tab.mc_num = mc_totalRecords;
|
||||
addItems(mc_itemsPerLoad, mc_lastIndex, dataObj);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
//界面加载
|
||||
$(document).ready(function () {
|
||||
selectNewsCollectList();
|
||||
});
|
||||
|
||||
function openUrl(url){
|
||||
clicked(url, true);
|
||||
}
|
||||
|
||||
function openNewsView(newId) {
|
||||
clicked('/fangija-zsyf/views/news/newsDetail.html',true,false,{},{newsId:newId},function(newId){
|
||||
axios.post(BASE_PATH + "/rest/comment/getCommentCount",{commentObjId : newId}).then(function (response) {
|
||||
var msg = response.data.message
|
||||
if(response.data.status){
|
||||
$("#visitComment_"+newId).text(response.data.data+"条");
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
},newId);
|
||||
var count = parseInt($("#visitCount_"+newId).text().replace("人",""))+1;
|
||||
$("#visitCount_"+newId).text(count+'人');
|
||||
}
|
||||
|
||||
/* 分页构造数据 */
|
||||
function addItems(itemsPerLoad, lastIndex, dataObj) {
|
||||
var html = '';
|
||||
for(var i in dataObj) {
|
||||
/*if(dataObj[i].yesterDayDeploy && yesterDayDeployFlag) {
|
||||
yesterDayDeployFlag = false;
|
||||
html += '<div class="content-block-title recommend" style="border-top:solid 0.5rem #f3f3f3;">历史推荐</div>';
|
||||
}*/
|
||||
if(dataObj[i].type == "专题") {
|
||||
html += '<div class="card cardInfo cardInfo01" onclick="openNewsView(\'' + dataObj[i].id + '\')">' +
|
||||
'<div class="card-header">' + dataObj[i].title + '</div>' +
|
||||
'<img src=' + dataObj[i].coverImg + '>' +
|
||||
'<div class="card-footer">' +
|
||||
'<span>' +
|
||||
'<i class="icon icon-eye-orange"></i><label id="visitCount_' + dataObj[i].id + '">' + dataObj[i].visitCount + '人</label>' +
|
||||
'<i class="icon icon-comments-orange"></i><label id="visitComment_' + dataObj[i].id + '">' + dataObj[i].recommendCommentCount + '条</label>' +
|
||||
'</span>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
if(dataObj[i].type == "推荐小区") {
|
||||
html += '<div class="card cardInfo cardInfo02" onclick="openUrl(\'' + BASE_PATH + '/district/details?city=' + dataObj[i].recommendDistrictCity + '®ion=' + dataObj[i].recommendDistrictRegion + '&name=' + dataObj[i].recommendDistrictName + '\')">' +
|
||||
'<div class="card-content">' +
|
||||
'<div class="list-block media-list"><ul><li class="item-content">' +
|
||||
'<div class="item-media"><img src=' + dataObj[i].coverImg + '></div>' +
|
||||
'<div class="item-inner" style="padding-right:0;">' +
|
||||
'<div class="item-title-row"><div class="item-title">' + dataObj[i].recommendDistrictName + '</div>' +
|
||||
'<div class="item-after"><span>' + dataObj[i].recommendDistrictCity + '-' + dataObj[i].recommendDistrictRegion +
|
||||
'</span></div></div>';
|
||||
if(dataObj[i].recommendDistrictTags != "" && dataObj[i].recommendDistrictTags != null) {
|
||||
var arry = dataObj[i].recommendDistrictTags.split("_");
|
||||
html += '<div class="item-subtitle"><span class="tag">';
|
||||
for(var j in arry) {
|
||||
html += '<small>' + arry[j] + '</small>';
|
||||
}
|
||||
html += '</span></div>';
|
||||
}
|
||||
html += '<div class="item-subtitle"><span class="star">推荐指数:<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i></span></div>';
|
||||
if(dataObj[i].recommendDistrictPrice) {
|
||||
html += '<div class="item-subtitle"><em><strong>' + dataObj[i].recommendDistrictPrice + '</strong>元/㎡</em></div>';
|
||||
}
|
||||
html += '</div></li></ul></div></div></div>';
|
||||
}
|
||||
if(dataObj[i].type == "活动") {
|
||||
html += '<div class="card cardInfo cardInfo01 cardInfo01b" onclick="openNewsView(\'' + dataObj[i].id + '\')">' +
|
||||
'<div class="card-header">' + dataObj[i].title + '</div>' +
|
||||
'<img src=' + dataObj[i].coverImg + '>' +
|
||||
'<div class="card-footer"><span>' + dataObj[i].introduction + '</span></div></div>';
|
||||
}
|
||||
if(dataObj[i].type == "推荐城市") {
|
||||
html += '<div class="card cardInfo cardInfo01 cardInfo01a" onclick="openUrl(\'' + BASE_PATH + '/quotations/building?cityName=' + dataObj[i].recommendCity + '\')">' +
|
||||
'<div class="card-header">推荐城市——' + dataObj[i].recommendCity + '</div>';
|
||||
if(dataObj[i].recommendCityTags != "" && dataObj[i].recommendCityTags != null) {
|
||||
var arry = dataObj[i].recommendCityTags.split("_");
|
||||
html += '<div class="card-content"><div class="card-content-inner"><span class="tag">';
|
||||
for(var j in arry) {
|
||||
html += '<small>' + arry[j] + '</small>';
|
||||
}
|
||||
html += '</span></div></div>';
|
||||
}
|
||||
html += '<img src=' + dataObj[i].coverImg + '>' +
|
||||
'<div class="card-footer"><span>均价:<em>' + dataObj[i].recommendCityAvgPrice + '元/㎡</em></span>' +
|
||||
'<span class="star">潜力指数:';
|
||||
if(dataObj[i].recommendCityIndex < 4) {
|
||||
html += '<i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 5 && dataObj[i].recommendCityIndex < 15) {
|
||||
html += '<i class="icon icon-star02"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 15 && dataObj[i].recommendCityIndex < 25) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 25 && dataObj[i].recommendCityIndex < 35) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star02"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 35 && dataObj[i].recommendCityIndex < 45) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 45 && dataObj[i].recommendCityIndex < 55) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star02"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 55 && dataObj[i].recommendCityIndex < 65) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 65 && dataObj[i].recommendCityIndex < 75) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star02"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 75 && dataObj[i].recommendCityIndex < 85) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star"></i>';
|
||||
} else if(dataObj[i].recommendCityIndex >= 85 && dataObj[i].recommendCityIndex < 95) {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star02"></i>';
|
||||
} else {
|
||||
html += '<i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i><i class="icon icon-star01"></i>';
|
||||
}
|
||||
html += '</span></div><div class="card-footer" style="margin-top:-0.75rem;">';
|
||||
if(dataObj[i].recommendCityYoy) {
|
||||
html += '<span>近1年涨跌幅:';
|
||||
if(dataObj[i].recommendCityYoy > 0) {
|
||||
html += '<strong>' + (dataObj[i].recommendCityYoy * 100).toFixed(2) + '%</strong><i class="icon icon-arrow-red"></i>';
|
||||
} else {
|
||||
html += '<strong>' + (dataObj[i].recommendCityYoy * 100).toFixed(2) + '%</strong><i class="icon icon-arrow-green"></i>';
|
||||
}
|
||||
html += '</span>';
|
||||
}
|
||||
if(dataObj[i].recommendCityIndexTrend) {
|
||||
html += '<span>';
|
||||
if(dataObj[i].recommendCityIndexTrend >= 0) {
|
||||
html += '上涨概率:<strong>' + dataObj[i].recommendCityIndexTrend + '%</strong><i class="icon icon-arrow-red"></i>';
|
||||
} else {
|
||||
html += '下跌概率:<strong>' + dataObj[i].recommendCityYoy * (-1) + '%</strong><i class="icon icon-arrow-green"></i>';
|
||||
}
|
||||
html += '</span>';
|
||||
}
|
||||
html += '</div></div>';
|
||||
}
|
||||
if(dataObj[i].type == "新闻") {
|
||||
html += '<div class="card cardInfo cardInfo02" onclick="openNewsView(\'' + dataObj[i].id + '\')"><div class="card-content"><div class="list-block media-list">' +
|
||||
'<ul><li class="item-content">' +
|
||||
'<div class="item-inner"><div class="item-title-row"><div class="item-title">' +
|
||||
dataObj[i].title + '</div></div>' +
|
||||
'<div class="item-subtitle"><font>' + dataObj[i].introduction + '</font></div>' +
|
||||
'<div class="item-subtitle"><span><i class="icon icon-eye-orange"></i><label id="visitCount_' + dataObj[i].id + '">' + dataObj[i].visitCount + '人</label>' +
|
||||
'<i class="icon icon-comments-orange"></i><label id="visitComment_' + dataObj[i].id + '">' + dataObj[i].recommendCommentCount + '条</label></span></div></div>' +
|
||||
'<div class="item-media"><img src=' + dataObj[i].coverImg + '></div>' +
|
||||
'</li></ul></div></div></div>';
|
||||
}
|
||||
if(dataObj[i].type == "投票") {
|
||||
var voteFavorCount = dataObj[i].voteFavorCount;
|
||||
var voteNoFavorCount = dataObj[i].voteNoFavorCount;
|
||||
var voteFavorCountRate = 50
|
||||
var voteNoFavorCountRate = 50
|
||||
if(voteFavorCount == 0 && voteNoFavorCount == 0) {
|
||||
|
||||
} else {
|
||||
voteFavorCountRate = Math.round((voteFavorCount * 100) / (voteFavorCount + voteNoFavorCount));
|
||||
voteNoFavorCountRate = 100 - voteFavorCountRate;
|
||||
}
|
||||
|
||||
html += '<div class="card cardInfo cardInfo03"><div class="card-header">' + dataObj[i].title +
|
||||
'</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">' +
|
||||
'<i class="icon icon-light-red" data-val="' + dataObj[i].id + '"></i><span>' + dataObj[i].voteFavorText + '</span>' +
|
||||
'<font style="width:' + voteFavorCountRate + '%;" id="voteFavorCountRate_' + dataObj[i].id + '"></font><label id="voteFavorCount_' + dataObj[i].id + '">' + voteFavorCount + '票 ' + voteFavorCountRate + '%</label></div>' +
|
||||
'<div class="vote02 col-50"><i class="icon icon-light-grey" data-val="' + dataObj[i].id + '"></i><span>' + dataObj[i].voteNoFavorText + '</span>' +
|
||||
'<font style="width:' + voteNoFavorCountRate + '%;" id="voteNoFavorCountRate' + dataObj[i].id + '"></font><label id="voteNoFavorCount_' + dataObj[i].id + '">' + voteNoFavorCount + '票 ' + voteNoFavorCountRate + '%</label></div><em>V.S</em></div></div></div>';
|
||||
}
|
||||
}
|
||||
$('#myColect').append(html);
|
||||
}
|
||||
@@ -1,10 +1,3 @@
|
||||
var tab = new Vue({
|
||||
el:"#tab",
|
||||
data:{
|
||||
mf_num:"0"
|
||||
}
|
||||
})
|
||||
|
||||
$("#mf_ul").empty();
|
||||
$.init()
|
||||
//加载flag
|
||||
@@ -23,7 +16,7 @@ function addEstate(number, lastIndex) {
|
||||
data = response.data;
|
||||
//data = eval( '(' + data + ')' );
|
||||
if(data['results']==null || data['results'].length==0) {
|
||||
$('#loadTip1').remove();
|
||||
$('#loadTip2').remove();
|
||||
$('.infinite-scroll-bottom #tab1').html("<div class='noData'><img src='../images/noData.png'><p>您还没有关注小区</p></div>");
|
||||
return;
|
||||
}
|
||||
@@ -89,7 +82,7 @@ function addEstate(number, lastIndex) {
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
// $.detachInfiniteScroll($('.infinite-scroll'));
|
||||
// 删除加载提示符
|
||||
$('#loadTip1').remove();
|
||||
$('#loadTip2').remove();
|
||||
}
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
@@ -100,34 +93,3 @@ function addEstate(number, lastIndex) {
|
||||
//预先加载8条
|
||||
addEstate(mf_itemsPerLoad, 0);
|
||||
|
||||
|
||||
|
||||
//注册'infinite'事件处理函数
|
||||
$(document).on('infinite', '.infinite-scroll',function() {
|
||||
console.log(1)
|
||||
if($("#tabList2").hasClass("active"))
|
||||
{
|
||||
// 如果正在加载,则退出
|
||||
if (mf_loading) return;
|
||||
// 设置flag
|
||||
mf_loading = true;
|
||||
// 模拟1s的加载过程
|
||||
setTimeout(function() {
|
||||
// 重置加载flag
|
||||
mf_loading = false;
|
||||
// 更新最后加载的序号
|
||||
mf_lastIndex = $('#mf_ul').find('li').length;
|
||||
if (mf_lastIndex >= mf_totalCount) {
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
// $.detachInfiniteScroll($('.infinite-scroll'));
|
||||
// 删除加载提示符
|
||||
$('#loadTip1').remove();
|
||||
return;
|
||||
}
|
||||
// 添加新条目
|
||||
addEstate(mf_itemsPerLoad, $('#mf_ul').find('li').length);
|
||||
//容器发生改变,如果是js滚动,需要刷新滚动
|
||||
// $.refreshScroller();
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user