YOUFANG1.1.2
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
<div class="item-inner" style="padding:0.75rem 0;">
|
||||
<div class="item-title-row">
|
||||
<div class="item-title" style="width:65%;overflow:visible;white-space:normal;font-size:0.75rem;">加入"我的房产",随时掌握房产价值变化</div>
|
||||
<div class="item-after"><a class="add add01 button theme open-vertical-modal">立即添加</a></div>
|
||||
<div class="item-after"><a class="add add01 button theme open-vertical-modal" id="addHouse">立即添加</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -141,6 +141,8 @@ $.config = {router: false}
|
||||
<script type="text/javascript" src="../../js/axios.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
|
||||
<script>
|
||||
var houseStatus = ""
|
||||
var hid = '104631167348637696';
|
||||
var house_info = new Vue({
|
||||
el:'#house_info',
|
||||
data:{
|
||||
@@ -171,7 +173,7 @@ $.config = {router: false}
|
||||
msg:""
|
||||
}
|
||||
})
|
||||
var hid = '104631167348637696';
|
||||
|
||||
|
||||
var price_feedback = new Vue({
|
||||
el:"#price_feedback",
|
||||
@@ -238,7 +240,7 @@ $.config = {router: false}
|
||||
evaluate_msg.evaluate_words="暂无"
|
||||
}
|
||||
evaluate_msg.msg=h.evaluateMsg
|
||||
$("#img").attr("src","http://192.168.10.161:8084/img/"+h.imgId);
|
||||
$("#img").attr("src",BASE_PATH+"/img/"+h.imgId);
|
||||
loadingChart(h.city,h.region,h.name,2)
|
||||
//按照时间范围加载数据
|
||||
$(".avgPriceTrend a").click(function(){
|
||||
@@ -247,10 +249,31 @@ $.config = {router: false}
|
||||
$(this).addClass('active');
|
||||
loadingChart(h.city,h.region,h.name,type);
|
||||
});
|
||||
houseStatus = h.houseStatus;
|
||||
}
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
//添加管理AJAX请求
|
||||
function addManagement(id, houseStatus, liveStatus){
|
||||
axios.post(BASE_PATH + "/rest/evaluate/addManagement",
|
||||
{
|
||||
id: id,
|
||||
houseStatus: houseStatus,
|
||||
liveStatus: liveStatus
|
||||
}).then(function (response) {
|
||||
var status = response.data.status;
|
||||
if(status){
|
||||
$.toast(response.data.data);
|
||||
window.location.reload();
|
||||
}else{
|
||||
$.toast(response.data.message);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@@ -276,19 +299,19 @@ $(document).on('click','.open-vertical-modal', function () {
|
||||
{
|
||||
text: '自住',
|
||||
onClick: function() {
|
||||
window.location.href = "01_index01_myHouse01_index.html";
|
||||
addManagement(hid, houseStatus, "自住");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '出租',
|
||||
onClick: function() {
|
||||
window.location.href = "01_index01_myHouse01_index.html";
|
||||
addManagement(hid, houseStatus, "自住");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '空置',
|
||||
onClick: function() {
|
||||
window.location.href = "01_index01_myHouse01_index.html";
|
||||
addManagement(hid, houseStatus, "自住");
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
var tab = new Vue({
|
||||
el:"#tab",
|
||||
data:{
|
||||
mf_num:"0"
|
||||
}
|
||||
})
|
||||
|
||||
$("#mf_ul").empty();
|
||||
$.init()
|
||||
//加载flag
|
||||
var mf_loading = false;
|
||||
//最多可加载的条目
|
||||
var mf_maxItems = 100;
|
||||
//上次加载的序号小区
|
||||
var mf_lastIndex = 0;
|
||||
//每次加载添加多少条目
|
||||
var mf_itemsPerLoad = 8;
|
||||
var mf_curpage = 1;
|
||||
var mf_totalCount = 0;
|
||||
function addEstate(number, lastIndex) {
|
||||
mf_curpage = mf_lastIndex/mf_itemsPerLoad + 1;
|
||||
axios.get("/myCollection/loadCollections",{params:{pageSize:mf_itemsPerLoad,page:mf_curpage}}).then(function(response){
|
||||
data = response.data;
|
||||
//data = eval( '(' + data + ')' );
|
||||
if(data['results']==null || data['results'].length==0) {
|
||||
$('#loadTip1').remove();
|
||||
$('.infinite-scroll-bottom #tab1').html("<div class='noData'><img src='../images/noData.png'><p>您还没有关注小区</p></div>");
|
||||
return;
|
||||
}
|
||||
mf_totalCount = data.totalCount;
|
||||
tab.mf_num = mf_totalCount;
|
||||
// 生成新条目的HTML
|
||||
var html = '';
|
||||
$.each(data['results'], function(i){
|
||||
var tag = this.tag;
|
||||
var tagStr = "";
|
||||
if(tag){
|
||||
var tags = tag.split("_")
|
||||
for(var j=0;j<tags.length;j++){
|
||||
if(j<3){
|
||||
var tag = tags[j];
|
||||
tagStr = tagStr + '<small>'+tag+'</small>';
|
||||
}
|
||||
}
|
||||
}
|
||||
var starStr = ''
|
||||
var index = this.index;
|
||||
if(index==0){
|
||||
var starStr = '暂无'
|
||||
}else{
|
||||
var totalHalfStar = Math.round(Math.round(index/5)/2) //总半星
|
||||
var starNum = Math.floor(totalHalfStar/2)
|
||||
var halfStarNum = totalHalfStar%2
|
||||
var noneStarNum = 5-starNum-halfStarNum
|
||||
for(i=0;i<starNum;i++){
|
||||
starStr+='<i class="icon icon-star01"></i>'
|
||||
}
|
||||
for(i=0;i<halfStarNum;i++){
|
||||
starStr+='<i class="icon icon-star02"></i>'
|
||||
}
|
||||
for(i=0;i<noneStarNum;i++){
|
||||
starStr+='<i class="icon icon-star"></i>'
|
||||
}
|
||||
}
|
||||
|
||||
html+= '<li>'+
|
||||
'<a onclick="clicked(\'${basePath}/district/details?city='+this.city+'®ion='+this.region+'&name='+this.name+'\',true)" class="item-content">'+
|
||||
'<div class="item-inner">'+
|
||||
'<div class="item-title-row">'+
|
||||
'<div class="item-title">'+this.name+'</div>'+
|
||||
'<div class="item-after">¥'+(this.avgPrice?this.avgPrice+ '元/㎡':'暂无')+'</div>'+
|
||||
'</div>'+
|
||||
'<div class="item-title-row">'+
|
||||
'<div class="item-title"><i class="icon icon-address03"></i><small>'+(this.address?(this.city+this.region+this.address):'')+'</small></div>'+
|
||||
'<div class="item-after"><span>'+(this.distance?"距您"+this.distance+"m":"暂无")+'</span></div>'+
|
||||
'</div>'+
|
||||
'<div class="item-subtitle">'+
|
||||
'<div>潜力指数: <span class="star">'+starStr+'</span></div>'+
|
||||
'<div>近30天涨跌幅: <em class="down">'+(this.oneMonthUpDownRange?(this.oneMonthUpDownRange>0?(this.oneMonthUpDownRange+'%<i class="icon icon-arrow-red"></i>'):(this.oneMonthUpDownRange<0?(-this.oneMonthUpDownRange+'%<i class="icon icon-arrow-green"></i>'):this.oneMonthUpDownRange+"%")):"暂无")+'</em></div>'+
|
||||
'</div>'+
|
||||
'<div class="item-subtitle"><span class="tag">'+tagStr+'</span></div>'+
|
||||
'</div>'+
|
||||
'</a>'+
|
||||
'</li>';
|
||||
});
|
||||
// 添加新条目
|
||||
$('#mf_ul').append(html);
|
||||
if(mf_totalCount<=mf_itemsPerLoad){
|
||||
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
||||
// $.detachInfiniteScroll($('.infinite-scroll'));
|
||||
// 删除加载提示符
|
||||
$('#loadTip1').remove();
|
||||
}
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
});
|
||||
console.log(1)
|
||||
}
|
||||
|
||||
//预先加载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