YOUFANG1.1

This commit is contained in:
zongzhimin
2018-04-12 09:41:10 +08:00
parent 09f58e22d9
commit 2219d23dac
4 changed files with 124 additions and 111 deletions
@@ -33,8 +33,8 @@ Vue.component('city_potential_ranking',{
'</span>'+
'</div>'+
'<div class="col-20">'+
'<i class="button theme collection collection01" v-on:click="follow(cp.city)">关注</i>'+
'<i class="button collection collection02 dn" v-on:click="abolish(cp.city)">取消</i>'+
'<i class="button theme collection collection01" v-on:click="follow(cp.city,$event)">关注</i>'+
'<i class="button collection collection02 dn" v-on:click="abolish(cp.city,$event)">取消</i>'+
'</div>'+
'</div>'+
'</div>'+
@@ -48,7 +48,6 @@ Vue.component('city_potential_ranking',{
methods:{
loadCityPotentialRanking:function(){
axios.get("/rest/quotations/potentialUpTopInfos").then(function(response){
// alert(1)
list = response.data.data;
$(list).each(function(i){
var index = this.index;
@@ -66,14 +65,20 @@ Vue.component('city_potential_ranking',{
console.log(error)
})
},
follow:function(city){
follow:function(city,event){
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
loadCityPotentialRanking()
}).catch(function(error){
console.log(error)
})
},
abolish:function(city){
abolish:function(city,event){
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
loadCityPotentialRanking()
}).catch(function(error){
console.log(error)
})