From 16ec13a7f8d4ae5679b764ce986d4b095fd8ec86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Wed, 30 May 2018 14:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=85=B3=E6=B3=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/user/myFocus.js | 27 ++++++++++++++++++++++++--- fangija-zsyf/views/user/userInfo.html | 2 ++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/fangija-zsyf/js/user/myFocus.js b/fangija-zsyf/js/user/myFocus.js index 910426c..9b6b414 100644 --- a/fangija-zsyf/js/user/myFocus.js +++ b/fangija-zsyf/js/user/myFocus.js @@ -12,15 +12,15 @@ var mf_totalCount = 0; function addEstate(number, lastIndex) { mf_curpage = mf_lastIndex/mf_itemsPerLoad + 1; axios.get("/rest/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) { $('#loadTip2').remove(); //$('.infinite-scroll-bottom #tab1').html("

您还没有关注小区

"); return; } mf_totalCount = data.totalCount; -// tab.mf_num = mf_totalCount; $("#mf_num").html("关注("+mf_totalCount+")") // 生成新条目的HTML var html = ''; @@ -71,7 +71,7 @@ function addEstate(number, lastIndex) { ''+ '
'+tagStr+'
'+ ''+ - ''+ + '取消关注'+ ''; }); // 添加新条目 @@ -89,4 +89,25 @@ function addEstate(number, lastIndex) { }).catch(function(error){ console.log(error) }); +} + +// 取消关注 +function removeCollect(city,region,name,obj){ + axios.post("/rest/districts/removeCollect",{city:city,region:region,name:name}).then(function (response) { + var msg = response.data.message + if(msg){ + $.toast(msg); + } else { + $.toast("取消关注"); + } + /*mf_curpage = 1; + $("#mf_ul").html(""); + addEstate(mf_itemsPerLoad, 0);*/ + $(obj).parent().remove(); + mf_totalCount = mf_totalCount - 1; + $("#mf_num").html("关注("+mf_totalCount+")") + }) + .catch(function (error) { + console.log(error); + }); } \ No newline at end of file diff --git a/fangija-zsyf/views/user/userInfo.html b/fangija-zsyf/views/user/userInfo.html index 0a754bb..4248f55 100644 --- a/fangija-zsyf/views/user/userInfo.html +++ b/fangija-zsyf/views/user/userInfo.html @@ -30,6 +30,8 @@ .buttons-tab .button{font-size:0.75rem;color:#999;line-height:2.5rem;height:2.5rem;} .list-block ul:before{height:0;} .cardInfo:first-child{border-top:none;} + + #tabList2 .collection02{top:inherit;bottom:0.75rem;}