update
This commit is contained in:
@@ -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)">关注</i>'+
|
||||
'<i class="button collection collection02" v-bind:class="{dn:!cp.follow}" v-on:click="abolish(cp.city,$event)">取消</i>'+
|
||||
'<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>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
@@ -65,13 +65,13 @@ Vue.component('city_potential_ranking',{
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
follow:function(city,event){
|
||||
follow: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") == ""){
|
||||
alert("rrrr")
|
||||
}else{
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
|
||||
|
||||
var msg = response.data.message;
|
||||
if(msg != "取消关注成功" && msg != "关注成功"){
|
||||
@@ -92,7 +92,7 @@ Vue.component('city_potential_ranking',{
|
||||
}
|
||||
})
|
||||
}else{
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
|
||||
var msg = response.data.message;
|
||||
if(msg != "取消关注成功" && msg != "关注成功"){
|
||||
$.toast(msg);
|
||||
@@ -110,8 +110,8 @@ Vue.component('city_potential_ranking',{
|
||||
}
|
||||
|
||||
},
|
||||
abolish:function(city,event){
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
|
||||
abolish:function(city,event,type){
|
||||
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
|
||||
$(event.target).parent().children().removeClass("dn");
|
||||
$(event.target).addClass("dn");
|
||||
reloadMyFocus()
|
||||
|
||||
Reference in New Issue
Block a user