Vue.component('city_increase_ranking',{ template:'
'+ ''+ '
', data:function(){ return cityIncreaseRankingData; }, methods:{ loadCityIncreaseRanking:function(){ axios.get("/rest/quotations/markUpTopInfos").then(function(response){ cityIncreaseRankingData.cityIncreaseRankingList = response.data.data; }).catch(function(error){ console.log(error) }) }, follow:function(city,event, type){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ clicked('/views/user/codeSms.html',true,false,{},{},function(){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ }else{ $.confirm('您确定要关注'+city+"?", function () { axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ var msg = response.data.message; if(msg != "取消关注成功" && msg != "关注成功"){ $.toast(msg); if (plus.webview.getWebviewById('views/house/houseDetail.html') != null) { plus.webview.getWebviewById('views/house/houseDetail.html').reload(); } }else{ //$(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; } } } if(plus.webview.getWebviewById('views/house/houseDetail.html')!= null) { plus.webview.getWebviewById('views/house/houseDetail.html').reload(); } // loadMyCollectCity() if(type == 0){ var curDatas = cityDetaiVue.$data.citys if(curDatas && curDatas.length>=0){ if(!IsInArray(curDatas, city)){ cityDetaiVue.$data.citys.push(city); } } } } }).catch(function(error){ console.log(error) }) },function(){ if (plus.webview.getWebviewById('views/house/houseDetail.html') != null) { plus.webview.getWebviewById('views/house/houseDetail.html').reload(); } }); if(plus.webview.getWebviewById('views/house/houseManageList.html') != null) { plus.webview.getWebviewById('views/house/houseManageList.html').reload(); } if(plus.webview.getWebviewById('views/user/userInfo.html') != null) { plus.webview.getWebviewById('views/user/userInfo.html').reload(); } } }) }else{ $.confirm('您确定要关注'+city+"?", function () { axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ var msg = response.data.message; if(msg != "取消关注成功" && msg != "关注成功"){ $.toast(msg); }else{ //$(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){ var curDatas = cityDetaiVue.$data.citys if(curDatas && curDatas.length>=0){ if(!IsInArray(curDatas, city)){ cityDetaiVue.$data.citys.push(city); } } } } }).catch(function(error){ console.log(error) }) }); } }, abolish:function(city,event, type){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ clicked('/views/user/passLogin.html',true,false,{},{},function(){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ }else{ } }) }else{ $.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"); 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() var da = cityDetaiVue.$data.citys if(da && da.length>0){ var index = da.indexOf(city) if(index>0){ da.splice(index, 1) cityDetaiVue.$data.citys = da; } } }).catch(function(error){ console.log(error) }) }); } } }, mounted:function(){ this.loadCityIncreaseRanking(); } })