Commit 5f52676f by shz

tospur

parent ec8333cf
...@@ -131,6 +131,71 @@ class SearchDao ...@@ -131,6 +131,71 @@ class SearchDao
} }
} }
public static function addHouseTag($tags, $house_id)
{
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 .= ",";
}
}
$string .= ")";
return $string;
}
public static function ajax_searchHouse() public static function ajax_searchHouse()
{ {
wp_send_json(SearchDao::searchHouse( wp_send_json(SearchDao::searchHouse(
...@@ -151,14 +216,21 @@ class SearchDao ...@@ -151,14 +216,21 @@ class SearchDao
{ {
global $wpdb; global $wpdb;
$params = array(); $params = array();
$sql = "select * from tospur_house th $buildpropertySql = null;
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 $orderbySql = null;
left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on ada.buildproperty_id = dbp.bp_value if ($array['houseType'] == 0) {
left join (select plateId,plateName from dic_city) dcp on th.plate_id = dcp.plateId $buildpropertySql = " 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 districtId,districtName from dic_city) dcd on th.district_id = dcd.districtId " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on ada.buildproperty_id = dbp.bp_value";
left join (select cityId,cityName from dic_city) dcc on th.city_id = dcc.cityId $orderbySql = " group by ada.bph_id order by th.creattime DESC";
left join (select id as rid,value as r_value,literal from dic_room) dr on th.room_id = dr.r_value } else if ($array['houseType'] == 1 || $array['houseType'] == 2) {
where 1=1"; $buildpropertySql = " left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value";
$orderbySql = " order by th.creattime DESC";
}
$sql = "select * from tospur_house th" .
$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";
if ($array['cityId'] > -1) { if ($array['cityId'] > -1) {
$params[] = $array['cityId']; $params[] = $array['cityId'];
$sql = $sql . " and cityId=%d"; $sql = $sql . " and cityId=%d";
...@@ -205,13 +277,12 @@ class SearchDao ...@@ -205,13 +277,12 @@ class SearchDao
$sql = $sql . " and id in (select house_id from a_house_user where user_type = %d and user_id = %d)"; $sql = $sql . " and id in (select house_id from a_house_user where user_type = %d and user_id = %d)";
} }
$sql = $sql . " group by bph_id order by th.creattime DESC"; $sql = $sql . $orderbySql;
if ($array['index'] > -1) { if ($array['index'] > -1) {
$params[] = $array['index']; $params[] = $array['index'];
$sql = $sql . " limit %d,10"; $sql = $sql . " limit %d,10";
} }
$result = $wpdb->get_results($wpdb->prepare($sql, $params)); $result = $wpdb->get_results($wpdb->prepare($sql, $params));
return $result; return $result;
} }
......
...@@ -132,7 +132,7 @@ class consultantScoreList extends WP_List_Table ...@@ -132,7 +132,7 @@ class consultantScoreList extends WP_List_Table
//$data = $this->example_data; //$data = $this->example_data;
$sql = "SELECT s.id,c.user_login as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s " . $sql = "SELECT s.id,c.display_name as consultant,u.user_login as user,s.score,s.valid FROM tospur_consultant_score s " .
"left join wp_users u on s.user_id = u.ID " . "left join wp_users u on s.user_id = u.ID " .
"left join wp_users c on s.consultant_id = c.ID"; "left join wp_users c on s.consultant_id = c.ID";
$result = $wpdb->get_results($sql); $result = $wpdb->get_results($sql);
......
...@@ -16,6 +16,6 @@ $context['consultant_result'] = $wpdb->get_results($consultant_sql); ...@@ -16,6 +16,6 @@ $context['consultant_result'] = $wpdb->get_results($consultant_sql);
$context['url'] = home_url(); $context['url'] = home_url();
$context['id'] = $house_id; $context['id'] = $house_id;
Timber::render('views/handle.html', $context); Timber::render('Admin/views/handle.html', $context);
?> ?>
\ No newline at end of file
...@@ -55,42 +55,11 @@ class viewHouseList extends WP_List_Table ...@@ -55,42 +55,11 @@ class viewHouseList extends WP_List_Table
} }
} }
function column_title($item)
{
//Build row actions
$actions = array(
'edit' => sprintf('<a href="?page=%s&action=%s&house=%s">Edit</a>', $_REQUEST['page'], 'edit', $item['ID']),
'delete' => sprintf('<a href="?page=%s&action=%s&house=%s">Delete</a>', $_REQUEST['page'], 'delete', $item['ID']),
);
//Return the title contents
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
/*$1%s*/
$item['title'],
/*$2%s*/
$item['ID'],
/*$3%s*/
$this->row_actions($actions)
);
}
function column_cb($item)
{
return sprintf(
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
/*$1%s*/
$this->_args['singular'], //Let's simply repurpose the table's singular label ("house")
/*$2%s*/
$item['ID'] //The value of the checkbox should be the record's id
);
}
function get_columns() function get_columns()
{ {
$columns = array( $columns = array(
'cb' => '<input type="checkbox">', //Render a checkbox instead of text
'name' => '楼盘名/房源名', 'name' => '楼盘名/房源名',
'date' => '时间', 'date' => '预约时间',
'phone' => '手机号', 'phone' => '手机号',
'consultant' => '置业顾问', 'consultant' => '置业顾问',
'handle' => '处理状态', 'handle' => '处理状态',
...@@ -112,22 +81,6 @@ class viewHouseList extends WP_List_Table ...@@ -112,22 +81,6 @@ class viewHouseList extends WP_List_Table
return $sortable_columns; return $sortable_columns;
} }
function get_bulk_actions()
{
$actions = array(
'delete' => 'Delete'
);
return $actions;
}
function process_bulk_action()
{
if ('delete' === $this->current_action()) {
wp_die('Items deleted (or they would be if we had items to delete)!');
}
}
function prepare_items() function prepare_items()
{ {
global $wpdb; global $wpdb;
...@@ -139,8 +92,6 @@ class viewHouseList extends WP_List_Table ...@@ -139,8 +92,6 @@ class viewHouseList extends WP_List_Table
$this->_column_headers = array($columns, $hidden); $this->_column_headers = array($columns, $hidden);
$this->process_bulk_action();
$sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.display_name as consultant, v.handle, v.handle_date FROM tospur_view_house v ' $sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, c.display_name as consultant, v.handle, v.handle_date FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id ' . 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id ' . 'left join wp_users u on v.user_id = u.id '
...@@ -152,7 +103,7 @@ class viewHouseList extends WP_List_Table ...@@ -152,7 +103,7 @@ class viewHouseList extends WP_List_Table
$data[$key] = array( $data[$key] = array(
'id' => $value->id, 'id' => $value->id,
'name' => $value->name, 'name' => $value->name,
'date' => $value->date, 'date' => $value->date.' '.$value->time,
'phone' => $value->phone, 'phone' => $value->phone,
'consultant' => $value->consultant, 'consultant' => $value->consultant,
'handle' => $value->handle, 'handle' => $value->handle,
...@@ -160,16 +111,6 @@ class viewHouseList extends WP_List_Table ...@@ -160,16 +111,6 @@ class viewHouseList extends WP_List_Table
); );
} }
/*function usort_reorder($a, $b)
{
$orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'handle'; //If no sort, default to title
$order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc
$result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
return ($order === 'asc') ? $result : -$result; //Send final sort direction to usort
}
usort($data, 'usort_reorder');*/
$current_page = $this->get_pagenum(); $current_page = $this->get_pagenum();
$total_items = count($data); $total_items = count($data);
......
...@@ -11,7 +11,7 @@ if ($user_id != 0) { ...@@ -11,7 +11,7 @@ if ($user_id != 0) {
$consultant_id = $_GET['consultant_id']; $consultant_id = $_GET['consultant_id'];
$context['consultant_id'] = $consultant_id; $context['consultant_id'] = $consultant_id;
$context['consultant_name'] = get_user_by('id', $consultant_id)->display_name; $context['consultant_name'] = get_user_by('id', $consultant_id)->display_name;
$context['consultant_score'] = get_consultant_score($consultant_id); $context['consultant'] = get_consultant_info($consultant_id);
$context['consultant_score_url'] = $const_score_page . '&consultant_id=' . $consultant_id; $context['consultant_score_url'] = $const_score_page . '&consultant_id=' . $consultant_id;
} }
......
...@@ -4,13 +4,18 @@ $context = array(); ...@@ -4,13 +4,18 @@ $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
$context['url'] = home_url(); $context['url'] = home_url();
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php"); require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php");
$city = SearchDao::searchCity(); $city = SearchDao::searchCity();
$context['city'] = $city; $context['city'] = $city;
$city_id = $_GET['city_id']; $city_id = $_GET['city_id'];
if(!isset($city_id)){ if (!isset($city_id)) {
$city_id = $city[0]->id; $city_id = $city[0]->id;
} }
foreach ($city as $value) {
if ($value->id == $city_id) {
$context['city_name'] = $value->value;
}
}
$context['city_id'] = $city_id; $context['city_id'] = $city_id;
Timber::render('consultant_list.html', $context); Timber::render('consultant_list.html', $context);
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
...@@ -344,7 +343,7 @@ a:hover { ...@@ -344,7 +343,7 @@ a:hover {
padding: 0 15px; padding: 0 15px;
} }
#wrapper #scroller ul li { #wrapper #scroller ul li {
color: #626262; color: #636363;
padding: 20px 0; padding: 20px 0;
border-bottom: 1px solid #7d7d7d; border-bottom: 1px solid #7d7d7d;
} }
......
@font-face {
font-family: 'iconfont';
src: url('http://at.alicdn.com/t/font_1439432624_5842593.eot');
src: url('http://at.alicdn.com/t/font_1439432624_5842593.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://at.alicdn.com/t/font_1439432624_5842593.woff') format('woff'), /* chrome、firefox */ url('http://at.alicdn.com/t/font_1439432624_5842593.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://at.alicdn.com/t/font_1439432624_5842593.svg#iconfont') format('svg');
/* IE9*/
/* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-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;
margin-bottom: 0;
border-bottom: 1px solid #008cd7;
}
.tab li .btn {
color: #000000;
font-size: 18px;
font-weight: bold;
position: static;
}
.tab li .btn:after {
content: "";
width: 88%;
height: 4px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
}
.tab li .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.tab li.active .btn:after {
background-color: #008cd7;
}
.modal .modal-dialog {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 280px;
height: 130px;
}
.modal .modal-dialog .modal-content {
color: #000000;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
box-shadow: none;
-webkit-box-shadow: none;
}
.modal .modal-dialog .modal-content h4 {
font-size: 19px;
font-weight: bold;
margin: 0 20px;
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px;
}
.modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0;
background-color: transparent;
font-weight: bold;
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;
}
.modal .modal-dialog .modal-content .btn:active {
background-color: #e9e9e9;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
box-shadow: none;
-webkit-box-shadow: none;
}
.modal .modal-dialog .modal-content .btn:focus {
outline: 0;
}
.loading {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1040;
background-color: rgba(0, 0, 0, 0.5);
}
.loading ul {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 40px;
height: 40px;
}
.loading ul li {
position: absolute;
width: 100%;
height: 100%;
}
.loading ul li:nth-child(1) p:nth-child(2) {
animation-delay: -0.9s;
-webkit-animation-delay: -0.9s;
}
.loading ul li:nth-child(1) p:nth-child(3) {
animation-delay: -0.6s;
-webkit-animation-delay: -0.6s;
}
.loading ul li:nth-child(1) p:nth-child(4) {
animation-delay: -0.3s;
-webkit-animation-delay: -0.3s;
}
.loading ul li:nth-child(2) {
transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
}
.loading ul li:nth-child(2) p:nth-child(1) {
animation-delay: -1.1s;
-webkit-animation-delay: -1.1s;
}
.loading ul li:nth-child(2) p:nth-child(2) {
animation-delay: -0.8s;
-webkit-animation-delay: -0.8s;
}
.loading ul li:nth-child(2) p:nth-child(3) {
animation-delay: -0.5s;
-webkit-animation-delay: -0.5s;
}
.loading ul li:nth-child(2) p:nth-child(4) {
animation-delay: -0.2s;
-webkit-animation-delay: -0.2s;
}
.loading ul li:nth-child(3) {
transform: rotateZ(90deg);
-webkit-transform: rotateZ(90deg);
}
.loading ul li:nth-child(3) p:nth-child(1) {
animation-delay: -1s;
-webkit-animation-delay: -1s;
}
.loading ul li:nth-child(3) p:nth-child(2) {
animation-delay: -0.7s;
-webkit-animation-delay: -0.7s;
}
.loading ul li:nth-child(3) p:nth-child(3) {
animation-delay: -0.4s;
-webkit-animation-delay: -0.4s;
}
.loading ul li:nth-child(3) p:nth-child(4) {
animation-delay: -0.1s;
-webkit-animation-delay: -0.1s;
}
.loading ul li p {
width: 10px;
height: 10px;
margin-bottom: 0;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
-webkit-border-top-left-radius: 50%;
-webkit-border-top-right-radius: 50%;
-webkit-border-bottom-left-radius: 50%;
-webkit-border-bottom-right-radius: 50%;
position: absolute;
background-color: #ffffff;
animation: bouncedelay 1.2s infinite ease-in-out both;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out both;
}
.loading ul li p:nth-child(1) {
top: 0;
left: 0;
}
.loading ul li p:nth-child(2) {
top: 0;
right: 0;
}
.loading ul li p:nth-child(3) {
bottom: 0;
right: 0;
}
.loading ul li p:nth-child(4) {
bottom: 0;
left: 0;
}
@keyframes bouncedelay {
0%,
80%,
100% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
@-webkit-keyframes bouncedelay {
0%,
80%,
100% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
html,
body {
width: 100%;
height: 100%;
}
body {
user-select: none;
-webkit-user-select: none;
tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
color: #707070;
background-color: #f9f9f9;
}
a:hover {
text-decoration: none;
}
.main form > p {
color: #000000;
font-size: 20px;
font-weight: bold;
padding: 20px 0 0 35px;
}
.main form ul {
margin-bottom: 30%;
border-top: 1px solid #008cd7;
}
.main form ul li {
width: 100%;
height: 60px;
line-height: 60px;
color: #636363;
font-size: 15px;
background-color: #ffffff;
border-bottom: 1px solid #008cd7;
}
.main form ul li label {
margin-bottom: 0;
text-align: center;
}
.main form ul li label input[type="radio"] {
display: none;
}
.main form ul li label input[type="radio"]:checked + span {
background-position: -27px -1px;
}
.main form ul li label span {
width: 25px;
height: 25px;
background: url("../img/radio_icon.png") no-repeat;
background-size: 53px 27px;
-webkit-background-size: 53px 27px;
background-position: -1px -1px;
display: inline-block;
position: relative;
top: 8px;
margin-right: 5px;
}
.main form ul li label span.time {
width: 30px;
height: 30px;
background: url("../img/blue_time_icon.png") no-repeat;
background-size: cover;
-webkit-background-size: cover;
top: 10px;
}
.main form ul li p {
margin-bottom: 0;
text-align: center;
}
.main form ul li p select {
font-size: 20px;
background-color: transparent;
border: 0;
margin: 0 -8px;
}
.main form .btn {
width: 90%;
color: #ffffff;
margin: 0 auto;
padding: 16px;
display: block;
background-color: #008cd7;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
box-shadow: 0 2px 0 0 #117bb9;
-webkit-box-shadow: 0 2px 0 0 #117bb9;
}
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
...@@ -418,6 +417,6 @@ a:hover { ...@@ -418,6 +417,6 @@ a:hover {
} }
#wrapper #scroller ul li ol p:nth-child(3) { #wrapper #scroller ul li ol p:nth-child(3) {
font-size: 16px; font-size: 16px;
color: #626262; color: #636363;
font-weight: normal; font-weight: normal;
} }
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
...@@ -356,7 +355,7 @@ a:hover { ...@@ -356,7 +355,7 @@ a:hover {
} }
.jumbotron ul li p { .jumbotron ul li p {
margin: 2px 0 0; margin: 2px 0 0;
color: #626262; color: #636363;
font-size: 18px; font-size: 18px;
} }
.jumbotron ul li p:nth-child(1) { .jumbotron ul li p:nth-child(1) {
...@@ -426,6 +425,7 @@ a:hover { ...@@ -426,6 +425,7 @@ a:hover {
font-size: 15px; font-size: 15px;
} }
#wrapper #scroller .row ul li { #wrapper #scroller .row ul li {
height: 18px;
line-height: 18px; line-height: 18px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -433,6 +433,7 @@ a:hover { ...@@ -433,6 +433,7 @@ a:hover {
} }
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px; margin-top: 2px;
height: 22px;
line-height: 22px; line-height: 22px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
...@@ -481,8 +482,9 @@ a:hover { ...@@ -481,8 +482,9 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2) { #wrapper #scroller .row ul li span:nth-child(2),
margin-left: 20px; #wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
} }
.footer { .footer {
width: 100%; width: 100%;
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
...@@ -496,6 +495,7 @@ a:hover { ...@@ -496,6 +495,7 @@ a:hover {
font-size: 15px; font-size: 15px;
} }
#wrapper #scroller .row ul li { #wrapper #scroller .row ul li {
height: 18px;
line-height: 18px; line-height: 18px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -503,6 +503,7 @@ a:hover { ...@@ -503,6 +503,7 @@ a:hover {
} }
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px; margin-top: 2px;
height: 22px;
line-height: 22px; line-height: 22px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
...@@ -551,8 +552,9 @@ a:hover { ...@@ -551,8 +552,9 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2) { #wrapper #scroller .row ul li span:nth-child(2),
margin-left: 20px; #wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
} }
.footer { .footer {
width: 100%; width: 100%;
......
@font-face {
font-family: 'iconfont';
src: url('http://at.alicdn.com/t/font_1439432624_5842593.eot');
src: url('http://at.alicdn.com/t/font_1439432624_5842593.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://at.alicdn.com/t/font_1439432624_5842593.woff') format('woff'), /* chrome、firefox */ url('http://at.alicdn.com/t/font_1439432624_5842593.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://at.alicdn.com/t/font_1439432624_5842593.svg#iconfont') format('svg');
/* IE9*/
/* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-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;
margin-bottom: 0;
border-bottom: 1px solid #008cd7;
}
.tab li .btn {
color: #000000;
font-size: 18px;
font-weight: bold;
position: static;
}
.tab li .btn:after {
content: "";
width: 88%;
height: 4px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
}
.tab li .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.tab li.active .btn:after {
background-color: #008cd7;
}
.modal .modal-dialog {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 280px;
height: 130px;
}
.modal .modal-dialog .modal-content {
color: #000000;
border: 0;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
box-shadow: none;
-webkit-box-shadow: none;
}
.modal .modal-dialog .modal-content h4 {
font-size: 19px;
font-weight: bold;
margin: 0 20px;
padding-top: 15px;
}
.modal .modal-dialog .modal-content p {
font-size: 16px;
margin: 12px 20px 14px;
}
.modal .modal-dialog .modal-content .btn {
border-top-color: #cfd0d0;
background-color: transparent;
font-weight: bold;
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;
}
.modal .modal-dialog .modal-content .btn:active {
background-color: #e9e9e9;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
box-shadow: none;
-webkit-box-shadow: none;
}
.modal .modal-dialog .modal-content .btn:focus {
outline: 0;
}
.loading {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1040;
background-color: rgba(0, 0, 0, 0.5);
}
.loading ul {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 40px;
height: 40px;
}
.loading ul li {
position: absolute;
width: 100%;
height: 100%;
}
.loading ul li:nth-child(1) p:nth-child(2) {
animation-delay: -0.9s;
-webkit-animation-delay: -0.9s;
}
.loading ul li:nth-child(1) p:nth-child(3) {
animation-delay: -0.6s;
-webkit-animation-delay: -0.6s;
}
.loading ul li:nth-child(1) p:nth-child(4) {
animation-delay: -0.3s;
-webkit-animation-delay: -0.3s;
}
.loading ul li:nth-child(2) {
transform: rotateZ(45deg);
-webkit-transform: rotateZ(45deg);
}
.loading ul li:nth-child(2) p:nth-child(1) {
animation-delay: -1.1s;
-webkit-animation-delay: -1.1s;
}
.loading ul li:nth-child(2) p:nth-child(2) {
animation-delay: -0.8s;
-webkit-animation-delay: -0.8s;
}
.loading ul li:nth-child(2) p:nth-child(3) {
animation-delay: -0.5s;
-webkit-animation-delay: -0.5s;
}
.loading ul li:nth-child(2) p:nth-child(4) {
animation-delay: -0.2s;
-webkit-animation-delay: -0.2s;
}
.loading ul li:nth-child(3) {
transform: rotateZ(90deg);
-webkit-transform: rotateZ(90deg);
}
.loading ul li:nth-child(3) p:nth-child(1) {
animation-delay: -1s;
-webkit-animation-delay: -1s;
}
.loading ul li:nth-child(3) p:nth-child(2) {
animation-delay: -0.7s;
-webkit-animation-delay: -0.7s;
}
.loading ul li:nth-child(3) p:nth-child(3) {
animation-delay: -0.4s;
-webkit-animation-delay: -0.4s;
}
.loading ul li:nth-child(3) p:nth-child(4) {
animation-delay: -0.1s;
-webkit-animation-delay: -0.1s;
}
.loading ul li p {
width: 10px;
height: 10px;
margin-bottom: 0;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
-webkit-border-top-left-radius: 50%;
-webkit-border-top-right-radius: 50%;
-webkit-border-bottom-left-radius: 50%;
-webkit-border-bottom-right-radius: 50%;
position: absolute;
background-color: #ffffff;
animation: bouncedelay 1.2s infinite ease-in-out both;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out both;
}
.loading ul li p:nth-child(1) {
top: 0;
left: 0;
}
.loading ul li p:nth-child(2) {
top: 0;
right: 0;
}
.loading ul li p:nth-child(3) {
bottom: 0;
right: 0;
}
.loading ul li p:nth-child(4) {
bottom: 0;
left: 0;
}
@keyframes bouncedelay {
0%,
80%,
100% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
@-webkit-keyframes bouncedelay {
0%,
80%,
100% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
html,
body {
width: 100%;
height: 100%;
}
body {
user-select: none;
-webkit-user-select: none;
tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
color: #707070;
background-color: #f9f9f9;
}
a:hover {
text-decoration: none;
}
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
height: 54px; height: 54px;
padding: 10px 10px 10px 5px; padding: 10px 10px 10px 5px;
position: relative; position: relative;
z-index: 2;
background-color: #008cd7; background-color: #008cd7;
border-bottom: 1px solid #008cd7; border-bottom: 1px solid #008cd7;
} }
...@@ -380,6 +379,7 @@ a:hover { ...@@ -380,6 +379,7 @@ a:hover {
font-size: 15px; font-size: 15px;
} }
#wrapper #scroller .row ul li { #wrapper #scroller .row ul li {
height: 18px;
line-height: 18px; line-height: 18px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -387,6 +387,7 @@ a:hover { ...@@ -387,6 +387,7 @@ a:hover {
} }
#wrapper #scroller .row ul li.address { #wrapper #scroller .row ul li.address {
margin-top: 2px; margin-top: 2px;
height: 22px;
line-height: 22px; line-height: 22px;
} }
#wrapper #scroller .row ul li.address span:nth-child(1) { #wrapper #scroller .row ul li.address span:nth-child(1) {
...@@ -435,6 +436,7 @@ a:hover { ...@@ -435,6 +436,7 @@ a:hover {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
white-space: normal; white-space: normal;
} }
#wrapper #scroller .row ul li span:nth-child(2) { #wrapper #scroller .row ul li span:nth-child(2),
margin-left: 20px; #wrapper #scroller .row ul li span:nth-child(3) {
margin-left: 15px;
} }
...@@ -48,7 +48,9 @@ class dao ...@@ -48,7 +48,9 @@ class dao
public static function search_view_house_by_user_id($user_id) public static function search_view_house_by_user_id($user_id)
{ {
global $wpdb; global $wpdb;
$sql = "select v.house_id,v.date,v.time,v.consultant_id,v.handle from " . tospur_view_house_table . " v where user_id = " . $user_id . " order by v.date desc"; $sql = "select v.house_id,v.date,v.time,v.consultant_id,v.handle,h.name from " . tospur_view_house_table . " v " .
"left join tospur_house h on v.house_id = h.id " .
"where v.user_id = " . $user_id . " order by v.date desc";
return $wpdb->get_results($sql); return $wpdb->get_results($sql);
} }
...@@ -56,7 +58,9 @@ class dao ...@@ -56,7 +58,9 @@ class dao
public static function search_view_house_by_consultant_id($consultant_id) public static function search_view_house_by_consultant_id($consultant_id)
{ {
global $wpdb; global $wpdb;
$sql = "select v.id,v.house_id,v.user_id,v.date,v.time,v.handle from " . tospur_view_house_table . " v where consultant_id = " . $consultant_id . " order by v.date desc"; $sql = "select v.id,v.house_id,v.date,v.time,v.user_id,v.handle,h.name from " . tospur_view_house_table . " v " .
"left join tospur_house h on v.house_id = h.id " .
"where v.consultant_id = " . $consultant_id . " order by v.date desc";
return $wpdb->get_results($sql); return $wpdb->get_results($sql);
} }
...@@ -74,12 +78,15 @@ class dao ...@@ -74,12 +78,15 @@ class dao
return $result; return $result;
} }
//search 置业顾问评分 //search 置业顾问信息
public static function search_consultant_score($consultant_id) public static function search_consultant_info($consultant_id)
{ {
global $wpdb; global $wpdb;
$sql = "select sum(score)/count(score) as average_score from tospur_consultant_score where consultant_id = " . $consultant_id . " and valid = 1;"; $sql = "select c.*,u.display_name,s.average_score from tospur_consultant c " .
return $wpdb->get_var($sql); "left join wp_users u on c.id = u.ID " .
"left join (select consultant_id,sum(score)/count(score) as average_score from tospur_consultant_score group by consultant_id) s " .
"on c.id = s.consultant_id where c.id = " . $consultant_id;
return $wpdb->get_row($sql);
} }
public static function update_consultant_score($score_id, $valid) public static function update_consultant_score($score_id, $valid)
......
...@@ -8,19 +8,19 @@ if ($_POST) { ...@@ -8,19 +8,19 @@ if ($_POST) {
$code = $_POST['code']; $code = $_POST['code'];
$password = $_POST['password']; $password = $_POST['password'];
if (!$phone) { if (!$phone) {
$context['phoneError'] = '请输入11位手机号'; $context['error'] = '请输入11位手机号';
} else if (!$code) { } else if (!$code) {
$context['codeError'] = '请输入验证码'; $context['error'] = '请输入验证码';
} else if (!$password) { } else if (!$password) {
$context['passwordError'] = '请输入新密码'; $context['error'] = '请输入新密码';
} else { } else {
$search_code = dao::search_tospur_verify($phone, $code); $search_code = dao::search_tospur_verify($phone, $code);
if ($code == $search_code) { if ($code == $search_code) {
wp_set_password($password, $user->data->ID); wp_set_password($password, $user->data->ID);
dao::update_tospur_verify($phone); dao::update_tospur_verify($phone);
echo '成功修改密码'; $context['error'] = '成功修改密码';
} else { } else {
$context['codeError'] = '请输入正确的验证码'; $context['error'] = '验证码错误';
} }
} }
} }
......
...@@ -148,10 +148,10 @@ function add_consultant_score() ...@@ -148,10 +148,10 @@ function add_consultant_score()
} }
} }
//置业顾问信息 评分 //置业顾问信息
function get_consultant_score($consultant_id) function get_consultant_info($consultant_id)
{ {
return dao::search_consultant_score($consultant_id); return dao::search_consultant_info($consultant_id);
} }
add_action('wp_ajax_get_consultant', 'get_consultant'); add_action('wp_ajax_get_consultant', 'get_consultant');
......
wp-content/themes/tospur/img/star.png

5.61 KB | W: | H:

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

7.18 KB | W: | H:

wp-content/themes/tospur/img/star.png
wp-content/themes/tospur/img/star.png
wp-content/themes/tospur/img/star.png
wp-content/themes/tospur/img/star.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -23,7 +23,7 @@ if ($current_user_id == 0) { ...@@ -23,7 +23,7 @@ if ($current_user_id == 0) {
if ($result) { if ($result) {
$context['result'] = $result; $context['result'] = $result;
} else { } else {
$context['message'] = 'not found'; $context['result'] = null;
} }
} }
......
...@@ -31,7 +31,7 @@ if ($_POST) { ...@@ -31,7 +31,7 @@ if ($_POST) {
$context['error'] = '抱歉,用户名已存在'; $context['error'] = '抱歉,用户名已存在';
} }
} else { } else {
$context['error'] = '请输入正确的验证码'; $context['error'] = '验证码错误';
} }
} }
} }
......
...@@ -5,9 +5,7 @@ $context['theme'] = get_template_directory_uri(); ...@@ -5,9 +5,7 @@ $context['theme'] = get_template_directory_uri();
$context['url'] = home_url(); $context['url'] = home_url();
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
$user_id = $current_user->ID; $user_id = $current_user->ID;
if ($user_id == 0) { if ($user_id != 0) {
}else{
$date = current_time('Y-m-d'); $date = current_time('Y-m-d');
$datetime = new DateTime($cureent_time . '+1 day'); $datetime = new DateTime($cureent_time . '+1 day');
$date = $datetime->format('Y-m-d'); $date = $datetime->format('Y-m-d');
......
...@@ -2,87 +2,102 @@ ...@@ -2,87 +2,102 @@
<html> <html>
<head lang="en"> <head lang="en">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title>置业顾问</title>
<style>
html, body {
width: 100%;
height: 100%;
}
#wrapper {
position: absolute;
z-index: 1;
top: 0;
bottom: 0;
left: 0;
width: 100%;
background: #fff;
overflow: hidden;
}
#scroller {
position: absolute;
width: 100%;
}
#pullUp {
height: 40px;
position: absolute;
bottom: -40px;
}
.star-rating {
display: inline-block;
}
</style>
<link rel="stylesheet" href="{{ theme }}/css/bootstrap.min.css"> <link rel="stylesheet" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ theme }}/css/consultantList.css">
<link rel="stylesheet" href="{{ theme }}/css/star-rating.min.css"> <link rel="stylesheet" href="{{ theme }}/css/star-rating.min.css">
<script src="{{ theme }}/js/iscroll.js"></script>
<script src="{{ theme }}/js/jquery.min.js"></script> <script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script src="{{ theme }}/js/star-rating.min.js"></script> <script src="{{ theme }}/js/star-rating.min.js"></script>
<script src="{{ theme }}/js/iscroll.js"></script>
</head> </head>
<body> <body>
<div id="wrapper"> <div class="search">
<div id="scroller"> <div class="btn-group pull-left" id="cityGroup">
<label for="city"></label> <a class="btn" id="cityName">{{ city_name }}<i class="iconfont"></i></a>
<select id="city"> <div id="city_wrapper" class="dropdown-menu">
<div id="city_scroller">
{% for item in city %} {% for item in city %}
<option value="{{ item.id }}" <a href="{{ url }}/?page=consultant_list&city_id={{ item.id }}"{% if(item.id==city_id) %} class="active"{% endif %}>{{ item.value }}</a>
{% if(item.id==city_id) %}selected="selected"{% endif %}>{{ item.value }}</option>
{% endfor %} {% endfor %}
</select> </div>
<a href="{{ url }}/?page=consultant_list&city_id={{ city_id }}" id="change">切换</a>
<div id="pullUp">
<span>上拉刷新</span>
</div> </div>
</div> </div>
</div> </div>
<div id="wrapper">
<div id="scroller">
<ul class="list-unstyled" id="consultantList"></ul>
</div>
</div>
<div id="template" style="display: none"> <div id="template" style="display: none">
<ol class="col-xs-3">
<img data-attr="image">
</ol>
<ol class="col-xs-4">
<p data-attr="name"></p> <p data-attr="name"></p>
<div class="star-rating rating-xs rating-disabled" style="font-size:12px;">
<div style="height: 42px;"> <div class="rating-container rating-gly-star" data-content="">
<span>星级:</span><input type="hidden" value="" data-attr="score"> <div class="rating-stars" data-content="" style="" data-attr="score"></div>
</div>
</div> </div>
<span data-attr="mobile"></span> <p>同策房屋</p>
<p><a href="" data-attr="url">&gt;</a></p> </ol>
<ol class="col-xs-5">
<a class="btn btn-phone" data-attr="mobile">
<span></span>电话联系
</a>
</ol>
</div>
<div class="loading" id="loading" style="display: none;">
<ul class="list-unstyled">
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
</ul>
</div> </div>
<script> <script>
var index = 0; var index = 0;
var cityScroll;
var myScroll; var myScroll;
var template; var template;
var consultant_info_url = '{{ url }}/?page=consultant_info'; var consultant_info_url = '{{ url }}/?page=consultant_info';
var loading;
$(document).ready(function () { $(document).ready(function () {
var i = 0; loading = $('#loading');
$('#city').on('change', function () { $('#cityGroup').tap(function () {
var city_id = $(this).find('option:selected').val(); var self = $(this);
$('#change').attr('href', '{{ url }}/?page=consultant_list&city_id=' + city_id); if(self.hasClass('open')){
self.removeClass('open');
}else{
self.addClass('open');
}
cityScroll.refresh();
}); });
var pullUpFlag = false; var pullUpFlag = false;
myScroll = new IScroll('#wrapper'); cityScroll = new IScroll('#city_wrapper',{
click: true
});
myScroll = new IScroll('#wrapper',{
click: true
});
myScroll.on("scrollStart", function () { myScroll.on("scrollStart", function () {
console.log(this.maxScrollY); console.log(this.maxScrollY);
console.log(this.y); console.log(this.y);
...@@ -101,20 +116,32 @@ ...@@ -101,20 +116,32 @@
}); });
function ajax_get_consultant() { function ajax_get_consultant() {
loading.show();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/', url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=get_consultant&city_id={{ city_id }}&index=' + index, data: 'action=get_consultant&city_id={{ city_id }}&index=' + index,
success: function (data) { success: function (data) {
loading.hide();
if (data.code == 2000) { if (data.code == 2000) {
$.each(data.result, function (index, value) { $.each(data.result, function (index, value) {
var div = $('<div>'); var li = $('<li>');
div.append(template); li.append(template);
div.find('[data-attr=name]').text(value.display_name); li.find('[data-attr=name]').text(value.display_name);
div.find('[data-attr=score]').val(value.average_score); li.find('[data-attr=score]').attr('style', 'width: '+ value.average_score*20+'%');
div.find('[data-attr=mobile]').text('电话联系:' + value.mobile); li.find('[data-attr=image]').attr('src', value.imageUrl);
div.find('[data-attr=url]').attr('href', consultant_info_url + '&consultant_id=' + value.id); var infoUrl;
$('#pullUp').before(div); if(value.mobile){
li.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile);
infoUrl = consultant_info_url + '&consultant_id=' + value.id + '&mobile=' + value.mobile;
}else{
li.find('[data-attr=mobile]').attr('disabled',true);
infoUrl = consultant_info_url + '&consultant_id=' + value.id;
}
li.tap(function(e){
window.location.href = infoUrl;
});
$('#consultantList').append(li);
}); });
$('input[data-attr=score]').rating({ $('input[data-attr=score]').rating({
size: 'xs', size: 'xs',
......
...@@ -5,13 +5,20 @@ ...@@ -5,13 +5,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title>忘记密码</title>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/form.css">
<script src="{{ theme }}/js/jquery.min.js"></script> <script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.validate.js"></script> <script src="{{ theme }}/js/jquery.validate.js"></script>
<script src="{{ theme }}/js/bootstrap.min.js"></script>
<script src="{{ theme }}/js/public.js"></script> <script src="{{ theme }}/js/public.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var notice = $('#notice');
var myModal = $('#myModal');
$('#forgetForm').validate({ $('#forgetForm').validate({
onkeyup: false,
onfocusout: false,
rules: { rules: {
phone: { phone: {
required: true, required: true,
...@@ -26,39 +33,65 @@ ...@@ -26,39 +33,65 @@
phone: '请输入11位手机号', phone: '请输入11位手机号',
code: '请输入验证码', code: '请输入验证码',
password: '请输入新密码' password: '请输入新密码'
},
errorLabelContainer: "#notice",
errorElement: 'span',
invalidHandler: function () {
myModal.modal('show');
},
submitHandler: function (form) {
form.submit();
} }
}); });
notice.bind('DOMNodeInserted', function () {
$(this).children(':not(:first)').remove();
});
myModal.on('hide.bs.modal', function () {
notice.children().remove();
});
sendCodeBindClick("{{ url }}", 1); sendCodeBindClick("{{ url }}", 1);
{% if(error) %}
notice.html('<span>{{ error }}</span>');
myModal.modal('show');
{% endif %}
}); });
</script> </script>
</head> </head>
<body> <body>
<form id="forgetForm" method="post">
<p>
<label for="phone">用户名<br>
<input type="tel" name="phone" id="phone">
<label id="phone-error" class="error" for="phone">{{ phoneError }}</label>
</label>
</p>
<p> <div class="container-fluid text-center">
<label for="code">验证码<br> <form id="forgetForm" method="post">
<input type="text" name="code" id="code"> <h2>忘记密码</h2>
<label id="code-error" class="error" for="code">{{ codeError }}</label>
</label> <p class="has-feedback username">
<span id="send">发送验证码</span> <label for="phone" class="sr-only">用户名</label>
<input type="tel" name="phone" id="phone" class="form-control input-lg" placeholder="手机号码">
<span class="form-control-feedback"></span>
</p> </p>
<p> <p class="has-feedback code">
<label for="password">新密码<br> <label for="code" class="sr-only">验证码</label>
<input type="password" name="password" id="password"> <input type="text" name="code" id="code" class="form-control input-lg" placeholder="验证码">
<label id="password-error" class="error" for="password">{{ passwordError }}</label> <span id="send" class="form-control-feedback">发送验证码</span>
</label>
</p> </p>
<p class="submit"> <p class="has-feedback password">
<input type="submit" id="forget_submit" value="修改密码"> <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> </p>
</form> <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 id="notice"></p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
if(parent.hasClass("open")){ if(parent.hasClass("open")){
$(".btn-group").removeClass("open"); $(".btn-group").removeClass("open");
}else{ }else{
$(".btn-group").removeClass("open"); //$(".btn-group").removeClass("open");
parent.addClass("open"); parent.addClass("open");
} }
$.each(scrollList,function(i,item){ $.each(scrollList,function(i,item){
...@@ -125,15 +125,15 @@ ...@@ -125,15 +125,15 @@
}); });
otherScroll.refresh(); otherScroll.refresh();
}); });
$(".btn-group").on('tap','a',function(){ $(".btn-group").on('tap','.dropdown-menu a',function(){
searchData.index = 0; searchData.index = 0;
scroller.html('');
if($(this).parent().attr("type")!=undefined){ if($(this).parent().attr("type")!=undefined){
searchData[$(this).parent().attr("type")] = $(this).attr("data-id")!=undefined?$(this).attr("data-id"):-1; searchData[$(this).parent().attr("type")] = $(this).attr("data-id")!=undefined?$(this).attr("data-id"):-1;
if($(this).attr("data-action") != "open"){ if($(this).attr("data-action") != "open"){
//do somthing //do somthing
$(".btn-group").removeClass("open"); $(".btn-group").removeClass("open");
console.log(JSON.stringify(searchData)); console.log(JSON.stringify(searchData));
scroller.html('');
getHouse(); getHouse();
} }
} }
......
...@@ -7,10 +7,63 @@ ...@@ -7,10 +7,63 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title></title>
<style></style> <style></style>
<script src="{{ theme }}/js/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<script src="{{ theme }}/js/public.js"></script> <link rel="stylesheet" type="text/css" href="{{ theme }}/css/bookingList.css">
<script> <script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
<script type="text/javascript" src="{{ theme }}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ theme }}/js/bootstrap.min.js"></script>
</head>
<body>
{% if result %}
<div id="wrapper">
<div id="scroller">
{% for item in result %}
<ul class="list-unstyled">
<li>
<p>楼盘名:{{ item.name }}</p>
<p>预约时间:{{ item.date }} {{ item.time }}</p>
{% if item.consultant_id %}
{% if item.handle==0 %}
<p>未接受</p>
{% else %}
<p>已接受</p>
{% endif %}
{% endif %}
{% if item.user_id %}
{% if item.handle==0 %}
<p data-name="handle" data-id="{{ item.id }}">接受</p>
{% else %}
<p>已接受</p>
{% endif %}
{% endif %}
</li>
</ul>
{% else %}
{{ message }}
{% endfor %}
</div>
</div>
{% else %}
<div class="modal fade" id="myModal">
<div class="modal-dialog modal-booking">
<div class="modal-content text-center">
<h3>您还未预约过看房信息。<br>马上去预约看房!</h3>
<ul class="list-unstyled">
<li>新房<i class="iconfont"></i></li>
<li>二手房<i class="iconfont"></i></li>
<li>租房<i class="iconfont"></i></li>
</ul>
</div>
</div>
</div>
{% endif %}
<script>
$(document).ready(function () { $(document).ready(function () {
{% if result %}
var myScroll = new IScroll('#wrapper',{
scrollbars: true,
click: true
});
$('[data-name=handle]').click(function () { $('[data-name=handle]').click(function () {
var self = $(this); var self = $(this);
var id = self.data('id'); var id = self.data('id');
...@@ -20,7 +73,7 @@ ...@@ -20,7 +73,7 @@
data: 'action=handle_view_house&id=' + id, data: 'action=handle_view_house&id=' + id,
success: function (data) { success: function (data) {
if (data.code == 2000) { if (data.code == 2000) {
self.parent().html('已接受'); self.html('已接受');
alert('接受成功'); alert('接受成功');
} else { } else {
alert('接受失败'); alert('接受失败');
...@@ -28,40 +81,14 @@ ...@@ -28,40 +81,14 @@
} }
}); });
}); });
{% if message %}
alert('{{ message }}');
{% endif %}
});
</script>
</head>
<body>
{% for item in result %}
<div>
<ul>
<li>楼盘 {{ item.house_id }}</li>
<li>预约时间 {{ item.date }} {{ item.time }}</li>
<!--用户 约看清单-->
{% if item.consultant_id %}
<li>置业顾问 {{ item.consultant_id }}</li>
{% if item.handle==0 %}
<li>未接受</li>
{% else %} {% else %}
<li>接受</li> var myModal = $('#myModal');
{% endif %} myModal.modal('show');
{% endif %} myModal.find('li').click(function(){
<!--置业顾问 约看清单--> window.location.href = '{{ url }}';
{% if item.user_id %} });
<li>用户 {{ item.user_id }}</li>
{% if item.handle==0 %}
<li>
<button data-name="handle" data-id="{{ item.id }}">接受</button>
</li>
{% else %}
<li>已接受</li>
{% endif %}
{% endif %} {% endif %}
</ul> });
</div> </script>
{% endfor %}
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -5,14 +5,7 @@ ...@@ -5,14 +5,7 @@
<meta name="viewport" content="width=360, user-scalable=0"/> <meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title>我的楼盘</title>
<style>
#pullUp {
height: 40px;
position: absolute;
bottom: -40px;
}
</style>
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/myHouse.css"> <link rel="stylesheet" type="text/css" href="{{ theme }}/css/myHouse.css">
<script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script> <script type="text/javascript" src="{{ theme }}/js/iscroll.js"></script>
...@@ -36,11 +29,30 @@ ...@@ -36,11 +29,30 @@
<div class="tab-pane fade in active" data-house="0" id="new"></div> <div class="tab-pane fade in active" data-house="0" id="new"></div>
<div class="tab-pane fade" data-house="1" id="secondhand"></div> <div class="tab-pane fade" data-house="1" id="secondhand"></div>
<div class="tab-pane fade" data-house="2" id="rent"></div> <div class="tab-pane fade" data-house="2" id="rent"></div>
<div id="pullUp">
<span>上拉刷新</span>
</div>
</div> </div>
</div> </div>
<div class="loading" id="loading" style="display: none;">
<ul class="list-unstyled">
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
<li>
<p></p>
<p></p>
<p></p>
<p></p>
</li>
</ul>
</div>
<div id="template_0" style="display: none"> <div id="template_0" style="display: none">
<p> <p>
<img src="" data-attr="image"> <img src="" data-attr="image">
...@@ -96,9 +108,11 @@ ...@@ -96,9 +108,11 @@
var index = 0; var index = 0;
var myScroll; var myScroll;
var template; var template;
var loading;
$(document).ready(function () { $(document).ready(function () {
var tabPane = $('[data-house=' + houseType + ']'); var tabPane = $('[data-house=' + houseType + ']');
template = $('#template_' + houseType).html(); template = $('#template_' + houseType).html();
loading = $('#loading');
ajax_get_my_house(tabPane); ajax_get_my_house(tabPane);
var pullUpFlag = false; var pullUpFlag = false;
myScroll = new IScroll('#wrapper', { myScroll = new IScroll('#wrapper', {
...@@ -135,11 +149,13 @@ ...@@ -135,11 +149,13 @@
}); });
function ajax_get_my_house(tabPane) { function ajax_get_my_house(tabPane) {
loading.show();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/', url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=get_my_house&houseType=' + houseType + '&userType=0&userId=' + userId + '&index=' + index, data: 'action=get_my_house&houseType=' + houseType + '&userType=0&userId=' + userId + '&index=' + index,
success: function (data) { success: function (data) {
loading.hide();
if (data.code == 2000) { if (data.code == 2000) {
$.each(data.result, function (index, value) { $.each(data.result, function (index, value) {
if(data.tags) if(data.tags)
...@@ -173,7 +189,9 @@ ...@@ -173,7 +189,9 @@
} }
if (data_tags) { if (data_tags) {
$.each(data_tags, function (k, v) { $.each(data_tags, function (k, v) {
if(k < 3){
tags.prepend('<span class="label">' + v + '</span>'); tags.prepend('<span class="label">' + v + '</span>');
}
}); });
} }
tabPane.append(div); tabPane.append(div);
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
<html> <html>
<head lang="en"> <head lang="en">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> <meta name="viewport" content="width=360, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/> <meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title></title> <title></title>
<style></style> <link rel="stylesheet" type="text/css" href="{{ theme }}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{{ theme }}/css/bookingSeeHouse.css">
<script src="{{ theme }}/js/jquery.min.js"></script> <script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.validate.js"></script> <script src="{{ theme }}/js/jquery.validate.js"></script>
<script src="{{ theme }}/js/date-selector.js"></script> <script src="{{ theme }}/js/date-selector.js"></script>
...@@ -14,15 +15,23 @@ ...@@ -14,15 +15,23 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var ds = new DateSelector('year', 'month', 'day', { var ds = new DateSelector('year', 'month', 'day', {
MaxYear: new Date().getFullYear() + 1, MaxYear: new Date().getFullYear() + 1
onChange: function () {
$('#date').val(this.Year + '-' + this.Month + '-' + this.Day);
}
}); });
ds.onChange();
var inputDate = $('#date');
var viewForm = $('#viewForm'); var viewForm = $('#viewForm');
viewForm.submit(function () { viewForm.submit(function () {
var dayValue = Number($('input[name=day]:checked').val());
var date = new Date();
switch (dayValue) {
case 3:
inputDate.val(ds.Year + '-' + ds.Month + '-' + ds.Day);
break;
default:
date.setTime(date.getTime() + dayValue * 24 * 60 * 60 * 1000);
inputDate.val(date.Format('yyyy-MM-dd'));
break;
}
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/', url: '{{ url }}/wp-admin/admin-ajax.php/',
...@@ -41,29 +50,58 @@ ...@@ -41,29 +50,58 @@
</script> </script>
</head> </head>
<body> <body>
<form id="viewForm" method="post"> <div class="main">
<div> <form id="viewForm" method="post">
<label for="jt">今天</label> <p class="">看房时间</p>
<input type="radio" name="day" id="jt" value="0"/> <ul class="list-unstyled">
<label for="mt">明天</label> <li>
<input type="radio" name="day" id="mt" value="1"/> <label for="jt" class="col-xs-4">
<label for="ht">后天</label> <input type="radio" name="day" id="jt" value="0" checked>
<input type="radio" name="day" id="ht" value="2"/> <span></span>今天
</div> </label>
<div>
<p>指定日期</p> <label for="mt" class="col-xs-4">
<input type="radio" name="day" id="mt" value="1">
<span></span>明天
</label>
<label for="ht" class="col-xs-4 ">
<input type="radio" name="day" id="ht" value="2">
<span></span>后天
</label>
</li>
<p> <li>
<label class="col-xs-5">
<input type="radio" name="day" value="3">
<span></span>指定日期
</label>
<p class="col-xs-7">
<select id="year">
<option value="2015">2015</option>
<option value="2016">2016</option>
</select>
<label for="year"></label> <label for="year"></label>
<select id="year"></select> <select id="month">
<option value="8">8</option>
<option value="9">9</option>
</select>
<label for="month"></label> <label for="month"></label>
<select id="month"></select> <select id="day">
<option value="8">14</option>
<option value="9">15</option>
</select>
<label for="day"></label> <label for="day"></label>
<select id="day"></select>
</p> </p>
</div> </li>
<div>
<label for="index">选择时间</label> <li>
<label for="index" class="col-xs-5">
<span class="time"></span>看房时段
</label>
<p class="col-xs-7">
<select id="index" name="index"> <select id="index" name="index">
<option value="0">9:00-10:00</option> <option value="0">9:00-10:00</option>
<option value="1">10:00-11:00</option> <option value="1">10:00-11:00</option>
...@@ -74,15 +112,15 @@ ...@@ -74,15 +112,15 @@
<option value="6">15:00-16:00</option> <option value="6">15:00-16:00</option>
<option value="7">16:00-17:00</option> <option value="7">16:00-17:00</option>
</select> </select>
</div> </p>
</li>
</ul>
<input type="hidden" name="date" id="date" value=""> <input type="hidden" name="date" id="date" value="">
<input type="hidden" name="user_id" value="{{ user_id }}"> <input type="hidden" name="user_id" value="{{ user_id }}">
<input type="hidden" name="house_id" value="{{ house_id }}"> <input type="hidden" name="house_id" value="{{ house_id }}">
<input type="hidden" name="consultant_id" value="{{ consultant_id }}"> <input type="hidden" name="consultant_id" value="{{ consultant_id }}">
<input type="submit" id="view_submit" value="提交" class="btn btn-lg">
<p class="submit"> </form>
<input type="submit" id="view_submit" value="提交"> </div>
</p>
</form>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment