添加城市过多提示

This commit is contained in:
2018-04-16 14:44:41 +08:00
parent 7cdce5b146
commit c4e62f5e5e
3 changed files with 47 additions and 24 deletions
@@ -53,12 +53,18 @@ Vue.component('city_increase_ranking',{
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn"); var msg = response.data.message;
$(event.target).addClass("dn"); if(msg != "取消关注成功" && msg != "关注成功"){
reloadMyFocus() $.toast(msg);
plus.webview.getWebviewById('views/house/houseDetail.html').reload(); }else{
plus.webview.getWebviewById('views/house/houseManageList.html').reload(); $(event.target).parent().children().removeClass("dn");
plus.webview.getWebviewById('views/user/userInfo.html').reload(); $(event.target).addClass("dn");
reloadMyFocus()
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); //cityDetaiVue.$data.citys.push(city);
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
@@ -67,10 +73,16 @@ Vue.component('city_increase_ranking',{
}) })
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn"); var msg = response.data.message;
$(event.target).addClass("dn"); if(msg != "取消关注成功" && msg != "关注成功"){
reloadMyFocus() $.toast(msg);
cityDetaiVue.$data.citys.push(city); }else{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
cityDetaiVue.$data.citys.push(city);
}
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
@@ -72,14 +72,20 @@ Vue.component('city_potential_ranking',{
alert("rrrr") alert("rrrr")
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn"); var msg = response.data.message;
alert(city) if(msg != "取消关注成功" && msg != "关注成功"){
plus.webview.getWebviewById('views/house/houseDetail.html').reload(); $.toast(msg);
plus.webview.getWebviewById('views/house/houseManageList.html').reload(); }else{
plus.webview.getWebviewById('views/user/userInfo.html').reload(); $(event.target).parent().children().removeClass("dn");
reloadMyFocus() $(event.target).addClass("dn");
//cityDetaiVue.$data.citys.push(city); 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);
}
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
@@ -87,11 +93,16 @@ Vue.component('city_potential_ranking',{
}) })
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn"); var msg = response.data.message;
$(event.target).addClass("dn"); if(msg != "取消关注成功" && msg != "关注成功"){
reloadMyFocus() $.toast(msg);
cityDetaiVue.$data.citys.push(city); }else{
//plus.webview.getWebviewById('views/user/userInfo.html').reload(); $(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){ }).catch(function(error){
console.log(error) console.log(error)
}) })
+1 -1
View File
@@ -38,7 +38,7 @@
<div class="card cardPrice cardPrice01 cardCity01" v-bind:hrefid="myCityMap.hrefId"> <div class="card cardPrice cardPrice01 cardCity01" v-bind:hrefid="myCityMap.hrefId">
<div class="card-header"> <div class="card-header">
<label>{{myCityMap.city}}</label> <label>{{myCityMap.city}}</label>
<a v-if="collecd" class="button theme collection collection02 " @click="collectCity(myCityMap.city)">取消关注</a> <a v-if="collecd" class="button theme collection collection02 " @click="collectCity(myCityMap.city)">取消关注</a>
<a v-else class="button theme collection collection01" @click="collectCity(myCityMap.city)">关注</a> <a v-else class="button theme collection collection01" @click="collectCity(myCityMap.city)">关注</a>
</div> </div>