Commit c824ea31 by felix

每日一更

parent 99b3aec2
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
......
......@@ -28,7 +28,7 @@ class newHouseList extends WP_List_Table
case 'average_price':
case 'developer':
case 'check_in_time':
case 'building_type':
case 'room_id':
case 'property_age':
case 'decoration':
case 'covered_area':
......@@ -65,7 +65,7 @@ class newHouseList extends WP_List_Table
'average_price' => '单价',
'developer' => '开发商',
'check_in_time' => '入住时间',
'building_type' => '建筑类型',
'room_id' => '建筑类型',
'property_age' => '产权年限',
'decoration' => '装修状况',
'covered_area' => '建筑面积',
......@@ -89,7 +89,7 @@ class newHouseList extends WP_List_Table
'average_price' => array('average_price', false),
'developer' => array('developer', 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),
'decoration' => array('decoration', false),
'covered_area' => array('covered_area', false),
......@@ -166,6 +166,7 @@ class newHouseList extends WP_List_Table
$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 value as did,literal as room_type from dic_room) dr on dr.did = th.room_id
where 1=1 and house_type=0";
if($_POST["listCity"]!=0 ){
$sql = $sql." and city_id=".$_POST["listCity"];
......@@ -196,7 +197,7 @@ class newHouseList extends WP_List_Table
if($_POST["searchText"]!=NULL){
$sql = $sql . " and name like '%".$_POST['searchText']."%'";
}
$sql = $sql . " group by bph_id";
$sql = $sql . " group by id";
$result = $wpdb->get_results($sql);
$data = array();
foreach ($result as $key => $value) {
......@@ -207,7 +208,7 @@ class newHouseList extends WP_List_Table
'average_price' => $value->average_price,
'developer' => $value->developer,
'check_in_time' => $value->check_in_time,
'building_type' => $value->building_type,
'room_id' => $value->room_type,
'property_age' => $value->property_age,
'decoration' => $value->decoration,
'covered_area' => $value->covered_area,
......
......@@ -10,6 +10,7 @@ class RentHouse{
global $wpdb;
$type = $_POST["type"];
$context = array();
$context['siteUrl'] = get_site_url();
//获取新房信息,存入tospur_house表
$insert_tospur_house_array = array(
'name' => $_POST['housename'],
......@@ -33,6 +34,7 @@ class RentHouse{
'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'],
'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"),
'house_type' => 2
);
if($type==3){
......@@ -65,6 +67,7 @@ class RentHouse{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']);
}
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
......@@ -81,82 +84,17 @@ class RentHouse{
$uploadedfile = $_FILES['files'];
//房源与类型以及面积信息
$data = $_POST["data"];
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE flat="' .$_POST['flat'] . '" and suite="' . $_POST["suite"] . '" and house_type=2', OBJECT);
if(!$res){
$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(
'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"推荐置业顾问信息插入失败";
}
}
}
InsertDao::addMainImage($houseId,$data);
InsertDao::addRecommend($houseId,$data);
InsertDao::addRecConsultant($houseId,$data);
InsertDao::addHouseTag($_POST['mark'],$houseId);
}else{
return 508;
}
......@@ -168,36 +106,34 @@ class RentHouse{
global $wpdb;
$data = $_POST["data"];
$res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId));
if($res){
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){
$a_house_userArray = array(
"user_id" => $val,
"house_id" => $houseId,
"user_type" =>1
);
$a_house_userRes = $wpdb->update(Config::A_HOUSE_USER_TABLE,$a_house_userArray,array("house_id" => $houseId));
if(!$a_house_userRes){
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);
}
}
$result = 202;
InsertDao::addMainImage($houseId,$data);
$exists_photo_ids = array();
if(isset($_POST['exists_photo'])){
foreach($_POST['exists_photo'] as $id => $item){
$wpdb->update(Config::TOSPUR_IMAGE_TABLE,array(
"image_type" => $item['type'],
),array("id" => $id));
$exists_photo_ids[] = $id;
}
}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{
global $wpdb;
$type = $_POST["type"];
$context = array();
$context['siteUrl'] = get_site_url();
$insert_tospur_house_array = array(
'name' => $_POST['housename'],
'house_number' =>$_POST['house_number'],
......@@ -32,6 +33,7 @@ class SecHandHouse{
'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'],
'status' =>$_POST['status'],
'creattime' => date("Y-m-d H:i:s"),
'house_type' => 1
);
if($type==2){
......@@ -51,7 +53,7 @@ class SecHandHouse{
$result = SecHandHouse::secHouseData_insert($insert_tospur_house_array);
if ($result != 200) {
$wpdb->query("ROLLBACK");
print_r($wpdb->last_error);;
print_r($wpdb->last_error);
echo "二手房房源新增失败";
} else {
$wpdb->query("COMMIT");
......@@ -64,6 +66,7 @@ class SecHandHouse{
$context = array_merge($context,SearchDao::getDetailInfo($_GET['id']));
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id,$context['result']->district_id);
$context["mark"] = SearchDao::searchHouseTag($_GET['id']);
}
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
......@@ -81,81 +84,18 @@ class SecHandHouse{
//房源与类型以及面积信息
$data = $_POST["data"];
//获取新房信息,存入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){
$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(
'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"推荐置业顾问信息插入失败";
}
}
}
InsertDao::addMainImage($houseId,$data);
InsertDao::addRecommend($houseId,$data);
InsertDao::addRecConsultant($houseId,$data);
InsertDao::addHouseTag($_POST['mark'],$houseId);
}else{
return 507;
}
......@@ -166,38 +106,35 @@ class SecHandHouse{
global $wpdb;
$data = $_POST["data"];
$res = $wpdb->update(Config::TOSPUR_HOUSE_TABLE,$params,array("id" => $houseId));
if($res){
if($data["recConsultant"]){
foreach($data["recConsultant"] as $val){
$a_house_userArray = array(
"user_id" => $val,
"house_id" => $houseId,
"user_type" =>1
);
$a_house_userRes = $wpdb->update(Config::A_HOUSE_USER_TABLE,$a_house_userArray,array("house_id" => $houseId));
if(!$a_house_userRes){
return 511;
}
}
}
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();
}
}
$result = 201;
InsertDao::addMainImage($houseId,$data);
$exists_photo_ids = array();
if(isset($_POST['exists_photo'])){
foreach($_POST['exists_photo'] as $id => $item){
$wpdb->update(Config::TOSPUR_IMAGE_TABLE,array(
"image_type" => $item['type'],
),array("id" => $id));
$exists_photo_ids[] = $id;
}
}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 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</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>
<td> <input name="community_name" id="community_name" type="text" value="{{result.community_name}}" class="regular-text code"></td>
</tr>
......@@ -63,7 +67,7 @@
{% set exists_ids = exists_ids~"," %}
{% endif %}
{% set exists_ids = exists_ids~item.id %}
<div id="exists_{{item.id}}">
<div>
<img src="{{siteUrl}}{{item.path}}" heghit="100" width="100"><br />
<select name="exists[{{item.id}}][buildProperty]">
{% for i in buildProperty %}
......@@ -171,19 +175,19 @@
<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.id %}
<p id="exists_photo_{{ item.id }}">
<select name="exists_photo[{{ item.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>
{% 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 />
......@@ -195,7 +199,15 @@
<tr>
<th><label for="traffic">推荐房源</label></th>
<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>
......@@ -204,7 +216,15 @@
<tr>
<th><label for="periphery">置业顾问</label></th>
<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>
......@@ -599,7 +619,7 @@
}
}
$("#preview,#picList").on("click",".existsCancel",function(){
$("#preview,#picList,#houseImg,#consultantImg").on("click",".existsCancel",function(){
$(this).parent().remove();
});
});
......
......@@ -15,6 +15,10 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</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>
<td> <input name="rent" id="rent" type="text" value="{{result.rent}}" class="regular-text code"></td>
</tr>
......@@ -71,7 +75,33 @@
<th><label for="overview">房源点评</label></th>
<td> <textarea name="overview" rows="4" cols="40" class="large-text code">{{result.overview}}</textarea></td>
</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>
</table>
<h2 class="title">位置及周边</h2>
......@@ -102,7 +132,25 @@
<tr>
<th><label>房源相册</label></th>
<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>
......@@ -120,7 +168,15 @@
<tr>
<th><label for="consultant">置业顾问</label></th>
<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>
......@@ -327,13 +383,20 @@
data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=2",
success:function(json){
var result = json.result;
var urlParams = getUrlParmas();
for(var i = 0; i <result.length; i++){
var name = result[i]["name"];
var id = result[i]['id'];
var imgUrl = json.images[id];
var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100});
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 @@
}
}
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);
......
......@@ -15,6 +15,10 @@
<td> <input name="housename" id="housename" type="text" value="{{result.name}}" class="regular-text code"></td>
</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>
<td> <input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="regular-text code"></td>
</tr>
......@@ -127,16 +131,42 @@
<tr>
<th><label>房源相册</label></th>
<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>
</td>
</tr>
<tr>
<th><label for="recommend">推荐房源</label></th>
<th><label for="traffic">推荐房源</label></th>
<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>
......@@ -145,7 +175,15 @@
<tr>
<th><label for="consultant">置业顾问</label></th>
<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>
......@@ -353,13 +391,20 @@
data: "action=searchHouse&cityId="+cityId+"&districtId="+areaId+"&plateId="+plateId+"&buildPropertyId="+buildPropertyId+"&roomId="+room+"&acreage="+acreage+"&totalPrice="+price+"&houseType=1",
success:function(json){
var result = json.result;
var urlParams = getUrlParmas();
for(var i = 0; i <result.length; i++){
var name = result[i]["name"];
var id = result[i]['id'];
var imgUrl = json.images[id];
var img = $("<img>").attr({"src":imgUrl,"height":100,"width":100});
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 @@
}
}
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);
......
......@@ -6,17 +6,20 @@ class Config {
const A_HOUSE_IMAGE_TABLE = 'a_house_image';
const A_HOUSE_RECOMMEND_TABLE = 'a_house_recommend';
const A_HOUSE_USER_TABLE = 'a_house_user';
const A_HOUSE_TAG_TABLE = 'a_house_tag';
const DIC_CITY_TABLE = 'dic_city';
const DIC_ROOM_TABLE = 'dic_room';
const DIC_BUILDPROPERTY_TABLE = 'dic_buildproperty';
const DIC_AREA_TABLE = 'dic_area';
const DIC_UNITPRICERANGE_TABLE = 'dic_unitpricerange';
const DIC_TOTALPRICE_TABLE = 'dic_totalprice';
const DIC_RENTALPRICE_TABLE = 'dic_rentalprice';
const DIC_PHOTOTYPE_TABLE = "dic_phototype";
const TOSPUR_ORGANIZATION_TABLE = 'tospur_organization';
const TOSPUR_CONSULTANT = 'tospur_consultant';
const TOSPUR_HOUSE_TABLE = 'tospur_house';
const TOSPUR_IMAGE_TABLE = 'tospur_image';
const TOSPUR_TAG_TABLE = 'tospur_tag';
//sync url
......
......@@ -63,6 +63,180 @@ class InsertDao{
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
$buildpropertySql.
" 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".
" where 1=1";
" where 1=1 and status = 1";
if ($array['cityId'] > -1) {
$params[] = $array['cityId'];
$sql = $sql . " and cityId=%d";
......@@ -269,8 +269,7 @@ class SearchDao
$house_id = $value->id;
$house_ids[] = $house_id;
}
$string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
$tag_result = SearchDao::search_house_tag($string);
$tag_result = SearchDao::search_house_tag($house_ids);
//标签
if ($tag_result) {
foreach ($tag_result as $key => $value) {
......@@ -278,7 +277,7 @@ class SearchDao
}
}
//图片
$image_result = SearchDao::search_house_image($string);
$image_result = SearchDao::search_house_image($house_ids);
if ($image_result) {
foreach ($image_result as $key => $value) {
$array['images'][$value->house_id] = home_url() . Image::getImage($value->path,'small');
......@@ -293,18 +292,24 @@ class SearchDao
public static function search_house_image($house_ids)
{
$sql = 'select ahi.house_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 ' . $house_ids . ' group by house_id';
$string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
$sql = 'select * from (select ahi.house_id,ti.path,ti.image_type,case ti.image_type ' .
'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;
return $wpdb->get_results($sql);
}
public static function search_house_tag($house_ids)
{
$sql = 'select aht.house_id,tt.name from a_house_tag aht' .
' left join tospur_tag tt on aht.tag_id = tt.id' .
' where house_id in ' . $house_ids;
$string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
$sql = 'select aht.house_id,tt.name from ' . Config::A_HOUSE_TAG_TABLE . ' aht' .
' left join ' . Config::TOSPUR_TAG_TABLE . ' tt on aht.tag_id = tt.id' .
' where house_id in ' . $string;
global $wpdb;
return $wpdb->get_results($sql);
}
......@@ -360,19 +365,24 @@ class SearchDao
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));
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){
$value->path = Image::getImage($value->path,'small');
}
$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
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 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));
$context['consultant'] = $consultant;
if($type == 'edit'){
$imagesSql = 'select * from a_house_image ahi
LEFT JOIN tospur_image ti on ti.id = ahi.image_id
......@@ -393,69 +403,17 @@ class SearchDao
return $context;
}
public static function addHouseTag($tags, $house_id)
{
public static function searchHouseTag($houseId){
global $wpdb;
$arr = array(',' => ',');
$in = explode(',', strtr($tags, $arr));
//string
$tags_string = SearchDao::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 .= ",";
}
$sql = "select tt.name from a_house_tag aht
LEFT JOIN tospur_tag tt on aht.tag_id = tt.id
where aht.house_id = %d;";
$results = $wpdb->get_results($wpdb->prepare($sql,$houseId));
$tags = array();
foreach($results as $item){
$tags[] =$item->name;
}
$string .= ")";
return $string;
return implode(",",$tags);
}
}
\ No newline at end of file
......@@ -94,9 +94,13 @@ class TCSync {
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')));
//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()
require_once(PLUGIN_DIR . 'Admin/newHouseList.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouse.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('view_house.php');
add_action('admin_menu', 'reset_menu');
......@@ -133,6 +135,8 @@ function reset_menu()
add_submenu_page('newHouseList', 'newHouse_title', '添加新房', 'activate_plugins', 'newHouse', 'House::init_view');
add_menu_page('secHandHouseList','二手房列表', 'activate_plugins', 'secHandHouseList', 'secHandHouseList', 'dashicons-menu', 7);
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 );
global $menu;
......@@ -168,7 +172,7 @@ function reset_menu()
function do_sync()
{
TCSync::user_sync();
TCSync::organization_sync();
//TCSync::user_sync();
//TCSync::organization_sync();
TCSync::other_sync();
}
......@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -340,7 +271,7 @@ a:hover {
}
#wrapper #scroller ul {
margin-bottom: 0;
padding: 0 15px;
padding: 0 10px;
}
#wrapper #scroller ul li {
color: #636363;
......@@ -378,14 +309,23 @@ a:hover {
line-height: 60px;
color: #959595;
font-size: 22px;
border-top: 1px solid #7d7d7d;
border-top: 1px solid #959595;
}
.modal .modal-booking .modal-content ul li .iconfont {
color: #008cd7;
font-size: 18px;
position: absolute;
right: 20px;
}
.modal .modal-booking .modal-content ul li .iconfont:after {
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 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -405,14 +336,14 @@ a:hover {
}
#wrapper #scroller .row p img {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
}
#wrapper #scroller .row ul {
height: 100%;
......@@ -431,10 +362,16 @@ a:hover {
text-overflow: ellipsis;
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 {
margin-top: 2px;
height: 22px;
line-height: 22px;
margin-top: 2px;
}
#wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000;
......@@ -455,6 +392,14 @@ a:hover {
border: 1px solid #acacac;
margin: 0 5px 0 0;
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 {
color: #000000;
......@@ -482,9 +427,8 @@ a:hover {
-webkit-box-orient: vertical;
white-space: normal;
}
#wrapper #scroller .row ul li span:nth-child(2),
#wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
#wrapper #scroller .row:active {
background-color: #e9e9e9;
}
.footer {
width: 100%;
......@@ -493,9 +437,10 @@ a:hover {
}
.footer .btn {
width: 45%;
color: #ffffff;
font-weight: bold;
margin: 5px 2%;
padding: 1px;
color: #ffffff;
background-color: #008cd7;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
......@@ -508,6 +453,9 @@ a:hover {
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 {
width: 30px;
height: 30px;
......
......@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -332,7 +263,7 @@ a:hover {
}
body {
height: auto;
padding-bottom: 45px;
padding-bottom: 50px;
}
.collect {
position: fixed;
......@@ -504,14 +435,14 @@ body {
}
.detail_row #wrapper #scroller ul li p img {
width: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
}
.detail_row #wrapper #scroller ul li:last-child {
margin-right: 0;
......@@ -524,6 +455,10 @@ body {
height: 40px;
text-align: center;
}
.detail_row .map:active {
transform: scale(1.1);
-webkit-transform: scale(1.1);
}
.detail_row .map span {
width: 30px;
height: 30px;
......@@ -552,14 +487,14 @@ body {
background-position: center;
background-size: auto 100%;
-webkit-background-size: auto 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
}
.detail_row .peopleCont li {
width: 100%;
......@@ -569,6 +504,9 @@ body {
.detail_row .peopleCont li ol {
padding: 0;
}
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.detail_row .peopleCont li ol img {
width: 50px;
border-top-left-radius: 3px;
......@@ -628,18 +566,17 @@ body {
display: inline-block;
vertical-align: middle;
}
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.footer {
width: 100%;
height: 45px;
height: 50px;
background-color: rgba(125, 125, 125, 0.9);
}
.footer .btn {
.footer > .btn {
width: 45%;
margin: 5px 2%;
color: #ffffff;
font-weight: bold;
margin: 5px 2%;
padding: 6px 12px;
background-color: #008cd7;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
......@@ -652,42 +589,88 @@ body {
box-shadow: 0 2px 0 0 #117bb9;
-webkit-box-shadow: 0 2px 0 0 #117bb9;
}
.footer > .btn:active {
background-color: #117bb9;
}
.footer ul {
height: 100%;
margin-bottom: 0;
font-size: 0;
}
.footer ul li {
width: 60px;
height: 100%;
padding: 0;
color: #ffffff;
font-size: 10px;
padding-right: 0;
color: #000000;
}
.footer ul li p {
margin-bottom: 0;
.footer ul li img {
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;
}
.footer ul li.phone p:nth-child(1) {
width: 100%;
.footer ul li:nth-child(3) .btn.btn-phone span {
display: block;
}
.footer ul li:nth-child(3) .btn.btn-phone span:nth-child(1) {
width: 30px;
height: 30px;
background: url("../img/white_phone_icon.png") no-repeat;
background-size: auto 100%;
-webkit-background-size: auto 100%;
background-position: center;
background-size: cover;
-webkit-background-size: cover;
margin: 0 auto;
}
.footer ul li.wechat {
.footer ul li:nth-child(3) .btn.btn-wechat {
background-color: #00a99d;
}
.footer ul li.wechat p:nth-child(1) {
width: 100%;
.footer ul li:nth-child(3) .btn.btn-wechat span {
display: block;
}
.footer ul li:nth-child(3) .btn.btn-wechat span:nth-child(1) {
width: 30px;
height: 30px;
background: url("../img/white_wechat_icon.png") no-repeat;
background-size: auto 100%;
-webkit-background-size: auto 100%;
background-position: center;
background-size: cover;
-webkit-background-size: cover;
margin: 0 auto;
}
.footer ul li:nth-child(3) .btn:active {
background-color: #898989;
}
.modal #carousel_wrapper {
width: 100%;
......
......@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -437,10 +368,16 @@ a:hover {
-webkit-border-bottom-right-radius: 4px;
pointer-events: auto;
}
.container-fluid form .has-feedback.code .form-control-feedback:active {
background-color: #088aa9;
}
.container-fluid form .btn {
font-size: 22px;
display: block;
color: #ffffff;
font-weight: bold;
margin: 12% 0 5%;
padding: 16px;
padding: 14px;
background-color: #008cd7;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
......@@ -453,6 +390,9 @@ a:hover {
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 {
margin-top: 20%;
}
......@@ -469,6 +409,12 @@ a:hover {
margin: 0 5px;
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 {
margin-top: 30%;
padding-bottom: 25px;
......
......@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -330,16 +261,95 @@ body {
a:hover {
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 {
width: 75%;
}
.search .has-feedback .form-control {
color: #b7b7b7;
color: #acacac;
border-color: #117bb9;
-webkit-appearance: none;
}
.search .has-feedback .form-control::-webkit-input-placeholder {
color: #b7b7b7;
color: #acacac;
}
.search .has-feedback .form-control-feedback {
top: 3px;
......@@ -384,12 +394,12 @@ a:hover {
color: #b7b7b7;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
position: relative;
top: -2px;
left: 5px;
}
.btn-group-justified .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.btn-group-justified .btn-group.open .btn .iconfont:after {
content: "\e602";
......@@ -475,14 +485,14 @@ a:hover {
}
#wrapper #scroller .row p img {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
}
#wrapper #scroller .row ul {
height: 100%;
......@@ -501,10 +511,16 @@ a:hover {
text-overflow: ellipsis;
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 {
margin-top: 2px;
height: 22px;
line-height: 22px;
margin-top: 2px;
}
#wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000;
......@@ -525,6 +541,14 @@ a:hover {
border: 1px solid #acacac;
margin: 0 5px 0 0;
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 {
color: #000000;
......@@ -552,16 +576,15 @@ a:hover {
-webkit-box-orient: vertical;
white-space: normal;
}
#wrapper #scroller .row ul li span:nth-child(2),
#wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
#wrapper #scroller .row:active {
background-color: #e9e9e9;
}
.footer {
width: 100%;
height: 45px;
line-height: 45px;
color: #008cd7;
font-size: 22px;
font-size: 24px;
font-weight: bold;
background-color: rgba(255, 255, 255, 0.9);
}
......@@ -14,85 +14,6 @@
-webkit-text-stroke-width: 0.2px;
-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 {
width: 100%;
height: 40px;
......@@ -134,6 +55,7 @@
}
.modal .modal-dialog .modal-content {
color: #000000;
font-size: 16px;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
......@@ -153,9 +75,18 @@
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
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 {
border-top-color: #cfd0d0;
background-color: transparent;
......@@ -359,14 +290,14 @@ a:hover {
}
#wrapper #scroller .row p img {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-webkit-border-top-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
}
#wrapper #scroller .row ul {
height: 100%;
......@@ -385,10 +316,16 @@ a:hover {
text-overflow: ellipsis;
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 {
margin-top: 2px;
height: 22px;
line-height: 22px;
margin-top: 2px;
}
#wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000;
......@@ -409,6 +346,14 @@ a:hover {
border: 1px solid #acacac;
margin: 0 5px 0 0;
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 {
color: #000000;
......@@ -436,7 +381,6 @@ a:hover {
-webkit-box-orient: vertical;
white-space: normal;
}
#wrapper #scroller .row ul li span:nth-child(2),
#wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
#wrapper #scroller .row:active {
background-color: #e9e9e9;
}
<?php
require_once(WP_PLUGIN_DIR."/tospur/Config.php");
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php");
$context = array();
$context['theme'] = get_template_directory_uri();
$context['siteUrl'] = get_site_url();
if(isset($_GET['hid'])){
$hid = $_GET['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);
$mainImagesSql = "SELECT db.literal as type,ada.house_area as area,ti.path FROM ".Config::A_DISTRICT_AREA_TABLE." ada
LEFT JOIN ".Config::DIC_BUILDPROPERTY_TABLE." db on db.value = ada.buildproperty_id
LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on ti.id = ada.image_id
where ada.house_id = %d";
$mainImage = $wpdb->get_results($wpdb->prepare($mainImagesSql,$hid));
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);
$context = array_merge($context,SearchDao::getDetailInfo($hid));
$houseType = $context['result']->house_type;
if($houseType !=0){
Timber::render('detailOther.html', $context);
}else
Timber::render('detail.html', $context);
}else{
Timber::render('error.html', $context);
}
......
......@@ -8,19 +8,19 @@ if ($_POST) {
$code = $_POST['code'];
$password = $_POST['password'];
if (!$phone) {
$context['phoneError'] = '请输入11位手机号';
$context['error'] = '请输入11位手机号';
} else if (!$code) {
$context['codeError'] = '请输入验证码';
$context['error'] = '请输入验证码';
} else if (!$password) {
$context['passwordError'] = '请输入新密码';
$context['error'] = '请输入新密码';
} else {
$search_code = dao::search_tospur_verify($phone, $code);
if ($code == $search_code) {
wp_set_password($password, $user->data->ID);
dao::update_tospur_verify($phone);
echo '成功修改密码';
$context['error'] = '成功修改密码';
} else {
$context['codeError'] = '请输入正确的验证码';
$context['error'] = '验证码错误';
}
}
}
......
......@@ -5,9 +5,13 @@ $context['theme'] = get_template_directory_uri();
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php");
$cityId = 1;
$houseType = 0;
if($_GET['cityId'])
$cityId = $_GET['cityId'];
if($_GET['houseType'])
$houseType = $_GET['houseType'];
$context['cityId'] = $cityId;
$context['houseType'] = $houseType;
$context['cityName'] = SearchDao::getCityNameWithId($cityId);
$context['select']['city'] = SearchDao::searchCity();
$context['select']['district'] = SearchDao::searchCity($cityId);
......@@ -25,6 +29,6 @@ $context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId);
$context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId);
$context['select']['area'] = json_encode(SearchDao::searchArea($cityId));
$context['site_url'] = site_url();
$context['url'] = home_url();
Timber::render('index.html', $context);
?>
\ No newline at end of file
......@@ -75,4 +75,84 @@ Date.prototype.Format = function (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)));
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) {
$context['error'] = '抱歉,用户名已存在';
}
} else {
$context['error'] = '请输入正确的验证码';
$context['error'] = '验证码错误';
}
}
}
......
......@@ -19,7 +19,7 @@ if ($user_id != 0) {
$context['consultant_id'] = $_GET['consultant_id'];
Timber::render('view.html', $context);
}else{
wp_redirect(get_site_url()."?page=login");
wp_redirect(home_url()."?page=login");
exit;
}
......
......@@ -12,14 +12,20 @@
<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/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/public.js"></script>
</head>
<body>
<div class="jumbotron">
<ul class="list-unstyled">
<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 class="col-xs-8">
<p>{{ consultant.display_name }}</p>
......@@ -141,26 +147,20 @@
var template;
var loading;
$(document).ready(function () {
var searchData = {
action: 'get_my_house',
houseType: houseType,
userType: 1,
userId: userId,
index: 0
};
var tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html();
loading = $('#loading');
ajax_get_house(tabPane);
var pullUpFlag = false;
ajax_get_house('{{ url }}', loading, searchData, tabPane);
var peopleScroll = new IScroll('#people_wrapper');
myScroll = new IScroll('#wrapper', {
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_house(tabPane);
}
myScroll = scrollPullToRefresh(function(){
ajax_get_house('{{ url }}', loading, searchData, tabPane);
});
var aTab = $('a[data-toggle=tab]');
aTab.on('show.bs.tab', function (e) {
......@@ -170,69 +170,16 @@
houseType = $(e.target).parent().index();
tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html();
index = 0;
searchData.houseType = houseType;
searchData.index = 0;
myScroll.scrollTo(0, 0);
setTimeout(function () {
myScroll.refresh();
ajax_get_house(tabPane);
ajax_get_house('{{ url }}', loading, searchData, tabPane);
}, 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>
</body>
</html>
\ No newline at end of file
......@@ -13,6 +13,7 @@
<script src="{{ theme }}/js/jquery.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/public.js"></script>
</head>
<body>
<div class="search">
......@@ -91,25 +92,11 @@
}
cityScroll.refresh();
});
var pullUpFlag = false;
cityScroll = new IScroll('#city_wrapper',{
click: true
});
myScroll = new IScroll('#wrapper',{
click: true
});
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();
}
myScroll = scrollPullToRefresh(function(){
ajax_get_consultant();
});
template = $('#template').html();
ajax_get_consultant();
......@@ -129,7 +116,7 @@
li.append(template);
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=image]').attr('src', value.imageUrl);
li.find('[data-attr=image]').attr('src', value.imageUrl!=""?value.imageUrl:"{{ theme }}/img/head.png");
var infoUrl;
if(value.mobile){
li.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile);
......
......@@ -16,7 +16,6 @@
<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;
......@@ -45,12 +44,6 @@
$(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,
......@@ -64,6 +57,11 @@
$("#carousel_indicator li").removeClass("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;
});
$("#carousel_wrapper").parent().bind("click",function(){
......@@ -205,6 +203,7 @@
<p class="detail_title">置业顾问</p>
<ul class="list-unstyled peopleCont">
{% for item in consultant %}
<a href="{{siteUrl}}?page=consultant_info&consultant_id={{ item.id }}">
<li>
<ol class="col-xs-2 text-center">
{% if item.imageUrl %}
......@@ -215,7 +214,7 @@
</ol>
<ol class="col-xs-4">
<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-stars" data-content="" style="width: {{item.average_score*2*10}}%;"></div>
</div>
......@@ -234,6 +233,7 @@
</a>
</ol>
</li>
</a>
{% endfor %}
</ul>
</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 @@
<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-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.validate.js"></script>
<script src="{{ theme }}/js/bootstrap.min.js"></script>
<script src="{{ theme }}/js/public.js"></script>
<script>
$(document).ready(function () {
var notice = $('#notice');
var myModal = $('#myModal');
$('#forgetForm').validate({
onkeyup: false,
onfocusout: false,
rules: {
phone: {
required: true,
......@@ -26,39 +33,65 @@
phone: '请输入11位手机号',
code: '请输入验证码',
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);
{% if(error) %}
notice.html('<span>{{ error }}</span>');
myModal.modal('show');
{% endif %}
});
</script>
</head>
<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>
<label for="code">验证码<br>
<input type="text" name="code" id="code">
<label id="code-error" class="error" for="code">{{ codeError }}</label>
</label>
<span id="send">发送验证码</span>
</p>
<div class="container-fluid text-center">
<form id="forgetForm" method="post">
<h2>忘记密码</h2>
<p class="has-feedback username">
<label for="phone" class="sr-only">用户名</label>
<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>
<label for="password">新密码<br>
<input type="password" name="password" id="password">
<label id="password-error" class="error" for="password">{{ passwordError }}</label>
</label>
</p>
<p class="has-feedback password">
<label for="password" class="sr-only">新密码</label>
<input type="password" name="password" id="password" class="form-control input-lg" placeholder="新密码">
<span class="form-control-feedback"></span>
</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">
<input type="submit" id="forget_submit" value="修改密码">
</p>
</form>
<p id="notice"></p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -11,6 +11,8 @@
<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/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>
<body>
<ul id="tab" class="list-unstyled btn-group-justified tab">
......@@ -105,30 +107,23 @@
<script>
var houseType = 0;
var userId = '{{ user_id }}';
var index = 0;
var myScroll;
var template;
var loading;
$(document).ready(function () {
var searchData = {
action: 'get_my_house',
houseType: houseType,
userType: 0,
userId: userId,
index: 0
};
var tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html();
loading = $('#loading');
ajax_get_my_house(tabPane);
var pullUpFlag = false;
myScroll = new IScroll('#wrapper', {
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);
}
ajax_get_house('{{ url }}', loading, searchData, tabPane);
myScroll = scrollPullToRefresh(function(){
ajax_get_house('{{ url }}', loading, searchData, tabPane);
});
var aTab = $('a[data-toggle=tab]');
aTab.on('show.bs.tab', function (e) {
......@@ -138,69 +133,16 @@
houseType = $(e.target).parent().index();
tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html();
index = 0;
searchData.houseType = houseType;
searchData.index = 0;
myScroll.scrollTo(0, 0);
setTimeout(function () {
myScroll.refresh();
ajax_get_my_house(tabPane);
ajax_get_house('{{ url }}', loading, searchData, tabPane);
}, 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>
</body>
</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