YOUFANG 1.0.3

This commit is contained in:
zongzhimin
2018-04-16 14:34:31 +08:00
parent a1f0378b7b
commit 3f61328464
3 changed files with 90 additions and 8 deletions
@@ -56,6 +56,7 @@ Vue.component('city_increase_ranking',{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
reloadCityPotentialRanking()
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
@@ -70,6 +71,7 @@ Vue.component('city_increase_ranking',{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
reloadCityPotentialRanking()
cityDetaiVue.$data.citys.push(city);
}).catch(function(error){
console.log(error)
@@ -91,6 +93,7 @@ Vue.component('city_increase_ranking',{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus();
reloadCityPotentialRanking()
//plus.webview.getWebviewById('views/user/userInfo.html').reload()
var da = cityDetaiVue.$data.citys
if(da && da.length>0){
@@ -111,3 +114,11 @@ Vue.component('city_increase_ranking',{
this.loadCityIncreaseRanking();
}
})
function reloadCityIncreaseRanking(){
axios.get("/rest/quotations/markUpTopInfos").then(function(response){
cityIncreaseRankingData.cityIncreaseRankingList = response.data.data;
}).catch(function(error){
console.log(error)
})
}
@@ -69,16 +69,15 @@ Vue.component('city_potential_ranking',{
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){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
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()
reloadCityIncreaseRanking()
//cityDetaiVue.$data.citys.push(city);
}).catch(function(error){
console.log(error)
@@ -90,6 +89,7 @@ Vue.component('city_potential_ranking',{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
reloadCityIncreaseRanking()
cityDetaiVue.$data.citys.push(city);
//plus.webview.getWebviewById('views/user/userInfo.html').reload();
}).catch(function(error){
@@ -103,7 +103,7 @@ Vue.component('city_potential_ranking',{
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
reloadCityIncreaseRanking()
var da = cityDetaiVue.$data.citys
if(da && da.length>0){
var index = da.indexOf(city)
@@ -121,4 +121,24 @@ Vue.component('city_potential_ranking',{
mounted:function(){
this.loadCityPotentialRanking();
}
})
})
function reloadCityPotentialRanking(){
axios.get("/rest/quotations/potentialUpTopInfos").then(function(response){
list = response.data.data;
$(list).each(function(i){
var index = this.index;
var totalHalfStar = Math.round(Math.round(index/5)/2) //总半星
var starNum = Math.floor(totalHalfStar/2) //全星
var halfStarNum = totalHalfStar%2 //半星
var noneStarNum = 5-starNum-halfStarNum //空星
this.starNum = starNum;
this.halfStarNum = halfStarNum;
this.noneStarNum = noneStarNum;
})
cityPotentialRankingData.cityPotentialRankingList = response.data.data;
}).catch(function(error){
console.log(error)
})
}
+55 -4
View File
@@ -327,6 +327,13 @@
<a href="#tabCity2" class="tab-link button">按城市等级</a>
</div>
</div>
<div class="content-block content-block01 content dn" style="top:66px;z-index:100;" id="selectContainer">
<div class="container" style="top:0;">
<div class="city" style="width:100%;">
<div class="city-list"></div>
</div>
</div>
</div>
<div class="tabs">
<div id="tabCity1" class="tab active">
<div class="content-block content-block01 content">
@@ -1321,13 +1328,13 @@ $.config = {router: false}
/* 获取城市 */
$(".popup-about01 .cityGPS").on("click", function () {
$("#input_city").val($(this).find("p").text());
//$("#input_city").val($(this).find("p").text());
$(".cityChoice a").text($(this).find("p").text());
$(".popup-about01 p").removeClass("active");
addFocus($(this).find("p").text())
});
$(".popup-about01 p").on("click", function () {
$("#input_city").val($(this).text());
//$("#input_city").val($(this).text());
$(".cityChoice a").text($(this).text());
$(".popup-about01 p").removeClass("active");
$(this).addClass("active");
@@ -1340,6 +1347,42 @@ $.config = {router: false}
});
loadMyCollectCity();
//城市选择
//$("#cityCopy").html($('.tabs').html())
var getAllCitys = function() {
var list = new Array();
$("#tabCity1 #cityContainer .city p").each(function(i, o) {
list.push($(o).text());
});
return list;
}
var search = function(){
var city = $("#citySearchInp").val();
$("#selectContainer .city-list").empty();
$("#selectContainer").show();
var cityList = getAllCitys();
for(var i=0;i<cityList.length;i++) {
if(cityList[i].indexOf(city) != -1){
$("#selectContainer .city-list").append('<p class="close-popup" onclick="addCityFocus(\''+cityList[i]+'\')">'+cityList[i]+'</p>');
}
}
if(city == ""){
$("#selectContainer").hide();
}
}
$("#citySearchInp").bind('input propertychange keyup', function() {
search();
});
$("#citySearchInp").bind('keyup', function() {
search();
});
}
@@ -1393,10 +1436,14 @@ $.config = {router: false}
});
function addCityFocus(city){
//city=city.replace("<i></i>","")
//$("#input_city").text(city);
addFocus(city);
}
</script>
<script>
@@ -1512,6 +1559,8 @@ function addFocus(city){
}else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
reloadMyFocus()
reloadCityIncreaseRanking()
reloadCityPotentialRanking()
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
@@ -1524,6 +1573,8 @@ function addFocus(city){
}else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
reloadMyFocus()
reloadCityIncreaseRanking()
reloadCityPotentialRanking()
cityDetaiVue.$data.citys.push(city);
}).catch(function(error){
console.log(error)