Commit c824ea31 by felix

每日一更

parent 99b3aec2
# BEGIN WordPress # BEGIN WordPress
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
......
...@@ -28,7 +28,7 @@ class newHouseList extends WP_List_Table ...@@ -28,7 +28,7 @@ class newHouseList extends WP_List_Table
case 'average_price': case 'average_price':
case 'developer': case 'developer':
case 'check_in_time': case 'check_in_time':
case 'building_type': case 'room_id':
case 'property_age': case 'property_age':
case 'decoration': case 'decoration':
case 'covered_area': case 'covered_area':
...@@ -65,7 +65,7 @@ class newHouseList extends WP_List_Table ...@@ -65,7 +65,7 @@ class newHouseList extends WP_List_Table
'average_price' => '单价', 'average_price' => '单价',
'developer' => '开发商', 'developer' => '开发商',
'check_in_time' => '入住时间', 'check_in_time' => '入住时间',
'building_type' => '建筑类型', 'room_id' => '建筑类型',
'property_age' => '产权年限', 'property_age' => '产权年限',
'decoration' => '装修状况', 'decoration' => '装修状况',
'covered_area' => '建筑面积', 'covered_area' => '建筑面积',
...@@ -89,7 +89,7 @@ class newHouseList extends WP_List_Table ...@@ -89,7 +89,7 @@ class newHouseList extends WP_List_Table
'average_price' => array('average_price', false), 'average_price' => array('average_price', false),
'developer' => array('developer', false), 'developer' => array('developer', false),
'check_in_time' => array('check_in_time', false), 'check_in_time' => array('check_in_time', false),
'building_type' => array('building_type', false), 'room_id' => array('room_id', false),
'property_age' => array('property_age', false), 'property_age' => array('property_age', false),
'decoration' => array('decoration', false), 'decoration' => array('decoration', false),
'covered_area' => array('covered_area', false), 'covered_area' => array('covered_area', false),
...@@ -166,6 +166,7 @@ class newHouseList extends WP_List_Table ...@@ -166,6 +166,7 @@ class newHouseList extends WP_List_Table
$sql = "select * from tospur_house th $sql = "select * from tospur_house th
left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id
left join (select value as did,literal as room_type from dic_room) dr on dr.did = th.room_id
where 1=1 and house_type=0"; where 1=1 and house_type=0";
if($_POST["listCity"]!=0 ){ if($_POST["listCity"]!=0 ){
$sql = $sql." and city_id=".$_POST["listCity"]; $sql = $sql." and city_id=".$_POST["listCity"];
...@@ -196,7 +197,7 @@ class newHouseList extends WP_List_Table ...@@ -196,7 +197,7 @@ class newHouseList extends WP_List_Table
if($_POST["searchText"]!=NULL){ if($_POST["searchText"]!=NULL){
$sql = $sql . " and name like '%".$_POST['searchText']."%'"; $sql = $sql . " and name like '%".$_POST['searchText']."%'";
} }
$sql = $sql . " group by bph_id"; $sql = $sql . " group by id";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
$data = array(); $data = array();
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
...@@ -207,7 +208,7 @@ class newHouseList extends WP_List_Table ...@@ -207,7 +208,7 @@ class newHouseList extends WP_List_Table
'average_price' => $value->average_price, 'average_price' => $value->average_price,
'developer' => $value->developer, 'developer' => $value->developer,
'check_in_time' => $value->check_in_time, 'check_in_time' => $value->check_in_time,
'building_type' => $value->building_type, 'room_id' => $value->room_type,
'property_age' => $value->property_age, 'property_age' => $value->property_age,
'decoration' => $value->decoration, 'decoration' => $value->decoration,
'covered_area' => $value->covered_area, 'covered_area' => $value->covered_area,
......
...@@ -10,6 +10,7 @@ class RentHouse{ ...@@ -10,6 +10,7 @@ class RentHouse{
global $wpdb; global $wpdb;
$type = $_POST["type"]; $type = $_POST["type"];
$context = array(); $context = array();
$context['siteUrl'] = get_site_url();
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
$insert_tospur_house_array = array( $insert_tospur_house_array = array(
'name' => $_POST['housename'], 'name' => $_POST['housename'],
...@@ -33,6 +34,7 @@ class RentHouse{ ...@@ -33,6 +34,7 @@ class RentHouse{
'traffic' => $_POST['traffic'], 'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'], 'periphery' => $_POST['periphery'],
'status' =>$_POST['status'], 'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"),
'house_type' => 2 'house_type' => 2
); );
if($type==3){ if($type==3){
...@@ -65,6 +67,7 @@ class RentHouse{ ...@@ -65,6 +67,7 @@ class RentHouse{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id'])); $context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$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["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
...@@ -81,82 +84,17 @@ class RentHouse{ ...@@ -81,82 +84,17 @@ class RentHouse{
$uploadedfile = $_FILES['files']; $uploadedfile = $_FILES['files'];
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=2', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=2', OBJECT);
if(!$res){ if(!$res){
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
//主力房源的图片与房子信息关联插入数据库
if(isset($uploadedfile["name"])){
foreach($uploadedfile["name"] as $key=> $value) {
$uploadParam = array(
"name" => $uploadedfile["name"][$key],
"type" => $uploadedfile["type"][$key],
"tmp_name" => $uploadedfile["tmp_name"][$key],
"error" => $uploadedfile["error"][$key],
"size" => $uploadedfile["size"][$key]
);
//因为file提交过来有一个空的数组,所以这里判断在filename不为空的情况下,再做后续操作
if ($uploadParam["name"] != "") {
//上传图片
if (!function_exists('wp_handle_upload')) {
require_once(ABSPATH . 'wp-admin/includes/file.php');
}
$overrides = array('test_form' => false);
$movefile = wp_handle_upload($uploadParam, $overrides);
$str = preg_replace('#^https?://#', '', $movefile["url"]);
$length = strpos($str, "/",strpos($str, "/")+1);
$url = substr($str,$length);
if ($movefile && !isset($movefile['error'])) {
//上传成功后将图片信息存入tospur_image表
$insert_image_array = array(
'name' => $uploadParam["name"],
'path' => $url,
'creattime' => date("Y-m-d H:i:s"),
'alt' => "",
'image_type' =>$data[$key]["type"]
);
//插入图片表
$imgId =InsertDao::insert_tospur_image($insert_image_array);
$house_img_array = array( InsertDao::addMainImage($houseId,$data);
'house_id' => $houseId,
'image_id' => $imgId, InsertDao::addRecommend($houseId,$data);
);
$houseImgRes =InsertDao::insert_a_house_image($house_img_array); InsertDao::addRecConsultant($houseId,$data);
} else {
return $movefile['error']; InsertDao::addHouseTag($_POST['mark'],$houseId);
echo "插入图片失败";
}
}
}
}
//插入推荐房源id与添加新房id到关联表a_house_recommend
if(isset($data["recommend"])){
foreach($data["recommend"] as $value){
$a_house_recommendArray = array(
"house_id" => $houseId,
"recommend_id" =>$value
);
$a_house_recommendRes =InsertDao::insert_a_house_recommend($a_house_recommendArray);
if($a_house_recommendRes == 504){
echo"推荐房源信息插入失败";
}
}
}
//插入推荐置业顾问user_id与新房id到关联表a_house_recommend
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){
$a_house_userArray = array(
"user_id" => $val,
"house_id" => $houseId,
"user_type" =>1
);
$a_house_userRes = InsertDao::insert_a_house_user($a_house_userArray);
if($a_house_userRes == 505){
echo"推荐置业顾问信息插入失败";
}
}
}
}else{ }else{
return 508; return 508;
} }
...@@ -168,36 +106,34 @@ class RentHouse{ ...@@ -168,36 +106,34 @@ class RentHouse{
global $wpdb; global $wpdb;
$data = $_POST["data"]; $data = $_POST["data"];
$res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId)); $res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId));
if($res){ $result = 202;
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){ InsertDao::addMainImage($houseId,$data);
$a_house_userArray = array( $exists_photo_ids = array();
"user_id" => $val, if(isset($_POST['exists_photo'])){
"house_id" => $houseId, foreach($_POST['exists_photo'] as $id => $item){
"user_type" =>1 $wpdb->update(Config::TOSPUR_IMAGE_TABLE,array(
); "image_type" => $item['type'],
$a_house_userRes = $wpdb->update(Config::A_HOUSE_USER_TABLE,$a_house_userArray,array("house_id" => $houseId)); ),array("id" => $id));
if(!$a_house_userRes){ $exists_photo_ids[] = $id;
return 513;
}
}
}
if(isset($data["recommend"])){
$delRes =$wpdb->delete( Config::A_HOUSE_RECOMMEND_TABLE, array( 'house_id'=>$houseId));
if($delRes){
foreach($data["recommend"] as $value){
$a_house_recommendArray = array(
"house_id" => $houseId,
"recommend_id" =>$value
);
$a_house_recommendRes =InsertDao::insert_a_house_recommend($a_house_recommendArray);
}
}
} }
}else{
return 512;
} }
return 202; $old_exists_photo_ids = explode(",",$_POST['exists_photo_ids']);
$delete_photo_ids = array();
foreach(array_diff($old_exists_photo_ids,$exists_photo_ids) as $key => $id){
$delete_photo_ids[] = $id;
}
$delete_photo_ids = implode(",",$delete_photo_ids);
$wpdb->query("delete from ".Config::A_HOUSE_IMAGE_TABLE." where house_id = {$houseId} and image_id in ({$delete_photo_ids});");
$wpdb->delete(Config::A_HOUSE_RECOMMEND_TABLE,array("house_id" => $houseId));
InsertDao::addRecommend($houseId,$data);
$wpdb->delete(Config::A_HOUSE_USER_TABLE,array("house_id" => $houseId));
InsertDao::addRecConsultant($houseId,$data);
InsertDao::addHouseTag($_POST['mark'],$houseId);
return $result;
} }
} }
...@@ -10,6 +10,7 @@ class SecHandHouse{ ...@@ -10,6 +10,7 @@ class SecHandHouse{
global $wpdb; global $wpdb;
$type = $_POST["type"]; $type = $_POST["type"];
$context = array(); $context = array();
$context['siteUrl'] = get_site_url();
$insert_tospur_house_array = array( $insert_tospur_house_array = array(
'name' => $_POST['housename'], 'name' => $_POST['housename'],
'house_number' =>$_POST['house_number'], 'house_number' =>$_POST['house_number'],
...@@ -32,6 +33,7 @@ class SecHandHouse{ ...@@ -32,6 +33,7 @@ class SecHandHouse{
'traffic' => $_POST['traffic'], 'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'], 'periphery' => $_POST['periphery'],
'status' =>$_POST['status'], 'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"),
'house_type' => 1 'house_type' => 1
); );
if($type==2){ if($type==2){
...@@ -51,7 +53,7 @@ class SecHandHouse{ ...@@ -51,7 +53,7 @@ class SecHandHouse{
$result = SecHandHouse::secHouseData_insert($insert_tospur_house_array); $result = SecHandHouse::secHouseData_insert($insert_tospur_house_array);
if ($result != 200) { if ($result != 200) {
$wpdb->query("ROLLBACK"); $wpdb->query("ROLLBACK");
print_r($wpdb->last_error);; print_r($wpdb->last_error);
echo "二手房房源新增失败"; echo "二手房房源新增失败";
} else { } else {
$wpdb->query("COMMIT"); $wpdb->query("COMMIT");
...@@ -64,6 +66,7 @@ class SecHandHouse{ ...@@ -64,6 +66,7 @@ class SecHandHouse{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id'])); $context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$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["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
...@@ -81,81 +84,18 @@ class SecHandHouse{ ...@@ -81,81 +84,18 @@ class SecHandHouse{
//房源与类型以及面积信息 //房源与类型以及面积信息
$data = $_POST["data"]; $data = $_POST["data"];
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE name="'.$params['name'].'" flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=1', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=1', OBJECT);
if(!$res){ if(!$res){
$houseId = InsertDao::insert_tospur_house($params); $houseId = InsertDao::insert_tospur_house($params);
//主力房源的图片与房子信息关联插入数据库
if(isset($uploadedfile["name"])){ InsertDao::addMainImage($houseId,$data);
foreach($uploadedfile["name"] as $key=> $value) {
$uploadParam = array( InsertDao::addRecommend($houseId,$data);
"name" => $uploadedfile["name"][$key],
"type" => $uploadedfile["type"][$key], InsertDao::addRecConsultant($houseId,$data);
"tmp_name" => $uploadedfile["tmp_name"][$key],
"error" => $uploadedfile["error"][$key], InsertDao::addHouseTag($_POST['mark'],$houseId);
"size" => $uploadedfile["size"][$key]
);
//因为file提交过来有一个空的数组,所以这里判断在filename不为空的情况下,再做后续操作
if ($uploadParam["name"] != "") {
//上传图片
if (!function_exists('wp_handle_upload')) {
require_once(ABSPATH . 'wp-admin/includes/file.php');
}
$overrides = array('test_form' => false);
$movefile = wp_handle_upload($uploadParam, $overrides);
$str = preg_replace('#^https?://#', '', $movefile["url"]);
$length = strpos($str, "/",strpos($str, "/")+1);
$url = substr($str,$length);
if ($movefile && !isset($movefile['error'])) {
//上传成功后将图片信息存入tospur_image表
$insert_image_array = array(
'name' => $uploadParam["name"],
'path' => $url,
'creattime' => date("Y-m-d H:i:s"),
'alt' => "",
'image_type' =>$data[$key]["type"]
);
//插入图片表
$imgId =InsertDao::insert_tospur_image($insert_image_array);
$house_img_array = array(
'house_id' => $houseId,
'image_id' => $imgId,
);
$houseImgRes =InsertDao::insert_a_house_image($house_img_array);
} else {
return $movefile['error'];
echo "插入图片失败";
}
}
}
}
//插入推荐房源id与添加新房id到关联表a_house_recommend
if(isset($data["recommend"])){
foreach($data["recommend"] as $value){
$a_house_recommendArray = array(
"house_id" => $houseId,
"recommend_id" =>$value
);
$a_house_recommendRes =InsertDao::insert_a_house_recommend($a_house_recommendArray);
if($a_house_recommendRes == 504){
echo"推荐房源信息插入失败";
}
}
}
//插入推荐置业顾问user_id与新房id到关联表a_house_recommend
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){
$a_house_userArray = array(
"user_id" => $val,
"house_id" => $houseId,
"user_type" =>1
);
$a_house_userRes = InsertDao::insert_a_house_user($a_house_userArray);
if($a_house_userRes == 505){
echo"推荐置业顾问信息插入失败";
}
}
}
}else{ }else{
return 507; return 507;
} }
...@@ -166,38 +106,35 @@ class SecHandHouse{ ...@@ -166,38 +106,35 @@ class SecHandHouse{
global $wpdb; global $wpdb;
$data = $_POST["data"]; $data = $_POST["data"];
$res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId)); $res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId));
if($res){ $result = 201;
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){ InsertDao::addMainImage($houseId,$data);
$a_house_userArray = array(
"user_id" => $val, $exists_photo_ids = array();
"house_id" => $houseId, if(isset($_POST['exists_photo'])){
"user_type" =>1 foreach($_POST['exists_photo'] as $id => $item){
); $wpdb->update(Config::TOSPUR_IMAGE_TABLE,array(
$a_house_userRes = $wpdb->update(Config::A_HOUSE_USER_TABLE,$a_house_userArray,array("house_id" => $houseId)); "image_type" => $item['type'],
if(!$a_house_userRes){ ),array("id" => $id));
return 511; $exists_photo_ids[] = $id;
}
}
}
if(isset($data["recommend"])){
$delRes =$wpdb->delete( Config::A_HOUSE_RECOMMEND_TABLE, array( 'house_id'=>$houseId));
if($delRes){
foreach($data["recommend"] as $value){
$a_house_recommendArray = array(
"house_id" => $houseId,
"recommend_id" =>$value
);
$a_house_recommendRes =InsertDao::insert_a_house_recommend($a_house_recommendArray);
$wpdb->show_errors();
$wpdb->print_error();
}
}
} }
}else{
return 510;
} }
return 201; $old_exists_photo_ids = explode(",",$_POST['exists_photo_ids']);
$delete_photo_ids = array();
foreach(array_diff($old_exists_photo_ids,$exists_photo_ids) as $key => $id){
$delete_photo_ids[] = $id;
}
$delete_photo_ids = implode(",",$delete_photo_ids);
$wpdb->query("delete from ".Config::A_HOUSE_IMAGE_TABLE." where house_id = {$houseId} and image_id in ({$delete_photo_ids});");
$wpdb->delete(Config::A_HOUSE_RECOMMEND_TABLE,array("house_id" => $houseId));
InsertDao::addRecommend($houseId,$data);
$wpdb->delete(Config::A_HOUSE_USER_TABLE,array("house_id" => $houseId));
InsertDao::addRecConsultant($houseId,$data);
InsertDao::addHouseTag($_POST['mark'],$houseId);
return $result;
} }
} }
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td> <td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</tr> </tr>
<tr> <tr>
<th><label for="mark">标签:</label></th>
<td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td>
</tr>
<tr>
<th><label for="community_name">小区名</label></th> <th><label for="community_name">小区名</label></th>
<td> <input name="community_name" id="community_name" type="text" value="{{result.community_name}}" class="regular-text code"></td> <td> <input name="community_name" id="community_name" type="text" value="{{result.community_name}}" class="regular-text code"></td>
</tr> </tr>
...@@ -63,7 +67,7 @@ ...@@ -63,7 +67,7 @@
{% set exists_ids = exists_ids~"," %} {% set exists_ids = exists_ids~"," %}
{% endif %} {% endif %}
{% set exists_ids = exists_ids~item.id %} {% set exists_ids = exists_ids~item.id %}
<div id="exists_{{item.id}}"> <div>
<img src="{{siteUrl}}{{item.path}}" heghit="100" width="100"><br /> <img src="{{siteUrl}}{{item.path}}" heghit="100" width="100"><br />
<select name="exists[{{item.id}}][buildProperty]"> <select name="exists[{{item.id}}][buildProperty]">
{% for i in buildProperty %} {% for i in buildProperty %}
...@@ -171,19 +175,19 @@ ...@@ -171,19 +175,19 @@
<div id="picList"> <div id="picList">
{% set exists_photo_ids = "" %} {% set exists_photo_ids = "" %}
{% for item in images %} {% for item in images %}
{% if exists_photo_ids != "" %} {% if exists_photo_ids != "" %}
{% set exists_photo_ids = exists_photo_ids~"," %} {% set exists_photo_ids = exists_photo_ids~"," %}
{% endif %} {% endif %}
{% set exists_photo_ids = exists_photo_ids~item.id %} {% set exists_photo_ids = exists_photo_ids~item.image_id %}
<p id="exists_photo_{{ item.id }}"> <p>
<select name="exists_photo[{{ item.id }}][type]"> <select name="exists_photo[{{ item.image_id }}][type]">
{% 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 %}
</select> </select>
<img src="{{siteUrl}}{{item.path}}" heghit="100" width="100"> <img src="{{siteUrl}}{{item.path}}" heghit="100" width="100">
<input type="button" value="取消" class="cancel existsCancel"> <input type="button" value="取消" class="cancel existsCancel">
</p> </p>
{% endfor %} {% endfor %}
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" > <input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
</div><br /> </div><br />
...@@ -195,7 +199,15 @@ ...@@ -195,7 +199,15 @@
<tr> <tr>
<th><label for="traffic">推荐房源</label></th> <th><label for="traffic">推荐房源</label></th>
<td> <td>
<div id="houseImg"></div><br /> <div id="houseImg">
{% for item in recommends %}
<p>
<img src="{{siteUrl}}{{item.path}}" height="100" width="100">
<input type="button" value="删除" class="imgCancel existsCancel">
<input type="hidden" name="data[recommend][]" value="{{item.id}}">
</p>
{% endfor %}
</div><br />
<button type="button" class="button action" data-toggle="modal" data-target="#myModal"> <button type="button" class="button action" data-toggle="modal" data-target="#myModal">
添加房源 添加房源
</button> </button>
...@@ -204,7 +216,15 @@ ...@@ -204,7 +216,15 @@
<tr> <tr>
<th><label for="periphery">置业顾问</label></th> <th><label for="periphery">置业顾问</label></th>
<td> <td>
<div id="consultantImg"></div><br /> <div id="consultantImg">
{% for item in consultant %}
<p>
<span>{{item.name}}</span>
<input type="button" value="删除" class="consultantCancel existsCancel">
<input type="hidden" name="data[recConsultant][]" value="{{item.id}}">
</p>
{% endfor %}
</div><br />
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant"> <button type="button" class="button action" data-toggle="modal" data-target="#myConsultant">
选择置业顾问 选择置业顾问
</button> </button>
...@@ -599,7 +619,7 @@ ...@@ -599,7 +619,7 @@
} }
} }
$("#preview,#picList").on("click",".existsCancel",function(){ $("#preview,#picList,#houseImg,#consultantImg").on("click",".existsCancel",function(){
$(this).parent().remove(); $(this).parent().remove();
}); });
}); });
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td> <td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</tr> </tr>
<tr> <tr>
<th><label for="mark">标签:</label></th>
<td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td>
</tr>
<tr>
<th><label for="rent">租金</label></th> <th><label for="rent">租金</label></th>
<td> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="regular-text code"></td> <td> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="regular-text code"></td>
</tr> </tr>
...@@ -71,7 +75,33 @@ ...@@ -71,7 +75,33 @@
<th><label for="overview">房源点评</label></th> <th><label for="overview">房源点评</label></th>
<td> <textarea name="overview" rows="4" cols="40" class="large-text code">{{result.overview}}</textarea></td> <td> <textarea name="overview" rows="4" cols="40" class="large-text code">{{result.overview}}</textarea></td>
</tr> </tr>
<tr>
<th><label for="from">所属地区</label></th>
<td>
<select id="baseCity" name="baseCity">
<option value=""> 城市</option>
{% for item in city %}
<option {{ item.id == result.city_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<select id="baseAreaId" name="baseAreaId">
<option value = "">区域</option>
{% if district %}
{% for item in district %}
<option {{ item.id == result.district_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<select id="basePlateId" name="basePlateId">
<option value = "">板块</option>
{% if district %}
{% for item in plate %}
<option {{ item.id == result.plate_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
</td>
</tr>
</tbody> </tbody>
</table> </table>
<h2 class="title">位置及周边</h2> <h2 class="title">位置及周边</h2>
...@@ -102,7 +132,25 @@ ...@@ -102,7 +132,25 @@
<tr> <tr>
<th><label>房源相册</label></th> <th><label>房源相册</label></th>
<td> <td>
<div id="picList"></div><br /> <div id="picList">
{% set exists_photo_ids = "" %}
{% for item in images %}
{% if exists_photo_ids != "" %}
{% set exists_photo_ids = exists_photo_ids~"," %}
{% endif %}
{% set exists_photo_ids = exists_photo_ids~item.image_id %}
<p>
<select name="exists_photo[{{ item.image_id }}][type]">
{% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %}
</select>
<img src="{{siteUrl}}{{item.path}}" heghit="100" width="100">
<input type="button" value="取消" class="cancel existsCancel">
</p>
{% endfor %}
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
</div><br />
<button type="button" id="housePicture" class="button action" data-toggle="modal"> <button type="button" id="housePicture" class="button action" data-toggle="modal">
新增 新增
</button> </button>
...@@ -120,7 +168,15 @@ ...@@ -120,7 +168,15 @@
<tr> <tr>
<th><label for="consultant">置业顾问</label></th> <th><label for="consultant">置业顾问</label></th>
<td> <td>
<div id="consultantImg"></div><br /> <div id="consultantImg">
{% for item in consultant %}
<p>
<span>{{item.name}}</span>
<input type="button" value="删除" class="consultantCancel existsCancel">
<input type="hidden" name="data[recConsultant][]" value="{{item.id}}">
</p>
{% endfor %}
</div><br />
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant"> <button type="button" class="button action" data-toggle="modal" data-target="#myConsultant">
选择置业顾问 选择置业顾问
</button> </button>
...@@ -327,13 +383,20 @@ ...@@ -327,13 +383,20 @@
data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=2", data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=2",
success:function(json){ success:function(json){
var result = json.result; var result = json.result;
var urlParams = getUrlParmas();
for(var i = 0; i <result.length; i++){ for(var i = 0; i <result.length; i++){
var name = result[i]["name"]; var name = result[i]["name"];
var id = result[i]['id']; var id = result[i]['id'];
var imgUrl = json.images[id]; var imgUrl = json.images[id];
var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100}); var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100});
var li = $("<li>").attr("id",id).addClass("addImg").append(img).append(name); var li = $("<li>").attr("id",id).addClass("addImg").append(img).append(name);
$("#houseList").append(li); if(urlParams["id"]){
if(urlParams["id"]!=id){
$("#houseList").append(li);
}
}else{
$("#houseList").append(li);
}
} }
} }
}); });
...@@ -511,6 +574,21 @@ ...@@ -511,6 +574,21 @@
} }
} }
function getUrlParmas(){
var href = location.search.substr(1,location.search.length-1);
var params = href.split("&");
var map = {};
for(item in params){
var key = params[item].split("=")[0] || "";
var value = params[item].split("=")[1] || "";
map[key] = value;
}
return map;
}
$("#picList,#houseImg,#consultantImg").on("click",".existsCancel",function(){
$(this).parent().remove();
});
}); });
})(jQuery); })(jQuery);
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td> <td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</tr> </tr>
<tr> <tr>
<th><label for="housename">标签:</label></th>
<td> <input name="mark" id="mark" type="text" value="{{mark}}" class="regular-text code"></td>
</tr>
<tr>
<th><label for="total_price">售价</label></th> <th><label for="total_price">售价</label></th>
<td> <input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="regular-text code"></td> <td> <input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="regular-text code"></td>
</tr> </tr>
...@@ -127,16 +131,42 @@ ...@@ -127,16 +131,42 @@
<tr> <tr>
<th><label>房源相册</label></th> <th><label>房源相册</label></th>
<td> <td>
<div id="picList"></div><br /> <div id="picList">
{% set exists_photo_ids = "" %}
{% for item in images %}
{% if exists_photo_ids != "" %}
{% set exists_photo_ids = exists_photo_ids~"," %}
{% endif %}
{% set exists_photo_ids = exists_photo_ids~item.image_id %}
<p>
<select name="exists_photo[{{ item.image_id }}][type]">
{% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %}
</select>
<img src="{{siteUrl}}{{item.path}}" heghit="100" width="100">
<input type="button" value="取消" class="cancel existsCancel">
</p>
{% endfor %}
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
</div><br />
<button type="button" id="housePicture" class="button action" data-toggle="modal"> <button type="button" id="housePicture" class="button action" data-toggle="modal">
新增 新增
</button> </button>
</td> </td>
</tr> </tr>
<tr> <tr>
<th><label for="recommend">推荐房源</label></th> <th><label for="traffic">推荐房源</label></th>
<td> <td>
<div id="houseImg"></div><br /> <div id="houseImg">
{% for item in recommends %}
<p>
<img src="{{siteUrl}}{{item.path}}" height="100" width="100">
<input type="button" value="删除" class="imgCancel existsCancel">
<input type="hidden" name="data[recommend][]" value="{{item.id}}">
</p>
{% endfor %}
</div><br />
<button type="button" class="button action" data-toggle="modal" data-target="#myModal"> <button type="button" class="button action" data-toggle="modal" data-target="#myModal">
添加房源 添加房源
</button> </button>
...@@ -145,7 +175,15 @@ ...@@ -145,7 +175,15 @@
<tr> <tr>
<th><label for="consultant">置业顾问</label></th> <th><label for="consultant">置业顾问</label></th>
<td> <td>
<div id="consultantImg"></div><br /> <div id="consultantImg">
{% for item in consultant %}
<p>
<span>{{item.name}}</span>
<input type="button" value="删除" class="consultantCancel existsCancel">
<input type="hidden" name="data[recConsultant][]" value="{{item.id}}">
</p>
{% endfor %}
</div><br />
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant"> <button type="button" class="button action" data-toggle="modal" data-target="#myConsultant">
选择置业顾问 选择置业顾问
</button> </button>
...@@ -353,13 +391,20 @@ ...@@ -353,13 +391,20 @@
data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=1", data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=1",
success:function(json){ success:function(json){
var result = json.result; var result = json.result;
var urlParams = getUrlParmas();
for(var i = 0; i <result.length; i++){ for(var i = 0; i <result.length; i++){
var name = result[i]["name"]; var name = result[i]["name"];
var id = result[i]['id']; var id = result[i]['id'];
var imgUrl = json.images[id]; var imgUrl = json.images[id];
var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100}); var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100});
var li = $("<li>").attr("id",id).addClass("addImg").append(img).append(name); var li = $("<li>").attr("id",id).addClass("addImg").append(img).append(name);
$("#houseList").append(li); if(urlParams["id"]){
if(urlParams["id"]!=id){
$("#houseList").append(li);
}
}else{
$("#houseList").append(li);
}
} }
} }
}); });
...@@ -537,6 +582,21 @@ ...@@ -537,6 +582,21 @@
} }
} }
function getUrlParmas(){
var href = location.search.substr(1,location.search.length-1);
var params = href.split("&");
var map = {};
for(item in params){
var key = params[item].split("=")[0] || "";
var value = params[item].split("=")[1] || "";
map[key] = value;
}
return map;
}
$("#picList,#houseImg,#consultantImg").on("click",".existsCancel",function(){
$(this).parent().remove();
});
}); });
})(jQuery); })(jQuery);
......
...@@ -6,17 +6,20 @@ class Config { ...@@ -6,17 +6,20 @@ class Config {
const A_HOUSE_IMAGE_TABLE = 'a_house_image'; const A_HOUSE_IMAGE_TABLE = 'a_house_image';
const A_HOUSE_RECOMMEND_TABLE = 'a_house_recommend'; const A_HOUSE_RECOMMEND_TABLE = 'a_house_recommend';
const A_HOUSE_USER_TABLE = 'a_house_user'; const A_HOUSE_USER_TABLE = 'a_house_user';
const A_HOUSE_TAG_TABLE = 'a_house_tag';
const DIC_CITY_TABLE = 'dic_city'; const DIC_CITY_TABLE = 'dic_city';
const DIC_ROOM_TABLE = 'dic_room'; const DIC_ROOM_TABLE = 'dic_room';
const DIC_BUILDPROPERTY_TABLE = 'dic_buildproperty'; const DIC_BUILDPROPERTY_TABLE = 'dic_buildproperty';
const DIC_AREA_TABLE = 'dic_area'; const DIC_AREA_TABLE = 'dic_area';
const DIC_UNITPRICERANGE_TABLE = 'dic_unitpricerange'; const DIC_UNITPRICERANGE_TABLE = 'dic_unitpricerange';
const DIC_TOTALPRICE_TABLE = 'dic_totalprice'; const DIC_TOTALPRICE_TABLE = 'dic_totalprice';
const DIC_RENTALPRICE_TABLE = 'dic_rentalprice';
const DIC_PHOTOTYPE_TABLE = "dic_phototype"; const DIC_PHOTOTYPE_TABLE = "dic_phototype";
const TOSPUR_ORGANIZATION_TABLE = 'tospur_organization'; const TOSPUR_ORGANIZATION_TABLE = 'tospur_organization';
const TOSPUR_CONSULTANT = 'tospur_consultant'; const TOSPUR_CONSULTANT = 'tospur_consultant';
const TOSPUR_HOUSE_TABLE = 'tospur_house'; const TOSPUR_HOUSE_TABLE = 'tospur_house';
const TOSPUR_IMAGE_TABLE = 'tospur_image'; const TOSPUR_IMAGE_TABLE = 'tospur_image';
const TOSPUR_TAG_TABLE = 'tospur_tag';
//sync url //sync url
......
...@@ -63,6 +63,180 @@ class InsertDao{ ...@@ -63,6 +63,180 @@ class InsertDao{
return 505; return 505;
} }
} }
public static function addMainImage($houseId,$data){
global $wpdb;
//图片信息
$uploadedfile = $_FILES['files'];
//主力房源的图片与房子信息关联插入数据库
if(isset($uploadedfile["name"])){
foreach($uploadedfile["name"] as $key=> $value) {
$uploadParam = array(
"name" => $uploadedfile["name"][$key],
"type" => $uploadedfile["type"][$key],
"tmp_name" => $uploadedfile["tmp_name"][$key],
"error" => $uploadedfile["error"][$key],
"size" => $uploadedfile["size"][$key]
);
//因为file提交过来有一个空的数组,所以这里判断在filename不为空的情况下,再做后续操作
if ($uploadParam["name"] != "") {
//上传图片
if (!function_exists('wp_handle_upload')) {
require_once(ABSPATH . 'wp-admin/includes/file.php');
}
$overrides = array('test_form' => false);
$movefile = wp_handle_upload($uploadParam, $overrides);
$str = preg_replace('#^https?://#', '', $movefile["url"]);
$length = strpos($str, "/",strpos($str, "/")+1);
$url = substr($str,$length);
if ($movefile && !isset($movefile['error'])) {
$uploadFileName = end(explode("/",$url));
//上传成功后将图片信息存入tospur_image表
$insert_image_array = array(
'name' => $uploadFileName,
'path' => $url,
'creattime' => date("Y-m-d H:i:s"),
'alt' => "",
'image_type' =>$data[$key]["type"]
);
$imagePath = get_home_path().$url;
Image::makeImage($uploadFileName,$imagePath);
//插入图片表
$imgRes = $wpdb->insert('tospur_image', $insert_image_array);
if (!$imgRes) {
return 501;
}
//获取插入图片的id
$imgid = $wpdb->insert_id;
//房源类型、面积与图片关联表
if($data[$key]["type"] == "0"){
$houseTypeArea = array(
'house_id' => $houseId,
"buildproperty_id" => $data["$key"]["buildProperty"],
"house_area" => $data["$key"]["housearea"],
"image_id" => $imgid
);
$houseTypeAreaRes = $wpdb->insert('a_district_area', $houseTypeArea);
if (!$houseTypeAreaRes) {
return 502;
}
}
//将房源id与图片id储存到关联表中
$house_img_array = array(
'house_id' => $houseId,
'image_id' => $imgid,
);
$houseImgRes = $wpdb->insert('a_house_image', $house_img_array);
if (!$houseImgRes) {
return 503;
}
} else {
return $movefile['error'];
}
}
}
}
}
public static function addRecommend($houseId,$data){
global $wpdb;
if(isset($data["recommend"])){
//插入推荐房源id与添加新房id到关联表a_house_recommend
foreach($data["recommend"] as $value){
$a_house_recommendArray = array(
"house_id" => $houseId,
"recommend_id" =>$value
);
$a_house_recommendRes = $wpdb->insert(Config::A_HOUSE_RECOMMEND_TABLE, $a_house_recommendArray);
if(!$a_house_recommendRes){
return 504;
}
}
}
}
public static function addRecConsultant($houseId,$data){
global $wpdb;
if($data["recConsultant"]){
//插入推荐置业顾问user_id与新房id到关联表a_house_recommend
foreach($data["recConsultant"] as $val){
$a_house_userArray = array(
"user_id" => $val,
"house_id" => $houseId,
"user_type" =>1
);
$a_house_userRes = $wpdb->replace(Config::A_HOUSE_USER_TABLE,$a_house_userArray);
if(!$a_house_userRes){
return 505;
}
}
}
}
public static function addHouseTag($tags, $house_id)
{
global $wpdb;
$arr = array(',' => ',');
$in = explode(',', strtr($tags, $arr));
//string
$tags_string = InsertDao::arrayToString($in);
//房源的标签id数组
$tags_ids = array();
//查询存在的标签
$sql = "select * from tospur_tag where name in " . $tags_string;
$has_tags_result = $wpdb->get_results($sql);
//排除存在的标签,剩下未有的标签和存在标签id数组
foreach ($has_tags_result as $key => $value) {
if (($key = array_search($value->name, $in)) !== false) {
unset($in[$key]);
}
$tags_ids[] = $value->id;
}
//添加未有的标签
foreach ($in as $value) {
$insert = $wpdb->insert(
'tospur_tag',
array(
'name' => $value
)
);
if($insert){
$tags_ids[] = $wpdb->insert_id;
}
}
//删除该房源的标签关联后,添加新的标签关联
$wpdb->delete(
'a_house_tag',
array(
'house_id' => $house_id
)
);
foreach ($tags_ids as $value) {
$wpdb->insert(
'a_house_tag',
array(
'house_id' => $house_id,
'tag_id' => $value
)
);
}
}
public static function arrayToString($array)
{
$string = "(";
$length = count($array);
$i = 0;
foreach ($array as $key => $value) {
$i++;
$string .= "'" . $value . "'";
if ($i != $length) {
$string .= ",";
}
}
$string .= ")";
return $string;
}
} }
......
...@@ -170,7 +170,7 @@ class SearchDao ...@@ -170,7 +170,7 @@ class SearchDao
$buildpropertySql. $buildpropertySql.
" left join dic_city dc on th.plate_id = dc.plateId". " left join dic_city dc on th.plate_id = dc.plateId".
" left join (select id as rid,value as r_value,literal from dic_room) dr on th.room_id = dr.r_value". " left join (select id as rid,value as r_value,literal from dic_room) dr on th.room_id = dr.r_value".
" where 1=1"; " where 1=1 and status = 1";
if ($array['cityId'] > -1) { if ($array['cityId'] > -1) {
$params[] = $array['cityId']; $params[] = $array['cityId'];
$sql = $sql . " and cityId=%d"; $sql = $sql . " and cityId=%d";
...@@ -269,8 +269,7 @@ class SearchDao ...@@ -269,8 +269,7 @@ class SearchDao
$house_id = $value->id; $house_id = $value->id;
$house_ids[] = $house_id; $house_ids[] = $house_id;
} }
$string = '(' . implode(',', array_map('intval', $house_ids)) . ')'; $tag_result = SearchDao::search_house_tag($house_ids);
$tag_result = SearchDao::search_house_tag($string);
//标签 //标签
if ($tag_result) { if ($tag_result) {
foreach ($tag_result as $key => $value) { foreach ($tag_result as $key => $value) {
...@@ -278,7 +277,7 @@ class SearchDao ...@@ -278,7 +277,7 @@ class SearchDao
} }
} }
//图片 //图片
$image_result = SearchDao::search_house_image($string); $image_result = SearchDao::search_house_image($house_ids);
if ($image_result) { if ($image_result) {
foreach ($image_result as $key => $value) { foreach ($image_result as $key => $value) {
$array['images'][$value->house_id] = home_url() . Image::getImage($value->path,'small'); $array['images'][$value->house_id] = home_url() . Image::getImage($value->path,'small');
...@@ -293,18 +292,24 @@ class SearchDao ...@@ -293,18 +292,24 @@ class SearchDao
public static function search_house_image($house_ids) public static function search_house_image($house_ids)
{ {
$sql = 'select ahi.house_id,ti.path from a_house_image ahi' . $string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
' left join tospur_image ti on ahi.image_id = ti.id' . $sql = 'select * from (select ahi.house_id,ti.path,ti.image_type,case ti.image_type ' .
' where ti.image_type in (1,5) and house_id in ' . $house_ids . ' group by house_id'; 'when 1 then 1 ' .
'when 5 then 1 ' .
'ELSE 2 ' .
'end as type from ' . Config::A_HOUSE_IMAGE_TABLE . ' ahi ' .
'left join ' . Config::TOSPUR_IMAGE_TABLE . ' ti on ahi.image_id = ti.id ' .
'where house_id in ' . $string . ' order by type) as image group by house_id;';
global $wpdb; global $wpdb;
return $wpdb->get_results($sql); return $wpdb->get_results($sql);
} }
public static function search_house_tag($house_ids) public static function search_house_tag($house_ids)
{ {
$sql = 'select aht.house_id,tt.name from a_house_tag aht' . $string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
' left join tospur_tag tt on aht.tag_id = tt.id' . $sql = 'select aht.house_id,tt.name from ' . Config::A_HOUSE_TAG_TABLE . ' aht' .
' where house_id in ' . $house_ids; ' left join ' . Config::TOSPUR_TAG_TABLE . ' tt on aht.tag_id = tt.id' .
' where house_id in ' . $string;
global $wpdb; global $wpdb;
return $wpdb->get_results($sql); return $wpdb->get_results($sql);
} }
...@@ -360,19 +365,24 @@ class SearchDao ...@@ -360,19 +365,24 @@ class SearchDao
where ti.image_type in (1,5) and house_id where ti.image_type in (1,5) and house_id
in (select recommend_id from a_house_recommend where house_id = %d) group by house_id"; in (select recommend_id from a_house_recommend where house_id = %d) group by house_id";
$recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid)); $recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid));
if(count($recommends) == 0){
$recommendSql = "select ahi.house_id as id,ti.path from a_house_image ahi
left join tospur_image ti on ahi.image_id = ti.id
where house_id in (select recommend_id from a_house_recommend where house_id = %d) group by house_id";
$recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid));
}
foreach($recommends as $key => $value){ foreach($recommends as $key => $value){
$value->path = Image::getImage($value->path,'small'); $value->path = Image::getImage($value->path,'small');
} }
$context['recommends'] = $recommends; $context['recommends'] = $recommends;
$consultantSql = 'select id,name,mobile,imageUrl,s.average_score from tospur_consultant c $consultantSql = "select id,name,mobile,imageUrl,s.average_score from tospur_consultant c
LEFT JOIN (select consultant_id,sum(score)/count(score) as average_score LEFT JOIN (select consultant_id,sum(score)/count(score) as average_score
from tospur_consultant_score from tospur_consultant_score
where valid=1 group by consultant_id) s on c.id = s.consultant_id where valid=1 group by consultant_id) s on c.id = s.consultant_id
where id in(select user_id from a_house_user where user_type = 1 and house_id = %d limit {$consultantLimit});'; where id in(select user_id from a_house_user where user_type = 1 and house_id = %d) limit {$consultantLimit};";
$consultant = $wpdb->get_results($wpdb->prepare($consultantSql,$hid)); $consultant = $wpdb->get_results($wpdb->prepare($consultantSql,$hid));
$context['consultant'] = $consultant; $context['consultant'] = $consultant;
if($type == 'edit'){ if($type == 'edit'){
$imagesSql = 'select * from a_house_image ahi $imagesSql = 'select * from a_house_image ahi
LEFT JOIN tospur_image ti on ti.id = ahi.image_id LEFT JOIN tospur_image ti on ti.id = ahi.image_id
...@@ -393,69 +403,17 @@ class SearchDao ...@@ -393,69 +403,17 @@ class SearchDao
return $context; return $context;
} }
public static function addHouseTag($tags, $house_id) public static function searchHouseTag($houseId){
{
global $wpdb; global $wpdb;
$arr = array(',' => ','); $sql = "select tt.name from a_house_tag aht
$in = explode(',', strtr($tags, $arr)); LEFT JOIN tospur_tag tt on aht.tag_id = tt.id
//string where aht.house_id = %d;";
$tags_string = SearchDao::arrayToString($in); $results = $wpdb->get_results($wpdb->prepare($sql,$houseId));
//房源的标签id数组 $tags = array();
$tags_ids = array(); foreach($results as $item){
//查询存在的标签 $tags[] =$item->name;
$sql = "select * from tospur_tag where name in " . $tags_string;
$has_tags_result = $wpdb->get_results($sql);
//排除存在的标签,剩下未有的标签和存在标签id数组
foreach ($has_tags_result as $key => $value) {
if (($key = array_search($value->name, $in)) !== false) {
unset($in[$key]);
}
$tags_ids[] = $value->id;
}
//添加未有的标签
foreach ($in as $value) {
$insert = $wpdb->insert(
'tospur_tag',
array(
'name' => $value
)
);
if($insert){
$tags_ids[] = $wpdb->insert_id;
}
}
//删除该房源的标签关联后,添加新的标签关联
$wpdb->delete(
'a_house_tag',
array(
'house_id' => $house_id
)
);
foreach ($tags_ids as $value) {
$wpdb->insert(
'a_house_tag',
array(
'house_id' => $house_id,
'tag_id' => $value
)
);
}
}
public static function arrayToString($array)
{
$string = "(";
$length = count($array);
$i = 0;
foreach ($array as $key => $value) {
$i++;
$string .= "'" . $value . "'";
if ($i != $length) {
$string .= ",";
}
} }
$string .= ")"; return implode(",",$tags);
return $string;
} }
} }
\ No newline at end of file
...@@ -94,9 +94,13 @@ class TCSync { ...@@ -94,9 +94,13 @@ class TCSync {
foreach($result['data']['UnitPriceRange'] as $item){ foreach($result['data']['UnitPriceRange'] as $item){
$wpdb->query(TCSync::create_insert_update_sql(Config::DIC_UNITPRICERANGE_TABLE,$item,array('id'),array('maxValue'=>'max','minValue'=>'min'))); $wpdb->query(TCSync::create_insert_update_sql(Config::DIC_UNITPRICERANGE_TABLE,$item,array('id'),array('maxValue'=>'max','minValue'=>'min')));
//print_r(TCSync::create_insert_update_sql(Config::DIC_AREA,$item,array('id'),array('maxValue'=>'max','minValue'=>'min')));print_r("<br />"); //print_r(TCSync::create_insert_update_sql(Config::DIC_UNITPRICERANGE_TABLE,$item,array('id'),array('maxValue'=>'max','minValue'=>'min')));print_r("<br />");
} }
foreach($result['data']['RentalPrice'] as $item){
$wpdb->query(TCSync::create_insert_update_sql(Config::DIC_RENTALPRICE_TABLE,$item,array('id'),array('maxValue'=>'max','minValue'=>'min')));
//print_r(TCSync::create_insert_update_sql(Config::DIC_RENTALPRICE_TABLE,$item,array('id'),array('maxValue'=>'max','minValue'=>'min')));print_r("<br />");
}
} }
} }
......
...@@ -19,6 +19,8 @@ function tospur_init() ...@@ -19,6 +19,8 @@ function tospur_init()
require_once(PLUGIN_DIR . 'Admin/newHouseList.php'); require_once(PLUGIN_DIR . 'Admin/newHouseList.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouse.php'); require_once(PLUGIN_DIR . 'Admin/secHandHouse.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouseList.php'); require_once(PLUGIN_DIR . 'Admin/secHandHouseList.php');
require_once(PLUGIN_DIR . 'Admin/rentHouse.php');
require_once(PLUGIN_DIR . 'Admin/rentHouseList.php');
require_once('consultant_score.php'); require_once('consultant_score.php');
require_once('view_house.php'); require_once('view_house.php');
add_action('admin_menu', 'reset_menu'); add_action('admin_menu', 'reset_menu');
...@@ -133,6 +135,8 @@ function reset_menu() ...@@ -133,6 +135,8 @@ function reset_menu()
add_submenu_page('newHouseList', 'newHouse_title', '添加新房', 'activate_plugins', 'newHouse', 'House::init_view'); add_submenu_page('newHouseList', 'newHouse_title', '添加新房', 'activate_plugins', 'newHouse', 'House::init_view');
add_menu_page('secHandHouseList','二手房列表', 'activate_plugins', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7); add_menu_page('secHandHouseList','二手房列表', 'activate_plugins', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', 'newHouse_title', '添加二手房', 'activate_plugins', 'secHandHouse', 'SecHandHouse::secHandHouse_html'); add_submenu_page('secHandHouseList', 'newHouse_title', '添加二手房', 'activate_plugins', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
add_menu_page('rentHouseList','租房列表', 'activate_plugins', 'rentHouseList', 'rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', 'rentHouse_title', '添加租房', 'activate_plugins', 'rentHouse', 'RentHouse::rentHouse_html');
//移除更新信息 //移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'update_nag', 3 );
global $menu; global $menu;
...@@ -168,7 +172,7 @@ function reset_menu() ...@@ -168,7 +172,7 @@ function reset_menu()
function do_sync() function do_sync()
{ {
TCSync::user_sync(); //TCSync::user_sync();
TCSync::organization_sync(); //TCSync::organization_sync();
TCSync::other_sync(); TCSync::other_sync();
} }
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -340,7 +271,7 @@ a:hover { ...@@ -340,7 +271,7 @@ a:hover {
} }
#wrapper #scroller ul { #wrapper #scroller ul {
margin-bottom: 0; margin-bottom: 0;
padding: 0 15px; padding: 0 10px;
} }
#wrapper #scroller ul li { #wrapper #scroller ul li {
color: #636363; color: #636363;
...@@ -378,14 +309,23 @@ a:hover { ...@@ -378,14 +309,23 @@ a:hover {
line-height: 60px; line-height: 60px;
color: #959595; color: #959595;
font-size: 22px; font-size: 22px;
border-top: 1px solid #7d7d7d; border-top: 1px solid #959595;
} }
.modal .modal-booking .modal-content ul li .iconfont { .modal .modal-booking .modal-content ul li .iconfont {
color: #008cd7; color: #008cd7;
font-size: 18px; font-size: 18px;
position: absolute;
right: 20px;
} }
.modal .modal-booking .modal-content ul li .iconfont:after { .modal .modal-booking .modal-content ul li .iconfont:after {
content: "\e603"; content: "\e603";
position: absolute; }
right: 20px; .modal .modal-booking .modal-content ul li:last-child:active {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
}
.modal .modal-booking .modal-content ul li:active {
background-color: #e9e9e9;
} }
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -405,14 +336,14 @@ a:hover { ...@@ -405,14 +336,14 @@ a:hover {
} }
#wrapper #scroller .row p img { #wrapper #scroller .row p img {
height: 100%; height: 100%;
border-top-left-radius: 5px; border-top-left-radius: 6px;
border-top-right-radius: 5px; border-top-right-radius: 6px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 6px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 6px;
} }
#wrapper #scroller .row ul { #wrapper #scroller .row ul {
height: 100%; height: 100%;
...@@ -431,10 +362,16 @@ a:hover { ...@@ -431,10 +362,16 @@ a:hover {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
#wrapper #scroller .row ul li span {
margin-right: 15px;
}
#wrapper #scroller .row ul li span:last-child {
margin-right: 0;
}
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
margin-top: 2px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000; color: #000000;
...@@ -455,6 +392,14 @@ a:hover { ...@@ -455,6 +392,14 @@ a:hover {
border: 1px solid #acacac; border: 1px solid #acacac;
margin: 0 5px 0 0; margin: 0 5px 0 0;
vertical-align: middle; vertical-align: middle;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
} }
#wrapper #scroller .row ul li:last-child span { #wrapper #scroller .row ul li:last-child span {
color: #000000; color: #000000;
...@@ -482,9 +427,8 @@ a:hover { ...@@ -482,9 +427,8 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2), #wrapper #scroller .row:active {
#wrapper #scroller .row ul li span:nth-child(3) { background-color: #e9e9e9;
margin-left: 15px;
} }
.footer { .footer {
width: 100%; width: 100%;
...@@ -493,9 +437,10 @@ a:hover { ...@@ -493,9 +437,10 @@ a:hover {
} }
.footer .btn { .footer .btn {
width: 45%; width: 45%;
color: #ffffff;
font-weight: bold;
margin: 5px 2%; margin: 5px 2%;
padding: 1px; padding: 1px;
color: #ffffff;
background-color: #008cd7; background-color: #008cd7;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
...@@ -508,6 +453,9 @@ a:hover { ...@@ -508,6 +453,9 @@ a:hover {
box-shadow: 0 2px 0 0 #117bb9; box-shadow: 0 2px 0 0 #117bb9;
-webkit-box-shadow: 0 2px 0 0 #117bb9; -webkit-box-shadow: 0 2px 0 0 #117bb9;
} }
.footer .btn:active {
background-color: #117bb9;
}
.footer .btn.btn-wechat span { .footer .btn.btn-wechat span {
width: 30px; width: 30px;
height: 30px; height: 30px;
......
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -332,7 +263,7 @@ a:hover { ...@@ -332,7 +263,7 @@ a:hover {
} }
body { body {
height: auto; height: auto;
padding-bottom: 45px; padding-bottom: 50px;
} }
.collect { .collect {
position: fixed; position: fixed;
...@@ -504,14 +435,14 @@ body { ...@@ -504,14 +435,14 @@ body {
} }
.detail_row #wrapper #scroller ul li p img { .detail_row #wrapper #scroller ul li p img {
width: 100%; width: 100%;
border-top-left-radius: 5px; border-top-left-radius: 6px;
border-top-right-radius: 5px; border-top-right-radius: 6px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 6px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 6px;
} }
.detail_row #wrapper #scroller ul li:last-child { .detail_row #wrapper #scroller ul li:last-child {
margin-right: 0; margin-right: 0;
...@@ -524,6 +455,10 @@ body { ...@@ -524,6 +455,10 @@ body {
height: 40px; height: 40px;
text-align: center; text-align: center;
} }
.detail_row .map:active {
transform: scale(1.1);
-webkit-transform: scale(1.1);
}
.detail_row .map span { .detail_row .map span {
width: 30px; width: 30px;
height: 30px; height: 30px;
...@@ -552,14 +487,14 @@ body { ...@@ -552,14 +487,14 @@ body {
background-position: center; background-position: center;
background-size: auto 100%; background-size: auto 100%;
-webkit-background-size: auto 100%; -webkit-background-size: auto 100%;
border-top-left-radius: 5px; border-top-left-radius: 6px;
border-top-right-radius: 5px; border-top-right-radius: 6px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 6px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 6px;
} }
.detail_row .peopleCont li { .detail_row .peopleCont li {
width: 100%; width: 100%;
...@@ -569,6 +504,9 @@ body { ...@@ -569,6 +504,9 @@ body {
.detail_row .peopleCont li ol { .detail_row .peopleCont li ol {
padding: 0; padding: 0;
} }
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.detail_row .peopleCont li ol img { .detail_row .peopleCont li ol img {
width: 50px; width: 50px;
border-top-left-radius: 3px; border-top-left-radius: 3px;
...@@ -628,18 +566,17 @@ body { ...@@ -628,18 +566,17 @@ body {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.footer { .footer {
width: 100%; width: 100%;
height: 45px; height: 50px;
background-color: rgba(125, 125, 125, 0.9); background-color: rgba(125, 125, 125, 0.9);
} }
.footer .btn { .footer > .btn {
width: 45%; width: 45%;
margin: 5px 2%;
color: #ffffff; color: #ffffff;
font-weight: bold;
margin: 5px 2%;
padding: 6px 12px;
background-color: #008cd7; background-color: #008cd7;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
...@@ -652,42 +589,88 @@ body { ...@@ -652,42 +589,88 @@ body {
box-shadow: 0 2px 0 0 #117bb9; box-shadow: 0 2px 0 0 #117bb9;
-webkit-box-shadow: 0 2px 0 0 #117bb9; -webkit-box-shadow: 0 2px 0 0 #117bb9;
} }
.footer > .btn:active {
background-color: #117bb9;
}
.footer ul { .footer ul {
height: 100%; height: 100%;
margin-bottom: 0; margin-bottom: 0;
font-size: 0;
} }
.footer ul li { .footer ul li {
width: 60px;
height: 100%; height: 100%;
padding: 0; padding-right: 0;
color: #ffffff; color: #000000;
font-size: 10px;
} }
.footer ul li p { .footer ul li img {
margin-bottom: 0; width: 50px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
}
.footer ul li div {
height: 25px;
}
.footer ul li div span {
font-size: 18px;
font-weight: bold;
}
.footer ul li:nth-child(1) {
top: -5px;
}
.footer ul li:nth-child(3) {
font-size: 0;
}
.footer ul li:nth-child(3) .btn {
width: 50%;
height: 100%;
color: #ffffff;
font-size: 12px;
margin: 0;
padding: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
} }
.footer ul li.phone { .footer ul li:nth-child(3) .btn.btn-phone {
background-color: #0caae5; background-color: #0caae5;
} }
.footer ul li.phone p:nth-child(1) { .footer ul li:nth-child(3) .btn.btn-phone span {
width: 100%; display: block;
}
.footer ul li:nth-child(3) .btn.btn-phone span:nth-child(1) {
width: 30px;
height: 30px; height: 30px;
background: url("../img/white_phone_icon.png") no-repeat; background: url("../img/white_phone_icon.png") no-repeat;
background-size: auto 100%; background-size: cover;
-webkit-background-size: auto 100%; -webkit-background-size: cover;
background-position: center; margin: 0 auto;
} }
.footer ul li.wechat { .footer ul li:nth-child(3) .btn.btn-wechat {
background-color: #00a99d; background-color: #00a99d;
} }
.footer ul li.wechat p:nth-child(1) { .footer ul li:nth-child(3) .btn.btn-wechat span {
width: 100%; display: block;
}
.footer ul li:nth-child(3) .btn.btn-wechat span:nth-child(1) {
width: 30px;
height: 30px; height: 30px;
background: url("../img/white_wechat_icon.png") no-repeat; background: url("../img/white_wechat_icon.png") no-repeat;
background-size: auto 100%; background-size: cover;
-webkit-background-size: auto 100%; -webkit-background-size: cover;
background-position: center; margin: 0 auto;
}
.footer ul li:nth-child(3) .btn:active {
background-color: #898989;
} }
.modal #carousel_wrapper { .modal #carousel_wrapper {
width: 100%; width: 100%;
......
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -437,10 +368,16 @@ a:hover { ...@@ -437,10 +368,16 @@ a:hover {
-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-right-radius: 4px;
pointer-events: auto; pointer-events: auto;
} }
.container-fluid form .has-feedback.code .form-control-feedback:active {
background-color: #088aa9;
}
.container-fluid form .btn { .container-fluid form .btn {
font-size: 22px;
display: block;
color: #ffffff; color: #ffffff;
font-weight: bold;
margin: 12% 0 5%; margin: 12% 0 5%;
padding: 16px; padding: 14px;
background-color: #008cd7; background-color: #008cd7;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
...@@ -453,6 +390,9 @@ a:hover { ...@@ -453,6 +390,9 @@ a:hover {
box-shadow: 0 2px 0 0 #117bb9; box-shadow: 0 2px 0 0 #117bb9;
-webkit-box-shadow: 0 2px 0 0 #117bb9; -webkit-box-shadow: 0 2px 0 0 #117bb9;
} }
.container-fluid form .btn:active {
background-color: #117bb9;
}
.container-fluid form .btn.btn-register { .container-fluid form .btn.btn-register {
margin-top: 20%; margin-top: 20%;
} }
...@@ -469,6 +409,12 @@ a:hover { ...@@ -469,6 +409,12 @@ a:hover {
margin: 0 5px; margin: 0 5px;
background-color: rgba(255, 255, 255, 0.4); background-color: rgba(255, 255, 255, 0.4);
} }
.container-fluid form a:active {
color: #636363;
}
.container-fluid form a:active span {
background-color: #636363;
}
.container-fluid form a.link-register { .container-fluid form a.link-register {
margin-top: 30%; margin-top: 30%;
padding-bottom: 25px; padding-bottom: 25px;
......
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -330,16 +261,95 @@ body { ...@@ -330,16 +261,95 @@ body {
a:hover { a:hover {
text-decoration: none; text-decoration: none;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
position: relative;
top: -2px;
left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.search .has-feedback { .search .has-feedback {
width: 75%; width: 75%;
} }
.search .has-feedback .form-control { .search .has-feedback .form-control {
color: #b7b7b7; color: #acacac;
border-color: #117bb9; border-color: #117bb9;
-webkit-appearance: none; -webkit-appearance: none;
} }
.search .has-feedback .form-control::-webkit-input-placeholder { .search .has-feedback .form-control::-webkit-input-placeholder {
color: #b7b7b7; color: #acacac;
} }
.search .has-feedback .form-control-feedback { .search .has-feedback .form-control-feedback {
top: 3px; top: 3px;
...@@ -384,12 +394,12 @@ a:hover { ...@@ -384,12 +394,12 @@ a:hover {
color: #b7b7b7; color: #b7b7b7;
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;
margin-left: 5px; position: relative;
top: -2px;
left: 5px;
} }
.btn-group-justified .btn-group .btn .iconfont:after { .btn-group-justified .btn-group .btn .iconfont:after {
content: "\e601"; content: "\e601";
position: relative;
top: -2px;
} }
.btn-group-justified .btn-group.open .btn .iconfont:after { .btn-group-justified .btn-group.open .btn .iconfont:after {
content: "\e602"; content: "\e602";
...@@ -475,14 +485,14 @@ a:hover { ...@@ -475,14 +485,14 @@ a:hover {
} }
#wrapper #scroller .row p img { #wrapper #scroller .row p img {
height: 100%; height: 100%;
border-top-left-radius: 5px; border-top-left-radius: 6px;
border-top-right-radius: 5px; border-top-right-radius: 6px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 6px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 6px;
} }
#wrapper #scroller .row ul { #wrapper #scroller .row ul {
height: 100%; height: 100%;
...@@ -501,10 +511,16 @@ a:hover { ...@@ -501,10 +511,16 @@ a:hover {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
#wrapper #scroller .row ul li span {
margin-right: 15px;
}
#wrapper #scroller .row ul li span:last-child {
margin-right: 0;
}
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
margin-top: 2px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000; color: #000000;
...@@ -525,6 +541,14 @@ a:hover { ...@@ -525,6 +541,14 @@ a:hover {
border: 1px solid #acacac; border: 1px solid #acacac;
margin: 0 5px 0 0; margin: 0 5px 0 0;
vertical-align: middle; vertical-align: middle;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
} }
#wrapper #scroller .row ul li:last-child span { #wrapper #scroller .row ul li:last-child span {
color: #000000; color: #000000;
...@@ -552,16 +576,15 @@ a:hover { ...@@ -552,16 +576,15 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2), #wrapper #scroller .row:active {
#wrapper #scroller .row ul li span:nth-child(3) { background-color: #e9e9e9;
margin-left: 15px;
} }
.footer { .footer {
width: 100%; width: 100%;
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
color: #008cd7; color: #008cd7;
font-size: 22px; font-size: 24px;
font-weight: bold; font-weight: bold;
background-color: rgba(255, 255, 255, 0.9); background-color: rgba(255, 255, 255, 0.9);
} }
...@@ -14,85 +14,6 @@ ...@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -134,6 +55,7 @@ ...@@ -134,6 +55,7 @@
} }
.modal .modal-dialog .modal-content { .modal .modal-dialog .modal-content {
color: #000000; color: #000000;
font-size: 16px;
border: 0; border: 0;
border-top-left-radius: 8px; border-top-left-radius: 8px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
...@@ -153,9 +75,18 @@ ...@@ -153,9 +75,18 @@
padding-top: 15px; padding-top: 15px;
} }
.modal .modal-dialog .modal-content p { .modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px; margin: 12px 20px 14px;
} }
.modal .modal-dialog .modal-content p:nth-of-type(2) {
margin: 0;
font-size: 0;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn {
width: 50%;
}
.modal .modal-dialog .modal-content p:nth-of-type(2) .btn:nth-child(2) {
border-left-color: #cfd0d0;
}
.modal .modal-dialog .modal-content .btn { .modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0; border-top-color: #cfd0d0;
background-color: transparent; background-color: transparent;
...@@ -359,14 +290,14 @@ a:hover { ...@@ -359,14 +290,14 @@ a:hover {
} }
#wrapper #scroller .row p img { #wrapper #scroller .row p img {
height: 100%; height: 100%;
border-top-left-radius: 5px; border-top-left-radius: 6px;
border-top-right-radius: 5px; border-top-right-radius: 6px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 6px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 5px; -webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 5px; -webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 6px;
} }
#wrapper #scroller .row ul { #wrapper #scroller .row ul {
height: 100%; height: 100%;
...@@ -385,10 +316,16 @@ a:hover { ...@@ -385,10 +316,16 @@ a:hover {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
#wrapper #scroller .row ul li span {
margin-right: 15px;
}
#wrapper #scroller .row ul li span:last-child {
margin-right: 0;
}
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
margin-top: 2px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000; color: #000000;
...@@ -409,6 +346,14 @@ a:hover { ...@@ -409,6 +346,14 @@ a:hover {
border: 1px solid #acacac; border: 1px solid #acacac;
margin: 0 5px 0 0; margin: 0 5px 0 0;
vertical-align: middle; vertical-align: middle;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
} }
#wrapper #scroller .row ul li:last-child span { #wrapper #scroller .row ul li:last-child span {
color: #000000; color: #000000;
...@@ -436,7 +381,6 @@ a:hover { ...@@ -436,7 +381,6 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2), #wrapper #scroller .row:active {
#wrapper #scroller .row ul li span:nth-child(3) { background-color: #e9e9e9;
margin-left: 15px;
} }
<?php <?php
require_once(WP_PLUGIN_DIR."/tospur/Config.php"); require_once(WP_PLUGIN_DIR."/tospur/Config.php");
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php");
$context = array(); $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
$context['siteUrl'] = get_site_url(); $context['siteUrl'] = get_site_url();
if(isset($_GET['hid'])){ if(isset($_GET['hid'])){
$hid = $_GET['hid']; $hid = $_GET['hid'];
$context['hid'] = $hid; $context['hid'] = $hid;
$sql = "select * from ".Config::TOSPUR_HOUSE_TABLE." where id = %d";
$result = $wpdb->get_row($wpdb->prepare($sql,$hid));
$context['result'] = $result;
$context['cityName'] = SearchDao::getCityNameWithId($result->city_id); $context['cityName'] = SearchDao::getCityNameWithId($result->city_id);
$context = array_merge($context,SearchDao::getDetailInfo($hid));
$mainImagesSql = "SELECT db.literal as type,ada.house_area as area,ti.path FROM ".Config::A_DISTRICT_AREA_TABLE." ada $houseType = $context['result']->house_type;
LEFT JOIN ".Config::DIC_BUILDPROPERTY_TABLE." db on db.value = ada.buildproperty_id if($houseType !=0){
LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on ti.id = ada.image_id Timber::render('detailOther.html', $context);
where ada.house_id = %d"; }else
$mainImage = $wpdb->get_results($wpdb->prepare($mainImagesSql,$hid)); Timber::render('detail.html', $context);
foreach($mainImage as $key => $value){
$value->path = Image::getImage($value->path,'small');
}
$context['mainImage'] = $mainImage;
$recommendSql = "select ahi.house_id as id,ti.path from a_house_image ahi
left join tospur_image ti on ahi.image_id = ti.id
where ti.image_type in (1,5) and house_id
in (select recommend_id from a_house_recommend where house_id = %d) group by house_id";
$recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid));
foreach($recommends as $key => $value){
$value->path = Image::getImage($value->path,'small');
}
$context['recommends'] = $recommends;
$consultantSql = 'select id,name,mobile,imageUrl,s.average_score from tospur_consultant c
LEFT JOIN (select consultant_id,sum(score)/count(score) as average_score
from tospur_consultant_score
where valid=1 group by consultant_id) s on c.id = s.consultant_id
where id in(select user_id from a_house_user where user_type = 1 and house_id = %d);';
$consultant = $wpdb->get_results($wpdb->prepare($consultantSql,$hid));
$context['consultant'] = $consultant;
$imagesSql = 'select * from tospur_image ti
LEFT JOIN a_house_image ahi on ti.id = ahi.image_id
WHERE ahi.house_id = %d order by image_type;';
$images = $wpdb->get_results($wpdb->prepare($imagesSql,$hid));
foreach($images as $key => $value){
$value->path = Image::getImage($value->path,'big');
}
$context['images'] = $images;
Timber::render('detail.html', $context);
}else{ }else{
Timber::render('error.html', $context); Timber::render('error.html', $context);
} }
......
...@@ -8,19 +8,19 @@ if ($_POST) { ...@@ -8,19 +8,19 @@ if ($_POST) {
$code = $_POST['code']; $code = $_POST['code'];
$password = $_POST['password']; $password = $_POST['password'];
if (!$phone) { if (!$phone) {
$context['phoneError'] = '请输入11位手机号'; $context['error'] = '请输入11位手机号';
} else if (!$code) { } else if (!$code) {
$context['codeError'] = '请输入验证码'; $context['error'] = '请输入验证码';
} else if (!$password) { } else if (!$password) {
$context['passwordError'] = '请输入新密码'; $context['error'] = '请输入新密码';
} else { } else {
$search_code = dao::search_tospur_verify($phone, $code); $search_code = dao::search_tospur_verify($phone, $code);
if ($code == $search_code) { if ($code == $search_code) {
wp_set_password($password, $user->data->ID); wp_set_password($password, $user->data->ID);
dao::update_tospur_verify($phone); dao::update_tospur_verify($phone);
echo '成功修改密码'; $context['error'] = '成功修改密码';
} else { } else {
$context['codeError'] = '请输入正确的验证码'; $context['error'] = '验证码错误';
} }
} }
} }
......
...@@ -5,9 +5,13 @@ $context['theme'] = get_template_directory_uri(); ...@@ -5,9 +5,13 @@ $context['theme'] = get_template_directory_uri();
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php"); require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php");
$cityId = 1; $cityId = 1;
$houseType = 0;
if($_GET['cityId']) if($_GET['cityId'])
$cityId = $_GET['cityId']; $cityId = $_GET['cityId'];
if($_GET['houseType'])
$houseType = $_GET['houseType'];
$context['cityId'] = $cityId; $context['cityId'] = $cityId;
$context['houseType'] = $houseType;
$context['cityName'] = SearchDao::getCityNameWithId($cityId); $context['cityName'] = SearchDao::getCityNameWithId($cityId);
$context['select']['city'] = SearchDao::searchCity(); $context['select']['city'] = SearchDao::searchCity();
$context['select']['district'] = SearchDao::searchCity($cityId); $context['select']['district'] = SearchDao::searchCity($cityId);
...@@ -25,6 +29,6 @@ $context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId); ...@@ -25,6 +29,6 @@ $context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId);
$context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId); $context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId);
$context['select']['area'] = json_encode(SearchDao::searchArea($cityId)); $context['select']['area'] = json_encode(SearchDao::searchArea($cityId));
$context['site_url'] = site_url(); $context['url'] = home_url();
Timber::render('index.html', $context); Timber::render('index.html', $context);
?> ?>
\ No newline at end of file
...@@ -75,4 +75,84 @@ Date.prototype.Format = function (fmt) { ...@@ -75,4 +75,84 @@ Date.prototype.Format = function (fmt) {
if (new RegExp("(" + k + ")").test(fmt)) if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt; return fmt;
}; };
\ No newline at end of file
function scrollPullToRefresh(cb){
var pullUpFlag = false;
var scroll = new IScroll('#wrapper', {
scrollbars: true,
click: true
});
scroll.on("scrollStart", function () {
if (this.maxScrollY >= this.y && this.scrollerHeight > this.wrapperHeight && this.directionY == 1) {
pullUpFlag = true;
}
});
scroll.on("scrollEnd", function () {
if (pullUpFlag) {
pullUpFlag = false;
cb();
}
});
return scroll;
}
function ajax_get_house(url, loading, ajax_data, context){
loading.show();
$.ajax({
type: 'POST',
url: url + '/wp-admin/admin-ajax.php/',
data: ajax_data,
success:function(data){
loading.hide();
if (data.code == 2000) {
$.each(data.result, function (index, value) {
var houseType= value.house_type;
var template = $('#template_' + houseType).html();
if(data.tags)
var data_tags = data.tags[value.id];
if(data.images)
var data_images = data.images[value.id];
var div = $('<div class="row">');
div.append(template);
div.find('[data-attr=name]').text(value.name);
var tags = div.find('[data-attr=tags]');
if (houseType == 0) {
div.find('[data-attr=type]').text(value.literal);
div.find('[data-attr=address]').text(value.address);
div.find('[data-attr=latest_news]').text(value.latest_news);
div.find('[data-attr=price]').html('<em>' + (value.average_price / 10000).toFixed(2) + '万</em>/m<em>2</em>');
} else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
} else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=decoration]').text(value.decoration);
div.find('[data-attr=price]').html('<em>' + value.rent + '</em>/月');
}
var image = div.find('[data-attr=image]');
if (data_images) {
image.attr('src', data_images);
}
if (data_tags) {
$.each(data_tags, function (k, v) {
if (k < 3) {
tags.prepend('<span class="label">' + v + '</span>');
}
});
}
div.bind("tap",function(){
window.location.href = url + '/?page=detail&hid=' + value.id;
});
context.append(div);
});
ajax_data.index += 10;
myScroll.refresh();
}
}
});
}
\ No newline at end of file
...@@ -31,7 +31,7 @@ if ($_POST) { ...@@ -31,7 +31,7 @@ if ($_POST) {
$context['error'] = '抱歉,用户名已存在'; $context['error'] = '抱歉,用户名已存在';
} }
} else { } else {
$context['error'] = '请输入正确的验证码'; $context['error'] = '验证码错误';
} }
} }
} }
......
...@@ -19,7 +19,7 @@ if ($user_id != 0) { ...@@ -19,7 +19,7 @@ if ($user_id != 0) {
$context['consultant_id'] = $_GET['consultant_id']; $context['consultant_id'] = $_GET['consultant_id'];
Timber::render('view.html', $context); Timber::render('view.html', $context);
}else{ }else{
wp_redirect(get_site_url()."?page=login"); wp_redirect(home_url()."?page=login");
exit; exit;
} }
......
...@@ -12,14 +12,20 @@ ...@@ -12,14 +12,20 @@
<script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script> <script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/star-rating.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/star-rating.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/public.js"></script>
</head> </head>
<body> <body>
<div class="jumbotron"> <div class="jumbotron">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="col-xs-4 text-center"> <li class="col-xs-4 text-center">
<img src="{{ consultant.imageUrl }}" data-attr=""> {% if consultant.imageUrl != "" %}
<img src="{{ consultant.imageUrl}}" data-attr="">
{% else %}
<img src="{{ theme }}/img/head.png " data-attr="">
{% endif %}
</li> </li>
<li class="col-xs-8"> <li class="col-xs-8">
<p>{{ consultant.display_name }}</p> <p>{{ consultant.display_name }}</p>
...@@ -141,26 +147,20 @@ ...@@ -141,26 +147,20 @@
var template; var template;
var loading; var loading;
$(document).ready(function () { $(document).ready(function () {
var searchData = {
action: 'get_my_house',
houseType: houseType,
userType: 1,
userId: userId,
index: 0
};
var tabPane = $('[data-house=' + houseType + ']'); var tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html(); template = $('#template_' + houseType).html();
loading = $('#loading'); loading = $('#loading');
ajax_get_house(tabPane); ajax_get_house('{{ url }}', loading, searchData, tabPane);
var pullUpFlag = false;
var peopleScroll = new IScroll('#people_wrapper'); var peopleScroll = new IScroll('#people_wrapper');
myScroll = new IScroll('#wrapper', { myScroll = scrollPullToRefresh(function(){
scrollbars: true, ajax_get_house('{{ url }}', loading, searchData, tabPane);
click: true
});
myScroll.on("scrollStart", function () {
if (this.maxScrollY >= this.y) {
pullUpFlag = true;
}
});
myScroll.on("scrollEnd", function () {
if (pullUpFlag) {
pullUpFlag = false;
ajax_get_house(tabPane);
}
}); });
var aTab = $('a[data-toggle=tab]'); var aTab = $('a[data-toggle=tab]');
aTab.on('show.bs.tab', function (e) { aTab.on('show.bs.tab', function (e) {
...@@ -170,69 +170,16 @@ ...@@ -170,69 +170,16 @@
houseType = $(e.target).parent().index(); houseType = $(e.target).parent().index();
tabPane = $('[data-house=' + houseType + ']'); tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html(); template = $('#template_' + houseType).html();
index = 0; searchData.houseType = houseType;
searchData.index = 0;
myScroll.scrollTo(0, 0); myScroll.scrollTo(0, 0);
setTimeout(function () { setTimeout(function () {
myScroll.refresh(); myScroll.refresh();
ajax_get_house(tabPane); ajax_get_house('{{ url }}', loading, searchData, tabPane);
}, 200); }, 200);
} }
}) })
}); });
function ajax_get_house(tabPane) {
loading.show();
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=get_my_house&houseType=' + houseType + '&userType=1&userId=' + userId + '&index=' + index,
success: function (data) {
loading.hide();
if (data.code == 2000) {
$.each(data.result, function (index, value) {
if(data.tags)
var data_tags = data.tags[value.id];
if(data.images)
var data_images = data.images[value.id];
var div = $('<div class="row">');
div.append(template);
div.find('[data-attr=name]').text(value.name);
var tags = div.find('[data-attr=tags]');
if (houseType == 0) {
div.find('[data-attr=type]').text(value.literal);
div.find('[data-attr=address]').text(value.address);
div.find('[data-attr=latest_news]').text(value.latest_news);
div.find('[data-attr=price]').html('<em>' + (value.average_price / 10000).toFixed(2) + '万</em>/m<em>2</em>');
} else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
} else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=decoration]').text(value.decoration);
div.find('[data-attr=price]').html('<em>' + value.rent + '</em>/月');
}
var image = div.find('[data-attr=image]');
if (data_images) {
image.attr('src', data_images);
}
if (data_tags) {
$.each(data_tags, function (k, v) {
tags.prepend('<span class="label">' + v + '</span>');
});
}
tabPane.append(div);
});
index += 10;
myScroll.refresh();
} else {
}
}
});
}
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<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/star-rating.min.js"></script> <script src="{{ theme }}/js/star-rating.min.js"></script>
<script src="{{ theme }}/js/public.js"></script>
</head> </head>
<body> <body>
<div class="search"> <div class="search">
...@@ -91,25 +92,11 @@ ...@@ -91,25 +92,11 @@
} }
cityScroll.refresh(); cityScroll.refresh();
}); });
var pullUpFlag = false;
cityScroll = new IScroll('#city_wrapper',{ cityScroll = new IScroll('#city_wrapper',{
click: true click: true
}); });
myScroll = new IScroll('#wrapper',{ myScroll = scrollPullToRefresh(function(){
click: true ajax_get_consultant();
});
myScroll.on("scrollStart", function () {
console.log(this.maxScrollY);
console.log(this.y);
if (this.maxScrollY >= this.y) {
pullUpFlag = true;
}
});
myScroll.on("scrollEnd", function () {
if (pullUpFlag) {
pullUpFlag = false;
ajax_get_consultant();
}
}); });
template = $('#template').html(); template = $('#template').html();
ajax_get_consultant(); ajax_get_consultant();
...@@ -129,7 +116,7 @@ ...@@ -129,7 +116,7 @@
li.append(template); li.append(template);
li.find('[data-attr=name]').text(value.display_name); li.find('[data-attr=name]').text(value.display_name);
li.find('[data-attr=score]').attr('style', 'width: '+ value.average_score*20+'%'); li.find('[data-attr=score]').attr('style', 'width: '+ value.average_score*20+'%');
li.find('[data-attr=image]').attr('src', value.imageUrl); li.find('[data-attr=image]').attr('src', value.imageUrl!=""?value.imageUrl:"{{ theme }}/img/head.png");
var infoUrl; var infoUrl;
if(value.mobile){ if(value.mobile){
li.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile); li.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile);
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/star-rating.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/star-rating.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var myScroll; var myScroll;
var carouselScroll; var carouselScroll;
...@@ -45,12 +44,6 @@ ...@@ -45,12 +44,6 @@
$(document).ready(function(){ $(document).ready(function(){
$("#slider").bind("tap",function(){ $("#slider").bind("tap",function(){
$("#carousel_wrapper").parent().show(); $("#carousel_wrapper").parent().show();
var carousel = $("#carousel_wrapper");
var carouselWidth = carousel.width();
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
carousel.find("#carousel_indicator li").removeClass("carousel_active");
carousel.find("#carousel_indicator li:first").addClass("carousel_active");
carouselScroll = new IScroll('#carousel_wrapper', { carouselScroll = new IScroll('#carousel_wrapper', {
bounce: false, bounce: false,
scrollX: true, scrollX: true,
...@@ -64,6 +57,11 @@ ...@@ -64,6 +57,11 @@
$("#carousel_indicator li").removeClass("carousel_active"); $("#carousel_indicator li").removeClass("carousel_active");
$("#carousel_indicator li").eq(this.currentPage.pageX).addClass("carousel_active"); $("#carousel_indicator li").eq(this.currentPage.pageX).addClass("carousel_active");
}); });
var carousel = $("#carousel_wrapper");
var carouselWidth = carousel.width();
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
carousel.find("#carousel_indicator li").removeClass("carousel_active");
carousel.find("#carousel_indicator li:first").addClass("carousel_active");
return false; return false;
}); });
$("#carousel_wrapper").parent().bind("click",function(){ $("#carousel_wrapper").parent().bind("click",function(){
...@@ -205,6 +203,7 @@ ...@@ -205,6 +203,7 @@
<p class="detail_title">置业顾问</p> <p class="detail_title">置业顾问</p>
<ul class="list-unstyled peopleCont"> <ul class="list-unstyled peopleCont">
{% for item in consultant %} {% for item in consultant %}
<a href="{{siteUrl}}?page=consultant_info&consultant_id={{ item.id }}">
<li> <li>
<ol class="col-xs-2 text-center"> <ol class="col-xs-2 text-center">
{% if item.imageUrl %} {% if item.imageUrl %}
...@@ -215,7 +214,7 @@ ...@@ -215,7 +214,7 @@
</ol> </ol>
<ol class="col-xs-4"> <ol class="col-xs-4">
<p>{{item.name}}</p> <p>{{item.name}}</p>
<div class="star-rating rating-xs rating-disabled" style="font-size:16px;height:25px;"> <div class="star-rating rating-xs rating-disabled" style="font-size:15px;height:25px;">
<div class="rating-container rating-gly-star" data-content=""> <div class="rating-container rating-gly-star" data-content="">
<div class="rating-stars" data-content="" style="width: {{item.average_score*2*10}}%;"></div> <div class="rating-stars" data-content="" style="width: {{item.average_score*2*10}}%;"></div>
</div> </div>
...@@ -234,6 +233,7 @@ ...@@ -234,6 +233,7 @@
</a> </a>
</ol> </ol>
</li> </li>
</a>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title>{{result.community_name}}</title>
<!--CSS-->
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/detail.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/star-rating.min.css">
<script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
<script type="text/javascript" src="{{ theme }}/js/swipe.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/star-rating.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
<script type="text/javascript">
var myScroll;
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(){
$("#slider").bind("tap",function(){
$("#carousel_wrapper").parent().show();
var carousel = $("#carousel_wrapper");
var carouselWidth = carousel.width();
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
carousel.find("#carousel_indicator li").removeClass("carousel_active");
carousel.find("#carousel_indicator li:first").addClass("carousel_active");
carouselScroll = new IScroll('#carousel_wrapper', {
bounce: false,
scrollX: true,
scrollY: false,
momentum: false,
snap: true,
snapSpeed: 400,
click: true
});
carouselScroll.on('scrollEnd',function(){
$("#carousel_indicator li").removeClass("carousel_active");
$("#carousel_indicator li").eq(this.currentPage.pageX).addClass("carousel_active");
});
return false;
});
$("#carousel_wrapper").parent().bind("click",function(){
$(this).hide();
return false;
});
$(".collect").bind("tap",function(){
$.ajax({
type: 'POST',
url: '{{ siteUrl }}/wp-admin/admin-ajax.php/',
data: 'action=add_collect&hid={{hid}}',
success: function (data) {
if (data.code == 2000) {
alert('收藏成功');
} else {
alert('收藏失败');
}
}
});
});
$(".map").bind("tap",function(){
location.href = "{{ siteUrl }}/?page=map&a={{result.address}}&c={{cityName}}&hn={{result.community_name}}<br>{{result.address}}&p={{result.location}}";
});
$(".col-xs-2").bind("tap",function(){
location.href = "{{siteUrl}}?page=consultant_info&consultant_id={{ consultant[0].id }}";
});
});
</script>
</head>
<body>
<p class="collect">
<i class="iconfont">&#xe604;</i>
</p>
<!-- 图片滚动 -->
<div class="addWrap">
<div id="slider" class="swipe">
<div class="swipe-wrap">
{% for item in images %}
<div>
<img src="{{siteUrl}}{{item.path}}">
</div>
{% endfor %}
</div>
</div>
<ul id="indicator" class="list-inline text-center">
{% for i in 1..images|length %}
<li {% if loop.index0 == 0 %}class="active"{% endif %}></li>
{% endfor %}
</ul>
</div>
<!-- /图片滚动 -->
<div class="detail_row priceCont">
<p class="detail_title">{{result.name}}</p>
<!-- <ul class="list-unstyled">
<li class="col-xs-7 price">
均价:<span><em>2.35万</em>/m<em>2</em></span>
</li>
<li class="col-xs-5">
<button type="button" class="btn btn-xs">房贷计算器</button>
</li>
</ul>-->
<!-- 二手房详细 -->
<ul class="list-unstyled">
<li class="col-xs-7">房源编号:{{result.house_number}}</li>
<li class="col-xs-5">
<button type="button" class="btn btn-xs">房贷计算器</button>
</li>
<li class="col-xs-7 price">
售价:<span><em>{{(result.total_price/10000)|round(2, 'floor')}}万</em></span>
</li>
<li class="col-xs-5">单价:{{(result.average_price/10000)|round(2, 'floor')}}万</li>
</ul>
<!-- 二手房详细 -->
</div>
<div class="detail_row">
<a class="collapsed" data-toggle="collapse" href="#collapseExample">
<p class="detail_title">基本信息<i class="iconfont pull-right"></i></p>
</a>
<ul class="list-unstyled collapse infoCont" id="collapseExample">
<li>户型:{{result.covered_area}}</li>
<li>面积:{{result.covered_area}}</li>
<li>楼层:{{result.floor}}</li>
<li>朝向:{{result.faceto}}</li>
<li>装修:{{result.decoration}}</li>
<li>年代:{{result.age}}</li>
</ul>
</div>
<div class="detail_row">
<p class="detail_title">房源点评</p>
<p>{{result.overview}}</p>
</div>
<div class="detail_row">
<p class="detail_title">位置及周边</p>
<ul class="list-unstyled">
<li>地址:{{result.address}}</li>
<li>交通线路:{{result.traffic}}</li>
<li>周边配套:{{result.periphery}}</li>
</ul>
<p class="map">
<span></span>
</p>
</div>
<div class="detail_row">
<p class="detail_title pull-left">推荐房源</p>
<ul class="list-unstyled recommendCont">
{% for item in recommends %}
<a href="{{siteUrl}}?page=detail&hid={{item.id}}"><li class="col-xs-3"><p style="background-image:url({{siteUrl}}{{ item.path }});"></p></li></a>
{% endfor %}
</ul>
</div>
{% if consultant[0] %}
<footer class="footer navbar-fixed-bottom">
<ul class="list-unstyled">
<li class="col-xs-2">
{% if item.imageUrl %}
<img src="{{ consultant[0].imageUrl }}">
{% else %}
<img src="{{ theme }}/img/head.png">
{% endif %}
</li>
<li class="col-xs-5">
<div>
<span class="pull-left">{{consultant[0].name}}</span>
<div class="star-rating rating-xs rating-disabled" style="font-size:14px;height:25px;">
<div class="rating-container rating-gly-star" data-content="">
<div class="rating-stars" data-content="" style="width: {{consultant[0].average_score*2*10}}%;"></div>
</div>
</div>
</div>
<div>置业顾问</div>
</li>
<li class="col-xs-5 text-right">
{% if consultant[0].mobile %}
<a href="tel:{{consultant[0].mobile}}" class="btn btn-phone">
<span></span>
<span>电话联系</span>
</a>
{% endif %}
<!--<a href="#" class="btn btn-wechat">
<span></span>
<span>微信联系</span>
</a>-->
</li>
</ul>
<!-- 二手房详细 -->
</footer>
{% endif %}
<div class="modal">
<div id="carousel_wrapper">
<div id="carousel_scroller">
<ul class="list-inline text-nowrap">
{% for item in images %}
<li>
<p>
<span><img src="{{siteUrl}}{{item.path}}"></span>
</p>
</li>
{% endfor %}
</ul>
</div>
<ul id="carousel_indicator" class="list-inline text-center indicators">
{% for i in 1..images|length %}
<li></li>
{% endfor %}
</ul>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -5,13 +5,20 @@ ...@@ -5,13 +5,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, 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>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/form.css">
<script src="{{ theme }}/js/jquery.min.js"></script> <script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.validate.js"></script> <script src="{{ theme }}/js/jquery.validate.js"></script>
<script src="{{ theme }}/js/bootstrap.min.js"></script>
<script src="{{ theme }}/js/public.js"></script> <script src="{{ theme }}/js/public.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var notice = $('#notice');
var myModal = $('#myModal');
$('#forgetForm').validate({ $('#forgetForm').validate({
onkeyup: false,
onfocusout: false,
rules: { rules: {
phone: { phone: {
required: true, required: true,
...@@ -26,39 +33,65 @@ ...@@ -26,39 +33,65 @@
phone: '请输入11位手机号', phone: '请输入11位手机号',
code: '请输入验证码', code: '请输入验证码',
password: '请输入新密码' password: '请输入新密码'
},
errorLabelContainer: "#notice",
errorElement: 'span',
invalidHandler: function () {
myModal.modal('show');
},
submitHandler: function (form) {
form.submit();
} }
}); });
notice.bind('DOMNodeInserted', function () {
$(this).children(':not(:first)').remove();
});
myModal.on('hide.bs.modal', function () {
notice.children().remove();
});
sendCodeBindClick("{{ url }}", 1); sendCodeBindClick("{{ url }}", 1);
{% if(error) %}
notice.html('<span>{{ error }}</span>');
myModal.modal('show');
{% endif %}
}); });
</script> </script>
</head> </head>
<body> <body>
<form id="forgetForm" method="post">
<p>
<label for="phone">用户名<br>
<input type="tel" name="phone" id="phone">
<label id="phone-error" class="error" for="phone">{{ phoneError }}</label>
</label>
</p>
<p> <div class="container-fluid text-center">
<label for="code">验证码<br> <form id="forgetForm" method="post">
<input type="text" name="code" id="code"> <h2>忘记密码</h2>
<label id="code-error" class="error" for="code">{{ codeError }}</label>
</label> <p class="has-feedback username">
<span id="send">发送验证码</span> <label for="phone" class="sr-only">用户名</label>
</p> <input type="tel" name="phone" id="phone" class="form-control input-lg" placeholder="手机号码">
<span class="form-control-feedback"></span>
</p>
<p class="has-feedback code">
<label for="code" class="sr-only">验证码</label>
<input type="text" name="code" id="code" class="form-control input-lg" placeholder="验证码">
<span id="send" class="form-control-feedback">发送验证码</span>
</p>
<p> <p class="has-feedback password">
<label for="password">新密码<br> <label for="password" class="sr-only">新密码</label>
<input type="password" name="password" id="password"> <input type="password" name="password" id="password" class="form-control input-lg" placeholder="新密码">
<label id="password-error" class="error" for="password">{{ passwordError }}</label> <span class="form-control-feedback"></span>
</label> </p>
</p> <input type="submit" id="forget_submit" value="修改密码" class="btn btn-lg btn-block">
</form>
</div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p class="submit"> <p id="notice"></p>
<input type="submit" id="forget_submit" value="修改密码"> <button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</p> </div>
</form> </div>
</div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script> <script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script> <script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/public.js"></script>
</head> </head>
<body> <body>
<ul id="tab" class="list-unstyled btn-group-justified tab"> <ul id="tab" class="list-unstyled btn-group-justified tab">
...@@ -105,30 +107,23 @@ ...@@ -105,30 +107,23 @@
<script> <script>
var houseType = 0; var houseType = 0;
var userId = '{{ user_id }}'; var userId = '{{ user_id }}';
var index = 0;
var myScroll; var myScroll;
var template; var template;
var loading; var loading;
$(document).ready(function () { $(document).ready(function () {
var searchData = {
action: 'get_my_house',
houseType: houseType,
userType: 0,
userId: userId,
index: 0
};
var tabPane = $('[data-house=' + houseType + ']'); var tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html(); template = $('#template_' + houseType).html();
loading = $('#loading'); loading = $('#loading');
ajax_get_my_house(tabPane); ajax_get_house('{{ url }}', loading, searchData, tabPane);
var pullUpFlag = false; myScroll = scrollPullToRefresh(function(){
myScroll = new IScroll('#wrapper', { ajax_get_house('{{ url }}', loading, searchData, tabPane);
scrollbars: true,
click: true
});
myScroll.on("scrollStart", function () {
if (this.maxScrollY >= this.y) {
pullUpFlag = true;
}
});
myScroll.on("scrollEnd", function () {
if (pullUpFlag) {
pullUpFlag = false;
ajax_get_my_house(tabPane);
}
}); });
var aTab = $('a[data-toggle=tab]'); var aTab = $('a[data-toggle=tab]');
aTab.on('show.bs.tab', function (e) { aTab.on('show.bs.tab', function (e) {
...@@ -138,69 +133,16 @@ ...@@ -138,69 +133,16 @@
houseType = $(e.target).parent().index(); houseType = $(e.target).parent().index();
tabPane = $('[data-house=' + houseType + ']'); tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html(); template = $('#template_' + houseType).html();
index = 0; searchData.houseType = houseType;
searchData.index = 0;
myScroll.scrollTo(0, 0); myScroll.scrollTo(0, 0);
setTimeout(function () { setTimeout(function () {
myScroll.refresh(); myScroll.refresh();
ajax_get_my_house(tabPane); ajax_get_house('{{ url }}', loading, searchData, tabPane);
}, 200); }, 200);
} }
}) })
}); });
function ajax_get_my_house(tabPane) {
loading.show();
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=get_my_house&houseType=' + houseType + '&userType=0&userId=' + userId + '&index=' + index,
success: function (data) {
loading.hide();
if (data.code == 2000) {
$.each(data.result, function (index, value) {
if(data.tags)
var data_tags = data.tags[value.id];
if(data.images)
var data_images = data.images[value.id];
var div = $('<div class="row">');
div.append(template);
div.find('[data-attr=name]').text(value.name);
var tags = div.find('[data-attr=tags]');
if (houseType == 0) {
div.find('[data-attr=type]').text(value.literal);
div.find('[data-attr=address]').text(value.address);
div.find('[data-attr=latest_news]').text(value.latest_news);
div.find('[data-attr=price]').html('<em>' + (value.average_price / 10000).toFixed(2) + '万</em>/m<em>2</em>');
} else if (houseType == 1) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=price]').html('<em>' + value.total_price + '万</em>');
} else if (houseType == 2) {
div.find('[data-attr=community]').text(value.community_name);
div.find('[data-attr=apartment]').text(value.bp_literal);
div.find('[data-attr=covered_area]').text(value.covered_area + '平米');
div.find('[data-attr=decoration]').text(value.decoration);
div.find('[data-attr=price]').html('<em>' + value.rent + '</em>/月');
}
var image = div.find('[data-attr=image]');
if (data_images) {
image.attr('src', data_images);
}
if (data_tags) {
$.each(data_tags, function (k, v) {
tags.prepend('<span class="label">' + v + '</span>');
});
}
tabPane.append(div);
});
index += 10;
myScroll.refresh();
} else {
}
}
});
}
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
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