This commit is contained in:
2018-04-17 18:52:59 +08:00
parent 653d640b5f
commit f57dfbdd91
3 changed files with 99 additions and 15 deletions
@@ -33,8 +33,8 @@ Vue.component('city_potential_ranking',{
'</span>'+
'</div>'+
'<div class="col-20">'+
'<i class="button theme collection collection01" v-bind:class="{dn:cp.follow}" v-on:click="follow(cp.city,$event,0)">关注</i>'+
'<i class="button collection collection02" v-bind:class="{dn:!cp.follow}" v-on:click="abolish(cp.city,$event,1)">取消</i>'+
'<i class="button collection collection02 confirm-ok" v-on:click="abolish(cp.city,$event,1)" v-if="cp.follow" >取消</i>'+
'<i class="button theme collection collection01 confirm-ok" v-on:click="follow(cp.city,$event,0)" v-else>关注</i>'+
'</div>'+
'</div>'+
'</div>'+
@@ -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