Commit 2be53ad8 by felix

每日一更

parent b6aca874
...@@ -5,7 +5,25 @@ class feature ...@@ -5,7 +5,25 @@ class feature
public static function ajax_add_feature() public static function ajax_add_feature()
{ {
$name = $_POST['name']; $name = $_POST['name'];
wp_send_json(feature::add_feature($name)); $array = array();
$result = feature::search_feature($name);
if ($result) {
$array['code'] = 2001;
} else {
feature::add_feature($name);
$array['code'] = 2000;
}
wp_send_json($array);
}
public static function search_feature($name = null)
{
global $wpdb;
$sql = "select id,name from " . Config::TOSPUR_TAG_TABLE . " where type = 1";
if ($name) {
$sql .= " and name = '" . $name . "'";
}
return $wpdb->get_results($sql);
} }
public static function add_feature($name) public static function add_feature($name)
...@@ -18,11 +36,20 @@ class feature ...@@ -18,11 +36,20 @@ class feature
return $result; return $result;
} }
public static function feature_html() public static function add_feature_html()
{ {
$context = array(); $context = array();
$context['url'] = home_url(); $context['url'] = home_url();
Timber::render('feature.html', $context); $context['admin_url'] = admin_url();
Timber::render('add_feature.html', $context);
}
public static function feature_list_html()
{
$context = array();
$context['view'] = plugins_url() . '/tospur/Admin/views';
$context['result'] = feature::search_feature();
Timber::render('feature_list.html', $context);
} }
} }
......
...@@ -260,13 +260,14 @@ add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); ...@@ -260,13 +260,14 @@ add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity'); add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity');
add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity'); add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity');
function newHouseList() function function_newHouseList()
{ {
$contest = array(); $contest = array();
$contest['page'] = $_REQUEST['page']; $contest['page'] = $_REQUEST['page'];
$contest['city'] = SearchDao::searchCity(); $contest['city'] = SearchDao::searchCity();
$contest['status'] = SearchDao::searchStatusType(1); $contest['status'] = SearchDao::searchStatusType(1);
$contest['buildProperty'] = SearchDao::searchBuildProperty(); $contest['buildProperty'] = SearchDao::searchBuildProperty();
$contest['room'] = searchDao::searchRoom();
if(isset($_POST['hasSearch'])){ if(isset($_POST['hasSearch'])){
$contest['district'] = SearchDao::searchCity($_POST['listCity']); $contest['district'] = SearchDao::searchCity($_POST['listCity']);
$contest['plate'] = SearchDao::searchCity($_POST['listCity'],$_POST['listDistrict']); $contest['plate'] = SearchDao::searchCity($_POST['listCity'],$_POST['listDistrict']);
...@@ -275,6 +276,7 @@ function newHouseList() ...@@ -275,6 +276,7 @@ function newHouseList()
$contest['cityId'] = $_POST['listCity']; $contest['cityId'] = $_POST['listCity'];
$contest['districtId'] = $_POST['listDistrict']; $contest['districtId'] = $_POST['listDistrict'];
$contest['plateId' ]= $_POST['listPlate']; $contest['plateId' ]= $_POST['listPlate'];
$contest['roomId']= $_POST['room'];
$contest['buildPropertyId']= $_POST['buildProperty']; $contest['buildPropertyId']= $_POST['buildProperty'];
$contest['totalPrice'] = $_POST['totalPrice']; $contest['totalPrice'] = $_POST['totalPrice'];
$contest['acreage'] = $_POST['acreage']; $contest['acreage'] = $_POST['acreage'];
......
...@@ -31,8 +31,6 @@ class rentHouseList extends WP_List_Table ...@@ -31,8 +31,6 @@ class rentHouseList extends WP_List_Table
case 'decoration': case 'decoration':
case 'age': case 'age':
case 'matching_facilities': case 'matching_facilities':
case 'flat':
case 'suite':
case 'user_id': case 'user_id':
case 'status': case 'status':
default: default:
...@@ -69,8 +67,6 @@ class rentHouseList extends WP_List_Table ...@@ -69,8 +67,6 @@ class rentHouseList extends WP_List_Table
$columns['decoration']= '装修状况'; $columns['decoration']= '装修状况';
$columns['age']= '年代'; $columns['age']= '年代';
$columns['matching_facilities']= '配套设施'; $columns['matching_facilities']= '配套设施';
$columns['flat']= '楼号';
$columns['suite']= '室';
$columns['user_id']= '置业顾问'; $columns['user_id']= '置业顾问';
$columns['status']= '状态'; $columns['status']= '状态';
return $columns; return $columns;
...@@ -90,8 +86,6 @@ class rentHouseList extends WP_List_Table ...@@ -90,8 +86,6 @@ class rentHouseList extends WP_List_Table
'decoration' => array('decoration', false), 'decoration' => array('decoration', false),
'age' => array('age', false), 'age' => array('age', false),
'matching_facilities' => array('matching_facilities', false), 'matching_facilities' => array('matching_facilities', false),
'flat' => array('flat', false),
'suite' => array('suite', false),
'user_id' => array('user_id', false), 'user_id' => array('user_id', false),
'status' => array('status', false) 'status' => array('status', false)
); );
...@@ -192,10 +186,10 @@ class rentHouseList extends WP_List_Table ...@@ -192,10 +186,10 @@ class rentHouseList extends WP_List_Table
); );
$sql = "select * from tospur_house th $sql = "select * from tospur_house th
left join(select user_id as aus_id,house_id from a_house_user where user_type = 1) ahu on th.id = ahu.house_id left join(select user_id as aus_id,house_id,user_type from a_house_user) ahu on th.id = ahu.house_id
left join(select id as consul_id,name as consul_name from tospur_consultant) tc on ahu.aus_id = tc.consul_id left join(select id as consul_id,name as consul_name from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select value,literal from dic_buildproperty) db on th.buildproperty_id = db.value left join(select value,literal from dic_buildproperty) db on th.buildproperty_id = db.value
where 1=1 and house_type=2"; where 1=1 and house_type=2 and ahu.user_type=1";
if($_POST["listCity"]!=0 ){ if($_POST["listCity"]!=0 ){
$sql = $sql." and city_id=".$_POST["listCity"]; $sql = $sql." and city_id=".$_POST["listCity"];
} }
...@@ -234,8 +228,6 @@ class rentHouseList extends WP_List_Table ...@@ -234,8 +228,6 @@ class rentHouseList extends WP_List_Table
'decoration' => $value->decoration, 'decoration' => $value->decoration,
'age' => $value->age, 'age' => $value->age,
'matching_facilities'=> $value->matching_facilities, 'matching_facilities'=> $value->matching_facilities,
'flat' => $value->flat,
'suite' => $value->suite,
'user_id' => $value->consul_name, 'user_id' => $value->consul_name,
); );
...@@ -284,7 +276,7 @@ add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); ...@@ -284,7 +276,7 @@ add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity'); add_action( 'wp_ajax_searchListCity', 'SearchDao::ajax_searchListCity');
add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity'); add_action( 'wp_ajax_nopriv_searchListCity', 'SearchDao::ajax_searchListCity');
function rentHouseList() function function_rentHouseList()
{ {
$contest = array(); $contest = array();
$contest['page'] = $_REQUEST['page']; $contest['page'] = $_REQUEST['page'];
......
...@@ -68,7 +68,7 @@ class SecHandHouse extends Tospur_House{ ...@@ -68,7 +68,7 @@ class SecHandHouse extends Tospur_House{
$context["district"] = SearchDao::searchCity($context['result']->city_id); $context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id); $context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']); $context["mark"] = SearchDao::searchHouseTag($_GET['id']);
$context["featureOld"] = SearchDao::searchFeatureByHouse($_GET['id']);
} }
$context['role'] = SecHandHouse::getCurrentRole(); $context['role'] = SecHandHouse::getCurrentRole();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
......
...@@ -23,14 +23,13 @@ class secHandHouseList extends WP_List_Table ...@@ -23,14 +23,13 @@ class secHandHouseList extends WP_List_Table
case 'name': case 'name':
case 'community_name': case 'community_name':
case 'total_price': case 'total_price':
case 'average_price':
case 'buildproperty_id': case 'buildproperty_id':
case 'covered_area': case 'covered_area':
case 'floor': case 'floor':
case 'faceto': case 'faceto':
case 'decoration': case 'decoration':
case 'age': case 'age':
case 'flat':
case 'suite':
case 'user_id': case 'user_id':
case 'status': case 'status':
default: default:
...@@ -60,14 +59,13 @@ class secHandHouseList extends WP_List_Table ...@@ -60,14 +59,13 @@ class secHandHouseList extends WP_List_Table
$columns['name']= '二手房标题'; $columns['name']= '二手房标题';
$columns['community_name']= '小区名称'; $columns['community_name']= '小区名称';
$columns['total_price']= '总价'; $columns['total_price']= '总价';
$columns['average_price']='单价';
$columns['buildproperty_id']= '户型'; $columns['buildproperty_id']= '户型';
$columns['covered_area']= '面积'; $columns['covered_area']= '面积';
$columns['floor']= '楼层'; $columns['floor']= '楼层';
$columns['faceto']= '朝向'; $columns['faceto']= '朝向';
$columns['decoration']= '装修状况'; $columns['decoration']= '装修状况';
$columns['age']= '年代'; $columns['age']= '年代';
$columns['flat']= '楼号';
$columns['suite']= '室';
$columns['user_id']= '置业顾问'; $columns['user_id']= '置业顾问';
$columns['status']= '状态'; $columns['status']= '状态';
return $columns; return $columns;
...@@ -80,14 +78,13 @@ class secHandHouseList extends WP_List_Table ...@@ -80,14 +78,13 @@ class secHandHouseList extends WP_List_Table
'name' => array('name', false), 'name' => array('name', false),
'community_name' => array('community_name', false), 'community_name' => array('community_name', false),
'total_price' => array('total_price', false), 'total_price' => array('total_price', false),
'average_price' => array('average_price', false),
'buildproperty_id' => array('buildproperty_id', false), 'buildproperty_id' => array('buildproperty_id', false),
'covered_area' => array('covered_area', false), 'covered_area' => array('covered_area', false),
'floor' => array('floor', false), 'floor' => array('floor', false),
'faceto' => array('faceto', false), 'faceto' => array('faceto', false),
'decoration' => array('decoration', false), 'decoration' => array('decoration', false),
'age' => array('age', false), 'age' => array('age', false),
'flat' => array('flat', false),
'suite' => array('suite', false),
'user_id' => array('user_id', false), 'user_id' => array('user_id', false),
'status' => array('status', false) 'status' => array('status', false)
); );
...@@ -159,7 +156,6 @@ class secHandHouseList extends WP_List_Table ...@@ -159,7 +156,6 @@ class secHandHouseList extends WP_List_Table
break; break;
} }
global $wpdb; global $wpdb;
print_r('update tospur_house SET status='.$status .' where id in ' . $string);
$result = $wpdb->query('update tospur_house SET status='.$status .' where id in ' . $string); $result = $wpdb->query('update tospur_house SET status='.$status .' where id in ' . $string);
} }
} }
...@@ -181,10 +177,10 @@ class secHandHouseList extends WP_List_Table ...@@ -181,10 +177,10 @@ class secHandHouseList extends WP_List_Table
//$data = $this->example_data; //$data = $this->example_data;
$sql = "select * from tospur_house th $sql = "select * from tospur_house th
left join(select user_id as aus_id,house_id from a_house_user where user_type = 1) ahu on th.id = ahu.house_id left join(select user_id as aus_id,house_id,user_type from a_house_user) ahu on th.id = ahu.house_id
left join(select id as consul_id,name as consul_name from tospur_consultant) tc on ahu.aus_id = tc.consul_id left join(select id as consul_id,name as consul_name from tospur_consultant) tc on ahu.aus_id = tc.consul_id
left join(select value,literal from dic_buildproperty) db on th.buildproperty_id = db.value left join(select value,literal from dic_buildproperty) db on th.buildproperty_id = db.value
where 1=1 and house_type=1"; where 1=1 and house_type=1 and ahu.user_type=1";
if($_POST["listCity"]!=0 ){ if($_POST["listCity"]!=0 ){
$sql = $sql." and city_id=".$_POST["listCity"]; $sql = $sql." and city_id=".$_POST["listCity"];
} }
...@@ -220,14 +216,13 @@ class secHandHouseList extends WP_List_Table ...@@ -220,14 +216,13 @@ class secHandHouseList extends WP_List_Table
'name' => $value->name, 'name' => $value->name,
'community_name' => $value->community_name, 'community_name' => $value->community_name,
'total_price' => $value->total_price, 'total_price' => $value->total_price,
'average_price'=> $value->average_price,
'buildproperty_id' => $value->literal, 'buildproperty_id' => $value->literal,
'covered_area' => $value->covered_area, 'covered_area' => $value->covered_area,
'floor' => $value->floor, 'floor' => $value->floor,
'faceto' => $value->faceto, 'faceto' => $value->faceto,
'decoration' => $value->decoration, 'decoration' => $value->decoration,
'age' => $value->age, 'age' => $value->age,
'flat' => $value->flat,
'suite' => $value->suite,
'user_id' => $value->consul_name, 'user_id' => $value->consul_name,
); );
if($value->status == 0){ if($value->status == 0){
...@@ -273,7 +268,7 @@ class secHandHouseList extends WP_List_Table ...@@ -273,7 +268,7 @@ class secHandHouseList extends WP_List_Table
add_action( 'wp_ajax_updateList', 'newHouseList::prepare_items'); add_action( 'wp_ajax_updateList', 'newHouseList::prepare_items');
add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items'); add_action( 'wp_ajax_nopriv_updateList', 'newHouseList::prepare_items');
function secHandHouseList() function function_secHandHouseList()
{ {
$contest = array(); $contest = array();
$contest['page'] = $_REQUEST['page']; $contest['page'] = $_REQUEST['page'];
......
<h2>添加特色</h2>
<label for="feature">特色:</label>
<input id="feature" type="text">
<input type="submit" id="submit" class="button">
<script>
var admin_url = '{{ admin_url }}';
(function ($) {
$(document).ready(function () {
$('#submit').click(function () {
var name = $('#feature').val();
if (name.trim() != '') {
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=add_feature&name=' + name,
success: function (data) {
switch (data.code) {
case 2000:
window.location.href = admin_url + 'admin.php?page=feature_list';
break;
case 2001:
alert('不能重复添加特色');
break;
default:
break;
}
}
});
} else {
alert('请输入特色');
}
});
});
})(jQuery);
</script>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<link rel="stylesheet" type="text/css" href="{{ view }}/css/bootstrap.min.css">
<h2>特色列表</h2>
<table class="table">
<thead>
<tr>
<th style="">
<div class="th-inner">ID</div>
<div class="fht-cell"></div>
</th>
<th style="">
<div class="th-inner">名称</div>
<div class="fht-cell"></div>
</th>
</tr>
</thead>
<tbody>
{% for item in result %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
\ No newline at end of file
...@@ -33,12 +33,17 @@ ...@@ -33,12 +33,17 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</select> </select>
<select id="room" name="room">
<option value="0">类型</option>
{% for item in room %}
<option {{ item.id == roomId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<select id="buildProperty" name="buildProperty"> <select id="buildProperty" name="buildProperty">
<option value="0"> 房型</option> <option value="0"> 房型</option>
{% for item in buildProperty %} {% for item in buildProperty %}
<option {{ item.id == buildPropertyId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option> <option {{ item.id == buildPropertyId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </select>
<select id="acreage" name="acreage"> <select id="acreage" name="acreage">
<option value ="">面积</option> <option value ="">面积</option>
...@@ -64,18 +69,6 @@ ...@@ -64,18 +69,6 @@
<script> <script>
(function ($) { (function ($) {
$(document).ready(function(){ $(document).ready(function(){
//获取城市信息AJAX
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
$("#listCity").change(function(){ $("#listCity").change(function(){
var listCityId = $("#listCity").val(); var listCityId = $("#listCity").val();
var district =$("#listDistrict"); var district =$("#listDistrict");
...@@ -83,6 +76,8 @@ ...@@ -83,6 +76,8 @@
var totalPrice = $("#totalPrice"); var totalPrice = $("#totalPrice");
$('#listDistrict').find('option:not(:first-child)').remove(); $('#listDistrict').find('option:not(:first-child)').remove();
$('#listPlate').find('option:not(:first-child)').remove(); $('#listPlate').find('option:not(:first-child)').remove();
$('#acreage').find('option:not(:first-child)').remove();
$('#totalPrice').find('option:not(:first-child)').remove();
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "/tospur/wp-admin/admin-ajax.php", url: "/tospur/wp-admin/admin-ajax.php",
......
...@@ -65,38 +65,6 @@ ...@@ -65,38 +65,6 @@
<script> <script>
(function ($) { (function ($) {
$(document).ready(function(){ $(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){ $("#listCity").change(function(){
var listCityId = $("#listCity").val(); var listCityId = $("#listCity").val();
var district =$("#listDistrict"); var district =$("#listDistrict");
......
...@@ -65,38 +65,6 @@ ...@@ -65,38 +65,6 @@
<script> <script>
(function ($) { (function ($) {
$(document).ready(function(){ $(document).ready(function(){
//获取城市信息AJAX
var listCity = $("#listCity");
var room = $("#room");
var buildProperty =$("#buildProperty");
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=serachCity",
success:function(data){
addOption(data,listCity)
}
})
//获取类型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchRoom",
success:function(data){
addOption(data,room)
}
})
//获取房型信息AJAX
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchBuildProperty",
success:function(data){
addOption(data,buildProperty)
}
})
$("#listCity").change(function(){ $("#listCity").change(function(){
var listCityId = $("#listCity").val(); var listCityId = $("#listCity").val();
var district =$("#listDistrict"); var district =$("#listDistrict");
...@@ -130,7 +98,7 @@ ...@@ -130,7 +98,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "/tospur/wp-admin/admin-ajax.php", url: "/tospur/wp-admin/admin-ajax.php",
data: "action=searchUnitPriceRange&cityId="+listCityId, data: "action=searchTotalPrice&cityId="+listCityId,
success:function(json){ success:function(json){
for(var i = 0; i <=json.length-1; i++){ for(var i = 0; i <=json.length-1; i++){
var id = json[i]["id"]; var id = json[i]["id"];
......
...@@ -207,7 +207,7 @@ class InsertDao{ ...@@ -207,7 +207,7 @@ class InsertDao{
//房源的标签id数组 //房源的标签id数组
$tags_ids = array(); $tags_ids = array();
//查询存在的标签 //查询存在的标签
$sql = "select * from tospur_tag where name in " . $tags_string; $sql = "select * from tospur_tag where name in " . $tags_string." and type=0";
$has_tags_result = $wpdb->get_results($sql); $has_tags_result = $wpdb->get_results($sql);
//排除存在的标签,剩下未有的标签和存在标签id数组 //排除存在的标签,剩下未有的标签和存在标签id数组
foreach ($has_tags_result as $key => $value) { foreach ($has_tags_result as $key => $value) {
......
...@@ -194,7 +194,8 @@ class SearchDao ...@@ -194,7 +194,8 @@ class SearchDao
$addSql = " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value"; $addSql = " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value";
$orderbySql = " order by th.creattime DESC"; $orderbySql = " order by th.creattime DESC";
} }
$sql = "select *,(SELECT GROUP_CONCAT(left(tt.name,3)) from a_house_tag aht". $sql = "select th.id,th.house_type,th.name,th.latest_news,th.address,th.average_price,th.community_name,th.covered_area,th.total_price,th.decoration,th.rent,".
"ti.path,dr.literal,dbp.bp_literal,(SELECT GROUP_CONCAT(left(tt.name,3)) from a_house_tag aht".
" LEFT JOIN tospur_tag tt on tt.id = aht.tag_id". " LEFT JOIN tospur_tag tt on tt.id = aht.tag_id".
" where aht.house_id = th.id) as tags from tospur_house th". " where aht.house_id = th.id) as tags from tospur_house th".
$addSql. $addSql.
...@@ -216,7 +217,11 @@ class SearchDao ...@@ -216,7 +217,11 @@ class SearchDao
} }
if ($array['buildPropertyId'] > -1) { if ($array['buildPropertyId'] > -1) {
$params[] = $array['buildPropertyId']; $params[] = $array['buildPropertyId'];
$sql = $sql . " and buildproperty_id=%d"; if ($array['houseType'] == 0) {
$sql = $sql . " and ada.buildproperty_id=%d";
}else{
$sql = $sql . " and th.buildproperty_id=%d";
}
} }
if ($array['roomId'] > -1) { if ($array['roomId'] > -1) {
$params[] = $array['roomId']; $params[] = $array['roomId'];
...@@ -226,13 +231,17 @@ class SearchDao ...@@ -226,13 +231,17 @@ class SearchDao
$areaArray = explode("-", $array['acreage']); $areaArray = explode("-", $array['acreage']);
$params[] = $areaArray[0]; $params[] = $areaArray[0];
$params[] = $areaArray[1]; $params[] = $areaArray[1];
$sql = $sql . " and covered_area between %d and %d"; if ($array['houseType'] == 0) {
$sql = $sql . " and ada.house_area between %d and %d";
}else{
$sql = $sql . " and covered_area between %d and %d";
}
} }
if ($array['totalPrice'] > -1) { if ($array['totalPrice'] > -1) {
$priceArray = explode("-", $array['totalPrice']); $priceArray = explode("-", $array['totalPrice']);
$params[] = $priceArray[0]; $params[] = $priceArray[0];
$params[] = $priceArray[1]; $params[] = $priceArray[1];
$sql = $sql . " and total_price between %d and %d"; $sql = $sql . " and total_price/10000 between %d and %d";
} }
if ($array['rentalPrice'] > -1) { if ($array['rentalPrice'] > -1) {
$priceArray = explode("-", $array['rentalPrice']); $priceArray = explode("-", $array['rentalPrice']);
...@@ -320,10 +329,18 @@ class SearchDao ...@@ -320,10 +329,18 @@ class SearchDao
return $array; return $array;
} }
public static function searchFeatureByHouse($hid){
global $wpdb;
$featureSql ="select tag_id,name from a_house_tag aht
LEFT JOIN (select id as tid,name ,type from tospur_tag) tt on aht.tag_id = tt.tid where aht.house_id = %d and type = 1";
$feature = $wpdb->get_results($wpdb->prepare($featureSql,$hid));
return $feature;
}
public static function searchFeature() public static function searchFeature()
{ {
$sql = 'select id,name as value from '.Config::TOSPUR_TAG_TABLE.' where type = 1;';
global $wpdb; global $wpdb;
$sql = 'select id,name as value from '.Config::TOSPUR_TAG_TABLE.' where type = 1;';
return $wpdb->get_results($sql); return $wpdb->get_results($sql);
} }
...@@ -353,7 +370,10 @@ class SearchDao ...@@ -353,7 +370,10 @@ class SearchDao
public static function getDetailInfo($hid,$type = NULL){ public static function getDetailInfo($hid,$type = NULL){
global $wpdb; global $wpdb;
$sql = "select * from ".Config::TOSPUR_HOUSE_TABLE." where id = %d"; $sql = "select *,dr.literal as room,db.literal as buildproperty from ".Config::TOSPUR_HOUSE_TABLE." th
left JOIN ".Config::DIC_ROOM_TABLE." dr on th.room_id = dr.id
left JOIN dic_buildproperty db on th.buildproperty_id = db.value
where th.id = %d";
$result = $wpdb->get_row($wpdb->prepare($sql,$hid)); $result = $wpdb->get_row($wpdb->prepare($sql,$hid));
$context = array(); $context = array();
$context['result'] = $result; $context['result'] = $result;
...@@ -425,7 +445,7 @@ class SearchDao ...@@ -425,7 +445,7 @@ class SearchDao
global $wpdb; global $wpdb;
$sql = "select tt.name from a_house_tag aht $sql = "select tt.name from a_house_tag aht
LEFT JOIN tospur_tag tt on aht.tag_id = tt.id LEFT JOIN tospur_tag tt on aht.tag_id = tt.id
where aht.house_id = %d;"; where aht.house_id = %d and type = 0;";
$results = $wpdb->get_results($wpdb->prepare($sql,$houseId)); $results = $wpdb->get_results($wpdb->prepare($sql,$houseId));
$tags = array(); $tags = array();
foreach($results as $item){ foreach($results as $item){
......
...@@ -68,9 +68,11 @@ function tospur_theme_format(){ ...@@ -68,9 +68,11 @@ function tospur_theme_format(){
function tospur_register_script_style(){ function tospur_register_script_style(){
wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js"); wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js");
wp_register_script('validate',plugins_url('Admin/views', __FILE__)."/js/jquery.validate.js");
wp_register_script('bootstrapjs',plugins_url('Admin/views', __FILE__)."/js/bootstrap.min.js"); wp_register_script('bootstrapjs',plugins_url('Admin/views', __FILE__)."/js/bootstrap.min.js");
wp_register_style('jquery-ui_css', plugins_url('Admin/views', __FILE__)."/css/jquery-ui.css"); wp_register_style('jquery-ui_css', plugins_url('Admin/views', __FILE__)."/css/jquery-ui.css");
wp_register_style('bootstrapcss', plugins_url('Admin/views', __FILE__)."/css/bootstrap.css"); wp_register_style('bootstrapcss', plugins_url('Admin/views', __FILE__)."/css/bootstrap.css");
wp_register_style('bootstrapMinCss', plugins_url('Admin/views', __FILE__)."/css/bootstrap.min.css");
} }
function tospur_ajax_set() function tospur_ajax_set()
...@@ -135,12 +137,12 @@ function update_consultant() ...@@ -135,12 +137,12 @@ function update_consultant()
function reset_menu() function reset_menu()
{ {
add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync"); add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync");
add_menu_page('nesHouseList','新房列表', 'moderate_comments', 'newHouseList', 'newHouseList', 'dashicons-menu', 6); add_menu_page('nesHouseList','新房列表', 'moderate_comments', 'newHouseList', 'function_newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', '添加新房', '添加新房', 'moderate_comments', 'newHouse', 'House::init_view'); add_submenu_page('newHouseList', '添加新房', '添加新房', 'moderate_comments', 'newHouse', 'House::init_view');
add_menu_page('secHandHouseList','二手房列表', 'moderate_comments', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7); add_menu_page('secHandHouseList','二手房列表', 'moderate_comments', 'secHandHouseList', 'function_secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'moderate_comments', 'secHandHouse', 'SecHandHouse::secHandHouse_html'); add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'moderate_comments', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
add_submenu_page('secHandHouseList', '添加特色', '添加特色', 'moderate_comments', 'feature', 'feature::feature_html'); add_submenu_page('secHandHouseList', '添加特色', '添加特色', 'moderate_comments', 'feature', 'feature::feature_html');
add_menu_page('rentHouseList','租房列表', 'moderate_comments', 'rentHouseList', 'rentHouseList', 'dashicons-menu', 8); add_menu_page('rentHouseList','租房列表', 'moderate_comments', 'rentHouseList', 'function_rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', '添加租房', '添加租房', 'moderate_comments', 'rentHouse', 'RentHouse::rentHouse_html'); add_submenu_page('rentHouseList', '添加租房', '添加租房', 'moderate_comments', 'rentHouse', 'RentHouse::rentHouse_html');
//移除更新信息 //移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'update_nag', 3 );
......
...@@ -443,10 +443,11 @@ a:hover { ...@@ -443,10 +443,11 @@ a:hover {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.footer .btn { .footer .btn {
width: 45%; width: 94%;
display: block;
color: #ffffff; color: #ffffff;
font-weight: bold; font-weight: bold;
margin: 5px 2%; margin: 5px auto;
padding: 1px; padding: 1px;
background-color: #008cd7; background-color: #008cd7;
border-top-left-radius: 4px; border-top-left-radius: 4px;
......
...@@ -526,8 +526,9 @@ body { ...@@ -526,8 +526,9 @@ body {
margin-right: 5px; margin-right: 5px;
font-size: 14px; font-size: 14px;
} }
.detail_row #wrapper #scroller ul li p img { .detail_row #wrapper #scroller ul li p:nth-child(1) {
width: 100%; height: 70px;
overflow: hidden;
border-top-left-radius: 6px; border-top-left-radius: 6px;
border-top-right-radius: 6px; border-top-right-radius: 6px;
border-bottom-left-radius: 6px; border-bottom-left-radius: 6px;
...@@ -537,6 +538,9 @@ body { ...@@ -537,6 +538,9 @@ body {
-webkit-border-bottom-left-radius: 6px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px; -webkit-border-bottom-right-radius: 6px;
} }
.detail_row #wrapper #scroller ul li p:nth-child(1) img {
height: 100%;
}
.detail_row #wrapper #scroller ul li p em { .detail_row #wrapper #scroller ul li p em {
font-style: normal; font-style: normal;
font-size: 7px; font-size: 7px;
......
wp-content/themes/tospur/img/formBg.jpg

10.2 KB | W: | H:

wp-content/themes/tospur/img/formBg.jpg

6.72 KB | W: | H:

wp-content/themes/tospur/img/formBg.jpg
wp-content/themes/tospur/img/formBg.jpg
wp-content/themes/tospur/img/formBg.jpg
wp-content/themes/tospur/img/formBg.jpg
  • 2-up
  • Swipe
  • Onion skin
wp-content/themes/tospur/img/logo.png

1.25 KB | W: | H:

wp-content/themes/tospur/img/logo.png

1.97 KB | W: | H:

wp-content/themes/tospur/img/logo.png
wp-content/themes/tospur/img/logo.png
wp-content/themes/tospur/img/logo.png
wp-content/themes/tospur/img/logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -48,7 +48,11 @@ function ajaxSendCode(ajaxUrl, self, phone, validate) { ...@@ -48,7 +48,11 @@ function ajaxSendCode(ajaxUrl, self, phone, validate) {
myModal.modal('show'); myModal.modal('show');
break; break;
case 2002: case 2002:
notice.html('<span>此手机号码尚未注册</span>'); if(validate == 1){
notice.html('<span>此手机号码尚未注册</span>');
}else{
notice.html('<span>此手机号码已注册</span>');
}
myModal.modal('show'); myModal.modal('show');
self.bind('click', {ajaxUrl: ajaxUrl, validate: validate}, clickSendCode); self.bind('click', {ajaxUrl: ajaxUrl, validate: validate}, clickSendCode);
break; break;
...@@ -59,6 +63,13 @@ function ajaxSendCode(ajaxUrl, self, phone, validate) { ...@@ -59,6 +63,13 @@ function ajaxSendCode(ajaxUrl, self, phone, validate) {
}); });
} }
function phoneAddValidate(){
var phoneTest=/^(13[0-9]|15[0-35-9]|18[0-9]|14[57]|17[06-8])+\d{8}$/;
$.validator.addMethod("format", function(value, element){
return phoneTest.test(value);
}, '手机号码格式有误');
}
Date.prototype.Format = function (fmt) { Date.prototype.Format = function (fmt) {
var o = { var o = {
"M+": this.getMonth() + 1, "M+": this.getMonth() + 1,
...@@ -80,7 +91,6 @@ Date.prototype.Format = function (fmt) { ...@@ -80,7 +91,6 @@ Date.prototype.Format = function (fmt) {
function scrollPullToRefresh(cb) { function scrollPullToRefresh(cb) {
var pullUpFlag = false; var pullUpFlag = false;
var scroll = new IScroll('#wrapper', { var scroll = new IScroll('#wrapper', {
scrollbars: true,
click: true click: true
}); });
scroll.on("scrollStart", function () { scroll.on("scrollStart", function () {
...@@ -121,7 +131,6 @@ function ajax_get_house(url, loading, ajax_data, context) { ...@@ -121,7 +131,6 @@ function ajax_get_house(url, loading, ajax_data, context) {
if (price.length > 4) { if (price.length > 4) {
price = (price / 10000).toFixed(2) + '万'; price = (price / 10000).toFixed(2) + '万';
} }
div.find('[data-attr=price]').html('<em>' + rent + '</em>/月');
div.find('[data-attr=price]').html('<em>' + price + '</em>/m<em>2</em>'); div.find('[data-attr=price]').html('<em>' + price + '</em>/m<em>2</em>');
} else if (houseType == 1) { } else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name); div.find('[data-attr=community]').text(value.community_name);
......
...@@ -63,9 +63,6 @@ ...@@ -63,9 +63,6 @@
</div> </div>
</div> </div>
<footer class="footer navbar-fixed-bottom"> <footer class="footer navbar-fixed-bottom">
<a class="btn btn-wechat">
<span></span>微信联系
</a>
<a href="tel:{{ consultant_mobile }}" class="btn btn-phone"> <a href="tel:{{ consultant_mobile }}" class="btn btn-phone">
<span></span>电话联系 <span></span>电话联系
</a> </a>
......
...@@ -19,29 +19,29 @@ ...@@ -19,29 +19,29 @@
<script type="text/javascript"> <script type="text/javascript">
var myScroll; var myScroll;
var carouselScroll; var carouselScroll;
window.addEventListener("load",function(){
var bullets = document.getElementById('indicator').getElementsByTagName('li');
window.mySwipe = new Swipe(document.getElementById('slider'), {
auto: 3000,
callback: function(pos) {
var i = bullets.length;
while (i--) {
bullets[i].className = ' ';
}
bullets[pos].className = 'active';
}
});
myScroll = new IScroll('#wrapper', {
eventPassthrough: true,
scrollX: true,
scrollY: false,
preventDefault: false,
click: true
});
},false);
$(document).ready(function(){ $(document).ready(function(){
window.addEventListener("load",function(){
var bullets = document.getElementById('indicator').getElementsByTagName('li');
window.mySwipe = new Swipe(document.getElementById('slider'), {
auto: 3000,
callback: function(pos) {
var i = bullets.length;
while (i--) {
bullets[i].className = ' ';
}
bullets[pos].className = 'active';
}
});
myScroll = new IScroll('#wrapper', {
eventPassthrough: true,
scrollX: true,
scrollY: false,
preventDefault: false,
click: true
});
},false);
$("#slider").bind("tap",function(){ $("#slider").bind("tap",function(){
$("#carouselModal").modal("show"); $("#carouselModal").modal("show");
var carousel = $("#carousel_wrapper"); var carousel = $("#carousel_wrapper");
...@@ -170,8 +170,8 @@ ...@@ -170,8 +170,8 @@
<a class="collapsed" data-toggle="collapse" href="#collapseExample"> <a class="collapsed" data-toggle="collapse" href="#collapseExample">
<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="collapseExample"> <ul class="list-unstyled collapse infoCont" id="collapseExample" style="min-height:60px;display:block;overflow:hidden;height:0;">
<li>户型:{{result.covered_area}}</li> <li>户型:{{result.buildproperty}}</li>
<li>面积:{{result.covered_area}}</li> <li>面积:{{result.covered_area}}</li>
<li>楼层:{{result.floor}}</li> <li>楼层:{{result.floor}}</li>
<li>朝向:{{result.faceto}}</li> <li>朝向:{{result.faceto}}</li>
...@@ -198,58 +198,60 @@ ...@@ -198,58 +198,60 @@
</ul> </ul>
<p class="map"></p> <p class="map"></p>
</div> </div>
<div class="detail_row recommend"> {% if recommends %}
<p class="detail_title">推荐房源</p> <div class="detail_row recommend">
<div class="recommendCont"> <p class="detail_title">推荐房源</p>
{% for item in recommends %} <div class="recommendCont">
<div data-id="{{item.id}}" class="row"> {% for item in recommends %}
<p> <div data-id="{{item.id}}" class="row">
{% if item.path %} <p>
<img src="{{siteUrl}}{{item.path}}"> {% if item.path %}
{% else %} <img src="{{siteUrl}}{{item.path}}">
<img src="{{siteUrl}}/wp-content/themes/tospur/img/img.jpg"> {% else %}
{% endif %} <img src="{{siteUrl}}/wp-content/themes/tospur/img/img.jpg">
</p>
<ul class="list-unstyled">
<li class="multiLine_omit">
{{item.name}}
</li>
<li>{{item.community_name}}</li>
<li>
<span>{{item.value}}</span>
{% if result.house_type == 2 %}
<span>{{item.decoration}}</span>
{% endif %} {% endif %}
<span>{{item.covered_area}}平米</span> </p>
</li> <ul class="list-unstyled">
<li> <li class="multiLine_omit">
{% for tag in item.tags|split(',') %} {{item.name}}
{% if loop.index <=3 %} </li>
<span class="label">{{tag}}</span> <li>{{item.community_name}}</li>
{% endif %} <li>
{% endfor %} <span>{{item.value}}</span>
<span class="pull-right"> {% if result.house_type == 2 %}
{% if result.house_type == 1 %} <span>{{item.decoration}}</span>
<em>
{{(item.total_price/10000)|round(2, 'floor')}}万
</em>
{% elseif result.house_type == 2 %}
<em>
{% if item.rent>=10000 %}
{{(item.rent/10000)|round(2, 'floor')}}万
{% else %}
{{item.rent}}
{% endif %}
/月
</em>
{% endif %} {% endif %}
</span> <span>{{item.covered_area}}平米</span>
</li> </li>
</ul> <li>
{% for tag in item.tags|split(',') %}
{% if loop.index <=3 %}
<span class="label">{{tag}}</span>
{% endif %}
{% endfor %}
<span class="pull-right">
{% if result.house_type == 1 %}
<em>
{{(item.total_price/10000)|round(2, 'floor')}}万
</em>
{% elseif result.house_type == 2 %}
<em>
{% if item.rent>=10000 %}
{{(item.rent/10000)|round(2, 'floor')}}万
{% else %}
{{item.rent}}
{% endif %}
/月
</em>
{% endif %}
</span>
</li>
</ul>
</div>
{% endfor %}
</div> </div>
{% endfor %}
</div> </div>
</div> {% endif %}
{% if consultant[0] %} {% if consultant[0] %}
<footer class="footer navbar-fixed-bottom"> <footer class="footer navbar-fixed-bottom">
<ul class="list-unstyled"> <ul class="list-unstyled">
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
$(document).ready(function () { $(document).ready(function () {
var notice = $('#notice'); var notice = $('#notice');
var myModal = $('#myModal'); var myModal = $('#myModal');
phoneAddValidate();
$('#forgetForm').validate({ $('#forgetForm').validate({
onkeyup: false, onkeyup: false,
onfocusout: false, onfocusout: false,
...@@ -24,13 +25,20 @@ ...@@ -24,13 +25,20 @@
required: true, required: true,
minlength: 11, minlength: 11,
maxlength: 11, maxlength: 11,
digits: true digits: true,
format: true
}, },
code: 'required', code: 'required',
password: 'required' password: 'required'
}, },
messages: { messages: {
phone: '请输入11位手机号', phone: {
required: '请输入11位手机号码',
minlength: '请输入11位手机号码',
maxlength: '请输入11位手机号码',
digits: '手机号码格式有误',
format: '手机号码格式有误'
},
code: '请输入验证码', code: '请输入验证码',
password: '请输入新密码' password: '请输入新密码'
}, },
......
...@@ -282,11 +282,11 @@ ...@@ -282,11 +282,11 @@
var other = $("#other_scroller"); var other = $("#other_scroller");
var other_item = area; var other_item = area;
var roomAndAcreageKey = "id"; var roomAndAcreageKey = "value";
$.each(other_item,function(i,item){ $.each(other_item,function(i,item){
other.append('<a data-id="'+item[roomAndAcreageKey]+'">'+item.value+'</a>'); other.append('<a data-id="'+item[roomAndAcreageKey]+'">'+item.value+'</a>');
}); });
other.attr("type","roomId"); other.attr("type","acreage");
$("#roomId,#acreage,#feature").bind('tap',function(){ $("#roomId,#acreage,#feature").bind('tap',function(){
$(this).parent().children().removeClass('active-bg'); $(this).parent().children().removeClass('active-bg');
$(this).addClass('active-bg'); $(this).addClass('active-bg');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head lang="en"> <head lang="en">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title></title>
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
$(document).ready(function () { $(document).ready(function () {
{% if result %} {% if result %}
var myScroll = new IScroll('#wrapper',{ var myScroll = new IScroll('#wrapper',{
scrollbars: true,
click: true click: true
}); });
$('[data-name=handle]').tap(function () { $('[data-name=handle]').tap(function () {
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
<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 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">
<ul id="tab" class="list-unstyled btn-group-justified tab"> <ul id="tab" class="list-unstyled btn-group-justified tab">
...@@ -106,13 +107,13 @@ ...@@ -106,13 +107,13 @@
<label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label> <label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
<p class="col-xs-7"> <p class="col-xs-7">
<input type="number" class="form-control" data-id="rate" value="5.4"> <input type="number" class="form-control" data-id="rate" value="{{ commerce_rate }}">
</p> </p>
<p class="col-xs-2">%</p> <p class="col-xs-2">%</p>
</li> </li>
</ul> </ul>
<p class="text-right">商业贷款利率5.40%</p> <p class="text-right">商业贷款利率{{ commerce_rate }}%</p>
<input type="submit" value="开始计算" class="btn btn-lg"> <input type="submit" value="开始计算" class="btn btn-lg">
</div> </div>
...@@ -185,13 +186,13 @@ ...@@ -185,13 +186,13 @@
<label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label> <label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
<p class="col-xs-7"> <p class="col-xs-7">
<input type="number" class="form-control" data-id="rate" value="3.5"> <input type="number" class="form-control" data-id="rate" value="{{ accumulationFund_rate }}">
</p> </p>
<p class="col-xs-2">%</p> <p class="col-xs-2">%</p>
</li> </li>
</ul> </ul>
<p class="text-right">公积金贷款利率3.50%</p> <p class="text-right">公积金贷款利率{{ accumulationFund_rate }}%</p>
<input type="submit" value="开始计算" class="btn btn-lg"> <input type="submit" value="开始计算" class="btn btn-lg">
</div> </div>
...@@ -303,13 +304,13 @@ ...@@ -303,13 +304,13 @@
<label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label> <label class="col-xs-3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
<p class="col-xs-7"> <p class="col-xs-7">
<input type="number" class="form-control" data-id="rate" value="5.4"> <input type="number" class="form-control" data-id="rate" value="{{ commerce_rate }}">
</p> </p>
<p class="col-xs-2">%</p> <p class="col-xs-2">%</p>
</li> </li>
</ul> </ul>
<p class="text-right">公积金贷款利率3.50% 商业贷款利率5.40%</p> <p class="text-right">公积金贷款利率{{ accumulationFund_rate }}% 商业贷款利率{{ commerce_rate }}%</p>
<input type="submit" value="开始计算" class="btn btn-lg"> <input type="submit" value="开始计算" class="btn btn-lg">
</div> </div>
</div> </div>
...@@ -354,12 +355,16 @@ ...@@ -354,12 +355,16 @@
<script> <script>
var daikuan_money = 0; var daikuan_money = 0;
var page = 0; var page = 0;
var flag = false;
var tabScroll; var tabScroll;
var resultScroll;
var resultList;
$(document).ready(function () { $(document).ready(function () {
tabScroll = new IScroll('#tabWrapper',{ tabScroll = new IScroll('#tabWrapper',{
click: true click: true
}); });
resultScroll = new IScroll('#wrapper', {
click: true
});
$('#tab a').click(function(){ $('#tab a').click(function(){
tabScroll.scrollTo(0,0); tabScroll.scrollTo(0,0);
setTimeout(function(){ setTimeout(function(){
...@@ -395,20 +400,20 @@ ...@@ -395,20 +400,20 @@
notice.html('请输入利率'); notice.html('请输入利率');
myModal.modal('show'); myModal.modal('show');
} else { } else {
var resultList = $('#result'); resultList = $('#result');
if (tabId == 'combined_loan') { if (tabId == 'combined_loan') {
var accumulationFund_money = Number(tab.find('[data-id=daikuan_money]').val().trim()); var accumulationFund_money = Number(tab.find('[data-id=daikuan_money]').val().trim());
var commerce_money = Number(tab.find('[data-id=commerce_money]').val().trim()); var commerce_money = Number(tab.find('[data-id=commerce_money]').val().trim());
var accumulationFund_year = Number(tab.find('[data-id=accumulationFund_year]').val()); var accumulationFund_year = Number(tab.find('[data-id=accumulationFund_year]').val());
var commerce_year = Number(tab.find('[data-id=commerce_year]').val()); var commerce_year = Number(tab.find('[data-id=commerce_year]').val());
var accumulationFund_result = loan_calc(accumulationFund_money, accumulationFund_year, 3.5); var accumulationFund_result = loan_calc(accumulationFund_money, accumulationFund_year, {{ accumulationFund_rate }});
var commerce_result = loan_calc(commerce_money, commerce_year, rate); var commerce_result = loan_calc(commerce_money, commerce_year, rate);
$('#money').text('贷款总额:' + (accumulationFund_money + commerce_money).toFixed(2) + '万元'); $('#money').text('贷款总额:' + (accumulationFund_money + commerce_money).toFixed(2) + '万元');
$('#acpi_interest').text(Math.round(accumulationFund_result.acpi.interest + commerce_result.acpi.interest)); $('#acpi_interest').text(Math.round(accumulationFund_result.acpi.interest + commerce_result.acpi.interest));
$('#ac_interest').text(Math.round(accumulationFund_result.ac.interest + commerce_result.ac.interest)); $('#ac_interest').text(Math.round(accumulationFund_result.ac.interest + commerce_result.ac.interest));
//公积金按揭年数 > //公积金按揭年数 > 商业贷款按揭年数
if (accumulationFund_result.loan_period >= commerce_result.loan_period) { if (accumulationFund_result.loan_period >= commerce_result.loan_period) {
$('#month').text('贷款月数:' + result.loan_period); $('#month').text('贷款月数:' + accumulationFund_result.loan_period);
$.each(accumulationFund_result.ac.monthlyPayment, function (index, value) { $.each(accumulationFund_result.ac.monthlyPayment, function (index, value) {
var payment = commerce_result.ac.monthlyPayment[index]; var payment = commerce_result.ac.monthlyPayment[index];
var commerce_monthlyPayment = commerce_result.acpi.monthlyPayment; var commerce_monthlyPayment = commerce_result.acpi.monthlyPayment;
...@@ -421,6 +426,7 @@ ...@@ -421,6 +426,7 @@
'<p class="col-xs-4">' + Math.round(value + payment) + '</p></li>'); '<p class="col-xs-4">' + Math.round(value + payment) + '</p></li>');
}); });
} else { } else {
$('#month').text('贷款月数:' + commerce_result.loan_period);
$.each(commerce_result.ac.monthlyPayment, function (index, value) { $.each(commerce_result.ac.monthlyPayment, function (index, value) {
var payment = accumulationFund_result.ac.monthlyPayment[index]; var payment = accumulationFund_result.ac.monthlyPayment[index];
var accumulationFund_monthlyPayment = accumulationFund_result.acpi.monthlyPayment; var accumulationFund_monthlyPayment = accumulationFund_result.acpi.monthlyPayment;
...@@ -447,17 +453,13 @@ ...@@ -447,17 +453,13 @@
'<p class="col-xs-4">' + Math.round(value) + '</p></li>'); '<p class="col-xs-4">' + Math.round(value) + '</p></li>');
}); });
} }
var scroll = new IScroll('#wrapper', { resultScroll.refresh();
scrollbars: true,
click: true
});
page = 1; page = 1;
window.location.href = '#result'; window.location.href = '#result';
PageTransitions.nextPage({ PageTransitions.nextPage({
animation: 1, animation: 1,
showPage: page showPage: page
}); });
flag = true;
} }
return false; return false;
}); });
...@@ -472,6 +474,8 @@ ...@@ -472,6 +474,8 @@
animation: 2, animation: 2,
showPage: page showPage: page
}); });
resultList.html('');
resultScroll.refresh();
} }
}); });
}); });
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
$(document).ready(function () { $(document).ready(function () {
var notice = $('#notice'); var notice = $('#notice');
var myModal = $('#myModal'); var myModal = $('#myModal');
phoneAddValidate();
$('#registerForm').validate({ $('#registerForm').validate({
onkeyup: false, onkeyup: false,
onfocusout: false, onfocusout: false,
...@@ -24,13 +25,20 @@ ...@@ -24,13 +25,20 @@
required: true, required: true,
minlength: 11, minlength: 11,
maxlength: 11, maxlength: 11,
digits: true digits: true,
format: true
}, },
code: 'required', code: 'required',
password: 'required' password: 'required'
}, },
messages: { messages: {
phone: '请输入11位手机号码', phone: {
required: '请输入11位手机号码',
minlength: '请输入11位手机号码',
maxlength: '请输入11位手机号码',
digits: '手机号码格式有误',
format: '手机号码格式有误'
},
code: '请输入验证码', code: '请输入验证码',
password: '请输入密码' password: '请输入密码'
}, },
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
var specified_time; var specified_time;
switch (dayValue) { switch (dayValue) {
case 3: case 3:
specified_time = new Date(ds.Year + '-' + ds.Month + '-' + ds.Day + ' ' + min_time).getTime(); specified_time = new Date(ds.Year + '/' + ds.Month + '/' + ds.Day + ' ' + min_time).getTime();
break; break;
default: default:
specified_time = new Date(date.Format('yyyy-MM-dd') + ' ' + min_time).getTime() + dayValue * 24 * 60 * 60 * 1000; specified_time = new Date(date.Format('yyyy/MM/dd') + ' ' + min_time).getTime() + dayValue * 24 * 60 * 60 * 1000;
break; break;
} }
if (specified_time > date.getTime()) { if (specified_time > date.getTime()) {
......
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