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

This commit is contained in:
zongzhimin
2018-03-30 10:34:17 +08:00
8 changed files with 2125 additions and 138 deletions
+26 -24
View File
@@ -2,7 +2,7 @@
/* === orange layout === */
.theme {
background-color: #FFA91C;
background-color: #F18D00;
}
.theme .bar{
background-color: #131313;
@@ -17,7 +17,7 @@
}
.theme .bar-nav,
.bar-nav.theme{
background-color: #FFA91C;
background-color: #F18D00;
color: #fff;
}
.theme .bar-nav:before,
@@ -28,7 +28,7 @@
color: #fff;
}
.theme .tab-item.active {
color: #FFA91C;
color: #F18D00;
}
.theme .picker-calendar-week-days {
color: #fff;
@@ -225,51 +225,53 @@ html:not(.watch-active-state) .theme label.label-radio:active,
color: #ddd;
}
.button.theme{background:none;border-color:#FFA91C;color:#FFA91C;}
.button.button-fill.theme{background:#FFA91C;color:#fff;}
.button.theme{background:none;border-color:#F18D00;color:#F18D00;}
.button.button-fill.theme{background:#F18D00;color:#fff;}
.bar-nav.theme .button-nav{background:#FFA91C;}
.priceRecovery .col-50 .button.theme{background:none;border-color:#F18D00;color:#F18D00;}
.bar-nav.theme .button-nav{background:#F18D00;}
.bar-nav.theme .icon.icon-left{color:#fff;}
.bar .button-link.theme{background:none;color:#FFA91C;}
.bar .button-link.theme{background:none;color:#F18D00;}
.bar-tab.theme{background:#f7f7f8;}
.bar-tab.theme .tab-item{color:#999;}
.bar-tab.theme .tab-item.active{color:#FFA91C;}
.bar-tab.theme .tab-item:active{color:#FFA91C;}
.bar-tab.theme .tab-item.active{color:#F18D00;}
.bar-tab.theme .tab-item:active{color:#F18D00;}
.buttons-row.theme{background:none;}
.buttons-row.theme .button{background:#fbfbfb;border-color:#ccc;color:#666;}
.buttons-row.theme .button.active{background:#FFA91C;border-color:#FFA91C;color:#fff;}
.buttons-row.theme .button{border-color:#D7D7D7;color:#999;}
.buttons-row.theme .button.active{background:none;border-color:#F18D00;color:#F18D00;}
.selectBox div.theme{background:none;}
.selectBox div.theme.active{color:#FFA91C;}
.selectBox div.theme.active a{color:#FFA91C;}
.selectBox div.theme.active{color:#F18D00;}
.selectBox div.theme.active a{color:#F18D00;}
.selectContent .list-block ul li .item-title.theme{background:none;}
.selectContent .list-block ul li .item-title.theme.active{color:#FFA91C;}
.selectContent .list-block ul li .item-title.theme.active{color:#F18D00;}
.buttons-tab.theme{background:#fff;}
.buttons-tab.theme .button.active{border-color:#FFA91C;color:#FFA91C;}
.buttons-tab.theme .button.active{border-color:#F18D00;color:#F18D00;}
.buttons-tab01.theme .button.active{border-right-color:#e7e7e7;}
.totalValue01.theme{background:none;}
.totalValue01.theme div.addPropertyBox .addProperty{border-color:#FFA91C;color:#FFA91C;}
.totalValue01.theme div.addPropertyBox .addProperty{border-color:#F18D00;color:#F18D00;}
.list-block .item-after span.sendCode.theme{background:none;border-color:#FFA91C;color:#FFA91C;}
.list-block .item-after span.waiting.theme{background:#FFA91C;border-color:#FFA91C;color:#fff;}
.list-block .item-after span.sendCode.theme{background:none;border-color:#F18D00;color:#F18D00;}
.list-block .item-after span.waiting.theme{background:#F18D00;border-color:#F18D00;color:#fff;}
.topic .topicTitle em.theme{background:none;color:#FFA91C;}
.topic .topicTitle em.theme{background:none;color:#F18D00;}
.topic .topicTitle > span.inputBox input{background:none;color:#FFA91C;}
.topic .topicTitle > span.inputBox font{background:none;color:#FFA91C;}
.topic .topicTitle > span.inputBox input{background:none;color:#F18D00;}
.topic .topicTitle > span.inputBox font{background:none;color:#F18D00;}
.list-block.theme ul{background:#FFA91C;}
.list-block.theme ul{background:#F18D00;}
.theme .list-block ul:before, .list-block.theme ul:before{height:0;}
.theme .list-block ul:after, .list-block.theme ul:after{height:0;}
.list-block.theme .item-link:active{background:#FFA91C;}
.list-block.theme .item-link:active{background:#F18D00;}
.list-block.theme p{color:#fff;}
.list-block.theme .item-link .item-inner{background-image:#fff;}
input[type=range].theme{background:-webkit-linear-gradient(#FFA91C, #FFA91C) no-repeat;}
input[type=range].theme{background:-webkit-linear-gradient(#F18D00, #F18D00) no-repeat;}
+1 -1
View File
@@ -14,7 +14,7 @@
"icons": {
"144": "icon.png"
},
"launch_path": "/views/evaluate/evaluateReport.html",/*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
"launch_path": "main.html",/*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
"developer": {
"name": "",/*开发者名称*/
"email": "",/*开发者邮箱地址*/
+68 -58
View File
@@ -96,19 +96,21 @@ $(document).on('click','.open-vertical-modal', function () {
{
text: '自住',
onClick: function() {
window.location.href = "01_index01_myHouse01_index.html";
//window.location.href = "01_index01_myHouse01_index.html";
}
},
{
text: '出租',
onClick: function() {
window.location.href = "01_index01_myHouse01_index.html";
//window.location.href = "01_index01_myHouse01_index.html";
}
},
{
text: '空置',
onClick: function() {
window.location.href = "01_index01_myHouse01_index.html";
//window.location.href = "01_index01_myHouse01_index.html";
}
},
{
@@ -118,6 +120,7 @@ $(document).on('click','.open-vertical-modal', function () {
})
});
//查询房产评估列表
function selectEvaluateList(){
//先清空列表
$('.list-block ul').html("");
@@ -132,62 +135,11 @@ function selectEvaluateList(){
var results = resultsMap.houseInfoList;
var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap;
var cityAvgPriceMap = resultsMap.cityAvgPriceMap;
//构造数据列表
htmlContent = constructHtmlContent(results, xqOneMonthUpDownRangeMap, cityAvgPriceMap, htmlContent);
if(results!=null && results.length>0){
for(var i in results){
var result = results[i];
var tempTotalPrice = result.totalPrice;
//考虑是否为数字,加强逻辑判断
if(!isNaN(tempTotalPrice)){
//转换成元,四舍五入
tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2);
}
htmlContent = htmlContent +"<li><a href='#' class='item-content'>";
htmlContent = htmlContent +"<div class='item-inner'><div class='item-title-row'>";
htmlContent = htmlContent +"<div class='item-title'>"+result.name+"<span class='span01'>"+result.city+"-"+result.region+"</span></div>";
htmlContent = htmlContent +"</div><div class='item-title-row'>";
htmlContent = htmlContent +"<div class='item-title'><small>"+result.roomCount+"室"+result.hallCount+"厅&nbsp;&nbsp;"+result.area+"m&nbsp;&nbsp;"+result.floor+"/"+result.height+"层</small></div>";
htmlContent = htmlContent +"</div><div class='item-subtitle'>";
//对应城市地区小区30天涨跌幅
//动态构建key
var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name;
//取得key对于的value
var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey];
if(!isNaN(xqOneMonthUpDownRangeValue)){
//涨跌幅大于零
if(parseFloat(xqOneMonthUpDownRangeValue)>=0){
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='up'>"+xqOneMonthUpDownRangeValue+"%<i class='icon icon-arrow-red'></i></em></div>";
}else{
//涨跌幅小于零
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+Math.abs(xqOneMonthUpDownRangeValue)+"%<i class='icon icon-arrow-green'></i></em></div>";
}
}else{
//为非数字清空放空格
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+ +"%<i class='icon icon-arrow-green'></i></em></div>";
}
//相比对于城市均价
var cityAvgPriceKey = result.city;
//取得对应城市的value
var cityAvgPriceValue = cityAvgPriceMap[cityAvgPriceKey];
if(!isNaN(cityAvgPriceValue)){
if(parseInt(cityAvgPriceValue)>=parseInt(result.price)){
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='up'>"+'高'+(parseInt(cityAvgPriceValue)-parseInt(result.price))+'元'+"</em></div>";
}else{
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>"+'低'+(parseInt(result.price)-parseInt(cityAvgPriceValue))+'元'+"</em></div>";
}
}else{
//为非数字清空放空格
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>"+' '+"</em></div>";
}
htmlContent = htmlContent + "<div>均价: <em class='em02'>"+result.price+"元/㎡</em></div>";
htmlContent = htmlContent + "<div class='price'><em><strong>"+tempTotalPrice+"</strong>万</em></div>";
htmlContent = htmlContent + "</div></div></a><a class='add open-vertical-modal'><i class='icon icon-add' id="+result.id+" uid="+result.uid+"></i>添加管理</a>"
htmlContent = htmlContent +"</li>";
}
//动态追加内容
$('.list-block ul').html(htmlContent);
}
//动态追加内容
$('.list-block ul').html(htmlContent);
//添加loading等待效果
$(".loadingBg").hide();
$(".content-block").show();
@@ -196,6 +148,64 @@ function selectEvaluateList(){
});
}
//动态构造房产评估列表
function constructHtmlContent(results, xqOneMonthUpDownRangeMap, cityAvgPriceMap, htmlContent){
if(results!=null && results.length>0){
for(var i in results){
var result = results[i];
var tempTotalPrice = result.totalPrice;
//考虑是否为数字,加强逻辑判断
if(!isNaN(tempTotalPrice)){
//转换成元,四舍五入
tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2);
}
htmlContent = htmlContent +"<li><a href='#' class='item-content'>";
htmlContent = htmlContent +"<div class='item-inner'><div class='item-title-row'>";
htmlContent = htmlContent +"<div class='item-title'>"+result.name+"<span class='span01'>"+result.city+"-"+result.region+"</span></div>";
htmlContent = htmlContent +"</div><div class='item-title-row'>";
htmlContent = htmlContent +"<div class='item-title'><small>"+result.roomCount+"室"+result.hallCount+"厅&nbsp;&nbsp;"+result.area+"m&nbsp;&nbsp;"+result.floor+"/"+result.height+"层</small></div>";
htmlContent = htmlContent +"</div><div class='item-subtitle'>";
//对应城市地区小区30天涨跌幅
//动态构建key
var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name;
//取得key对于的value
var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey];
if(!isNaN(xqOneMonthUpDownRangeValue)){
//涨跌幅大于零
if(parseFloat(xqOneMonthUpDownRangeValue)>=0){
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='up'>"+xqOneMonthUpDownRangeValue+"%<i class='icon icon-arrow-red'></i></em></div>";
}else{
//涨跌幅小于零
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+Math.abs(xqOneMonthUpDownRangeValue)+"%<i class='icon icon-arrow-green'></i></em></div>";
}
}else{
//为非数字清空放空格
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+ +"%<i class='icon icon-arrow-green'></i></em></div>";
}
//相比对于城市均价
var cityAvgPriceKey = result.city;
//取得对应城市的value
var cityAvgPriceValue = cityAvgPriceMap[cityAvgPriceKey];
if(!isNaN(cityAvgPriceValue)){
if(parseInt(cityAvgPriceValue)>=parseInt(result.price)){
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='up'>"+'高'+(parseInt(cityAvgPriceValue)-parseInt(result.price))+'元'+"</em></div>";
}else{
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>"+'低'+(parseInt(result.price)-parseInt(cityAvgPriceValue))+'元'+"</em></div>";
}
}else{
//为非数字清空放空格
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>"+' '+"</em></div>";
}
htmlContent = htmlContent + "<div>均价: <em class='em02'>"+result.price+"元/㎡</em></div>";
htmlContent = htmlContent + "<div class='price'><em><strong>"+tempTotalPrice+"</strong>万</em></div>";
htmlContent = htmlContent + "</div></div></a><a class='add open-vertical-modal'><i class='icon icon-add' id="+result.id+" uid="+result.uid+"></i>添加管理</a>"
htmlContent = htmlContent +"</li>";
}
}
return htmlContent;
}
//界面加载
$(document).ready(function () {
selectEvaluateList();
File diff suppressed because it is too large Load Diff
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>房产评估</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
</head>
<body>
<div class="page-group">
<div class="page page-current">
<header class="bar bar-nav">
<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
<span class="icon icon-left"></span>
</button>
<h1 class="title">房产评估</h1>
</header>
<div class="content contentSuggest">
<div class="noData">
<img src="../../images/noData.png">
<p>评估房产&nbsp;&nbsp;发现价值</p>
<div class="content-block">
<p><a href="03_evaluation02_inputInfo.html" class="button button-big button-fill theme">立即评估</a></p>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
Zepto = $
$.config = {router: false}
</script>
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
</body>
</html>
+12
View File
@@ -28,6 +28,7 @@
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
<span class="mui-icon mui-icon mui-icon-arrowleft"></span>
</button>
<!--<a href="javascript:void(0)" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left">返回刷新</a>-->
<button class="button button-link button-nav pull-right open-popover" onclick="shareHref()">
<span class="icon icon-path"></span>
</button>
@@ -106,6 +107,7 @@ $.config = {router: false}
<script type="text/javascript" src="../../js/vue.js"></script>
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/mui.min.js" charset="utf-8"></script>
<script src="../../config.js"></script>
<script type="text/javascript" src="../../js/common.js" ></script>
<script type="text/javascript" src="../../js/axios.min.js"></script>
@@ -537,6 +539,16 @@ function addComment(){
});
}
mui.init({
beforeback: function() {
     //获得父页面的webview
var list = plus.webview.getWebviewById('yfindex.html');
     //触发父页面的自定义事件(refresh),从而进行刷新
mui.fire(list, 'refresh');
//返回true,继续页面关闭逻辑
return true;
}
});
</script>
</body>
</html>
+164
View File
@@ -0,0 +1,164 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>绑定账号</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
</head>
<body>
<div class="page-group" id="app">
<div class="page page-current">
<header class="bar bar-nav">
<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
<span class="icon icon-left"></span>
</button>
<h1 class="title">绑定账号</h1>
</header>
<div class="content">
<div class="list-block media-list">
<ul>
<li>
<a class="item-content">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><i class="icon icon-login01"></i></div>
<div class="item-after">
<input type="number" v-model="mobile" id="input_phoneNumber" class="textAlignLeft" placeholder="请输入手机号码">
<label>
<span class="sendCode theme" @click="sendSmsCode">获取验证码</span>
<span class="waiting theme dn">48&nbsp;s</span>
</label>
</div>
</div>
</div>
</a>
</li>
<li>
<a class="item-content">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><i class="icon icon-login02"></i></div>
<div class="item-after">
<input type="number" v-model="smsCode" id="input_codeSms" class="textAlignLeft" placeholder="请输入验证码">
</div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block loginBox">
<p><a class="button button-big button-fill theme" id="bundling_btn" @click="binding">绑定</a></p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
Zepto = $
$.config = {router: false}
</script>
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/vue.js" ></script>
<script type="text/javascript" src="../../js/zepto.md5.js" ></script>
<script type="text/javascript" src="../../config.js"></script>
<script type="text/javascript" src="../../js/axios.min.js"></script>
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
<script>
timer = {
countdown:60,
start:function(){
countdown = 60
$(".sendCode").hide()
$(".waiting").empty().append(countdown + " s").show()
timer.down()
},
down:function(){
countdown --
$(".waiting").empty().append(countdown + " s")
if(countdown <= 0){
$(".sendCode").show()
$(".waiting").hide()
}else{
setTimeout(timer.down, 1000)
}
},
cancel:function(){
countdown = 0
}
}
new Vue({
el: '#app',
data: {
mobile:'',
smsCode:''
},
methods: {
// 手机号码检查
checkMobile: function() {
if(this.mobile == ""){
$.toast("请输入手机号码");
return false;
}
var mobile_reg = /^1\d{10}$/
if (!mobile_reg.test(this.mobile)) {
$.toast("手机号码格式错误");
return false;
}
return true;
},
// 短信验证码检查
checkSmsCode: function() {
if(this.smsCode == ""){
$.toast("请输入验证码");
return false;
}
if(this.smsCode.length != 4){
$.toast("验证码格式不正确");
return false;
}
return true;
},
// 发送短信验证码
sendSmsCode: function() {
if (this.checkMobile()) {
$(".waiting").show();
$(".sendCode").hide();
timer.start();
}
},
// 绑定手机
binding: function() {
if (this.checkMobile() && this.checkSmsCode()) {
}
}
}
});
</script>
</body>
</html>
+148 -55
View File
@@ -64,21 +64,28 @@
</span>
</div>
<div class="card-content">
<div class="card-content-inner">{{momAvgPrice}}<span>元/㎡</span></div>
<div class="card-content-inner" id="momAvgPriceId_noData">暂无数据</div>
<div class="card-content-inner" id="momAvgPriceId">{{momAvgPrice}}<span>元/㎡</span></div>
</div>
<div class="card-footer">
<span>
<em><strong>{{momRate}}</strong>%
<em id="momRateId_noData">暂无数据
</em>
<em id="momRateId"><strong>{{momRate}}</strong>%
<i class="icon" id="momRateTypeClass"></i>
</em>
<label>环比上月</label>
</span>
<span>
<em><strong>{{regionRank}}</strong></em>
<label>区域涨跌排名</label>
<em id="regionRankId_noData">暂无数据
</em>
<em id="regionRankId"><strong>{{regionRank}}</strong></em>
<label>区域均价排名</label>
</span>
<span>
<em><strong>{{priceRate}}</strong>%<i class="icon" id="priceRateTypeClass"></i></em>
<em id="priceRateId_noData">暂无数据
</em>
<em id="priceRateId"><strong>{{priceRate}}</strong>%<i class="icon" id="priceRateTypeClass"></i></em>
<label id="priceInfo">下跌概率</label>
</span>
</div>
@@ -124,7 +131,7 @@
<!-- 加载提示符 -->
<div id="otherCityDiv">
<div class="card cardList">
<div class="selectContainer">
<div class="selectBox row">
<div class="region col-25 theme"><a>区域</a><i class="icon icon-down"></i></div>
<div class="price col-25 theme" id="select_price_div"><a>均价</a><i class="icon icon-down"></i></div>
@@ -132,7 +139,7 @@
<div class="order col-25 theme"><a>距离近优先</a><i class="icon icon-down"></i></div>
</div>
<div class="card-footer selectContent dn">
<div class="selectContent dn">
<div class="topic dn" id="select_region">
<div class="topicContent" style="padding:0.2rem 0.75rem;" id="regionDiv">
</div>
@@ -201,7 +208,7 @@
</div>
</div>
</div>
<div class="list-block media-list">
<div class="list-block media-list" id="nearDistrictContainer">
<div class="list-block">
<ul class="list-container">
</ul>
@@ -1173,9 +1180,8 @@ $.config = {router: false}
<script type="text/javascript" src="js/cn.js" charset="utf-8"></script>
<script type="text/javascript" src="js/mui.min.js" charset="utf-8"></script>
<script type="text/javascript" src="config.js"></script>
<script type='text/javascript' src="js/axios.min.js"></script>
<script type="text/javascript" src="js/axios.min.js"></script>
<script type="text/javascript" src="js/axiosPlugin.js"></script>
<script type='text/javascript' src='js/city-app.js?version=${version!}' charset='utf-8'></script>
<script type='text/javascript' src='js/searchDistrict-app.js?' charset='utf-8'></script>
@@ -1207,6 +1213,7 @@ var scoreCount = 0;
var lat = 0;
var lng = 0;
var address = "";
var timestamp1 = new Date().getTime();
document.addEventListener('plusready', onPlusReady, false);
//扩展API加载完毕,现在可以正常调用扩展API
function onPlusReady(){
@@ -1281,7 +1288,6 @@ var baseInfo = new Vue({
topMonth:"",
momAvgPrice: "",
momRate: "",
dealCount:"",
priceRate:"",
priceRateType:1,
isLogin:"",
@@ -1306,7 +1312,7 @@ function initBaseInfo(city,region,address,lat,lng){
var regionParam = region;
var latParam = lat;
var lngParam = lng;
axios.get(BASE_PATH+"/rest/index/home", {
axios.get("/rest/index/home", {
params: {
city: cityParam,
region:regionParam
@@ -1315,13 +1321,42 @@ function initBaseInfo(city,region,address,lat,lng){
.then(function (response) {
baseInfo.region = response.data.data.region;
baseInfo.topMonth = response.data.data.topMonth;
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
baseInfo.momRate = (response.data.data.momRate*100).toFixed(2);
baseInfo.dealCount = response.data.data.dealCount;
baseInfo.priceRate = response.data.data.priceRate;
baseInfo.priceRateType = response.data.data.priceRateType;
if(response.data.data.momAvgPrice=='暂无数据'){
$("#momAvgPriceId").hide();
$("#momAvgPriceId_noData").show();
}else{
$("#momAvgPriceId").show();
$("#momAvgPriceId_noData").hide();
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
}
if(response.data.data.momRate=='暂无数据'){
$("#momRateId").hide();
$("#momRateId_noData").show();
}else{
$("#momRateId").show();
$("#momRateId_noData").hide();
baseInfo.momRate = (response.data.data.momRate*100).toFixed(2);
}
if(response.data.data.regionRank=='暂无数据'){
$("#regionRankId").hide();
$("#regionRankId_noData").show();
}else{
$("#regionRankId").show();
$("#regionRankId_noData").hide();
baseInfo.regionRank = response.data.data.regionRank;
}
if(response.data.data.priceRate=='暂无数据'){
$("#priceRateId").hide();
$("#priceRateId_noData").show();
}else{
$("#priceRateId").show();
$("#priceRateId_noData").hide();
//baseInfo.dealCount = response.data.data.dealCount;
baseInfo.priceRate = response.data.data.priceRate;
baseInfo.priceRateType = response.data.data.priceRateType;
}
baseInfo.isLogin = response.data.data.isLogin;
baseInfo.regionRank = response.data.data.regionRank;
if(response.data.data.isLogin){
$("#addHouseDiv").hide();
$("#detailHouseDiv").show();
@@ -1354,6 +1389,16 @@ function initBaseInfo(city,region,address,lat,lng){
$(".loadingBg").hide();
})
.catch(function (error) {
setTimeout(function(){
mui.init();
mui.openWindow({
url: 'error.html',
id:'error.html',
extras:{
//扩展参数
}
});
},10000)
console.log(error);
});
initNearDistricts(cityParam,latParam,lngParam,regionParam,0,0,0,"");
@@ -1404,7 +1449,7 @@ $("body").delegate("#regionStatusButton", "click", function (){
})
function initNearDistricts(cityParam,latParam,lngParam,regionParam,order,minPrice,maxPrice,tag){
axios.get(BASE_PATH+"/rest/index/districtList", {
axios.get("/rest/index/districtList", {
params: {
city: cityParam,
region:regionParam,
@@ -1457,7 +1502,7 @@ function initNearDistricts(cityParam,latParam,lngParam,regionParam,order,minPric
function initNews(page){
//资讯列表
axios.get(BASE_PATH+"/rest/news/list", {
axios.get("/rest/news/list", {
params: {
city: $("#input_city").text(),
page:page
@@ -1532,7 +1577,7 @@ $("body").delegate(".icon-light-grey", "click", function () {
});
function doVote(id,flag){
axios.get(BASE_PATH+"/rest/news/vote", {
axios.get("/rest/news/vote", {
params: {
newsId: id,
type:flag
@@ -1546,7 +1591,7 @@ function doVote(id,flag){
}
function changeRegion(){
axios.get(BASE_PATH+"/rest/index/home", {
axios.get("/rest/index/home", {
params: {
city: $("#input_city").text(),
region:$("#region").val(),
@@ -1557,12 +1602,41 @@ function changeRegion(){
.then(function (response) {
baseInfo.region = response.data.data.region;
baseInfo.topMonth = response.data.data.topMonth;
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
baseInfo.momRate = (response.data.data.momRate*100).toFixed(2);
baseInfo.dealCount = response.data.data.dealCount;
baseInfo.priceRate = response.data.data.priceRate;
baseInfo.priceRateType = response.data.data.priceRateType;
baseInfo.regionRank = response.data.data.regionRank;
if(response.data.data.momAvgPrice=='暂无数据'){
$("#momAvgPriceId").hide();
$("#momAvgPriceId_noData").show();
}else{
$("#momAvgPriceId").show();
$("#momAvgPriceId_noData").hide();
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
}
if(response.data.data.momRate=='暂无数据'){
$("#momRateId").hide();
$("#momRateId_noData").show();
}else{
$("#momRateId").show();
$("#momRateId_noData").hide();
baseInfo.momRate = (response.data.data.momRate*100).toFixed(2);
}
if(response.data.data.regionRank=='暂无数据'){
$("#regionRankId").hide();
$("#regionRankId_noData").show();
}else{
$("#regionRankId").show();
$("#regionRankId_noData").hide();
baseInfo.regionRank = response.data.data.regionRank;
}
if(response.data.data.priceRate=='暂无数据'){
$("#priceRateId").hide();
$("#priceRateId_noData").show();
}else{
$("#priceRateId").show();
$("#priceRateId_noData").hide();
//baseInfo.dealCount = response.data.data.dealCount;
baseInfo.priceRate = response.data.data.priceRate;
baseInfo.priceRateType = response.data.data.priceRateType;
}
baseInfo.isLogin = response.data.data.isLogin;
regionChange(response.data.data.region);
if(response.data.data.momRateType>0){
@@ -1601,6 +1675,7 @@ var itemsPerLoad2 = 5;
var dataObj = [];
var dataObj2 = [];
var page = 1;
var yesterDayDeployFlag = true;
function addItems(number, lastIndex) {
// 生成新条目的HTML
@@ -1617,7 +1692,8 @@ function addItems(number, lastIndex) {
for(var i in dataObj){
if(i>=lastIndex){
if((dataObj.length<lastIndex + number) || (i < lastIndex + number)){
if(dataObj[i].yesterDayDeploy){
if(dataObj[i].yesterDayDeploy && yesterDayDeployFlag){
yesterDayDeployFlag = false;
html += '<div class="content-block-title recommend" style="border-top:solid 0.5rem #f3f3f3;">历史推荐</div>';
}
if(dataObj[i].type=="专题"){
@@ -1627,7 +1703,7 @@ function addItems(number, lastIndex) {
'<div class="card-footer">'+
'<span>'+
'<i class="icon icon-eye-orange"></i><label id="visitCount_'+dataObj[i].id+'">'+dataObj[i].visitCount+'人</label>'+
'<i class="icon icon-comments-orange"></i>'+dataObj[i].recommendCommentCount+'条'+
'<i class="icon icon-comments-orange"></i><label id="visitComment_'+dataObj[i].id+'">'+dataObj[i].recommendCommentCount+'条'+
'</span>'+
'</div>'+
'</div>';
@@ -1727,15 +1803,22 @@ function addItems(number, lastIndex) {
dataObj[i].title+'</div></div>'+
'<div class="item-subtitle"><font>'+dataObj[i].introduction+'</font></div>'+
'<div class="item-subtitle"><span><i class="icon icon-eye-orange"></i><label id="visitCount_'+dataObj[i].id+'">'+dataObj[i].visitCount+'人</label>'+
'<i class="icon icon-comments-orange"></i>'+dataObj[i].recommendCommentCount+'条</span></div></div>'+
'<i class="icon icon-comments-orange"></i><label id="visitComment_'+dataObj[i].id+'">'+dataObj[i].recommendCommentCount+'条</span></div></div>'+
'<div class="item-media"><img src='+dataObj[i].coverImg+'></div>'+
'</li></ul></div></div></div>';
}
if(dataObj[i].type=="投票"){
var voteFavorCount = dataObj[i].voteFavorCount;
var voteNoFavorCount = dataObj[i].voteNoFavorCount;
var voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount));
var voteNoFavorCountRate = 100-voteFavorCountRate;
var voteFavorCountRate = 50
var voteNoFavorCountRate = 50
if(voteFavorCount == 0 && voteNoFavorCount==0){
}else{
voteFavorCountRate = Math.round((voteFavorCount*100)/(voteFavorCount+voteNoFavorCount));
voteNoFavorCountRate = 100-voteFavorCountRate;
}
html += '<div class="card cardInfo cardInfo03"><div class="card-header">'+dataObj[i].title+
'</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">'+
'<i class="icon icon-light-red" data-val="'+dataObj[i].id+'"></i><span>'+dataObj[i].voteFavorText+'</span>'+
@@ -1781,7 +1864,6 @@ function addItems(number, lastIndex) {
}
tagStr += '</span></div>';
}
html += '<li>'+
'<a onclick="openUrl(\''+BASE_PATH+'/district/details?city='+dataObj2[i].city+'&region='+dataObj2[i].region+'&name='+dataObj2[i].districtName+'\')" class="external item-content">'+
'<div class="item-inner"><div class="item-title-row"><div class="item-title">'+
@@ -1817,6 +1899,7 @@ function addItems(number, lastIndex) {
// 添加新条目
if(lastIndex2 == 0){
$('.infinite-scroll-bottom .list-container').html(html);
$("#nearDistrictContainer").show();
}else{
$('.infinite-scroll-bottom .list-container').append(html);
}
@@ -1971,17 +2054,23 @@ $(document).on('click','#notFound_btn', function () {
});
/* 获取城市 */
$("body").delegate(".popup-about01 p", "click", function () {
$("#input_city").text($(this).text());
$(".cityChoice a").text($(this).text());
changeCity($(this).text())
});
$("body").delegate(".popup-about01 .cityGPS", "click", function () {
changeCity($(this).find('p')[0].innerHTML)
});
function changeCity(cityStr){
$("#input_city").text(cityStr);
$(".cityChoice a").text(cityStr);
$(".popup-about01 p").removeClass("active");
$(this).addClass("active");
var sort = 1;
city = $(this).text()
if(oriCity== $(this).text()){
city = cityStr
if(oriCity== cityStr){
lat = oriLat;
lng = oriLng;
if($(this).text()=="上海"){
if(cityStr=="上海"){
$("#ShangHaiDiv").show();
$("#otherCityDiv").hide();
//initNearDistricts($(this).text(),lat,lng,"",0,0,0,"");
@@ -1997,7 +2086,7 @@ $("body").delegate(".popup-about01 p", "click", function () {
}else{
lat = 0;
lng = 0;
if($(this).text()=="上海"){
if(cityStr=="上海"){
$("#ShangHaiDiv").show();
$("#otherCityDiv").hide();
//initNews()
@@ -2010,11 +2099,11 @@ $("body").delegate(".popup-about01 p", "click", function () {
}
}
if($(this).text()=="上海"){
if(cityStr=="上海"){
$("#ShangHaiDiv").show();
$("#otherCityDiv").hide();
//initNearDistricts($(this).text(),0,0,"",0,0,0,"");
initBaseInfo($(this).text(),"",address,lat,lng);
initBaseInfo(cityStr,"",address,lat,lng);
}else{
$("#ShangHaiDiv").hide();
$("#otherCityDiv").show();
@@ -2022,24 +2111,23 @@ $("body").delegate(".popup-about01 p", "click", function () {
dataObj2 = {};
$(".infinite-scroll-preloader").show();
$('.infinite-scroll-bottom .list-container').html('');
city = $(this).text();
initRegionSelect($(this).text());
city = cityStr;
initRegionSelect(cityStr);
$(".region a").text('不限');
$("#select_price_div a").text('不限');
//不同城市查询价格区间
getCityPriceLevel($(this).text());
getCityPriceLevel(cityStr);
//加载列表
sort=6;
getDistrictList($(this).text(),lat,lng,"",sort,0,0,"");
initBaseInfo($(this).text(),"","",0,0);
getDistrictList(cityStr,lat,lng,"",sort,0,0,"");
initBaseInfo(cityStr,"","",0,0);
}
$(".selectContent").hide();
//刷新下拉滚动加载事件
$.attachInfiniteScroll($('.infinite-scroll'))
//potenialIndex($(this).text(),sort);
});
}
function req(cityStr){
city=cityStr.replace("<i></i>","")
$("#input_city").text(city);
@@ -2069,7 +2157,7 @@ function req(cityStr){
initRegionSelect(city);
$(".region a").text('不限');
$("#select_price_div a").text('不限');
potenialIndex(city,sort);
//potenialIndex(city,sort);
}
function openUrl(url){
@@ -2317,7 +2405,7 @@ $("#select_order li").on("click", function () {
//查询城市价格区间
function getCityPriceLevel(cityParam){
axios.get(BASE_PATH+"/house/getCityPriceLevel", {
axios.get("/house/getCityPriceLevel", {
params: {
city: cityParam
}
@@ -2395,9 +2483,10 @@ function getCityPriceLevel(cityParam){
}
function getDistrictList(cityParam,latParam,lngParam,regionParam,order,minPrice,maxPrice,tag){
$("#nearDistrictContainer").hide();
latParam=0;
lngParam=0;
axios.get(BASE_PATH+"/rest/index/districtList", {
axios.get("/rest/index/districtList", {
params: {
city: cityParam,
lat:latParam,
@@ -2442,9 +2531,13 @@ function openNewsView(newId) {
}
});
var count = parseInt($("#visitCount_"+newId).text().replace("人",""))+1;
$("#visitCount_"+newId).text(count+'人');
$("#visitCount_"+newId).text(count+'人');
}
window.addEventListener('refresh', function(e){//执行刷新
alert("aa");
});
</script>
<script>
/* 获取附近小区名称字数,截取附近小区名称前5字,并添加... */