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
@@ -27,8 +27,8 @@ Vue.component('city_increase_ranking',{
'<em class="up">{{!ci.oneMonthUpDownRange||ci.oneMonthUpDownRange==""?"暂无":Math.abs(100*ci.oneMonthUpDownRange).toFixed(2)+"%"}}<i class="icon" v-bind:class="[ci.oneMonthUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,ci.oneMonthUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'</div>'+
'<div class="col-20">'+
'<i class="button theme collection collection01" v-on:click="follow(ci.city)">关注</i>'+
'<i class="button collection collection02 dn" v-on:click="abolish(ci.city)">取消</i>'+
'<i class="button theme collection collection01" v-on:click="follow(ci.city,$event)">关注</i>'+
'<i class="button collection collection02 dn" v-on:click="abolish(ci.city,$event)">取消</i>'+
'</div>'+
'</div>'+
'</div>'+
@@ -47,14 +47,18 @@ Vue.component('city_increase_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");
}).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");
}).catch(function(error){
console.log(error)
})