Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into xh-youfangApp1.1

This commit is contained in:
xuhe@fangjia.com
2018-04-14 14:21:30 +08:00
7 changed files with 116 additions and 75 deletions
+8 -18
View File
@@ -9,10 +9,6 @@ var mapLoadCount = 0;
/* 关注&已关注切换 */ /* 关注&已关注切换 */
$(".collection01").on("click", function () {
doAddCollect()
});
function doAddCollect(){ function doAddCollect(){
if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") {
clicked('../user/codeSms.html',true,false,{},{},function(){ clicked('../user/codeSms.html',true,false,{},{},function(){
@@ -34,7 +30,6 @@ function addCollect(){
$(".collection02").show(); $(".collection02").show();
$.toast("随时掌握小区动态"); $.toast("随时掌握小区动态");
} }
alert(12)
plus.webview.getWebviewById('views/user/userInfo.html').reload(); plus.webview.getWebviewById('views/user/userInfo.html').reload();
plus.webview.getWebviewById('yfindex.html').reload(); plus.webview.getWebviewById('yfindex.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload(); plus.webview.getWebviewById('views/house/houseManageList.html').reload();
@@ -79,22 +74,22 @@ function removeCollect(){
} }
/* button状态切换 */ /* button状态切换 */
$("#trendTabDiv .button").on("click", function () { /*$("#trendTabDiv .button").on("click", function () {
$(this).parent().children().removeClass("active"); $(this).parent().children().removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
}); });
*/
/* 图表切换 */ /* 图表切换 */
$("#tabAvgDiv").on("click", function () { /*$("#tabAvgDiv").on("click", function () {
$("#tabChart1").css("z-index","1"); $("#tabChart1").css("z-index","1");
$("#tabChart2").css("z-index","-1"); $("#tabChart2").css("z-index","-1");
}); });
$("#tabRentDiv").on("click", function () { $("#tabRentDiv").on("click", function () {
$("#tabChart2").css("z-index","1"); $("#tabChart2").css("z-index","1");
$("#tabChart1").css("z-index","-1"); $("#tabChart1").css("z-index","-1");
}); });*/
var t1 = window.setInterval(loadMap,1000); /*var t1 = window.setInterval(loadMap,1000);
function loadMap(){ function loadMap(){
mapLoadCount++; mapLoadCount++;
if(lng && lat){ if(lng && lat){
@@ -109,7 +104,7 @@ function loadMap(){
$("#mapDiv").hide(); $("#mapDiv").hide();
} }
} }
} }*/
//小区详情 //小区详情
function loadDistrictInfo(){ function loadDistrictInfo(){
@@ -301,11 +296,6 @@ function loadKLineData(city, region, name){
}); });
} }
$("#trendDiv1 a").click(function(){
//showTrends();
var v = $(this).attr("t-v");
showTrends(v)
});
function showTrends(v){ function showTrends(v){
if(v == "36"){ if(v == "36"){
@@ -534,8 +524,8 @@ $("#trendDiv2 a").click(function(){
/* 小区租金走势 */ /* 小区租金走势 */
function loadRentTrends(city, region, name){ function loadRentTrends(city, region, name, type){
var type = $("#trendDiv2 a.active").attr("t-v") if(type == undefined) type= 2;
axios.get("/rest/trend/distRentTrends", { axios.get("/rest/trend/distRentTrends", {
params: { params: {
city: city, city: city,
@@ -49,11 +49,20 @@ Vue.component('city_increase_ranking',{
}, },
follow:function(city,event){ follow:function(city,event){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
alert("请先登录")
clicked('/views/user/passLogin.html',true,false,{},{},function(){ clicked('/views/user/passLogin.html',true,false,{},{},function(){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
reloadMyFocus()
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
}).catch(function(error){
console.log(error)
})
} }
}) })
}else{ }else{
@@ -61,7 +70,6 @@ Vue.component('city_increase_ranking',{
$(event.target).parent().children().removeClass("dn"); $(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn"); $(event.target).addClass("dn");
reloadMyFocus() reloadMyFocus()
//plus.webview.getWebviewById('views/user/userInfo.html').reload()
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
@@ -67,11 +67,20 @@ Vue.component('city_potential_ranking',{
}, },
follow:function(city,event){ follow:function(city,event){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
alert("请先登录")
clicked('/views/user/passLogin.html',true,false,{},{},function(){ clicked('/views/user/passLogin.html',true,false,{},{},function(){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
$(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn");
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()
}).catch(function(error){
console.log(error)
})
} }
}) })
}else{ }else{
+71 -38
View File
@@ -70,8 +70,8 @@
<div class="item-title"><i class="icon icon-address02"></i>{{city}}{{region}}{{address}}</div> <div class="item-title"><i class="icon icon-address02"></i>{{city}}{{region}}{{address}}</div>
<div class="item-after"> <div class="item-after">
<a class="button theme collection collection01">关注</a> <a class="button theme collection collection01" onclick="doAddCollect()">关注</a>
<a class="button collection collection02 dn">取消关注</a> <a class="button collection collection02 dn" onclick="removeCollect()">取消关注</a>
</div> </div>
</div> </div>
<div class="item-subtitle"> <div class="item-subtitle">
@@ -114,17 +114,17 @@
<div class="topicContent" style="padding:0;"> <div class="topicContent" style="padding:0;">
<div class="content-block content-block01 content-block01a"> <div class="content-block content-block01 content-block01a">
<div class="buttons-row theme" id="trendTabDiv"> <div class="buttons-row theme" id="trendTabDiv">
<a href="#tabChart1" class="tab-link button active" id="tabAvgDiv">均价</a> <a href="#tabChart1" class="tab-link button active" id="tabAvgDiv" @click="showChat(1)">均价</a>
<a href="#tabChart2" class="tab-link button" id="tabRentDiv">租金</a> <a href="#tabChart2" class="tab-link button" id="tabRentDiv" @click="showChat(2)">租金</a>
</div> </div>
</div> </div>
<div class="tabs"> <div class="tabs">
<div id="tabChart1" class="tab tabChart1 active"> <div id="tabChart1" class="tab tabChart1 active">
<div class="content-block content-block01a" style="margin:0;padding-left:0;padding-right:0;"> <div class="content-block content-block01a" style="margin:0;padding-left:0;padding-right:0;">
<div class="buttons-row theme" style="padding:0 0.75rem;" id="trendDiv1"> <div class="buttons-row theme" style="padding:0 0.75rem;" id="trendDiv1">
<a t-v="6" class="tab-link button active">半年</a> <a t-v="6" class="tab-link button active" onclick="showTrends(6)">半年</a>
<a t-v="12" class="tab-link button">一年</a> <a t-v="12" class="tab-link button" onclick="showTrends(12)">一年</a>
<a t-v="36" class="tab-link button">三年</a> <a t-v="36" class="tab-link button" onclick="showTrends(36)">三年</a>
</div> </div>
<div class="chart" id="chart01" style="height:360px;"></div> <div class="chart" id="chart01" style="height:360px;"></div>
</div> </div>
@@ -132,8 +132,8 @@
<div id="tabChart2" class="tab tabChart2" style="display: block;"> <div id="tabChart2" class="tab tabChart2" style="display: block;">
<div class="content-block content-block01a" style="margin:0;padding-left:0;padding-right:0;"> <div class="content-block content-block01a" style="margin:0;padding-left:0;padding-right:0;">
<div class="buttons-row theme" style="padding:0 0.75rem;" id="trendDiv2"> <div class="buttons-row theme" style="padding:0 0.75rem;" id="trendDiv2">
<a t-v="2" class="tab-link button active">半年</a> <a t-v="2" id="trendDivTab2" class="tab-link button active" onclick="showLoadRentTrends(2)">半年</a>
<a t-v="3" class="tab-link button">一年</a> <a t-v="3" id="trendDivTab3" class="tab-link button" onclick="showLoadRentTrends(3)">一年</a>
</div> </div>
<div class="chart" id="chart02" style="margin-top:0.75rem;"></div> <div class="chart" id="chart02" style="margin-top:0.75rem;"></div>
</div> </div>
@@ -270,40 +270,61 @@ function onPlusReady() {
name = self.name; name = self.name;
// 创建根实例 // 创建根实例
baseInfo = new Vue({ baseInfo = new Vue({
el: '#districtBaseInfo', el: '#districtBaseInfo',
data: { data: {
name : "", name : "",
city:"", city:"",
region: "", region: "",
address: "", address: "",
avgPrice:"", avgPrice:"",
oneMonthUpDownRange:"", oneMonthUpDownRange:"",
priceRate:"", priceRate:"",
cityPrice:"", cityPrice:"",
finishBuildingDate:"", finishBuildingDate:"",
householdCount:"", householdCount:"",
cubagePercent:"", cubagePercent:"",
carSiteCount:"", carSiteCount:"",
virescencePercent:"", virescencePercent:"",
estateCharge:"", estateCharge:"",
moreArea:"", moreArea:"",
developer:"", developer:"",
estateCompany:"", estateCompany:"",
tags:[], tags:[],
nearDists:[], nearDists:[],
regionIndex:"", regionIndex:"",
schoolIndex:"" schoolIndex:""
},
methods:{
showChat: function(type){
if(type == 2) {
document.getElementById("tabChart2").style = "z-index:1";
document.getElementById("tabChart1").style = "z-index:-1";
} else {
document.getElementById("tabChart2").style = "z-index:-1";
document.getElementById("tabChart1").style = "z-index:1";
} }
}
}
}) })
/* 小区均价分析 */ /* 小区均价分析 */
loadKLineData(city, region, name); loadKLineData(city, region, name);
/* 小区租金走势 */ /* 小区租金走势 */
loadRentTrends(city, region, name); loadRentTrends(city, region, name,2);
} }
function showLoadRentTrends(type) {
if(type == 3) {
document.getElementById("trendDivTab3").setAttribute("class","tab-link button active");
document.getElementById("trendDivTab2").setAttribute("class","tab-link button");
} else {
document.getElementById("trendDivTab3").setAttribute("class","tab-link button");
document.getElementById("trendDivTab2").setAttribute("class","tab-link button active");
}
loadRentTrends(city, region, name,type);
}
/*baseInfo = new Vue({ /*baseInfo = new Vue({
el: '#districtBaseInfo', el: '#districtBaseInfo',
@@ -330,9 +351,21 @@ function onPlusReady() {
regionIndex:"", regionIndex:"",
schoolIndex:"" schoolIndex:""
} },
})*/ methods:{
showChat: function(type){
if(type == 2) {
document.getElementById("tabChart2").style = "z-index:1";
document.getElementById("tabChart1").style = "z-index:-1";
} else {
document.getElementById("tabChart2").style = "z-index:-1";
document.getElementById("tabChart1").style = "z-index:1";
}
}
}
})
*/
function openMapWindow(){ function openMapWindow(){
clicked('arround.html',true,false,{},{city:city,region:region,name:name,lat:lat,lng:lng}); clicked('arround.html',true,false,{},{city:city,region:region,name:name,lat:lat,lng:lng});
} }
+9 -2
View File
@@ -1472,12 +1472,19 @@ function markFocus(){
function addFocus(city){ function addFocus(city){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
alert("请先登录")
clicked('/views/user/passLogin.html',true,false,{},{},function(){ clicked('/views/user/passLogin.html',true,false,{},{},function(){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{ }else{
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
reloadMyFocus()
createData(city, myDatasVue.$data.cityDatas.length);
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
plus.webview.getWebviewById('views/user/userInfo.html').reload();
}).catch(function(error){
console.log(error)
})
} }
}) })
}else{ }else{
+8 -13
View File
@@ -170,15 +170,10 @@ function onPlusReady() {
id = self.newsId; id = self.newsId;
shareId = id shareId = id
shareUrl = shareUrl+id shareUrl = shareUrl+id
$.ajax({
type : 'get', axios.get("/rest/news/detail",{params:{newsId:id}}).then(function(response){
url : BASE_PATH + "/rest/news/detail", if(response.data.code==200){
data:{newsId:id}, data = response.data.data
dataType:'json',
async:false,
success:function(result){
if(result.code==200){
data = result.data
$("#title").text(data.title) $("#title").text(data.title)
$("#title2").text(data.title) $("#title2").text(data.title)
$("#source").text(data.source==null?"":"来源:"+data.source) $("#source").text(data.source==null?"":"来源:"+data.source)
@@ -200,10 +195,10 @@ function onPlusReady() {
//是否收藏 //是否收藏
isCollect(); isCollect();
} }
},
error:function(){ }).catch(function(error){
} console.log(error)
}) });
getPosition(); getPosition();
updateSerivces(); updateSerivces();
} }
-1
View File
@@ -211,7 +211,6 @@ function onPlusReady() {
console.log(error) console.log(error)
}); });
//var id="165878889770385408"
/* 编辑状态-确定 */ /* 编辑状态-确定 */
$(document).on('click','#confirm_btn', function () { $(document).on('click','#confirm_btn', function () {