This commit is contained in:
2018-04-16 19:28:19 +08:00
parent 369b83fd69
commit f5f4ec0487
11 changed files with 53 additions and 68 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-bind:class="{dn:ci.follow}" v-on:click="follow(ci.city,$event)">关注</i>'+
'<i class="button collection collection02" v-bind:class="{dn:!ci.follow}" v-on:click="abolish(ci.city,$event)">取消</i>'+
'<i class="button theme collection collection01" v-bind:class="{dn:ci.follow}" v-on:click="follow(ci.city,$event, 0)">关注</i>'+
'<i class="button collection collection02" v-bind:class="{dn:!ci.follow}" v-on:click="abolish(ci.city,$event, 1)">取消</i>'+
'</div>'+
'</div>'+
'</div>'+
@@ -47,12 +47,12 @@ Vue.component('city_increase_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") == ""){
}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);
@@ -73,7 +73,7 @@ Vue.component('city_increase_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);
@@ -91,7 +91,7 @@ Vue.component('city_increase_ranking',{
}
},
abolish:function(city,event){
abolish: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") == ""){
@@ -101,7 +101,7 @@ Vue.component('city_increase_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){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus();
@@ -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()
@@ -75,6 +75,7 @@ function reloadMyFocus(){
$("#myFocusFirstPage").hide();
$("#myFocus").hide();
}else{
myFocusDatas.myFocusList = response.data.data;
}
}).catch(function(error){