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-03-30 09:50:20 +08:00
2 changed files with 232 additions and 58 deletions
+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();
+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>