From f5f5aa0e58fdb2faa2996a83dc7fc2a31ef5e6a5 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Sat, 14 Apr 2018 17:43:14 +0800 Subject: [PATCH] update --- fangija-zsyf/js/quotations/cityDetail.js | 34 +++++++++++++++++-- .../cityPotentialRankingComponent.js | 5 ++- fangija-zsyf/views/house/houseDetail.html | 30 ++++------------ 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/fangija-zsyf/js/quotations/cityDetail.js b/fangija-zsyf/js/quotations/cityDetail.js index a97034f..12aa4d7 100644 --- a/fangija-zsyf/js/quotations/cityDetail.js +++ b/fangija-zsyf/js/quotations/cityDetail.js @@ -1,6 +1,33 @@ var ret = [] +function loadMyCollectCity(){ + plus.nativeUI.showWaiting(); + axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) { + var curDatas = response.data.data + if(curDatas && curDatas.length>0){ + if(positionCity){ + if(!IsInArray(curDatas, positionCity)){ + curDatas.splice(0,0, positionCity) + } + } + cityDetaiVue.$data.citys = curDatas; + }else{ + if(positionCity){ + cityDetaiVue.$data.citys.push(positionCity); + } + + $("#cityInfo").hide() + } + plus.nativeUI.closeWaiting(); + }).catch(function (error) { + console.log(error); + }); +} + + function loadCurCity(city){ + plus.nativeUI.showWaiting(); + axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) { var curDatas = response.data.data if(curDatas && curDatas.length>0){ @@ -10,7 +37,7 @@ function loadCurCity(city){ cityInfoVue.$data.collecd = false; } } - + plus.nativeUI.closeWaiting(); }).catch(function (error) { console.log(error); }); @@ -478,8 +505,9 @@ function docollectCity(city){ } - - plus.webview.getWebviewById('views/house/houseDetail.html').reload(); + //loadMyCollectCity(); + $("a[href='#tabQuotation1']").click(); + //plus.webview.getWebviewById('views/house/houseDetail.html').reload(); }else if(msg == "关注成功"){ cityInfoVue.$data.collecd = true; plus.webview.getWebviewById('views/house/houseDetail.html').reload(); diff --git a/fangija-zsyf/views/component/cityPotentialRankingComponent.js b/fangija-zsyf/views/component/cityPotentialRankingComponent.js index d754df3..cb99b6e 100644 --- a/fangija-zsyf/views/component/cityPotentialRankingComponent.js +++ b/fangija-zsyf/views/component/cityPotentialRankingComponent.js @@ -66,6 +66,7 @@ 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") == ""){ @@ -74,10 +75,11 @@ Vue.component('city_potential_ranking',{ 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(); + // 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); }).catch(function(error){ console.log(error) }) @@ -88,6 +90,7 @@ Vue.component('city_potential_ranking',{ $(event.target).parent().children().removeClass("dn"); $(event.target).addClass("dn"); reloadMyFocus() + cityDetaiVue.$data.citys.push(city); //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 7fc8cdd..f00117d 100644 --- a/fangija-zsyf/views/house/houseDetail.html +++ b/fangija-zsyf/views/house/houseDetail.html @@ -1434,8 +1434,13 @@ $("a[href='#tabQuotation1'],a[href='#tabQuotation0']").click(function(){ $("#cityInfo").hide() }) + + function clickCity(val){ + city = val; + + $("#cityInfo").show() $("#tabCityDiv a").removeClass("active"); // $("a[href="+val+"]").addClass("active"); @@ -1520,6 +1525,7 @@ 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) @@ -1535,30 +1541,6 @@ function hotCity(city){ } -function loadMyCollectCity(){ - axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) { - var curDatas = response.data.data - if(curDatas && curDatas.length>0){ - if(positionCity){ - if(!IsInArray(curDatas, positionCity)){ - curDatas.splice(0,0, positionCity) - } - } - cityDetaiVue.$data.citys = curDatas; - }else{ - if(positionCity){ - cityDetaiVue.$data.citys.push(positionCity); - } - - $("#cityInfo").hide() - } - - }).catch(function (error) { - console.log(error); - }); - - -}