From 7d0b7a6f32498077ba4fbeb667fe81d77c3c0c82 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Sat, 14 Apr 2018 18:19:11 +0800 Subject: [PATCH] update --- .../component/cityIncreaseRankingComponent.js | 13 +++++++++++-- .../component/cityPotentialRankingComponent.js | 17 +++++++++++++---- fangija-zsyf/views/house/houseDetail.html | 1 - 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js index ae6f51f..de7e321 100644 --- a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js +++ b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js @@ -51,7 +51,6 @@ Vue.component('city_increase_ranking',{ 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{ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ $(event.target).parent().children().removeClass("dn"); @@ -60,6 +59,7 @@ Vue.component('city_increase_ranking',{ plus.webview.getWebviewById('views/house/houseDetail.html').reload(); plus.webview.getWebviewById('views/house/houseManageList.html').reload(); plus.webview.getWebviewById('views/user/userInfo.html').reload(); + //cityDetaiVue.$data.citys.push(city); }).catch(function(error){ console.log(error) }) @@ -70,6 +70,7 @@ Vue.component('city_increase_ranking',{ $(event.target).parent().children().removeClass("dn"); $(event.target).addClass("dn"); reloadMyFocus() + cityDetaiVue.$data.citys.push(city); }).catch(function(error){ console.log(error) }) @@ -90,7 +91,15 @@ Vue.component('city_increase_ranking',{ $(event.target).parent().children().removeClass("dn"); $(event.target).addClass("dn"); reloadMyFocus(); - //plus.webview.getWebviewById('views/user/userInfo.html').reload() + //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) }) diff --git a/fangija-zsyf/views/component/cityPotentialRankingComponent.js b/fangija-zsyf/views/component/cityPotentialRankingComponent.js index cb99b6e..8875151 100644 --- a/fangija-zsyf/views/component/cityPotentialRankingComponent.js +++ b/fangija-zsyf/views/component/cityPotentialRankingComponent.js @@ -66,20 +66,20 @@ Vue.component('city_potential_ranking',{ }) }, follow:function(city,event){ - alert("wwww") 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") == ""){ - + alert("rrrr") }else{ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ $(event.target).parent().children().removeClass("dn"); $(event.target).addClass("dn"); - // plus.webview.getWebviewById('views/house/houseDetail.html').reload(); + alert(city) + plus.webview.getWebviewById('views/house/houseDetail.html').reload(); plus.webview.getWebviewById('views/house/houseManageList.html').reload(); plus.webview.getWebviewById('views/user/userInfo.html').reload(); reloadMyFocus() - cityDetaiVue.$data.citys.push(city); + //cityDetaiVue.$data.citys.push(city); }).catch(function(error){ console.log(error) }) @@ -103,6 +103,15 @@ Vue.component('city_potential_ranking',{ $(event.target).parent().children().removeClass("dn"); $(event.target).addClass("dn"); reloadMyFocus() + + 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; + } + } //plus.webview.getWebviewById('views/user/userInfo.html').reload(); }).catch(function(error){ console.log(error) diff --git a/fangija-zsyf/views/house/houseDetail.html b/fangija-zsyf/views/house/houseDetail.html index 4fe7d83..94d6241 100644 --- a/fangija-zsyf/views/house/houseDetail.html +++ b/fangija-zsyf/views/house/houseDetail.html @@ -1525,7 +1525,6 @@ function addFocus(city){ }else{ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ reloadMyFocus() - alert("wqqqq") cityDetaiVue.$data.citys.push(city); }).catch(function(error){ console.log(error)