Commit 79910c51 by felix

每日一更

parent 38ca481e
...@@ -19,20 +19,26 @@ class Contract { ...@@ -19,20 +19,26 @@ class Contract {
if($type==1){ if($type==1){
$wpdb->query("START TRANSACTION"); $wpdb->query("START TRANSACTION");
$prefix = "新增"; $prefix = "<h4>新增";
if(isset($_REQUEST["id"])) { if(isset($_REQUEST["id"])) {
$prefix = "修改"; $prefix = "<h4>修改";
} }
$result = Contract::doSqlAction(); $result = Contract::doSqlAction();
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
$context["error"] = $result; $context["error"] = $result;
echo $result; echo $result;
echo $prefix."合同失败"; echo $prefix."合同失败</h4>";
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo $prefix."合同成功"; echo $prefix."合同成功</h4>";
} }
echo "<h4>3秒后自动跳转至合同列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=contractList') . "';
},3000);
</script>";
exit; exit;
}else if(isset($_GET['edit'])){ }else if(isset($_GET['edit'])){
$id = $_REQUEST["id"]; $id = $_REQUEST["id"];
......
...@@ -47,11 +47,11 @@ class House extends Tospur_House{ ...@@ -47,11 +47,11 @@ class House extends Tospur_House{
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array); $result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
echo "<h4>新房房源修改失败</h4>";
print_r($result); print_r($result);
echo "新房房源修改失败";
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "新房房源修改成功"; echo "<h4>新房房源修改成功</h4>";
} }
}else{ }else{
$insert_tospur_house_array["status"] = 0; $insert_tospur_house_array["status"] = 0;
...@@ -59,13 +59,19 @@ class House extends Tospur_House{ ...@@ -59,13 +59,19 @@ class House extends Tospur_House{
$result = House::data_insert($insert_tospur_house_array); $result = House::data_insert($insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
echo "<h4>新房房源新增失败</h4>";
print_r($result); print_r($result);
echo "新增房源失败";
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "新增房源成功"; echo "<h4>新房房源新增成功</h4>";
} }
} }
echo "<h4>3秒后自动跳转至新房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=newHouseList') . "';
},3000);
</script>";
exit; exit;
}else if(isset($_GET['edit'])){ }else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id']; $context['houseId'] = $_GET['id'];
......
...@@ -62,22 +62,28 @@ class customer extends Tospur_House ...@@ -62,22 +62,28 @@ class customer extends Tospur_House
CustomerTrackingDao::insert($_POST['houseId'], $_REQUEST); CustomerTrackingDao::insert($_POST['houseId'], $_REQUEST);
if ($result >= 0) { if ($result >= 0) {
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "修改客源成功"; echo "<h4>修改客源成功</h4>";
} else { } else {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
echo "修改客源失败"; echo "<h4>修改客源失败</h4>";
} }
} else { } else {
$id = CustomerDao::insert_customer($insert_tospur_house_array); $id = CustomerDao::insert_customer($insert_tospur_house_array);
if ($id) { if ($id) {
CustomerTrackingDao::insert($id, $_REQUEST); CustomerTrackingDao::insert($id, $_REQUEST);
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "新增客源成功"; echo "<h4>新增客源成功</h4>";
} else { } else {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
echo "新增客源失败"; echo "<h4>新增客源失败</h4>";
} }
} }
echo "<h4>3秒后自动跳转至客户列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=customerList') . "';
},3000);
</script>";
exit; exit;
} else if (isset($_GET['edit'])) { } else if (isset($_GET['edit'])) {
$context['houseId'] = $_GET['id']; $context['houseId'] = $_GET['id'];
......
...@@ -60,11 +60,11 @@ class RentHouse extends Tospur_House{ ...@@ -60,11 +60,11 @@ class RentHouse extends Tospur_House{
$result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array); $result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
print_r($result);; echo "<h4>租房房源修改失败</h4>";
echo "租房房源修改失败"; print_r($result);
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "租房房源修改成功"; echo "<h4>租房房源修改成功</h4>";
} }
}else { }else {
...@@ -73,13 +73,19 @@ class RentHouse extends Tospur_House{ ...@@ -73,13 +73,19 @@ class RentHouse extends Tospur_House{
$result = RentHouse::rentHouseData_insert($insert_tospur_house_array); $result = RentHouse::rentHouseData_insert($insert_tospur_house_array);
if (!is_numeric($result)) { if (!is_numeric($result)) {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
echo "<h4>租房房源新增失败</h4>";
print_r($result); print_r($result);
echo "租房房源新增失败";
} else { } else {
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "租房房源新增成功"; echo "<h4>租房房源新增成功</h4>";
} }
} }
echo "<h4>3秒后自动跳转至租房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=rentHouseList') . "';
},3000);
</script>";
exit; exit;
}else if(isset($_GET['edit'])){ }else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id']; $context['houseId'] = $_GET['id'];
......
...@@ -60,11 +60,11 @@ class SecHandHouse extends Tospur_House{ ...@@ -60,11 +60,11 @@ class SecHandHouse extends Tospur_House{
$result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array); $result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){ if(!is_numeric($result)){
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
print_r( $result);; echo "<h4>二手房房源修改失败</h4>";
echo "二手房房源修改失败"; print_r($result);
}else{ }else{
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "二手房房源修改成功"; echo "<h4>二手房房源修改成功</h4>";
} }
}else { }else {
...@@ -73,13 +73,19 @@ class SecHandHouse extends Tospur_House{ ...@@ -73,13 +73,19 @@ class SecHandHouse extends Tospur_House{
$result = SecHandHouse::secHouseData_insert($insert_tospur_house_array); $result = SecHandHouse::secHouseData_insert($insert_tospur_house_array);
if (!is_numeric($result)) { if (!is_numeric($result)) {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
print_r( $result);; echo "<h4>二手房房源新增失败</h4>";
echo "二手房房源新增失败"; print_r($result);
} else { } else {
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
echo "二手房房源新增成功"; echo "<h4>二手房房源新增成功</h4>";
} }
} }
echo "<h4>3秒后自动跳转至二手房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=secHandHouseList') . "';
},3000);
</script>";
exit; exit;
}else if(isset($_GET['edit'])){ }else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id']; $context['houseId'] = $_GET['id'];
......
...@@ -252,7 +252,7 @@ class upload ...@@ -252,7 +252,7 @@ class upload
'entrustDay' => $sheet->getCell('B47')->getValue(), 'entrustDay' => $sheet->getCell('B47')->getValue(),
'deadLine' => $sheet->getCell('B48')->getValue(), 'deadLine' => $sheet->getCell('B48')->getValue(),
'mortgage' => $sheet->getCell('B49')->getValue(), 'mortgage' => $sheet->getCell('B49')->getValue(),
'approval' => 1 'approval' => -2
); );
$sql = null; $sql = null;
......
<table class="form-table"> <table class="form-table">
<tbody> <tbody>
<tr> <tr>
<th style="width:11.7%"><label for="periphery" style="margin-left: 30px">置业顾问:</label></th> <th style="width: 63px;box-sizing: content-box;">
<label>置业顾问:</label>
</th>
<td> <td>
<div id="consultantImg"> <div id="consultantImg">
</div> </div>
......
<table class="form-table addBorder"> <table class="form-table" style="margin-bottom: 15px;">
<tbody> <tbody>
<tr> <tr>
<th style="width:20%"><label for="feature" style="margin-left: 45px">特色筛选:</label></th> <td style="width: 75px;padding: 10px 0;">
<label class="control-label">特色筛选:</label>
</td>
<td> <td>
<div id="feature" class="row"> <div id="feature"></div>
</div> </td>
</tr>
<tr>
<td style="display: inline;padding: 10px 0;margin-left: 75px;">
<button type="button" class="button action" id="addFeatureBtn"> <button type="button" class="button action" id="addFeatureBtn">
添加特色 添加特色
</button> </button>
......
<table class="form-table" id="recHouseTable"> <table class="form-table" id="recHouseTable">
<tbody> <tbody>
<tr> <tr>
<th style="width:11.7%"><label for="traffic" style="margin-left: 30px">推荐房源:</label></th> <th style="width: 63px;box-sizing: content-box;">
<label>推荐房源:</label>
</th>
<td> <td>
<div id="houseImg"> <div id="houseImg">
</div> </div>
......
{% block addTag %} {% block addTag %}
<style> <style>
.table td { .table > tbody > tr > td {
text-align: center; text-align: center;
padding: 12px;
border: 0;
}
.table > tbody > tr > td > span {
border-radius: 50px;
border: 1px solid #e5e5e5;
padding: 5px 10px;
}
.table > tbody > tr > td > span:active {
border-color: #1b9af7;
} }
</style> </style>
<!-- 房源特色出层 --> <!-- 房源特色出层 -->
<div class="modal fade" id="houseFeature" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal fade" id="houseFeature" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0; margin: auto;height: 200px;overflow-y: auto;overflow-x: hidden;"> <div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0; margin: auto;height: 232px;overflow-y: auto;overflow-x: hidden;">
<div class="modal-content"> <div class="modal-content">
<div class="row" id="featureTable"> <div class="modal-header">
<div class="col-md-12"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"></h4>
</div>
<div id="featureTable">
<table class="table" id="tagList"> <table class="table" id="tagList">
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<script> <script>
var search_type; var search_type;
var search_callback; var search_callback;
...@@ -35,13 +47,13 @@ ...@@ -35,13 +47,13 @@
if (index % 4 == 0) { if (index % 4 == 0) {
tr = $('<tr>'); tr = $('<tr>');
} }
tr.append('<td id="' + item.id + '">' + item.value + '</td>'); tr.append('<td><span id="' + item.id + '">' + item.value + '</span></td>');
tagList.append(tr); tagList.append(tr);
}); });
} }
}); });
}); });
tagList.on("click", "tr > td", function () { tagList.on("click", "tr > td > span", function () {
search_callback($(this).attr('id'), $(this).text()); search_callback($(this).attr('id'), $(this).text());
}); });
existsCancel(); existsCancel();
...@@ -49,7 +61,10 @@ ...@@ -49,7 +61,10 @@
function init_modal_addTag(type, callback) { function init_modal_addTag(type, callback) {
search_type = type; search_type = type;
search_callback = callback; search_callback = callback;
$('#houseFeature').modal('show'); var houseTag = $('#houseFeature');
var title = (search_type == 0) ? '标签' : '特色';
houseTag.find('h4').text(title);
houseTag.modal('show');
} }
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -12,31 +12,11 @@ p[class^=col-]{ ...@@ -12,31 +12,11 @@ p[class^=col-]{
padding: 0; padding: 0;
} }
#preview,#addPhotos,#recHouseTable,#featureTable,#weixin,#markTable,.addBorder{ #preview,#addPhotos,#recHouseTable{
border-bottom: 1px solid; border-bottom: 1px solid;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
.form-horizontal .form-group{
margin-left:0px;
margin-right:0px;
padding-bottom: 0px;
}
.addBorder{
margin-left:0px;
margin-right:0px;
}
#paidTbody_buy tr,#paidTbody_sell tr{
border-bottom: 1px solid #ddd;
}
.addBorder{
padding-bottom: 10px;
}
#photoTables th,#photoTables td{ #photoTables th,#photoTables td{
text-align: center; text-align: center;
} }
\ No newline at end of file
...@@ -4,6 +4,17 @@ ...@@ -4,6 +4,17 @@
{% set title = houseId?"修改新房房源":"添加新房房源" %} {% set title = houseId?"修改新房房源":"添加新房房源" %}
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
</head> </head>
<body> <body>
<script> <script>
......
<style>
#photoTables > tbody > tr {
border-top: 1px solid #ddd;
}
#photoTables > tbody > tr select {
width: 60px;
margin-left: 30px;
}
</style>
<div id="addPhotos"> <div id="addPhotos">
<div class="row"> <div class="row">
<div class="col-md-2"> <label for="photos" style="float: left;margin-top: 25px;margin-left: 15px;">房源相册:</label>
<label for="photos" style="margin-left: 30px; margin-top: 25px">房源相册:</label> <div class="col-md-7">
</div>
<div class="col-md-10">
<table class="form-table" id="photoTables"> <table class="form-table" id="photoTables">
<thead> <thead>
<tr> <tr>
...@@ -22,7 +29,7 @@ ...@@ -22,7 +29,7 @@
{% set exists_photo_ids = exists_photo_ids~item.image_id %} {% set exists_photo_ids = exists_photo_ids~item.image_id %}
<tr> <tr>
<td> <td>
<select name="exists_photo[{{ item.image_id }}][type]" style="width:38%;margin-left:30px" class="form-control" > <select name="exists_photo[{{ item.image_id }}][type]" class="form-control" >
{% for i in photoType %} {% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option> <option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %} {% endfor %}
...@@ -42,7 +49,7 @@ ...@@ -42,7 +49,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px;margin-left: 225px;margin-bottom: 10px"> <button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-left: 130px;margin-bottom: 20px;clear: both;display: block;">
新增 新增
</button> </button>
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" > <input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
...@@ -56,7 +63,7 @@ ...@@ -56,7 +63,7 @@
$("#housePicture").click(function(){ $("#housePicture").click(function(){
var tr = $("<tr>"); var tr = $("<tr>");
var td = $("<td>"); var td = $("<td>");
var select = $("<select>").attr({"name":"data["+i+"][type]"}).addClass("form-control").css({"width":"38%","margin-left":"30px"}); var select = $("<select>").attr({"name":"data["+i+"][type]"}).addClass("form-control");
{% for item in photoType %} {% for item in photoType %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}')); select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%} {% endfor%}
......
...@@ -4,6 +4,17 @@ ...@@ -4,6 +4,17 @@
{% set title = houseId?"修改租房房源":"添租新房房源" %} {% set title = houseId?"修改租房房源":"添租新房房源" %}
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
</head> </head>
<body> <body>
<script> <script>
......
...@@ -5,6 +5,17 @@ ...@@ -5,6 +5,17 @@
{% set title = houseId?"修改二手房房源":"添加二手房房源" %} {% set title = houseId?"修改二手房房源":"添加二手房房源" %}
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{title}}</title> <title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
<script> <script>
var i = 0; var i = 0;
</script> </script>
......
<div class="row form-group addBorder" > <div class="row form-group">
<div class="col-xs-4"> <div class="col-xs-4">
<label for="housename" class="col-xs-5 control-label" >微信标题:</label> <label for="housename" class="control-label">微信标题:</label>
<p class="col-xs-7"> <p class="col-xs-7">
<input name="housename" id="housename" type="text" value="{{result.name}}" class="form-control" > <input name="housename" id="housename" type="text" value="{{result.name}}" class="form-control" >
</p> </p>
</div> </div>
{% if house_type == 0 %} {% if house_type == 0 %}
<div class="col-xs-4"> <div class="col-xs-4">
<label for="average_price" class="col-xs-5 control-label">均价:</label> <label for="average_price" class="control-label">均价:</label>
<p class="col-xs-6"> <p class="col-xs-6">
<input name="average_price" id="average_price" type="text" value="{{result.average_price}}" class="form-control"> <input name="average_price" id="average_price" type="text" value="{{result.average_price}}" class="form-control">
</p> </p>
...@@ -18,13 +18,18 @@ ...@@ -18,13 +18,18 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
<table class="form-table addBorder"> <table class="form-table" style="margin-bottom: 15px;">
<tbody > <tbody>
<tr> <tr>
<th style="width:20%"><label for="mark" style="margin-left: 72px">标签:</label></th> <td style="width: 75px;padding: 10px 0;">
<label class="control-label">标签:</label>
</td>
<td> <td>
<div id="mark" class="row"> <div id="mark"></div>
</div> </td>
</tr>
<tr>
<td style="display: inline;padding: 10px 0;margin-left: 75px;">
<button type="button" class="button action" id="addTagBtn"> <button type="button" class="button action" id="addTagBtn">
标签 标签
</button> </button>
......
...@@ -7,19 +7,19 @@ $context['url'] = home_url(); ...@@ -7,19 +7,19 @@ $context['url'] = home_url();
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
$user_id = $current_user->ID; $user_id = $current_user->ID;
if ($user_id != 0) { if ($user_id != 0) {
require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php"); $city_id = 2;
if ($_GET['cityId']){
$city_id = $_GET['cityId'];
}
$context['city_id'] = $city_id;
$city = SearchDao::searchCity(); $city = SearchDao::searchCity();
$context['city'] = $city; $context['city'] = $city;
$city_id = $_GET['city_id'];
if (!isset($city_id)) {
$city_id = $city[0]->id;
}
foreach ($city as $value) { foreach ($city as $value) {
if ($value->id == $city_id) { if ($value->id == $city_id) {
$context['city_name'] = $value->value; $context['city_name'] = $value->value;
} }
} }
$context['city_id'] = $city_id;
$context['default_head'] = get_avatar_url(1); $context['default_head'] = get_avatar_url(1);
Timber::render('consultant_list.html', $context); Timber::render('consultant_list.html', $context);
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</div> </div>
<footer class="footer navbar-fixed-bottom"> <footer class="footer navbar-fixed-bottom">
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<a href="tel:{{ consultant_mobile }}" class="btn btn-phone"> <a class="btn btn-phone" id="mobile">
<span></span>电话联系 <span></span>电话联系
</a> </a>
{% if consultant.QRcodeImg %} {% if consultant.QRcodeImg %}
...@@ -96,6 +96,15 @@ ...@@ -96,6 +96,15 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p id="notice">该置业顾问还没有设置电话</p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
<div id="template_0" style="display: none"> <div id="template_0" style="display: none">
<p> <p>
<img src="" data-attr="image"> <img src="" data-attr="image">
...@@ -170,6 +179,15 @@ ...@@ -170,6 +179,15 @@
var loading; var loading;
var score = 0; var score = 0;
$(document).ready(function () { $(document).ready(function () {
var consultant_mobile = '{{ consultant_mobile }}';
var mobile = $('#mobile');
if(consultant_mobile){
mobile.attr('href','tel:'+consultant_mobile);
}else{
mobile.click(function(){
$('#myModal').modal('show');
});
}
$('#score').rating({ $('#score').rating({
min: 0, min: 0,
max: 5, max: 5,
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script src="{{ theme }}/js/iscroll.js"></script> <script src="{{ theme }}/js/iscroll.js"></script>
<script src="{{ theme }}/js/jquery.min.js"></script> <script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.mobile.custom.min.js"></script> <script src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script src="{{ theme }}/js/bootstrap.min.js"></script>
<script src="{{ theme }}/js/star-rating.min.js"></script> <script src="{{ theme }}/js/star-rating.min.js"></script>
<script src="{{ theme }}/js/public.js"></script> <script src="{{ theme }}/js/public.js"></script>
</head> </head>
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
</div> </div>
<p>同策房屋</p> <p>同策房屋</p>
</li> </li>
<li class="col-xs-4"> <li class="col-xs-4" data-id="mobile">
<a class="btn btn-phone" data-attr="mobile"> <a class="btn btn-phone" data-attr="mobile">
<span></span>电话联系 <span></span>电话联系
</a> </a>
...@@ -75,6 +76,15 @@ ...@@ -75,6 +76,15 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p id="notice">该置业顾问还没有设置电话</p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
<script> <script>
var index = 0; var index = 0;
var cityScroll; var cityScroll;
...@@ -86,17 +96,17 @@ ...@@ -86,17 +96,17 @@
loading = $('#loading'); loading = $('#loading');
$('#cityGroup').tap(function () { $('#cityGroup').tap(function () {
var self = $(this); var self = $(this);
if(self.hasClass('open')){ if (self.hasClass('open')) {
self.removeClass('open'); self.removeClass('open');
}else{ } else {
self.addClass('open'); self.addClass('open');
} }
cityScroll.refresh(); cityScroll.refresh();
}); });
cityScroll = new IScroll('#city_wrapper',{ cityScroll = new IScroll('#city_wrapper', {
click: true click: true
}); });
myScroll = scrollPullToRefresh(function(){ myScroll = scrollPullToRefresh(function () {
ajax_get_consultant(); ajax_get_consultant();
}); });
template = $('#template').html(); template = $('#template').html();
...@@ -116,22 +126,29 @@ ...@@ -116,22 +126,29 @@
var div = $('<div>'); var div = $('<div>');
div.append(template); div.append(template);
div.find('[data-attr=name]').text(value.display_name); div.find('[data-attr=name]').text(value.display_name);
div.find('[data-attr=score]').attr('style', 'width: '+ value.average_score*20+'%'); div.find('[data-attr=score]').attr('style', 'width: ' + value.average_score * 20 + '%');
var head = value.imageUrl; var head = value.imageUrl;
if(!head){ if (!head) {
head = '{{ default_head }}'; head = '{{ default_head }}';
} }
div.find('[data-attr=image]').attr('src', head); div.find('[data-attr=image]').attr('src', head);
var infoUrl;
if(value.mobile){ var mobile = div.find('[data-attr=mobile]');
div.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile); if (!value.mobile) {
infoUrl = consultant_info_url + '&consultant_id=' + value.id + '&mobile=' + value.mobile; mobile.attr('disabled', true);
}else{
div.find('[data-attr=mobile]').attr('disabled',true);
infoUrl = consultant_info_url + '&consultant_id=' + value.id;
} }
div.tap(function(e){
window.location.href = infoUrl; mobile.tap(function (e) {
if (value.mobile) {
window.location.href = 'tel:' + value.mobile;
} else {
$('#myModal').modal('show');
}
return false;
});
div.tap(function (e) {
window.location.href = consultant_info_url + '&consultant_id=' + value.id + '&mobile=' + value.mobile;
}); });
$('#scroller').append(div); $('#scroller').append(div);
}); });
......
...@@ -167,8 +167,10 @@ ...@@ -167,8 +167,10 @@
</ul> </ul>
</div> </div>
<div class="detail_row"> <div class="detail_row">
<p class="detail_title">最新动态</p> <a class="collapsed" data-toggle="collapse" href="#latestNews">
<p class="single_omit">{{result.latest_news}}</p> <p class="detail_title">最新动态<span class="pull-right"></span></p>
</a>
<p id="latestNews" style="min-height:20px;display:block;overflow:hidden;height:0;">{{result.latest_news}}</p>
</div> </div>
<div class="detail_row"> <div class="detail_row">
<p class="detail_title">主力户型</p> <p class="detail_title">主力户型</p>
...@@ -203,15 +205,15 @@ ...@@ -203,15 +205,15 @@
<p class="detail_title">基本信息<span class="pull-right"></span></p> <p class="detail_title">基本信息<span class="pull-right"></span></p>
</a> </a>
<ul class="list-unstyled collapse infoCont" id="collapseInfoCont" style="min-height:60px;display:block;overflow:hidden;height:0;"> <ul class="list-unstyled collapse infoCont" id="collapseInfoCont" style="min-height:60px;display:block;overflow:hidden;height:0;">
<li>开发商:<span>{{result.developer}}</span></li> <li>开发商:{{result.developer}}</li>
<li>建筑类型:{{result.room}}</li> <li>建筑类型:{{result.room}}</li>
<li>装修状况:{{result.decoration}}</li> <li>装修状况:{{result.decoration}}</li>
<li>容积率:{{result.volume_rate}}</li> <li>容积率:{{result.volume_rate}}</li>
<li>规划户数:{{result.households}}</li> <li>规划户数:{{result.households}}</li>
<li>物业公司:{{result.property_management}}</li> <li>物业公司:{{result.property_management}}</li>
<li>入住时间:<span>{{result.check_in_time}}</span></li> <li>入住时间:{{result.check_in_time}}</li>
<li>产权年限:{{result.property_age}}</li> <li>产权年限:{{result.property_age}}</li>
<li>建筑面积:{{result.covered_area}}</li> <li>建筑面积:{{result.covered_area}}</li>
<li>绿化率:{{result.greening_rate}}</li> <li>绿化率:{{result.greening_rate}}</li>
<li>车位数:{{result.parking_spaces}}</li> <li>车位数:{{result.parking_spaces}}</li>
<li>物业费:{{result.property_money}}</li> <li>物业费:{{result.property_money}}</li>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
{% for item in result %} {% for item in result %}
<ul class="list-unstyled"> <ul class="list-unstyled">
<li> <li>
<p>楼盘名:{{ item.name }}</p> <p><a href="{{ url }}/?page=detail&hid={{ item.house_id }}">{{ item.name }}</a></p>
<p>预约时间:{{ item.date }} {{ item.time }}</p> <p>预约时间:{{ item.date }} {{ item.time }}</p>
{% if item.user_id %} {% if item.user_id %}
{% if item.handle==0 %} {% if item.handle==0 %}
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<script type="text/javascript" src="{{ theme }}/js/gftools.js"></script> <script type="text/javascript" src="{{ theme }}/js/gftools.js"></script>
</head> </head>
<body> <body>
{% set commerce_rate = 5.15 %} {% set commerce_rate = 4.90 %}
{% set accumulationFund_rate = 3.25 %} {% set accumulationFund_rate = 3.25 %}
<div id="pt-main" class="pt-perspective"> <div id="pt-main" class="pt-perspective">
<div class="pt-page pt-page-1"> <div class="pt-page pt-page-1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment