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

This commit is contained in:
raoyanhui
2018-04-17 13:12:01 +08:00
9 changed files with 369 additions and 296 deletions
+72
View File
@@ -0,0 +1,72 @@
var renameCitys = [{"baiduCity": "阿克苏地区", "city": "阿克苏"},
{"baiduCity": "阿勒泰地区", "city": "阿勒泰"},
{"baiduCity": "阿里地区", "city": "阿里"},
{"baiduCity": "博尔塔拉蒙古自治州", "city": "博尔塔拉"},
{"baiduCity": "昌都地区", "city": "昌都"},
{"baiduCity": "昌吉回族自治州", "city": "昌吉"},
{"baiduCity": "白沙黎族自治县", "city": "白沙"},
{"baiduCity": "保亭黎族苗族自治县", "city": "保亭"},
{"baiduCity": "巴音郭楞蒙古自治州", "city": "巴音郭楞"},
{"baiduCity": "毕节地区", "city": "毕节"},
{"baiduCity": "昌都地区", "city": "昌都"},
{"baiduCity": "昌江黎族自治县", "city": "昌江"},
{"baiduCity": "楚雄彝族自治州", "city": "楚雄"},
{"baiduCity": "澄迈县", "city": "澄迈"},
{"baiduCity": "定安县", "city": "定安"},
{"baiduCity": "大兴安岭地区", "city": "大兴安岭"},
{"baiduCity": "迪庆藏族自治州", "city": "迪庆州"},
{"baiduCity": "德宏傣族景颇族自治州", "city": "德宏州"},
{"baiduCity": "恩施土家族苗族自治州", "city": "恩施"},
{"baiduCity": "甘南藏族自治州", "city": "甘南"},
{"baiduCity": "甘孜藏族自治州", "city": "甘孜州"},
{"baiduCity": "果洛藏族自治州", "city": "果洛州"},
{"baiduCity": "哈密地区", "city": "哈密"},
{"baiduCity": "海北藏族自治州", "city": "海北州"},
{"baiduCity": "海南藏族自治州", "city": "海南州"},
{"baiduCity": "海西蒙古族藏族自治州", "city": "海西州"},
{"baiduCity": "海东地区", "city": "海东"},
{"baiduCity": "和田地区", "city": "和田"},
{"baiduCity": "红河哈尼族彝族自治州", "city": "红河"},
{"baiduCity": "黄南藏族自治州", "city": "黄南州"},
{"baiduCity": "喀什地区", "city": "喀什"},
{"baiduCity": "克孜勒苏柯尔克孜自治州", "city": "克孜勒苏"},
{"baiduCity": "乐东黎族自治县", "city": "乐东"},
{"baiduCity": "凉山彝族自治州", "city": "凉山州"},
{"baiduCity": "临高县", "city": "临高"},
{"baiduCity": "临夏回族自治州", "city": "临夏"},
{"baiduCity": "陵水黎族自治县", "city": "陵水"},
{"baiduCity": "林芝地区", "city": "林芝"},
{"baiduCity": "那曲地区", "city": "那曲"},
{"baiduCity": "怒江傈僳族自治州", "city": "怒江州"},
{"baiduCity": "琼中黎族苗族自治县", "city": "琼中"},
{"baiduCity": "黔东南苗族侗族自治州", "city": "黔东南"},
{"baiduCity": "黔南布依族苗族自治州", "city": "黔南"},
{"baiduCity": "黔西南布依族苗族自治州", "city": "黔西南"},
{"baiduCity": "日喀则地区", "city": "日喀则"},
{"baiduCity": "山南地区", "city": "山南"},
{"baiduCity": "神农架林区", "city": "神农架"},
{"baiduCity": "塔城地区", "city": "塔城"},
{"baiduCity": "铜仁地区", "city": "铜仁"},
{"baiduCity": "吐鲁番地区", "city": "吐鲁番"},
{"baiduCity": "屯昌县", "city": "屯昌"},
{"baiduCity": "文山壮族苗族自治州", "city": "文山州"},
{"baiduCity": "西双版纳傣族自治州", "city": "西双版纳州"},
{"baiduCity": "湘西土家族苗族自治州", "city": "湘西"},
{"baiduCity": "延边朝鲜族自治州", "city": "延边"},
{"baiduCity": "伊犁哈萨克自治州", "city": "伊犁"},
{"baiduCity": "玉树藏族自治州", "city": "玉树州"}];
/**
* 把百度的城市格式化成房价网的城市
* @param baiduCity
* @returns {string}
*/
function formatBaiduCity(baiduCity) {
var newCity = "";
for (var i = 0; i < renameCitys.length; i++) {
if (renameCitys[i].baiduCity == baiduCity) {
newCity = renameCitys[i].city;
break;
}
}
return newCity;
}
+12 -7
View File
@@ -382,9 +382,9 @@ var option01 = {
type: 'slider', type: 'slider',
xAxisIndex: [0, 1], xAxisIndex: [0, 1],
realtime: false, realtime: false,
start: 5, start: 1,
end: 95, end: 99,
top: 65, top: 5,
height: 20, height: 20,
handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z', handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '120%' handleSize: '120%'
@@ -425,12 +425,17 @@ var option01 = {
min: 'dataMin', min: 'dataMin',
max: 'dataMax', max: 'dataMax',
axisPointer: { axisPointer: {
//type: 'shadow', type: 'line',
lineStyle: {
color: '#fff',
width: 1,
type: 'solid'
},
label: {show: false}, label: {show: false},
triggerTooltip: true, triggerTooltip: true,
handle: { handle: {
show: true, show: true,
margin: -20, margin: -70,
color: '#F18D00' color: '#F18D00'
} }
} }
@@ -473,7 +478,7 @@ var option01 = {
grid: [{ grid: [{
left: 20, left: 20,
right: 20, right: 20,
top: 110, top: 60,
height: 120 height: 120
}, { }, {
left: 20, left: 20,
@@ -521,7 +526,7 @@ var option01 = {
} }
} }
}] }]
}; };
/*$("#trendDiv2 a").click(function(){ /*$("#trendDiv2 a").click(function(){
+19 -2
View File
@@ -15,11 +15,12 @@ function loadMyCollectCity(){
if(positionCity){ if(positionCity){
cityDetaiVue.$data.citys.push(positionCity); cityDetaiVue.$data.citys.push(positionCity);
} }
$("#cityInfo").hide()
} }
$("#cityInfo").hide()
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();
}).catch(function (error) { }).catch(function (error) {
plus.nativeUI.closeWaiting();
console.log(error); console.log(error);
}); });
} }
@@ -36,8 +37,10 @@ function loadCurCity(city){
cityInfoVue.$data.collecd = false; cityInfoVue.$data.collecd = false;
} }
} }
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();
}).catch(function (error) { }).catch(function (error) {
plus.nativeUI.closeWaiting();
console.log(error); console.log(error);
}); });
} }
@@ -50,6 +53,7 @@ function loadCityPriceInfo(city){
} }
}).then(function (response) { }).then(function (response) {
var data1 = response.data.data var data1 = response.data.data
if(data1){ if(data1){
var cityObj = new Object(); var cityObj = new Object();
cityObj.city = data1.city cityObj.city = data1.city
@@ -62,7 +66,9 @@ function loadCityPriceInfo(city){
cityObj.rangeLevel = data1.rangeLevel cityObj.rangeLevel = data1.rangeLevel
cityObj.time = year + month cityObj.time = year + month
cityInfoVue.$data.myCityMap = cityObj; cityInfoVue.$data.myCityMap = cityObj;
$("#priceDiv").removeClass("dn");
} }
}).catch(function (error) { }).catch(function (error) {
console.log(error); console.log(error);
}); });
@@ -482,7 +488,18 @@ function collectCity(city, type){
}) })
return; return;
} else { } else {
var title = ""
if(type == 0){
title = "您确定要添加关注?"
}else{
title = "您确定要取消关注?"
}
$.confirm(title, function () {
docollectCity(city, type) docollectCity(city, type)
});
} }
} }
@@ -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>'+ '<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>'+
'<div class="col-20">'+ '<div class="col-20">'+
'<i class="button theme collection collection01" v-bind:class="{dn:ci.follow}" v-on:click="follow(ci.city,$event, 0)">关注</i>'+ '<i class="button theme collection collection01 confirm-ok" 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>'+ '<i class="button collection collection02 confirm-ok" v-bind:class="{dn:!ci.follow}" v-on:click="abolish(ci.city,$event, 1)">取消</i>'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
@@ -48,31 +48,16 @@ Vue.component('city_increase_ranking',{
}) })
}, },
follow:function(city,event, type){ follow:function(city,event, type){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
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, type:type}}).then(function(response){
var msg = response.data.message;
if(msg != "取消关注成功" && msg != "关注成功"){
$.toast(msg);
}else{
$(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();
}
//cityDetaiVue.$data.citys.push(city);
}).catch(function(error){
console.log(error)
})
} }
}) })
}else{ }else{
$.confirm('您确定要关注'+city+"?", function () {
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
var msg = response.data.message; var msg = response.data.message;
if(msg != "取消关注成功" && msg != "关注成功"){ if(msg != "取消关注成功" && msg != "关注成功"){
@@ -95,6 +80,7 @@ Vue.component('city_increase_ranking',{
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
});
} }
}, },
@@ -108,6 +94,8 @@ Vue.component('city_increase_ranking',{
} }
}) })
}else{ }else{
$.confirm("您确定要取消关注?", function () {
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
$(event.target).parent().children().removeClass("dn"); $(event.target).parent().children().removeClass("dn");
$(event.target).addClass("dn"); $(event.target).addClass("dn");
@@ -125,6 +113,7 @@ Vue.component('city_increase_ranking',{
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
});
} }
} }
@@ -71,6 +71,7 @@ Vue.component('city_potential_ranking',{
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
}else{ }else{
$.confirm('您确定要关注'+city+"?", function () {
axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){
var msg = response.data.message; var msg = response.data.message;
@@ -89,6 +90,7 @@ Vue.component('city_potential_ranking',{
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
});
} }
}) })
}else{ }else{
+1 -1
View File
@@ -118,7 +118,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chart" id="chart01" style="height:320px;margin-top:-2.75rem;"></div> <div class="chart" id="chart01" style="height:270px;"></div>
<div class="topicTitle topicTitle01" style="position:relative;border-top:solid 1px #e7e7e7;">租金 <div class="topicTitle topicTitle01" style="position:relative;border-top:solid 1px #e7e7e7;">租金
<div class="content-block"> <div class="content-block">
<div class="buttons-row theme" id="trendDiv2"> <div class="buttons-row theme" id="trendDiv2">
@@ -51,7 +51,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="card cardPrice cardPrice01" id="house_price"> <div class="card cardPrice cardPrice01" id="house_price" v-cloak>
<div class="card-header"> <div class="card-header">
<span>评估总价</span> <span>评估总价</span>
<span>均价:<em>{{avg_price}}</em></span> <span>均价:<em>{{avg_price}}</em></span>
+10 -14
View File
@@ -35,7 +35,7 @@
</header> </header>
<div class="content" id="cityInfo" v-cloak> <div class="content" id="cityInfo" v-cloak>
<div class="card cardPrice cardPrice01 cardCity01" v-bind:hrefid="myCityMap.hrefId"> <div class="card cardPrice cardPrice01 cardCity01 dn" id="priceDiv" v-bind:hrefid="myCityMap.hrefId">
<div class="card-header"> <div class="card-header">
<label>{{myCityMap.city}}</label> <label>{{myCityMap.city}}</label>
<a v-if="collecd" class="button collection collection02" @click="collectCity(myCityMap.city, 1)">取消关注</a> <a v-if="collecd" class="button collection collection02" @click="collectCity(myCityMap.city, 1)">取消关注</a>
@@ -45,7 +45,7 @@
<div class="card-header"> <div class="card-header">
<span>当前参考均价</span> <span>当前参考均价</span>
</div> </div>
<div class="card-content"> <div class="card-content" >
<div class="card-content-inner" v-if="myCityMap.cityTopMonthAvgPrice">{{myCityMap.cityTopMonthAvgPrice}}<span>元/㎡</span></div> <div class="card-content-inner" v-if="myCityMap.cityTopMonthAvgPrice">{{myCityMap.cityTopMonthAvgPrice}}<span>元/㎡</span></div>
<div class="card-content-inner" v-else>暂无</div> <div class="card-content-inner" v-else>暂无</div>
</div> </div>
@@ -151,8 +151,14 @@ $.config = {router: false}
var date = new Date(); var date = new Date();
var year = date.getFullYear()+'年'; var year = date.getFullYear()+'年';
var month = date.getMonth()+1+'月'; var month = date.getMonth()+1+'月';
var city = "神农架" var city = "普洱"
var cityInfoVue = new Vue({ var cityInfoVue;
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady() {
var self = plus.webview.currentWebview();
city = self.city
cityInfoVue = new Vue({
el: '#cityInfo', el: '#cityInfo',
data: { data: {
city:"", city:"",
@@ -162,11 +168,6 @@ var cityInfoVue = new Vue({
myCityMap : [] myCityMap : []
} }
}); });
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady() {
var self = plus.webview.currentWebview();
var city = self.city
cityInfoVue.$data.city = city; cityInfoVue.$data.city = city;
loadCurCity(city); loadCurCity(city);
loadCityPriceInfo(city) loadCityPriceInfo(city)
@@ -176,11 +177,6 @@ function onPlusReady() {
} }
//loadCurCity(city);
// loadCityPriceInfo(city)
// loadUpOrDown(city);
// loadHotDistrict(city)
// loadCityPricesAndCounts(city)
+9 -17
View File
@@ -228,34 +228,26 @@
</div> </div>
<div class="topic"> <div class="topic">
<div class="topicTitle">小区走势分析</div> <div class="topicTitle">小区走势分析</div>
<div class="topicContent" style="padding:0;"> <div class="topicContent" style="padding:0;padding-bottom:0.75rem;">
<div class="content-block content-block01 content-block01a"> <div class="topicTitle topicTitle01" style="position:relative;">均价
<div class="buttons-row theme" id="trendTabDiv"> <div class="content-block">
<a href="#tabChart1" class="tab-link button active" id="tabAvgDiv">均价</a> <div class="buttons-row theme" id="trendDiv1">
<a href="#tabChart2" class="tab-link button" id="tabRentDiv">租金</a>
</div>
</div>
<div class="tabs">
<div id="tabChart1" class="tab tabChart1 active">
<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">
<a t-v="6" class="tab-link button active" onclick="showTrends(6)">半年</a> <a t-v="6" class="tab-link button active" onclick="showTrends(6)">半年</a>
<a t-v="12" class="tab-link button" onclick="showTrends(12)">一年</a> <a t-v="12" class="tab-link button" onclick="showTrends(12)">一年</a>
<a t-v="36" class="tab-link button" onclick="showTrends(36)">三年</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> </div>
</div> </div>
<div id="tabChart2" class="tab tabChart2" style="display: block;"> <div class="chart" id="chart01" style="height:270px;"></div>
<div class="content-block content-block01a" style="margin:0;padding-left:0;padding-right:0;"> <div class="topicTitle topicTitle01" style="position:relative;border-top:solid 1px #e7e7e7;">租金
<div class="buttons-row theme" style="padding:0 0.75rem;" id="trendDiv2"> <div class="content-block">
<div class="buttons-row theme" id="trendDiv2">
<a t-v="2" id="trendDivTab2" class="tab-link button active" onclick="showLoadRentTrends(2)">半年</a> <a t-v="2" id="trendDivTab2" class="tab-link button active" onclick="showLoadRentTrends(2)">半年</a>
<a t-v="3" id="trendDivTab3" class="tab-link button" onclick="showLoadRentTrends(3)">一年</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>
</div> </div>
</div> </div>
<div class="chart" id="chart02"></div>
</div> </div>
</div> </div>
<div class="topic" v-show="rentRooms.length>0"> <div class="topic" v-show="rentRooms.length>0">