diff --git a/fangija-zsyf/js/quotations/cityDetail.js b/fangija-zsyf/js/quotations/cityDetail.js index 9eb2baa..50cf42e 100644 --- a/fangija-zsyf/js/quotations/cityDetail.js +++ b/fangija-zsyf/js/quotations/cityDetail.js @@ -521,7 +521,7 @@ function docollectCity(city, type){ if(index>=0){ da.splice(index, 1) cityDetaiVue.$data.citys = da; - if(da.length>0){ + if(da.length==0){ $("a[href='#tabQuotation0']").click(); } } diff --git a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js index 3214d1b..0393c37 100644 --- a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js +++ b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js @@ -27,8 +27,8 @@ Vue.component('city_increase_ranking',{ '{{!ci.oneMonthUpDownRange||ci.oneMonthUpDownRange==""?"暂无":Math.abs(100*ci.oneMonthUpDownRange).toFixed(2)+"%"}}'+ ''+ '
'+ - '关注'+ - '取消'+ + '取消'+ + '关注'+ '
'+ ''+ ''+ @@ -63,8 +63,25 @@ Vue.component('city_increase_ranking',{ if(msg != "取消关注成功" && msg != "关注成功"){ $.toast(msg); }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); + //$(event.target).parent().children().removeClass("dn"); + //$(event.target).addClass("dn"); + + var increaseList = cityIncreaseRankingData.cityIncreaseRankingList + + if(increaseList && increaseList.length>0){ + for(var i in increaseList){ + var dd = increaseList[i]; + if(dd.city == city){ + if(type == 0){ + dd.follow = true; + }else{ + dd.follow = false; + } + break; + } + } + } + reloadMyFocus() reloadCityPotentialRanking() if(type == 0){ @@ -97,8 +114,25 @@ Vue.component('city_increase_ranking',{ $.confirm("您确定要取消关注?", function () { axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); + //$(event.target).parent().children().removeClass("dn"); + //$(event.target).addClass("dn"); + + var increaseList = cityIncreaseRankingData.cityIncreaseRankingList + + if(increaseList && increaseList.length>0){ + for(var i in increaseList){ + var dd = increaseList[i]; + if(dd.city == city){ + if(type == 0){ + dd.follow = true; + }else{ + dd.follow = false; + } + break; + } + } + } + reloadMyFocus(); reloadCityPotentialRanking() //plus.webview.getWebviewById('views/user/userInfo.html').reload() diff --git a/fangija-zsyf/views/component/cityPotentialRankingComponent.js b/fangija-zsyf/views/component/cityPotentialRankingComponent.js index 895c762..bbb8da4 100644 --- a/fangija-zsyf/views/component/cityPotentialRankingComponent.js +++ b/fangija-zsyf/views/component/cityPotentialRankingComponent.js @@ -33,8 +33,8 @@ Vue.component('city_potential_ranking',{ ''+ ''+ '
'+ - '关注'+ - '取消'+ + '取消'+ + '关注'+ '
'+ ''+ ''+ @@ -78,8 +78,23 @@ Vue.component('city_potential_ranking',{ if(msg != "取消关注成功" && msg != "关注成功"){ $.toast(msg); }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); + //$(event.target).parent().children().removeClass("dn"); + //$(event.target).addClass("dn"); + var rankList = cityPotentialRankingData.cityPotentialRankingList + + if(rankList && rankList.length>0){ + for(var i in rankList){ + var dd = rankList[i]; + if(dd.city == city){ + if(type == 0){ + dd.follow = true; + }else{ + dd.follow = false; + } + break; + } + } + } plus.webview.getWebviewById('views/house/houseDetail.html').reload(); plus.webview.getWebviewById('views/house/houseManageList.html').reload(); plus.webview.getWebviewById('views/user/userInfo.html').reload(); @@ -100,8 +115,26 @@ Vue.component('city_potential_ranking',{ if(msg != "取消关注成功" && msg != "关注成功"){ $.toast(msg); }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); + //$(event.target).parent().children().removeClass("dn"); + //$(event.target).addClass("dn"); + + + var rankList = cityPotentialRankingData.cityPotentialRankingList + + if(rankList && rankList.length>0){ + for(var i in rankList){ + var dd = rankList[i]; + if(dd.city == city){ + if(type == 0){ + dd.follow = true; + }else{ + dd.follow = false; + } + break; + } + } + } + reloadMyFocus() reloadCityIncreaseRanking() if(type == 0){ @@ -124,8 +157,25 @@ Vue.component('city_potential_ranking',{ abolish:function(city,event,type){ $.confirm("您确定要取消关注?", function () { axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); +// $(event.target).parent().children().removeClass("dn"); +// $(event.target).addClass("dn"); + + var rankList = cityPotentialRankingData.cityPotentialRankingList + + if(rankList && rankList.length>0){ + for(var i in rankList){ + var dd = rankList[i]; + if(dd.city == city){ + if(type == 0){ + dd.follow = true; + }else{ + dd.follow = false; + } + break; + } + } + } + reloadMyFocus() reloadCityIncreaseRanking() var da = cityDetaiVue.$data.citys