Commit 8256ba90 by felix

每日一更

parent 9af48fab
<?php <?php
require_once(PLUGIN_DIR . 'Dao/SearchDao.php'); require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
require_once(PLUGIN_DIR . 'Tools/Image.php');
class House { class House {
public static function init_view(){ public static function init_view(){
wp_enqueue_script('jquery-ui'); wp_enqueue_script('jquery-ui');
...@@ -7,16 +8,26 @@ class House { ...@@ -7,16 +8,26 @@ class House {
wp_enqueue_style('jquery-ui_css'); wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapcss'); wp_enqueue_style('bootstrapcss');
if(isset($_GET["updated"])){
echo "updated success";
}else{
global $wpdb; global $wpdb;
$type = $_POST["type"];
if($type==1){
$wpdb->query("START TRANSACTION");
$result = House::data_insert();
if($result != 200){
$wpdb->query("ROLLBACK");
print_r($wpdb->last_error);;
echo "新增房源失败";
}else{
$wpdb->query("COMMIT");
echo "新增房源成功";
}
exit;
}else{
$context = array(); $context = array();
$context["city"] = SearchDao::searchCity(); $context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty(); $context["buildProperty"] = SearchDao::searchBuildProperty();
$context["room"] = SearchDao::searchRoom(); $context["room"] = SearchDao::searchRoom();
$context["photoType"] = SearchDao::searchPhotoType(); $context["photoType"] = SearchDao::searchPhotoType();
House::data_insert();
Timber::render("newhouse.html",$context); Timber::render("newhouse.html",$context);
} }
} }
...@@ -30,7 +41,7 @@ class House { ...@@ -30,7 +41,7 @@ class House {
$data = $_POST["data"]; $data = $_POST["data"];
//获取新房信息,存入tospur_house表 //获取新房信息,存入tospur_house表
$insert_tospur_house_array = array( $insert_tospur_house_array = array(
'name' => $_POST['name'], 'name' => $_POST['housename'],
'average_price' => $_POST['average_price'], 'average_price' => $_POST['average_price'],
'latest_news' => $_POST['event'], 'latest_news' => $_POST['event'],
'address' => $_POST['address'], 'address' => $_POST['address'],
...@@ -38,7 +49,6 @@ class House { ...@@ -38,7 +49,6 @@ class House {
'periphery' => $_POST['periphery'], 'periphery' => $_POST['periphery'],
'developer' => $_POST['developers'], 'developer' => $_POST['developers'],
'check_in_time' => $_POST['check_in_time'], 'check_in_time' => $_POST['check_in_time'],
'building_type' => $_POST['building_type'],
'property_age' => $_POST['property_age'], 'property_age' => $_POST['property_age'],
'decoration' => $_POST['decoration'], 'decoration' => $_POST['decoration'],
'covered_area' => $_POST['acreage'], 'covered_area' => $_POST['acreage'],
...@@ -55,16 +65,17 @@ class House { ...@@ -55,16 +65,17 @@ class House {
"property_money" => $_POST["property_money"], "property_money" => $_POST["property_money"],
'creattime' => date("Y-m-d H:i:s"), 'creattime' => date("Y-m-d H:i:s"),
'user_id' => get_current_user_id(), 'user_id' => get_current_user_id(),
'community_name' => $_POST["community_name"] 'community_name' => $_POST["community_name"],
'house_type' => 0
); );
$res = $wpdb->get_results('SELECT * FROM tospur_house WHERE name="' . $_POST['name'] . '" and address="' . $_POST['address'] . '"', OBJECT); $res = $wpdb->get_results('SELECT * FROM tospur_house WHERE name="' . $_POST['housename'] . '" and address="' . $_POST['address'] . '"', OBJECT);
if (!$res) { if (!$res) {
$houseRes = $wpdb->insert('tospur_house', $insert_tospur_house_array); $houseRes = $wpdb->insert('tospur_house', $insert_tospur_house_array);
if (!$houseRes) { if (!$houseRes) {
return 500; return 500;
} }
$houseid = $wpdb->insert_id; $houseid = $wpdb->insert_id;
} $house_number = "xf".str_pad($insert_tospur_house_array['city_id'],6,'0',STR_PAD_LEFT).str_pad($houseid,6,'0',STR_PAD_LEFT);
//主力房源的图片与房子信息关联插入数据库 //主力房源的图片与房子信息关联插入数据库
if(isset($uploadedfile["name"])){ if(isset($uploadedfile["name"])){
foreach($uploadedfile["name"] as $key=> $value) { foreach($uploadedfile["name"] as $key=> $value) {
...@@ -87,14 +98,17 @@ class House { ...@@ -87,14 +98,17 @@ class House {
$length = strpos($str, "/",strpos($str, "/")+1); $length = strpos($str, "/",strpos($str, "/")+1);
$url = substr($str,$length); $url = substr($str,$length);
if ($movefile && !isset($movefile['error'])) { if ($movefile && !isset($movefile['error'])) {
$uploadFileName = end(explode("/",$url));
//上传成功后将图片信息存入tospur_image表 //上传成功后将图片信息存入tospur_image表
$insert_image_array = array( $insert_image_array = array(
'name' => $uploadParam["name"], 'name' => $uploadFileName,
'path' => $url, 'path' => $url,
'creattime' => date("Y-m-d H:i:s"), 'creattime' => date("Y-m-d H:i:s"),
'alt' => "", 'alt' => "",
'image_type' =>$data[$key]["type"] 'image_type' =>$data[$key]["type"]
); );
$imagePath = get_home_path().$url;
Image::makeImage($uploadFileName,$imagePath);
//插入图片表 //插入图片表
$imgRes = $wpdb->insert('tospur_image', $insert_image_array); $imgRes = $wpdb->insert('tospur_image', $insert_image_array);
if (!$imgRes) { if (!$imgRes) {
...@@ -159,5 +173,9 @@ class House { ...@@ -159,5 +173,9 @@ class House {
} }
} }
} }
}else{
return 506;
}
return 200;
} }
} }
\ No newline at end of file
<?php
require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
require_once(PLUGIN_DIR . 'Dao/InsertDao.php');
require_once(PLUGIN_DIR . 'Tools/Image.php');
class SecHandHouse{
//二手房信息
public static function secHandHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_style('bootstrapcss');
global $wpdb;
$type = $_POST["type"];
if($type==2){
$wpdb->query("START TRANSACTION");
$result = SecHandHouse::secHouseData_insert();
if($result != 200){
$wpdb->query("ROLLBACK");
print_r($wpdb->last_error);;
echo "二手房房源新增失败";
}else{
$wpdb->query("COMMIT");
echo "二手房房源新增成功";
}
exit;
}else{
$context = array();
$context["city"] = SearchDao::searchCity();
$context["buildProperty"] = SearchDao::searchBuildProperty();
$context["photoType"] = SearchDao::searchPhotoType();
Timber::render("secHandHouse.html",$context);
}
}
public static function secHouseData_insert()
{
global $wpdb;
//图片信息
$uploadedfile = $_FILES['files'];
//房源与类型以及面积信息
$data = $_POST["data"];
//获取新房信息,存入tospur_house表
$insert_tospur_house_array = array(
'name' => $_POST['housename'],
'house_number' =>$_POST['house_number'],
'total_price' =>$_POST['total_price'],
'average_price' => $_POST['average_price'],
'buildproperty_id'=>$_POST['buildproperty_id'],
'covered_area' =>$_POST['covered_area'],
'floor' =>$_POST['floor'],
'faceto'=>$_POST['faceto'],
'decoration' => $_POST['decoration'],
'age'=>$_POST['age'],
'flat'=>$_POST['flat'],
'suite'=>$_POST["suite"],
'overview' => $_POST['overview'],
'address' => $_POST['address'],
'community_name'=>$_POST['community_name'],
'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'],
'house_type' => 1
);
$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($insert_tospur_house_array);
//主力房源的图片与房子信息关联插入数据库
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"推荐置业顾问信息插入失败";
}
}
}
}else{
return 507;
}
return 200;
}
}
<?php
//require_once(dirname(__FILE__) . '/Config.php');
class InsertDao{
public static function insert_tospur_house($params){
global $wpdb;
$houseRes = $wpdb->insert(Config::TOSPUR_HOUSE_TABLE, $params);
$houseId = $wpdb->insert_id;
if($houseRes){
return $houseId;
}else{
return 500;
}
}
public static function insert_tospur_image($params){
global $wpdb;
$imgRes = $wpdb->insert(Config::TOSPUR_IMAGE_TABLE, $params);
$imgId = $wpdb->insert_id;
if($imgRes){
return $imgId;
}else{
return 501;
}
}
public static function insert_a_district_area($params){
global $wpdb;
$districtAreaRes = $wpdb->insert(Config::A_DISTRICT_AREA_TABLE, $params);
if($districtAreaRes){
return $districtAreaRes;
}else{
return 502;
}
}
public static function insert_a_house_image($params){
global $wpdb;
$houseImageRes = $wpdb->insert(Config::A_HOUSE_IMAGE_TABLE, $params);
if($houseImageRes){
return $houseImageRes;
}else{
return 503;
}
}
public static function insert_a_house_recommend($params){
global $wpdb;
$houseImageRes = $wpdb->insert(Config::A_HOUSE_RECOMMEND_TABLE, $params);
if($houseImageRes){
return $houseImageRes;
}else{
return 504;
}
}
public static function insert_a_house_user($params){
global $wpdb;
$houseUserRes = $wpdb->insert(Config::A_HOUSE_USER_TABLE, $params);
if($houseUserRes){
return $houseUserRes;
}else{
return 505;
}
}
}
?>
\ No newline at end of file
<?php
require_once(PLUGIN_DIR . 'Config.php');
class Image {
private static $imageSize = array(
'small' => array(120,90),
'normal' => array(320,270),
'big' => array(640,960)
);
public static function makeImage($name,$path){
foreach(Image::$imageSize as $item){
$image = wp_get_image_editor($path);
if(!is_wp_error($image)){
$image->resize($item[0],$item[1],true);
$imageName = explode(".",$name);
$image->save(str_replace($name,$imageName[0]."-{$item[0]}x{$item[1]}.".$imageName[1],$path));
}else{
return false;
}
}
return true;
}
public static function getImage($path,$size){
switch($size){
case "small":
$formatPath = Image::formatImageName($path,"small");
if(file_exists(Image::get_home_path().$formatPath)){
return $formatPath;
}
case "normal":
$formatPath = Image::formatImageName($path,"normal");
if(file_exists(Image::get_home_path().$formatPath)){
return $formatPath;
}
case "big":
$formatPath = Image::formatImageName($path,"big");
if(file_exists(Image::get_home_path().$formatPath)){
return $formatPath;
}
default:
return $path;
}
}
private static function get_home_path() {
$home = set_url_scheme( get_option( 'home' ), 'http' );
$siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
$pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
$home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos );
$home_path = trailingslashit( $home_path );
} else {
$home_path = ABSPATH;
}
return str_replace( '\\', '/', $home_path );
}
private static function formatImageName($path,$size){
$name = end(explode("/",$path));
$nameArray = explode(".",$name);
$imageSize = Image::$imageSize[$size];
return str_replace($name,$nameArray[0]."-{$imageSize[0]}x{$imageSize[1]}.".$nameArray[1],$path);
}
}
\ No newline at end of file
...@@ -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);
......
<?php <?php
$house_id = $_GET['id']; $house_id = $_GET['id'];
$house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, v.handle, v.handle_date FROM view_house v ' $house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, 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 '
. 'where v.id = ' . $house_id; . 'where v.id = ' . $house_id;
...@@ -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
<?php <?php
/* /*
Plugin Name: table_test Plugin Name: 同策插件
Version: 1.0 Version: 1.0
Plugin URI: http://www.u-gen.net Author: 同策.
Author: U-GEN TECH. Description: 同策
Description: 自定义列表
*/ */
define('PLUGIN_DIR', dirname(__FILE__) . '\\'); define('PLUGIN_DIR', dirname(__FILE__) . '/');
add_action('init', 'tospur_init'); add_action('init', 'tospur_init');
function tospur_init() function tospur_init()
{ {
require_once(PLUGIN_DIR . 'Tools/TCSync.php');
require_once(PLUGIN_DIR . 'Tools/Image.php');
require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
require_once(PLUGIN_DIR . 'Admin/House.php');
require_once(PLUGIN_DIR . 'Admin/newHouseList.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouse.php');
require_once('consultant_score.php'); require_once('consultant_score.php');
require_once('view_house.php'); require_once('view_house.php');
require_once(PLUGIN_DIR . 'Tools\TCSync.php');
require_once(PLUGIN_DIR . 'Dao\SearchDao.php');
require_once(PLUGIN_DIR . 'Admin\House.php');
add_action('admin_menu', 'reset_menu'); add_action('admin_menu', 'reset_menu');
$type = $_POST["type"];
if($type==1){
wp_redirect("?page=newHouse&updated=true");
}
tospur_register_script_style(); tospur_register_script_style();
tospur_ajax_set(); tospur_ajax_set();
tospur_theme_format(); tospur_theme_format();
} }
function tospur_theme_format(){ function tospur_theme_format(){
//移除 //移除
add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000); add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000);
...@@ -130,8 +127,10 @@ function update_consultant() ...@@ -130,8 +127,10 @@ function update_consultant()
function reset_menu() function reset_menu()
{ {
add_menu_page("talbe_test", "table_test", "manage_options", "1", "create_table"); add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync");
add_menu_page( 'newHouse_title', '新房信息', 'manage_options', 'newHouse', 'House::init_view', 'dashicons-admin-tools', 6 ); add_menu_page('nesHouseList','新房列表', 'activate_plugins', 'newHouseList', 'newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', 'newHouse_title', '添加新房', 'activate_plugins', 'newHouse', 'House::init_view');
add_menu_page('secHandHouse','二手房', 'activate_plugins', 'secHandHouse', 'SecHandHouse::secHandHouse_html', 'dashicons-menu', 7);
//移除更新信息 //移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'update_nag', 3 );
global $menu; global $menu;
...@@ -165,9 +164,9 @@ function reset_menu() ...@@ -165,9 +164,9 @@ function reset_menu()
} }
} }
function create_table() function do_sync()
{ {
//TCSync::user_sync(); TCSync::user_sync();
TCSync::organization_sync(); TCSync::organization_sync();
TCSync::other_sync(); TCSync::other_sync();
} }
...@@ -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,9 +92,7 @@ class viewHouseList extends WP_List_Table ...@@ -139,9 +92,7 @@ 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 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 '
. 'left join wp_users c on v.consultant_id = c.id ' . 'left join wp_users c on v.consultant_id = c.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);
......
<?php
$context = array();
$context['theme'] = get_template_directory_uri();
$context['url'] = home_url();
Timber::render('comment.html', $context);
?>
\ No newline at end of file
...@@ -8,6 +8,8 @@ $const_register_page = home_url() . '/?page=register'; ...@@ -8,6 +8,8 @@ $const_register_page = home_url() . '/?page=register';
$const_forget_page = home_url() . '/?page=forget'; $const_forget_page = home_url() . '/?page=forget';
//我的 //我的
$const_my_page = home_url() . '/?page=my'; $const_my_page = home_url() . '/?page=my';
//我的楼盘
$const_myHouse_page = home_url() . '/?page=myHouse';
//预约看房 //预约看房
$const_view_page = home_url() . '/?page=view'; $const_view_page = home_url() . '/?page=view';
//约看清单 //约看清单
......
...@@ -8,10 +8,11 @@ $current_user = wp_get_current_user(); ...@@ -8,10 +8,11 @@ $current_user = wp_get_current_user();
$user_id = $current_user->ID; $user_id = $current_user->ID;
if ($user_id != 0) { if ($user_id != 0) {
$context['user_id'] = $user_id; $context['user_id'] = $user_id;
$consultant_id = $_GET['consultant_id']; $current_user = wp_get_current_user();
$consultant_id = isset($_GET['consultant_id'])?$_GET['consultant_id']:$current_user->ID;
$context['consultant_id'] = $consultant_id; $context['consultant_id'] = $consultant_id;
$context['consultant_name'] = get_user_by('id', $consultant_id)->user_nicename; $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;
} }
......
<?php
$context = array();
$context['theme'] = get_template_directory_uri();
$context['url'] = home_url();
require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php");
$city = SearchDao::searchCity();
$context['city'] = $city;
$city_id = $_GET['city_id'];
if (!isset($city_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;
Timber::render('consultant_list.html', $context);
?>
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: UGEN79
* Date: 2015/8/6
* Time: 16:51
*/
if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
class consultantScoreList extends WP_List_Table
{
function __construct()
{
global $status, $page;
//Set parent defaults
parent::__construct(array(
'singular' => 'score', //singular name of the listed records
'plural' => 'scores', //plural name of the listed records
'ajax' => false //does this table support ajax?
));
}
function column_default($item, $column_name)
{
switch ($column_name) {
case 'id':
case 'consultant':
case 'user':
case 'score':
return $item[$column_name];
case 'valid':
if ($item[$column_name]) {
return '<button data-valid="0" data-score-id="' . $item['id'] . '">设为无效</button>';
} else {
return '<button data-valid="1" data-score-id="' . $item['id'] . '">设为有效</button>';
}
default:
return print_r($item, true); //Show the whole array for troubleshooting purposes
}
}
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 ("score")
/*$2%s*/
$item['id'] //The value of the checkbox should be the record's id
);
}
function get_columns()
{
$columns = array(
'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
'id' => 'ID',
'consultant' => '置业顾问',
'user' => '用户',
'score' => '评分',
'valid' => '状态'
);
return $columns;
}
function get_sortable_columns()
{
$sortable_columns = array(
'id' => array('id', false),
'consultant' => array('consultant', false),
'user' => array('user', false),
'score' => array('score', false),
'valid' => array('valid', false)
);
return $sortable_columns;
}
function get_bulk_actions()
{
$actions = array(
'invalid' => '设为无效',
'valid' => '设为有效',
);
return $actions;
}
function process_bulk_action()
{
$action = $this->current_action();
if ($action) {
$string = null;
$valid = null;
switch ($action) {
case 'invalid':
$score = $_GET['score'];
if ($score) {
$string = '(' . implode(',', array_map('intval', $score)) . ')';
$valid = 0;
}
break;
case 'valid':
$score = $_GET['score'];
if ($score) {
$valid = 1;
$string = '(' . implode(',', array_map('intval', $score)) . ')';
}
break;
}
global $wpdb;
$result = $wpdb->query('update tospur_consultant_score SET valid=' . $valid . ' where id in ' . $string);
}
}
function prepare_items()
{
global $wpdb;
$per_page = 5;
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
$this->_column_headers = array($columns, $hidden, $sortable);
$this->process_bulk_action();
//$data = $this->example_data;
$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 c on s.consultant_id = c.ID";
$result = $wpdb->get_results($sql);
$data = array();
foreach ($result as $key => $value) {
$data[$key] = array(
'id' => $value->id,
'consultant' => $value->consultant,
'user' => $value->user,
'score' => $value->score,
'valid' => $value->valid,
);
}
function usort_reorder($a, $b)
{
$orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'valid'; //If no sort, default to title
$order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'desc'; //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();
$total_items = count($data);
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$this->items = $data;
$this->set_pagination_args(array(
'total_items' => $total_items, //WE have to calculate the total number of items
'per_page' => $per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $per_page) //WE have to calculate the total number of pages
));
}
}
function add_consultant_score_menu()
{
add_menu_page('置业顾问评分', '置业顾问评分', 'activate_plugins', 'consultant_score', 'consultant_score_page', 'dashicons-menu', 26);
}
add_action('admin_menu', 'add_consultant_score_menu');
function consultant_score_page()
{
$consultantScoreList = new consultantScoreList();
$consultantScoreList->prepare_items();
?>
<div class="wrap">
<h2>置业顾问评分列表</h2>
<form id="scores-filter" method="get">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>"/>
<!-- Now we can render the completed list table -->
<?php $consultantScoreList->display() ?>
</form>
</div>
<script>
(function ($) {
$('button[data-score-id]').click(function () {
var self = $(this);
var score_id = $(this).data('score-id');
var valid = $(this).data('valid');
$.ajax({
type: 'POST',
url: '<?php echo admin_url()?>admin-ajax.php/',
data: 'action=valid_consultant_score&id=' + score_id + '&valid=' + valid,
success: function (data) {
if (data.code == 2000) {
if (valid == 0) {
self.text('设为有效');
self.data('valid', 1);
} else {
self.text('设为无效');
self.data('valid', 0);
}
alert('设置成功');
} else {
alert('设置失败');
}
}
});
return false;
});
})(jQuery);
</script>
<?php
}
?>
\ No newline at end of file
@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;
}
#wrapper {
width: 100%;
height: 100%;
overflow: hidden;
}
#wrapper #scroller {
padding-bottom: 5px;
}
#wrapper #scroller ul {
margin-bottom: 0;
padding: 0 15px;
}
#wrapper #scroller ul li {
color: #636363;
padding: 20px 0;
border-bottom: 1px solid #7d7d7d;
}
#wrapper #scroller ul li p {
padding-left: 15px;
margin-bottom: 0;
}
#wrapper #scroller ul li p:nth-child(1) {
color: #000000;
font-size: 22px;
font-weight: bold;
margin-bottom: 2px;
}
.modal .modal-booking {
width: 320px;
height: 276px;
}
.modal .modal-booking .modal-content h3 {
color: #ffffff;
font-weight: bold;
line-height: 28px;
margin: 0;
padding: 25px 0 15px 15px;
background-color: #008cd7;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
}
.modal .modal-booking .modal-content ul li {
height: 60px;
line-height: 60px;
color: #959595;
font-size: 22px;
border-top: 1px solid #7d7d7d;
}
.modal .modal-booking .modal-content ul li .iconfont {
color: #008cd7;
font-size: 18px;
}
.modal .modal-booking .modal-content ul li .iconfont:after {
content: "\e603";
position: absolute;
right: 20px;
}
@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;
}
@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;
}
#wrapper {
position: absolute;
z-index: 1;
top: 54px;
bottom: 0;
left: 0;
width: 100%;
overflow: hidden;
}
#wrapper #scroller {
padding-bottom: 5px;
}
#wrapper #scroller ul {
margin-bottom: 0;
}
#wrapper #scroller ul li {
width: 100%;
height: 106px;
padding: 15px 0;
}
#wrapper #scroller ul li ol {
padding-right: 0;
}
#wrapper #scroller ul li ol img {
width: 75px;
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 ul li ol p {
color: #000000;
font-size: 18px;
font-weight: bold;
height: 25px;
margin-bottom: 0;
}
#wrapper #scroller ul li ol .btn {
width: 80%;
padding: 2px 0;
margin-top: 24px;
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;
}
#wrapper #scroller ul li ol .btn.btn-phone {
color: #ed6d00;
border-color: #ed6d00;
background-color: transparent;
}
#wrapper #scroller ul li ol .btn.btn-phone span {
width: 18px;
height: 18px;
background: url("../img/orange_phone_icon.png") no-repeat;
background-size: cover;
-webkit-background-size: cover;
display: inline-block;
vertical-align: middle;
}
#wrapper #scroller ul li ol .btn.btn-booking {
color: #008cd7;
border-color: #008cd7;
background-color: transparent;
}
#wrapper #scroller ul li ol .btn.btn-booking span {
width: 18px;
height: 18px;
background: url("../img/blue_bespeak_icon.png") no-repeat;
background-size: cover;
-webkit-background-size: cover;
display: inline-block;
vertical-align: middle;
}
#wrapper #scroller ul li {
border-bottom: 1px solid #7d7d7d;
}
#wrapper #scroller ul li ol p:nth-child(3) {
font-size: 16px;
color: #636363;
font-weight: normal;
}
...@@ -14,6 +14,85 @@ ...@@ -14,6 +14,85 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -24,13 +103,14 @@ ...@@ -24,13 +103,14 @@
color: #000000; color: #000000;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
position: static;
} }
.tab li .btn:after { .tab li .btn:after {
content: ""; content: "";
width: 88%; width: 88%;
height: 4px; height: 4px;
position: absolute; position: absolute;
bottom: -1px; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
...@@ -489,9 +569,6 @@ body { ...@@ -489,9 +569,6 @@ body {
.detail_row .peopleCont li ol { .detail_row .peopleCont li ol {
padding: 0; padding: 0;
} }
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.detail_row .peopleCont li ol img { .detail_row .peopleCont li ol img {
width: 50px; width: 50px;
border-top-left-radius: 3px; border-top-left-radius: 3px;
...@@ -507,13 +584,12 @@ body { ...@@ -507,13 +584,12 @@ body {
color: #000000; color: #000000;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
height: 25px;
margin-bottom: 0;
} }
.detail_row .peopleCont li ol .btn-phone { .detail_row .peopleCont li ol .btn {
width: 48%; width: 48%;
padding: 3px; padding: 2px 0;
color: #ed6d00;
border-color: #ed6d00;
background-color: transparent;
margin-top: 12px; margin-top: 12px;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
...@@ -524,40 +600,37 @@ body { ...@@ -524,40 +600,37 @@ body {
-webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-right-radius: 4px;
} }
.detail_row .peopleCont li ol .btn-phone span { .detail_row .peopleCont li ol .btn.btn-phone {
width: 16px; color: #ed6d00;
height: 16px; border-color: #ed6d00;
background-color: transparent;
}
.detail_row .peopleCont li ol .btn.btn-phone span {
width: 18px;
height: 18px;
background: url("../img/orange_phone_icon.png") no-repeat; background: url("../img/orange_phone_icon.png") no-repeat;
background-size: cover; background-size: cover;
-webkit-background-size: cover; -webkit-background-size: cover;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.detail_row .peopleCont li ol .btn-booking { .detail_row .peopleCont li ol .btn.btn-booking {
width: 48%;
padding: 3px;
color: #008cd7; color: #008cd7;
border-color: #008cd7; border-color: #008cd7;
background-color: transparent; background-color: transparent;
margin-top: 12px;
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;
} }
.detail_row .peopleCont li ol .btn-booking span { .detail_row .peopleCont li ol .btn.btn-booking span {
width: 16px; width: 18px;
height: 16px; height: 18px;
background: url("../img/blue_bespeak_icon.png") no-repeat; background: url("../img/blue_bespeak_icon.png") no-repeat;
background-size: cover; background-size: cover;
-webkit-background-size: cover; -webkit-background-size: cover;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.detail_row .peopleCont li ol:nth-child(2) {
padding: 0 10px;
}
.footer { .footer {
width: 100%; width: 100%;
height: 45px; height: 45px;
...@@ -636,7 +709,6 @@ body { ...@@ -636,7 +709,6 @@ body {
font-size: 0; font-size: 0;
} }
.modal #carousel_wrapper #carousel_scroller ul li { .modal #carousel_wrapper #carousel_scroller ul li {
width: 360px;
height: 100%; height: 100%;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
......
@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;
}
.container-fluid p {
color: #7d7d7d;
font-size: 16px;
font-weight: bold;
margin: 10% 0 5%;
}
.container-fluid .form-control {
resize: none;
border-color: #e9e9e9;
box-shadow: none;
-webkit-box-shadow: none;
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;
-webkit-appearance: none;
color: #7d7d7d;
}
.container-fluid .form-control::-webkit-input-placeholder {
color: #7d7d7d;
}
.container-fluid .btn {
width: 94%;
color: #ffffff;
margin: 10% 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;
}
...@@ -14,6 +14,85 @@ ...@@ -14,6 +14,85 @@
-webkit-text-stroke-width: 0.2px; -webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
border-bottom: 1px solid #008cd7;
}
.search .btn-group {
position: static;
}
.search .btn-group .btn {
color: #ffffff;
font-size: 17px;
font-weight: bold;
}
.search .btn-group .btn:active {
box-shadow: none;
-webkit-box-shadow: none;
}
.search .btn-group .btn .iconfont {
color: #ffffff;
font-size: 12px;
font-weight: normal;
margin-left: 5px;
}
.search .btn-group .btn .iconfont:after {
content: "\e601";
position: relative;
top: -2px;
}
.search .btn-group.open .btn .iconfont:after {
content: "\e602";
}
.search .btn-group .dropdown-menu {
left: 0;
width: 100%;
height: 300px;
padding: 0;
border: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.tab { .tab {
width: 100%; width: 100%;
height: 40px; height: 40px;
...@@ -24,13 +103,14 @@ ...@@ -24,13 +103,14 @@
color: #000000; color: #000000;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
position: static;
} }
.tab li .btn:after { .tab li .btn:after {
content: ""; content: "";
width: 88%; width: 88%;
height: 4px; height: 4px;
position: absolute; position: absolute;
bottom: -1px; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
...@@ -250,84 +330,6 @@ body { ...@@ -250,84 +330,6 @@ body {
a:hover { a:hover {
text-decoration: none; text-decoration: none;
} }
.search {
width: 100%;
height: 54px;
padding: 10px 10px 10px 5px;
position: relative;
background-color: #008cd7;
}
.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;
border: 0;
padding: 0;
margin-top: 1px;
overflow: hidden;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
.search .btn-group .dropdown-menu a {
color: #000000;
margin: 0 10px;
padding: 20px;
display: block;
border-bottom: 1px solid;
}
.search .btn-group .dropdown-menu a.active {
color: #008cd7;
}
.search .btn-group .dropdown-menu .left-menu {
height: 100%;
overflow: hidden;
padding: 0;
background-color: #f9f9f9;
}
.search .btn-group .dropdown-menu .left-menu a {
margin: 0;
border-bottom-color: transparent;
}
.search .btn-group .dropdown-menu .left-menu a.active-bg {
background-color: #ffffff;
}
.search .btn-group .dropdown-menu .right-menu {
height: 100%;
overflow: hidden;
padding: 0;
}
.search .has-feedback { .search .has-feedback {
width: 75%; width: 75%;
} }
...@@ -361,10 +363,9 @@ a:hover { ...@@ -361,10 +363,9 @@ a:hover {
} }
.btn-group-justified { .btn-group-justified {
width: 100%; width: 100%;
height: 45px; height: 46px;
position: relative; position: relative;
box-sizing: content-box; z-index: 2;
-webkit-box-sizing: content-box;
border-bottom: 1px solid #b7b7b7; border-bottom: 1px solid #b7b7b7;
} }
.btn-group-justified .btn-group { .btn-group-justified .btn-group {
...@@ -397,8 +398,8 @@ a:hover { ...@@ -397,8 +398,8 @@ a:hover {
left: 0; left: 0;
width: 100%; width: 100%;
height: 300px; height: 300px;
border: 0;
padding: 0; padding: 0;
border: 0;
margin-top: 1px; margin-top: 1px;
overflow: hidden; overflow: hidden;
border-top-left-radius: 0; border-top-left-radius: 0;
...@@ -494,15 +495,18 @@ a:hover { ...@@ -494,15 +495,18 @@ 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;
white-space: nowrap; white-space: nowrap;
} }
#wrapper #scroller .row ul li:first-child { #wrapper #scroller .row ul li.address {
margin-top: 5px; margin-top: 2px;
height: 22px;
line-height: 22px;
} }
#wrapper #scroller .row ul li:first-child .address { #wrapper #scroller .row ul li.address span:nth-child(1) {
color: #000000; color: #000000;
font-size: 21px; font-size: 21px;
font-weight: bold; font-weight: bold;
...@@ -512,23 +516,26 @@ a:hover { ...@@ -512,23 +516,26 @@ a:hover {
left: 0; left: 0;
right: 10px; right: 10px;
bottom: 0; bottom: 0;
font-size: 0;
} }
#wrapper #scroller .row ul li:last-child .label { #wrapper #scroller .row ul li:last-child .label {
color: #ff0000; color: #ff0000;
padding: 1px 4px;
font-size: 9px; font-size: 9px;
padding: 0 4px 1px;
border: 1px solid #acacac; border: 1px solid #acacac;
vertical-align: bottom; margin: 0 5px 0 0;
vertical-align: middle;
} }
#wrapper #scroller .row ul li:last-child span { #wrapper #scroller .row ul li:last-child span {
color: #000000; color: #000000;
font-size: 15px;
} }
#wrapper #scroller .row ul li:last-child span em { #wrapper #scroller .row ul li:last-child span em {
font-style: normal; font-style: normal;
} }
#wrapper #scroller .row ul li:last-child span em:nth-child(1) { #wrapper #scroller .row ul li:last-child span em:nth-child(1) {
color: #ff0000; color: #ff0000;
font-size: 21px; font-size: 19px;
font-weight: bold; font-weight: bold;
} }
#wrapper #scroller .row ul li:last-child span em:nth-child(2) { #wrapper #scroller .row ul li:last-child span em:nth-child(2) {
...@@ -545,6 +552,10 @@ a:hover { ...@@ -545,6 +552,10 @@ 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(3) {
margin-left: 15px;
}
.footer { .footer {
width: 100%; width: 100%;
height: 45px; height: 45px;
......
@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;
}
...@@ -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)
......
...@@ -18,14 +18,19 @@ ...@@ -18,14 +18,19 @@
LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on ti.id = ada.image_id LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on ti.id = ada.image_id
where ada.house_id = %d"; where ada.house_id = %d";
$mainImage = $wpdb->get_results($wpdb->prepare($mainImagesSql,$hid)); $mainImage = $wpdb->get_results($wpdb->prepare($mainImagesSql,$hid));
foreach($mainImage as $key => $value){
$value->path = Image::getImage($value->path,'small');
}
$context['mainImage'] = $mainImage; $context['mainImage'] = $mainImage;
$recommendSql = "select ahi.house_id as id,ti.path from a_house_image ahi $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 left join tospur_image ti on ahi.image_id = ti.id
where ti.image_type in (1,5) and house_id where ti.image_type in (1,5) and house_id
in (select recommend_id from a_house_recommend where house_id = %d) group by house_id"; in (select recommend_id from a_house_recommend where house_id = %d) group by house_id";
$recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid)); $recommends = $wpdb->get_results($wpdb->prepare($recommendSql,$hid));
foreach($recommends as $key => $value){
$value->path = Image::getImage($value->path,'small');
}
$context['recommends'] = $recommends; $context['recommends'] = $recommends;
$consultantSql = 'select id,name,mobile,imageUrl,s.average_score from tospur_consultant c $consultantSql = 'select id,name,mobile,imageUrl,s.average_score from tospur_consultant c
...@@ -40,8 +45,10 @@ ...@@ -40,8 +45,10 @@
LEFT JOIN a_house_image ahi on ti.id = ahi.image_id LEFT JOIN a_house_image ahi on ti.id = ahi.image_id
WHERE ahi.house_id = %d order by image_type;'; WHERE ahi.house_id = %d order by image_type;';
$images = $wpdb->get_results($wpdb->prepare($imagesSql,$hid)); $images = $wpdb->get_results($wpdb->prepare($imagesSql,$hid));
foreach($images as $key => $value){
$value->path = Image::getImage($value->path,'big');
}
$context['images'] = $images; $context['images'] = $images;
Timber::render('detail.html', $context); Timber::render('detail.html', $context);
}else{ }else{
Timber::render('error.html', $context); Timber::render('error.html', $context);
......
<?php <?php
require_once(dirname(__FILE__) . '/dao.php'); require_once(dirname(__FILE__) . '/dao.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Dao/SearchDao.php');
require_once(dirname(__FILE__) . '/../../plugins/tospur/Tools/Image.php');
add_filter('template_include', 'page_template'); add_filter('template_include', 'page_template');
function page_template($template) function page_template($template)
{ {
$theme = get_stylesheet_directory(); $theme = get_stylesheet_directory();
$page = null; $page = null;
if (isset($_GET['page'])) {
switch ($_GET['page']) { switch ($_GET['page']) {
case 'login': case 'login':
$page = $theme . '/login.php'; $page = $theme . '/login.php';
...@@ -29,20 +32,29 @@ function page_template($template) ...@@ -29,20 +32,29 @@ function page_template($template)
case 'consultant_info': case 'consultant_info':
$page = $theme . '/consultant_info.php'; $page = $theme . '/consultant_info.php';
break; break;
case 'consultant_list':
$page = $theme . '/consultant_list.php';
break;
case 'score': case 'score':
$page = $theme . '/score.php'; $page = $theme . '/score.php';
break; break;
case 'comment':
$page = $theme . '/comment.php';
break;
case 'myHouse':
$page = $theme . '/myHouse.php';
break;
case 'detail': case 'detail':
$page = $theme . '/detail.php'; $page = $theme . '/detail.php';
break; break;
case 'map': case 'map':
$page = $theme . '/map.php'; $page = $theme . '/map.php';
break; break;
default:
$page = $template;
break;
} }
return $page; return $page;
} else {
return $template;
}
} }
function generate_code() function generate_code()
...@@ -100,7 +112,6 @@ function view_house() ...@@ -100,7 +112,6 @@ function view_house()
} }
$time = (9 + $index) . ':00-' . (10 + $index) . ':00'; $time = (9 + $index) . ':00-' . (10 + $index) . ':00';
$result = dao::insert_view_house($_POST['house_id'], $_POST['user_id'], $date, $index, $time, $_POST['consultant_id']); $result = dao::insert_view_house($_POST['house_id'], $_POST['user_id'], $date, $index, $time, $_POST['consultant_id']);
print_r($result);
$array = array(); $array = array();
if ($result) { if ($result) {
$array['code'] = 2000; $array['code'] = 2000;
...@@ -144,12 +155,83 @@ function add_consultant_score() ...@@ -144,12 +155,83 @@ 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');
function get_consultant()
{
if (isset($_POST['city_id']) && isset($_POST['index'])) {
$result = dao::search_consultant_by_city($_POST['city_id'], $_POST['index']);
$array = array();
if ($result) {
$array['code'] = 2000;
$array['result'] = $result;
} else {
$array['code'] = 2001;
}
wp_send_json($array);
}
}
add_action('wp_ajax_get_my_house', 'get_my_house');
function get_my_house()
{
$houseType = $_POST['houseType'];
$userType = $_POST['userType'];
$userId = $_POST['userId'];
$index = $_POST['index'];
if (isset($houseType) && isset($userType) && isset($userId) && isset($index)) {
$house_result = SearchDao::searchHouse(
array(
'houseType' => $houseType,
'userType' => $userType,
'userId' => $userId,
'index' => $index
)
);
$array = get_house_image_and_tags($house_result);
wp_send_json($array);
}
} }
add_action('wp_ajax_search_house', 'SearchDao::ajax_searchHouse');
add_action('wp_ajax_nopriv_search_house', 'SearchDao::ajax_searchHouse');
function get_house_image_and_tags($house_result)
{
$array = array();
if ($house_result) {
$array['code'] = 2000;
$house_ids = array();
foreach ($house_result as $key => $value) {
$house_id = $value->id;
$house_ids[] = $house_id;
}
$string = '(' . implode(',', array_map('intval', $house_ids)) . ')';
$tag_result = dao::search_house_tag($string);
//标签
if ($tag_result) {
foreach ($tag_result as $key => $value) {
$array['tags'][$value->house_id][] = $value->name;
}
}
//图片
$image_result = dao::search_house_image($string);
if ($image_result) {
foreach ($image_result as $key => $value) {
$array['images'][$value->house_id] = home_url() . Image::getImage($value->path,'small');
}
}
$array['result'] = $house_result;
} else {
$array['code'] = 2001;
}
return $array;
}
add_action('wp_ajax_add_collect', 'add_collect'); add_action('wp_ajax_add_collect', 'add_collect');
function add_collect($house_id){ function add_collect($house_id){
...@@ -169,4 +251,18 @@ function add_collect($house_id){ ...@@ -169,4 +251,18 @@ function add_collect($house_id){
} }
wp_send_json($array); wp_send_json($array);
} }
add_filter('login_redirect', 'new_login_redirect', 10, 3);
function new_login_redirect($redirect_to, $request, $user ){
if($user-ID>0) {
$role = $user->roles[0];
if ($role == 'administrator' || $role == 'editor') {
return admin_url('admin.php?page=newHouseList');
} else {
return site_url();
}
}else{
return $redirect_to;
}
}
?> ?>
\ No newline at end of file
<?php
$house_id = $_GET['id'];
$house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, v.handle, v.handle_date FROM tospur_view_house v '
. 'left join tospur_house h on v.house_id = h.id '
. 'left join wp_users u on v.user_id = u.id '
. 'where v.id = ' . $house_id;
$consultant_sql = 'SELECT u.id,u.display_name FROM wp_users u '
. 'left join wp_usermeta m on u.id=m.user_id where meta_key="wp_user_level" and meta_value=7;';
global $wpdb;
$context['house_result'] = $wpdb->get_row($house_sql);
$context['consultant_result'] = $wpdb->get_results($consultant_sql);
$context['url'] = home_url();
$context['id'] = $house_id;
Timber::render('Admin/views/handle.html', $context);
?>
\ No newline at end of file
<?php <?php
$context = array(); $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php"); require_once(WP_PLUGIN_DIR."/tospur/Dao/SearchDao.php");
$cityId = 1; $cityId = 1;
if($_GET['cityId']) if($_GET['cityId'])
$cityId = $_GET['cityId']; $cityId = $_GET['cityId'];
$context['cityId'] = $cityId; $context['cityId'] = $cityId;
$context['cityName'] = SearchDao::getCityNameWithId($cityId); $context['cityName'] = SearchDao::getCityNameWithId($cityId);
$context['select']['city'] = SearchDao::searchCity(); $context['select']['city'] = SearchDao::searchCity();
$context['select']['district'] = SearchDao::searchCity($cityId); $context['select']['district'] = SearchDao::searchCity($cityId);
$plateArray = array(); $plateArray = array();
foreach($context['select']['district'] as $item){ foreach($context['select']['district'] as $item){
$plateArray[$item->id] = array(); $plateArray[$item->id] = array();
foreach(SearchDao::searchCity($cityId,$item->id) as $i){ foreach(SearchDao::searchCity($cityId,$item->id) as $i){
$plateArray[$item->id][] = $i; $plateArray[$item->id][] = $i;
} }
} }
$context['select']['plate'] = json_encode($plateArray); $context['select']['plate'] = json_encode($plateArray);
$context['select']['buildProperty'] = SearchDao::searchBuildProperty(); $context['select']['buildProperty'] = SearchDao::searchBuildProperty();
$context['select']['room'] = json_encode(SearchDao::searchRoom()); $context['select']['room'] = json_encode(SearchDao::searchRoom());
$context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId); $context['select']['unitPriceRange'] = SearchDao::searchUnitPriceRange($cityId);
$context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId); $context['select']['totalPrice'] = SearchDao::searchTotalPrice($cityId);
$context['select']['area'] = json_encode(SearchDao::searchArea($cityId)); $context['select']['area'] = json_encode(SearchDao::searchArea($cityId));
$context['site_url'] = site_url(); $context['site_url'] = site_url();
Timber::render('index.html', $context); Timber::render('index.html', $context);
?> ?>
\ No newline at end of file
...@@ -76,77 +76,3 @@ Date.prototype.Format = function (fmt) { ...@@ -76,77 +76,3 @@ Date.prototype.Format = function (fmt) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt; return fmt;
}; };
//将数据存储到lacalstorage和cookie中,
var ugenLocalStorage =
{
set: function(name, value)
{
var date = new Date(),
expires = '',
type = typeof(value),
valueToUse = ''
//cookie后的时间变量,固定为了365天
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
//判断数据类型是string还是map
if (type === "object" && type !== "undefined") {
if(!("JSON" in window)) throw "Bummer, your browser doesn't support JSON parsing.";
valueToUse = JSON.stringify(value);
} else {
valueToUse = value;
}
//储存在localStorage中
localStorage[name] = valueToUse;
//储存在cookie中
document.cookie = name + "=" +encodeURIComponent(valueToUse) + expires
},
get: function(name){
//判断是否存在localstorage,有返回localstorage没有返回cookie
if(localStorage[name]){
return localStorage[name];
}else
{
var nameEQ = name + "=",
//从cookie中拿出数据使用';'分开
ca = document.cookie.split(';'),
value = '',
//存放数据第一个字符变量
firstChar = '',
parsed={};
for (var i = 0; i < ca.length; i++)
{
var c = ca[i];
//循环每个字符,直到为空
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
//判断nameEQ与储存数据name是否匹配
if (c.indexOf(nameEQ) === 0)
{
//将cookie数据解码
value = decodeURIComponent(c.substring(nameEQ.length, c.length));
firstChar = value.substring(0, 1);
//判断是否为map形式
if(firstChar=="{")
{
try
{
parsed = JSON.parse(value);
if("v" in parsed) return parsed.v;
} catch(e)
{
return value;
}
}
if (value=="undefined") return undefined;
return value;
}
}
return null;
}
}
}
\ No newline at end of file
...@@ -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;
} }
} }
......
...@@ -12,9 +12,9 @@ if (is_user_logged_in()) { ...@@ -12,9 +12,9 @@ if (is_user_logged_in()) {
$phone = $_POST['phone']; $phone = $_POST['phone'];
$password = $_POST['password']; $password = $_POST['password'];
if (!$phone) { if (!$phone) {
$context['phoneError'] = '请输入用户名'; $context['error'] = '请输入用户名';
} else if (!$password) { } else if (!$password) {
$context['passwordError'] = '请输入密码'; $context['error'] = '请输入密码';
} else { } else {
if (strlen($phone) != 11) { if (strlen($phone) != 11) {
$response = wp_remote_post('http://218.1.67.130:8988/api/NanTongWechat/LoginWechat' . $response = wp_remote_post('http://218.1.67.130:8988/api/NanTongWechat/LoginWechat' .
...@@ -33,9 +33,9 @@ if (is_user_logged_in()) { ...@@ -33,9 +33,9 @@ if (is_user_logged_in()) {
if (!is_wp_error($user)) { if (!is_wp_error($user)) {
wp_redirect($const_my_page); wp_redirect($const_my_page);
} else if ($user->get_error_code() == 'invalid_username') { } else if ($user->get_error_code() == 'invalid_username') {
$context['phoneError'] = '请输入有效的用户名'; $context['error'] = '请输入有效的用户名';
} else if ($user->get_error_code() == 'incorrect_password') { } else if ($user->get_error_code() == 'incorrect_password') {
$context['passwordError'] = '您输入的密码无效'; $context['error'] = '您输入的密码无效';
} }
} }
} }
......
...@@ -7,32 +7,23 @@ $context['theme'] = get_template_directory_uri(); ...@@ -7,32 +7,23 @@ $context['theme'] = get_template_directory_uri();
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
$current_user_id = $current_user->ID; $current_user_id = $current_user->ID;
if ($current_user_id == 0) { if ($current_user_id == 0) {
$context['logout'] = array( wp_redirect(get_site_url()."?page=login");
'login' => $const_login_page,
'register' => $const_register_page
);
} else { } else {
$name = $current_user->user_login; $name = $current_user->user_login;
$role = $current_user->roles[0]; $role = $current_user->roles[0];
$user_role = ''; $user_role = '';
switch ($role) { switch ($role) {
case 'contributor': case 'administrator':
case 'subscriber':
$user_role = '用户'; $user_role = '用户';
wp_redirect(get_site_url()."?page=myHouse");
break; break;
case 'editor': case 'editor':
$user_role = '置业顾问'; $user_role = '置业顾问';
/*header('Location: ' . $const_list_page); wp_redirect(get_site_url()."?page=list");
exit;*/
break;
case 'administrator':
$user_role = '管理员';
break; break;
} }
$context['login'] = array(
'name' => $user_role . $name,
'out' => wp_logout_url($const_login_page)
);
} }
Timber::render('my.html', $context);
?> ?>
\ No newline at end of file
<?php
$context = array();
$context['theme'] = get_template_directory_uri();
$context['url'] = home_url();
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
if ($user_id != 0) {
$context['user_id'] = $user_id;
}
Timber::render('myHouse.html', $context);
?>
\ No newline at end of file
<?php <?php
require_once('const.php');
$context = array(); $context = array();
$context['theme'] = get_template_directory_uri(); $context['theme'] = get_template_directory_uri();
$context['url'] = home_url(); $context['url'] = home_url();
...@@ -8,11 +9,11 @@ if ($_POST) { ...@@ -8,11 +9,11 @@ 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) {
...@@ -22,16 +23,15 @@ if ($_POST) { ...@@ -22,16 +23,15 @@ if ($_POST) {
$creds['user_login'] = $phone; $creds['user_login'] = $phone;
$creds['user_password'] = $password; $creds['user_password'] = $password;
$creds['remember'] = true; $creds['remember'] = true;
echo '注册成功';
$user = wp_signon($creds, false); $user = wp_signon($creds, false);
if (!is_wp_error($user)) { if (!is_wp_error($user)) {
echo '自动登录,跳转页面'; wp_redirect($const_my_page);
} }
} else { } else {
$context['phoneError'] = '抱歉,用户名已存在'; $context['error'] = '抱歉,用户名已存在';
} }
} else { } else {
$context['codeError'] = '请输入正确的验证码'; $context['error'] = '请输入正确的验证码';
} }
} }
} }
......
...@@ -5,10 +5,7 @@ $context['theme'] = get_template_directory_uri(); ...@@ -5,10 +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) {
wp_redirect(get_site_url()."?page=login");
exit;
}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');
...@@ -21,6 +18,9 @@ if ($user_id == 0) { ...@@ -21,6 +18,9 @@ if ($user_id == 0) {
$context['house_id'] = $_GET['house_id']; $context['house_id'] = $_GET['house_id'];
$context['consultant_id'] = $_GET['consultant_id']; $context['consultant_id'] = $_GET['consultant_id'];
Timber::render('view.html', $context); Timber::render('view.html', $context);
}else{
wp_redirect(get_site_url()."?page=login");
exit;
} }
......
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<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>
<style></style>
<script src="{{ theme }}/js/jquery.min.js"></script>
<script>
$(document).ready(function () {
$('#submit').click(function () {
var content = $('#content').val();
if (content.trim() == '') {
alert('请输入评论内容!');
}
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=submit_comment',
success: function (data) {
}
});
});
});
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head lang="en">
<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>置业顾问</title>
<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">
<script src="{{ theme }}/js/iscroll.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>
</head>
<body>
<div class="search">
<div class="btn-group pull-left" id="cityGroup">
<a class="btn" id="cityName">{{ city_name }}<i class="iconfont"></i></a>
<div id="city_wrapper" class="dropdown-menu">
<div id="city_scroller">
{% for item in city %}
<a href="{{ url }}/?page=consultant_list&city_id={{ item.id }}"{% if(item.id==city_id) %} class="active"{% endif %}>{{ item.value }}</a>
{% endfor %}
</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">
<ol class="col-xs-3">
<img data-attr="image">
</ol>
<ol class="col-xs-4">
<p data-attr="name"></p>
<div class="star-rating rating-xs rating-disabled" style="font-size:12px;">
<div class="rating-container rating-gly-star" data-content="">
<div class="rating-stars" data-content="" style="" data-attr="score"></div>
</div>
</div>
<p>同策房屋</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>
<script>
var index = 0;
var cityScroll;
var myScroll;
var template;
var consultant_info_url = '{{ url }}/?page=consultant_info';
var loading;
$(document).ready(function () {
loading = $('#loading');
$('#cityGroup').tap(function () {
var self = $(this);
if(self.hasClass('open')){
self.removeClass('open');
}else{
self.addClass('open');
}
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();
}
});
template = $('#template').html();
ajax_get_consultant();
});
function ajax_get_consultant() {
loading.show();
$.ajax({
type: 'POST',
url: '{{ url }}/wp-admin/admin-ajax.php/',
data: 'action=get_consultant&city_id={{ city_id }}&index=' + index,
success: function (data) {
loading.hide();
if (data.code == 2000) {
$.each(data.result, function (index, value) {
var li = $('<li>');
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);
var infoUrl;
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({
size: 'xs',
showClear: false,
showCaption: false,
hoverEnabled: false,
readonly: true
});
index += 20;
myScroll.refresh();
} else {
}
}
});
}
</script>
</body>
</html>
\ No newline at end of file
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
$(document).ready(function(){ $(document).ready(function(){
$("#slider").bind("tap",function(){ $("#slider").bind("tap",function(){
$("#carousel_wrapper").parent().show(); $("#carousel_wrapper").parent().show();
var carousel = $("#carousel_wrapper");
var carouselWidth = carousel.width();
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
carousel.find("#carousel_indicator li").removeClass("carousel_active");
carousel.find("#carousel_indicator li:first").addClass("carousel_active");
carouselScroll = new IScroll('#carousel_wrapper', { carouselScroll = new IScroll('#carousel_wrapper', {
bounce: false, bounce: false,
scrollX: true, scrollX: true,
...@@ -58,11 +64,6 @@ ...@@ -58,11 +64,6 @@
$("#carousel_indicator li").removeClass("carousel_active"); $("#carousel_indicator li").removeClass("carousel_active");
$("#carousel_indicator li").eq(this.currentPage.pageX).addClass("carousel_active"); $("#carousel_indicator li").eq(this.currentPage.pageX).addClass("carousel_active");
}); });
var carousel = $("#carousel_wrapper");
var carouselWidth = carousel.width();
carousel.find("#carousel_scroller ul li").css({"width":carouselWidth});
carousel.find("#carousel_indicator li").removeClass("carousel_active");
carousel.find("#carousel_indicator li:first").addClass("carousel_active");
return false; return false;
}); });
$("#carousel_wrapper").parent().bind("click",function(){ $("#carousel_wrapper").parent().bind("click",function(){
...@@ -214,13 +215,11 @@ ...@@ -214,13 +215,11 @@
</ol> </ol>
<ol class="col-xs-4"> <ol class="col-xs-4">
<p>{{item.name}}</p> <p>{{item.name}}</p>
<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:12px;">
<div class="rating-container rating-gly-star" data-content=""> <div class="rating-container rating-gly-star" data-content="">
<div class="rating-stars" data-content="" style="width: {{item.average_score*2*10}}%;"></div> <div class="rating-stars" data-content="" style="width: {{item.average_score*2*10}}%;"></div>
</div> </div>
</div> </div>
</p>
</ol> </ol>
<ol class="col-xs-6"> <ol class="col-xs-6">
{% if not item.mobile %} {% if not item.mobile %}
......
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