Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tospur
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
felix
tospur
Commits
48e530a6
Commit
48e530a6
authored
Sep 06, 2015
by
shz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tospur
parent
7754a36b
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
813 additions
and
34 deletions
+813
-34
wp-content/plugins/tospur/Admin/views/sale_detail.html
+83
-0
wp-content/plugins/tospur/Config.php
+1
-0
wp-content/plugins/tospur/Dao/TospurDao.php
+21
-0
wp-content/plugins/tospur/index.php
+1
-0
wp-content/plugins/tospur/tospur_sale.php
+241
-0
wp-content/plugins/tospur/tospur_sale_detail.php
+32
-0
wp-content/themes/tospur/consultant_info.php
+0
-1
wp-content/themes/tospur/css/rent.css
+38
-23
wp-content/themes/tospur/functions.php
+23
-2
wp-content/themes/tospur/js/iscroll.js
+5
-1
wp-content/themes/tospur/sale.php
+7
-4
wp-content/themes/tospur/views/consultant_info.html
+11
-3
wp-content/themes/tospur/views/forget.html
+3
-0
wp-content/themes/tospur/views/login.html
+3
-0
wp-content/themes/tospur/views/manager.html
+3
-0
wp-content/themes/tospur/views/register.html
+3
-0
wp-content/themes/tospur/views/sale.html
+335
-0
wp-content/themes/tospur/views/view.html
+3
-0
No files found.
wp-content/plugins/tospur/Admin/views/sale_detail.html
0 → 100644
View file @
48e530a6
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ view }}/css/bootstrap.min.css"
>
<style>
.sale_detail
ul
{
margin-top
:
30px
;
}
.sale_detail
ul
li
{
margin
:
20px
0
;
}
.sale_detail
ul
li
span
:nth-of-type
(
1
)
{
font-weight
:
bold
;
font-size
:
14px
;
display
:
inline-block
;
width
:
100px
;
}
.sale_detail
ul
li
span
:nth-of-type
(
2
)
{
font-size
:
14px
;
display
:
inline-block
;
width
:
400px
;
}
</style>
<script>
(
function
(
$
)
{
$
(
document
).
ready
(
function
()
{
$
(
'#handle'
).
click
(
function
()
{
var
consultant_id
=
$
(
'#consultant'
).
find
(
'option:selected'
).
val
();
alert
(
consultant_id
);
});
});
})(
jQuery
);
</script>
{% if house_type == 1 %}
{% set unit = '万元' %}
{% set price = '售价' %}
{% elseif house_type == 2 %}
{% set unit = '元/月' %}
{% set price = '租金' %}
{% endif %}
<div
class=
"sale_detail"
>
<h2>
房东服务详细
</h2>
<ul>
<li>
<span>
城市:
</span>
<span>
{{ detail_result.cityName }}
</span>
</li>
<li>
<span>
小区名称:
</span>
<span>
{{ detail_result.community_name }}
</span>
</li>
<li>
<span>
户型:
</span>
<span>
{{ detail_result.bedroom }}室{{ detail_result.hall }}厅{{ detail_result.kitchen }}厨{{ detail_result.bathroom }}卫
</span>
</li>
<li>
<span>
面积:
</span>
<span>
{{ detail_result.covered_area }}m²
</span>
</li>
<li>
<span>
楼层:
</span>
<span>
第{{ detail_result.floor }}层(共{{ detail_result.total_floor }}层)
</span>
</li>
<li>
<span>
期望{{ price }}:
</span>
<span>
{{ detail_result.price }}{{ unit }}
</span>
</li>
<li>
<span>
房源描述:
</span>
<span>
{{ detail_result.description }}
</span>
</li>
<li>
<span>
置业顾问:
</span>
<span>
<select
id=
"consultant"
>
{% for consultant in consultant_result %}
<option
value=
"{{ consultant.id }}"
{%
if
(
house_result
.
consultant_id =
=
consultant
.
id
)
%}
selected=
"selected"
{%
endif
%}
>
{{ consultant.display_name }}
</option>
{% endfor %}
</select>
<label
for=
"consultant"
></label>
</span>
</li>
</ul>
</div>
<button
id=
"handle"
>
提交处理
</button>
\ No newline at end of file
wp-content/plugins/tospur/Config.php
View file @
48e530a6
...
...
@@ -23,6 +23,7 @@ class Config {
const
TOSPUR_TAG_TABLE
=
'tospur_tag'
;
const
TOSPUR_VIEW_HOUSE_TABLE
=
'tospur_view_house'
;
const
TOSPUR_VERIFY_TABLE
=
'tospur_verify'
;
const
TOSPUR_SALE_TABLE
=
'tospur_sale'
;
const
WP_USERS_TABLE
=
'wp_users'
;
...
...
wp-content/plugins/tospur/Dao/TospurDao.php
View file @
48e530a6
...
...
@@ -78,6 +78,17 @@ class TospurDao
return
$result
;
}
public
static
function
search_score_type
(
$user_id
,
$consultant_id
)
{
global
$wpdb
;
$sql
=
'select type from (SELECT user_id,consultant_id,handle_date,1 as type FROM '
.
Config
::
TOSPUR_VIEW_HOUSE_TABLE
.
' where handle = 1 and user_id = '
.
$user_id
.
' and consultant_id = '
.
$consultant_id
.
' UNION'
.
' SELECT user_id,consultant_id,handle_date,2 as type FROM '
.
Config
::
TOSPUR_SALE_TABLE
.
' where handle = 1 and user_id = '
.
$user_id
.
' and consultant_id = '
.
$consultant_id
.
') as u'
.
' order by handle_date desc limit 1'
;
return
$wpdb
->
get_var
(
$sql
);
}
//search 置业顾问信息
public
static
function
search_consultant_info
(
$consultant_id
)
{
...
...
@@ -141,6 +152,15 @@ class TospurDao
'where cityid = '
.
$city_id
.
' LIMIT '
.
$index
.
',20;'
;
return
$wpdb
->
get_results
(
$consultant_sql
);
}
public
static
function
insert_tospur_sale
(
$post
)
{
$post
[
'submission_date'
]
=
current_time
(
'Y-m-d H:i:s'
);
unset
(
$post
[
'action'
]);
global
$wpdb
;
$result
=
$wpdb
->
insert
(
Config
::
TOSPUR_SALE_TABLE
,
$post
);
return
$result
;
}
}
?>
\ No newline at end of file
wp-content/plugins/tospur/index.php
View file @
48e530a6
...
...
@@ -27,6 +27,7 @@ function tospur_init()
require_once
(
PLUGIN_DIR
.
'Admin/introduction.php'
);
require_once
(
'consultant_score.php'
);
require_once
(
'view_house.php'
);
require_once
(
'tospur_sale.php'
);
add_action
(
'admin_menu'
,
'reset_menu'
);
tospur_register_script_style
();
tospur_ajax_set
();
...
...
wp-content/plugins/tospur/tospur_sale.php
0 → 100644
View file @
48e530a6
<?php
if
(
!
class_exists
(
'WP_List_Table'
))
{
require_once
(
ABSPATH
.
'wp-admin/includes/class-wp-list-table.php'
);
}
class
tospurSaleList
extends
WP_List_Table
{
function
__construct
()
{
global
$status
,
$page
;
//Set parent defaults
parent
::
__construct
(
array
(
'singular'
=>
'sale'
,
//singular name of the listed records
'plural'
=>
'sales'
,
//plural name of the listed records
'ajax'
=>
false
//does this table support ajax?
));
}
function
column_default
(
$item
,
$column_name
)
{
switch
(
$column_name
)
{
case
'community_name'
:
return
'<a href="'
.
admin_url
(
'admin.php?page='
.
$_GET
[
'page'
]
.
'&id='
.
$item
[
'id'
])
.
'">'
.
$item
[
$column_name
]
.
'</a>'
;
case
'consultant'
:
$consultant
=
$item
[
$column_name
]
?
$item
[
$column_name
]
:
'未分配'
;
return
$consultant
;
case
'handle'
:
$handle
=
(
$item
[
$column_name
]
==
1
)
?
'已处理'
:
'未处理'
;
return
$handle
;
default
:
return
$item
[
$column_name
];
}
}
function
get_columns
()
{
$columns
=
array
(
'cityName'
=>
'城市'
,
'community_name'
=>
'小区名'
,
'apartment'
=>
'户型'
,
'covered_area'
=>
'面积'
,
'floor'
=>
'楼层'
,
'faceto'
=>
'朝向'
,
'price'
=>
'期望售价'
,
'description'
=>
'房源描述'
,
'phone'
=>
'手机号'
,
'submission_date'
=>
'提交时间'
,
'consultant'
=>
'置业顾问'
,
'handle'
=>
'处理状态'
,
'handle_date'
=>
'处理时间'
);
return
$columns
;
}
function
get_sortable_columns
()
{
$sortable_columns
=
array
();
return
$sortable_columns
;
}
function
extra_tablenav
(
$which
)
{
if
(
$which
==
'top'
)
{
?>
<div>
<label
for=
"cityDropDown"
></label>
<select
name=
"cityId"
id=
"cityDropDown"
style=
"vertical-align: initial;"
>
<?php
$cityId
=
(
int
)
$_GET
[
'cityId'
];
$city
=
SearchDao
::
searchCity
();
?>
<option
value=
"-1"
<?php
if
(
$cityId
==
-
1
)
{
echo
' selected="selected"'
;
}
?>
>
城市
</option>
<?php
foreach
(
$city
as
$item
)
{
if
(
$item
->
id
==
$cityId
)
{
$selected
=
' selected="selected"'
;
}
else
{
$selected
=
null
;
}
echo
'<option value="'
.
$item
->
id
.
'"'
.
$selected
.
'>'
.
$item
->
value
.
'</option>'
;
}
?>
</select>
<span>
<label
for=
"search"
></label>
<input
type=
"search"
id=
"search"
name=
"s"
value=
"
<?php
echo
$_GET
[
's'
];
?>
"
placeholder=
"请输入关键字搜索"
style=
"height: 28px;"
>
<input
type=
"submit"
id=
"search-submit"
class=
"button"
value=
"搜索"
>
</span>
</div>
<?php
}
}
function
prepare_items
()
{
global
$wpdb
;
$per_page
=
10
;
$columns
=
$this
->
get_columns
();
$hidden
=
array
();
$sortable
=
$this
->
get_sortable_columns
();
$this
->
_column_headers
=
array
(
$columns
,
$hidden
,
$sortable
);
$house_type
=
$_GET
[
'page'
];
if
(
$house_type
==
'tospur_sale_secondhand'
)
{
$house_type
=
1
;
}
else
if
(
$house_type
==
'tospur_sale_rent'
)
{
$house_type
=
2
;
}
$sql
=
"SELECT ts.*,dc.cityName,u.display_name FROM tospur_sale ts"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join wp_users u on u.ID = ts.consultant_id"
.
" where ts.house_type = "
.
$house_type
;
$cityId
=
(
int
)
$_GET
[
'cityId'
];
if
(
$cityId
>
0
)
{
$sql
.=
" and ts.cityId = "
.
$cityId
;
}
$s
=
$_GET
[
's'
];
if
(
$s
)
{
$sql
.=
" and (ts.community_name like '%"
.
$s
.
"%' or ts.phone like '%"
.
$s
.
"%' or ts.faceto like '%"
.
$s
.
"%')"
;
}
$result
=
$wpdb
->
get_results
(
$sql
);
$data
=
array
();
foreach
(
$result
as
$key
=>
$value
)
{
$unit
=
(
$value
->
house_type
==
1
)
?
'万元'
:
'元/月'
;
$data
[
$key
]
=
array
(
'id'
=>
$value
->
id
,
'cityName'
=>
$value
->
cityName
,
'community_name'
=>
$value
->
community_name
,
'apartment'
=>
$value
->
bedroom
.
'室'
.
$value
->
hall
.
'厅'
.
$value
->
kitchen
.
'厨'
.
$value
->
bathroom
.
'卫'
,
'covered_area'
=>
$value
->
covered_area
.
'm²'
,
'floor'
=>
'第'
.
$value
->
floor
.
'层(共'
.
$value
->
total_floor
.
'层)'
,
'faceto'
=>
$value
->
faceto
,
'price'
=>
$value
->
price
.
$unit
,
'description'
=>
$value
->
description
,
'phone'
=>
$value
->
phone
,
'submission_date'
=>
$value
->
submission_date
,
'consultant'
=>
$value
->
display_name
,
'handle'
=>
$value
->
handle
,
'handle_date'
=>
$value
->
handle_date
);
}
function
usort_reorder
(
$a
,
$b
)
{
$orderby
=
(
!
empty
(
$_REQUEST
[
'orderby'
]))
?
$_REQUEST
[
'orderby'
]
:
'handle'
;
$order
=
(
!
empty
(
$_REQUEST
[
'order'
]))
?
$_REQUEST
[
'order'
]
:
'asc'
;
$result
=
strcmp
(
$a
[
$orderby
],
$b
[
$orderby
]);
return
(
$order
===
'asc'
)
?
$result
:
-
$result
;
}
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
,
'per_page'
=>
$per_page
,
'total_pages'
=>
ceil
(
$total_items
/
$per_page
)
));
}
}
function
add_tospur_sale_menu
()
{
add_menu_page
(
'房东服务'
,
'房东服务'
,
'activate_plugins'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
,
'dashicons-menu'
,
28
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出售'
,
'出售'
,
'activate_plugins'
,
'tospur_sale_secondhand'
,
'tospur_sale_page'
);
add_submenu_page
(
'tospur_sale_secondhand'
,
'出租'
,
'出租'
,
'activate_plugins'
,
'tospur_sale_rent'
,
'tospur_sale_page'
);
}
add_action
(
'admin_menu'
,
'add_tospur_sale_menu'
);
function
tospur_sale_page
()
{
if
(
$_GET
[
'id'
])
{
require_once
(
'tospur_sale_detail.php'
);
}
else
{
$tospurSaleList
=
new
tospurSaleList
();
$tospurSaleList
->
prepare_items
();
$house_type
=
$_GET
[
'page'
];
$title
=
null
;
if
(
$house_type
==
'tospur_sale_secondhand'
)
{
$title
=
'房东服务列表—出售'
;
}
else
if
(
$house_type
==
'tospur_sale_rent'
)
{
$title
=
'房东服务列表—出租'
;
}
?>
<div
class=
"wrap"
>
<h2>
<?php
echo
$title
;
?>
</h2>
<form
method=
"get"
>
<input
type=
"hidden"
name=
"page"
value=
"
<?php
echo
$_REQUEST
[
'page'
];
?>
"
/>
<?php
$tospurSaleList
->
display
();
?>
</form>
</div>
<style>
</style>
<script>
(
function
(
$
)
{
var
cityId
=
-
1
;
$
(
document
).
ready
(
function
()
{
var
cityDropDown
=
$
(
'#cityDropDown'
);
cityId
=
Number
(
cityDropDown
.
find
(
'option:selected'
).
val
());
cityDropDown
.
change
(
function
()
{
cityId
=
Number
(
$
(
this
).
val
());
window
.
location
.
href
=
'
<?php
echo
admin_url
(
'admin.php?page='
.
$_GET
[
'page'
]
.
'&paged=1'
);
?>
'
+
'&cityId='
+
cityId
;
});
$
(
'#search-submit'
).
click
(
function
()
{
var
s
=
$
(
'#search'
).
val
();
if
(
!
s
)
{
alert
(
'请输入关键字搜索'
);
}
else
{
window
.
location
.
href
=
'
<?php
echo
admin_url
(
'admin.php?page='
.
$_GET
[
'page'
]
.
'&paged=1'
);
?>
'
+
'&cityId='
+
cityId
+
'&s='
+
s
;
}
return
false
;
});
});
})(
jQuery
);
</script>
<?php
}
}
?>
\ No newline at end of file
wp-content/plugins/tospur/tospur_sale_detail.php
0 → 100644
View file @
48e530a6
<?php
$house_id
=
$_GET
[
'id'
];
$page
=
$_GET
[
'page'
];
if
(
$page
==
'tospur_sale_secondhand'
)
{
$house_type
=
1
;
}
else
if
(
$page
==
'tospur_sale_rent'
)
{
$house_type
=
2
;
}
$detail_sql
=
"SELECT ts.*,dc.cityName,u.display_name FROM tospur_sale ts"
.
" left join (SELECT cityId,cityName FROM dic_city group by cityId) dc on ts.cityId = dc.cityId"
.
" left join wp_users u on u.ID = ts.consultant_id"
.
" where ts.house_type = "
.
$house_type
.
" and ts.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
[
'detail_result'
]
=
$wpdb
->
get_row
(
$detail_sql
);
$context
[
'consultant_result'
]
=
$wpdb
->
get_results
(
$consultant_sql
);
$context
[
'url'
]
=
home_url
();
$context
[
'id'
]
=
$house_id
;
$context
[
'house_type'
]
=
$house_type
;
$context
[
'view'
]
=
plugins_url
()
.
'/tospur/Admin/views'
;
Timber
::
render
(
'Admin/views/sale_detail.html'
,
$context
);
?>
\ No newline at end of file
wp-content/themes/tospur/consultant_info.php
View file @
48e530a6
...
...
@@ -7,7 +7,6 @@ $current_user = wp_get_current_user();
$user_id
=
$current_user
->
ID
;
if
(
$user_id
!=
0
)
{
$context
[
'user_id'
]
=
$user_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'
]
=
get_consultant_info
(
$consultant_id
);
...
...
wp-content/themes/tospur/css/rent.css
View file @
48e530a6
...
...
@@ -356,31 +356,41 @@ body {
a
:hover
{
text-decoration
:
none
;
}
.main
{
#wrapper
{
position
:
absolute
;
z-index
:
1
;
top
:
40px
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
padding-bottom
:
5%
;
overflow
:
hidden
;
}
#wrapper
#scroller
{
padding-bottom
:
15px
;
}
.main
ul
li
{
#wrapper
#scroller
ul
li
{
margin
:
0
15px
;
padding
:
13px
0
;
height
:
60px
;
line-height
:
60px
;
border-bottom
:
1px
solid
#b7b7b7
;
color
:
#7d7d7d
;
font-size
:
18px
;
overflow
:
hidden
;
}
.main
ul
li
label
{
#wrapper
#scroller
ul
li
label
{
margin-bottom
:
0
;
padding
:
5px
0
0
4px
;
padding
:
0
0
0
4px
;
}
.main
ul
li
p
{
#wrapper
#scroller
ul
li
p
{
margin-bottom
:
0
;
padding
:
0
;
height
:
100%
;
}
.main
ul
li
p
.form-control
{
#wrapper
#scroller
ul
li
p
.form-control
{
color
:
#7d7d7d
;
font-size
:
18px
;
background-color
:
transparent
;
border
-color
:
transparent
;
border
:
0
;
display
:
inline-block
;
box-shadow
:
none
;
-webkit-box-shadow
:
none
;
...
...
@@ -394,29 +404,34 @@ a:hover {
-webkit-border-bottom-right-radius
:
0
;
-webkit-appearance
:
none
;
}
.main
ul
li
p
.form-control
::-webkit-input-placeholder
{
#wrapper
#scroller
ul
li
p
.form-control
::-webkit-input-placeholder
{
color
:
#7d7d7d
;
}
.main
ul
li
p
.form-control
::-webkit-outer-spin-button
,
.main
ul
li
p
.form-control
::-webkit-inner-spin-button
{
#wrapper
#scroller
ul
li
p
.form-control
::-webkit-outer-spin-button
,
#wrapper
#scroller
ul
li
p
.form-control
::-webkit-inner-spin-button
{
-webkit-appearance
:
none
!important
;
margin
:
0
;
}
.main
ul
li
p
.form-control.width-sm
{
width
:
45px
;
#wrapper
#scroller
ul
li
p
.form-control.width-sm
{
width
:
36px
;
padding
:
6px
;
}
.main
ul
li
p
textarea
.form-control
{
#wrapper
#scroller
ul
li
p
textarea
.form-control
{
resize
:
none
;
background-color
:
#ffffff
;
border
-color
:
#e9e9e9
;
border
:
1px
solid
#e9e9e9
;
}
.main
ul
li
:last-child
{
border-bottom
:
0
;
#wrapper
#scroller
ul
li
p
em
{
font-size
:
9px
;
position
:
relative
;
top
:
-6px
;
font-style
:
normal
;
}
.main
ul
li
:last-child
label
{
margin-bottom
:
18px
;
#wrapper
#scroller
ul
li
:last-child
{
height
:
auto
;
border-bottom
:
0
;
}
.main
.btn
{
#wrapper
#scroller
.btn
{
width
:
86%
;
display
:
block
;
color
:
#ffffff
;
...
...
@@ -435,9 +450,9 @@ a:hover {
box-shadow
:
0
2px
0
0
#117bb9
;
-webkit-box-shadow
:
0
2px
0
0
#117bb9
;
}
.main
.btn
:active
{
#wrapper
#scroller
.btn
:active
{
background-color
:
#117bb9
;
}
.main
.btn
:focus
{
#wrapper
#scroller
.btn
:focus
{
outline
:
0
;
}
wp-content/themes/tospur/functions.php
View file @
48e530a6
<?php
require_once
(
'const.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../../plugins/tospur/Dao/TospurDao.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../../plugins/tospur/Dao/SearchDao.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../../plugins/tospur/Tools/Image.php'
);
...
...
@@ -150,12 +151,18 @@ add_action('wp_ajax_add_score', 'add_consultant_score');
function
add_consultant_score
()
{
if
(
isset
(
$_POST
[
'score'
]))
{
$type
=
TospurDao
::
search_score_type
(
$_POST
[
'user_id'
],
$_POST
[
'consultant_id'
]);
$result
=
null
;
if
(
$type
)
{
$result
=
TospurDao
::
insert_consultant_score
(
$_POST
[
'consultant_id'
],
$_POST
[
'user_id'
],
$_POST
[
'score'
]);
}
$array
=
array
();
if
(
$result
)
{
if
(
$
type
&&
$
result
)
{
$array
[
'code'
]
=
2000
;
}
else
{
}
else
if
(
!
$type
)
{
$array
[
'code'
]
=
2001
;
}
else
if
(
!
$result
){
$array
[
'code'
]
=
2002
;
}
wp_send_json
(
$array
);
}
...
...
@@ -266,4 +273,17 @@ function user_redirect($user)
}
}
add_action
(
'wp_ajax_submit_sale'
,
'submit_sale'
);
function
submit_sale
()
{
$array
=
array
(
'code'
=>
2001
);
if
(
$_POST
)
{
$result
=
TospurDao
::
insert_tospur_sale
(
$_POST
);
if
(
$result
)
{
$array
[
'code'
]
=
2000
;
}
}
wp_send_json
(
$array
);
}
?>
\ No newline at end of file
wp-content/themes/tospur/js/iscroll.js
View file @
48e530a6
...
...
@@ -1571,7 +1571,11 @@ IScroll.prototype = {
this
.
_key
(
e
);
break
;
case
'click'
:
if
(
!
e
.
_constructed
)
{
if
(
!
e
.
_constructed
)
{
if
(
!
e
.
_constructed
&&
target
.
type
!=
"submit"
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
}
e
.
preventDefault
();
e
.
stopPropagation
();
}
...
...
wp-content/themes/tospur/s
cor
e.php
→
wp-content/themes/tospur/s
al
e.php
View file @
48e530a6
...
...
@@ -7,9 +7,13 @@ $current_user = wp_get_current_user();
$user_id
=
$current_user
->
ID
;
if
(
$user_id
!=
0
)
{
$context
[
'user_id'
]
=
$user_id
;
$context
[
'consultant_id'
]
=
$_GET
[
'consultant_id'
];
$context
[
'phone'
]
=
$current_user
->
data
->
user_login
;
$city
=
SearchDao
::
searchCity
();
$context
[
'city'
]
=
$city
;
Timber
::
render
(
'sale.html'
,
$context
);
}
else
{
wp_redirect
(
$const_login_page
);
exit
;
}
Timber
::
render
(
'score.html'
,
$context
);
?>
\ No newline at end of file
wp-content/themes/tospur/views/consultant_info.html
View file @
48e530a6
...
...
@@ -184,10 +184,18 @@
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=add_score&user_id={{user_id}}&consultant_id={{consultant_id}}&score='
+
$
(
"#score"
).
val
(),
success
:
function
(
data
)
{
if
(
data
.
code
==
2000
)
{
switch
(
data
.
code
){
case
2000
:
alert
(
'评分成功'
);
}
else
{
break
;
case
2001
:
alert
(
'未和置业顾问接触过,不能评分'
);
break
;
case
2002
:
alert
(
'您已经提交过评分了'
);
break
;
default
:
break
;
}
},
complete
:
function
(){
...
...
@@ -230,7 +238,7 @@
ajax_get_house
(
'{{ url }}'
,
loading
,
searchData
,
tabPane
);
},
200
);
}
})
})
;
});
</script>
</body>
...
...
wp-content/themes/tospur/views/forget.html
View file @
48e530a6
...
...
@@ -62,6 +62,9 @@
notice
.
html
(
'<span>{{ error }}</span>'
);
myModal
.
modal
(
'show'
);
{
%
endif
%
}
document
.
addEventListener
(
'touchmove'
,
function
(
e
){
e
.
preventDefault
();
});
});
</script>
</head>
...
...
wp-content/themes/tospur/views/login.html
View file @
48e530a6
...
...
@@ -45,6 +45,9 @@
notice
.
html
(
'<span>{{ error }}</span>'
);
myModal
.
modal
(
'show'
);
{
%
endif
%
}
document
.
addEventListener
(
'touchmove'
,
function
(
e
){
e
.
preventDefault
();
});
});
</script>
</head>
...
...
wp-content/themes/tospur/views/manager.html
View file @
48e530a6
...
...
@@ -45,6 +45,9 @@
notice
.
html
(
'<span>{{ error }}</span>'
);
myModal
.
modal
(
'show'
);
{
%
endif
%
}
document
.
addEventListener
(
'touchmove'
,
function
(
e
){
e
.
preventDefault
();
});
});
</script>
</head>
...
...
wp-content/themes/tospur/views/register.html
View file @
48e530a6
...
...
@@ -62,6 +62,9 @@
notice
.
html
(
'<span>{{ error }}</span>'
);
myModal
.
modal
(
'show'
);
{
%
endif
%
}
document
.
addEventListener
(
'touchmove'
,
function
(
e
){
e
.
preventDefault
();
});
});
</script>
</head>
...
...
wp-content/themes/tospur/views/sale.html
0 → 100644
View file @
48e530a6
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=360, user-scalable=0"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<title>
房东服务
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ theme }}/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ theme }}/css/rent.css"
>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/iscroll.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/jquery.validate.js"
></script>
<script
type=
"text/javascript"
src=
"{{ theme }}/js/bootstrap.min.js"
></script>
</head>
<body>
<ul
id=
"tab"
class=
"list-unstyled btn-group-justified tab"
>
<li
class=
"btn-group active"
>
<a
href=
"#secondhand"
data-toggle=
"tab"
class=
"btn"
>
出售
</a>
</li>
<li
class=
"btn-group"
>
<a
href=
"#rent"
data-toggle=
"tab"
class=
"btn"
>
出租
</a>
</li>
</ul>
<div
id=
"wrapper"
>
<div
id=
"scroller"
class=
"tab-content"
>
<div
class=
"tab-pane fade in active"
id=
"secondhand"
>
<form
id=
"secondhandForm"
data-house=
"1"
>
<ul
class=
"list-unstyled"
>
<li>
<label
class=
"col-xs-2"
>
城市:
</label>
<p
class=
"col-xs-10"
>
<select
class=
"form-control"
name=
"cityId"
>
{% for item in city %}
<option
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
</p>
</li>
<li>
<label
class=
"col-xs-3"
>
小区名称:
</label>
<p
class=
"col-xs-9"
>
<input
type=
"text"
class=
"form-control"
name=
"community_name"
>
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
户型:
</label>
<p
class=
"col-xs-10"
>
(
<input
type=
"number"
class=
"form-control width-sm"
name=
"bedroom"
value=
"0"
>
室
<input
type=
"number"
class=
"form-control width-sm"
name=
"hall"
value=
"0"
>
厅
<input
type=
"number"
class=
"form-control width-sm"
name=
"kitchen"
value=
"0"
>
厨
<input
type=
"number"
class=
"form-control width-sm"
name=
"bathroom"
value=
"0"
>
卫)
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
面积:
</label>
<p
class=
"col-xs-8"
>
<input
type=
"number"
class=
"form-control"
name=
"covered_area"
>
</p>
<p
class=
"col-xs-2"
>
m
<em>
2
</em></p>
</li>
<li>
<label
class=
"col-xs-3"
>
所在楼层:
</label>
<p
class=
"col-xs-9"
>
(
<input
type=
"number"
class=
"form-control width-sm"
name=
"floor"
>
层/共
<input
type=
"number"
class=
"form-control width-sm"
name=
"total_floor"
>
层)
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
朝向:
</label>
<p
class=
"col-xs-10"
>
<select
class=
"form-control"
name=
"faceto"
>
<option
value=
"其他"
>
其他
</option>
<option
value=
"东"
>
东
</option>
<option
value=
"南"
>
南
</option>
<option
value=
"西"
>
西
</option>
<option
value=
"北"
>
北
</option>
<option
value=
"东西"
>
东西
</option>
<option
value=
"南北"
>
南北
</option>
<option
value=
"南南"
>
南南
</option>
<option
value=
"东南"
>
东南
</option>
<option
value=
"东北"
>
东北
</option>
<option
value=
"西南"
>
西南
</option>
<option
value=
"西北"
>
西北
</option>
</select>
</p>
</li>
<li>
<label
class=
"col-xs-3"
>
期望售价:
</label>
<p
class=
"col-xs-7"
>
<input
type=
"number"
class=
"form-control"
name=
"price"
>
</p>
<p
class=
"col-xs-2"
>
万元
</p>
</li>
<li>
<label
class=
"col-xs-12"
>
房源描述:
</label>
<p
class=
"col-xs-12"
>
<textarea
class=
"form-control"
rows=
"8"
placeholder=
"选填"
name=
"description"
></textarea>
</p>
</li>
</ul>
<input
type=
"submit"
value=
"提交"
class=
"btn btn-lg"
>
</form>
</div>
<div
class=
"tab-pane fade"
id=
"rent"
>
<form
id=
"rentForm"
data-house=
"2"
>
<ul
class=
"list-unstyled"
>
<li>
<label
class=
"col-xs-2"
>
城市:
</label>
<p
class=
"col-xs-10"
>
<select
class=
"form-control"
name=
"cityId"
>
{% for item in city %}
<option
value=
"{{ item.id }}"
>
{{ item.value }}
</option>
{% endfor %}
</select>
</p>
</li>
<li>
<label
class=
"col-xs-3"
>
小区名称:
</label>
<p
class=
"col-xs-9"
>
<input
type=
"text"
class=
"form-control"
name=
"community_name"
>
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
户型:
</label>
<p
class=
"col-xs-10"
>
(
<input
type=
"number"
class=
"form-control width-sm"
name=
"bedroom"
value=
"0"
>
室
<input
type=
"number"
class=
"form-control width-sm"
name=
"hall"
value=
"0"
>
厅
<input
type=
"number"
class=
"form-control width-sm"
name=
"kitchen"
value=
"0"
>
厨
<input
type=
"number"
class=
"form-control width-sm"
name=
"bathroom"
value=
"0"
>
卫)
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
面积:
</label>
<p
class=
"col-xs-8"
>
<input
type=
"number"
class=
"form-control"
name=
"covered_area"
>
</p>
<p
class=
"col-xs-2"
>
m
<em>
2
</em></p>
</li>
<li>
<label
class=
"col-xs-3"
>
所在楼层:
</label>
<p
class=
"col-xs-9"
>
(
<input
type=
"number"
class=
"form-control width-sm"
name=
"floor"
>
层/共
<input
type=
"number"
class=
"form-control width-sm"
name=
"total_floor"
>
层)
</p>
</li>
<li>
<label
class=
"col-xs-2"
>
朝向:
</label>
<p
class=
"col-xs-10"
>
<select
class=
"form-control"
name=
"faceto"
>
<option
value=
"其他"
>
其他
</option>
<option
value=
"东"
>
东
</option>
<option
value=
"南"
>
南
</option>
<option
value=
"西"
>
西
</option>
<option
value=
"北"
>
北
</option>
<option
value=
"东西"
>
东西
</option>
<option
value=
"南北"
>
南北
</option>
<option
value=
"南南"
>
南南
</option>
<option
value=
"东南"
>
东南
</option>
<option
value=
"东北"
>
东北
</option>
<option
value=
"西南"
>
西南
</option>
<option
value=
"西北"
>
西北
</option>
</select>
</p>
</li>
<li>
<label
class=
"col-xs-3"
>
期望租金:
</label>
<p
class=
"col-xs-7"
>
<input
type=
"number"
class=
"form-control"
name=
"price"
>
</p>
<p
class=
"col-xs-2"
>
元/月
</p>
</li>
<li>
<label
class=
"col-xs-12"
>
房源描述:
</label>
<p
class=
"col-xs-12"
>
<textarea
class=
"form-control"
rows=
"8"
placeholder=
"选填"
name=
"description"
></textarea>
</p>
</li>
</ul>
<input
type=
"submit"
value=
"提交"
class=
"btn btn-lg"
>
</form>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"myModal"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content text-center"
>
<h4>
提示
</h4>
<p
id=
"notice"
></p>
<button
type=
"button"
class=
"btn btn-lg btn-block"
data-dismiss=
"modal"
>
确认
</button>
</div>
</div>
</div>
<script>
var
notice
;
var
myModal
;
var
flag
=
true
;
var
user_id
=
'{{ user_id }}'
;
var
phone
=
'{{ phone }}'
;
var
myScroll
;
window
.
addEventListener
(
"load"
,
function
(){
myScroll
=
new
IScroll
(
'#wrapper'
,{
click
:
true
,
submit
:
true
});
},
false
);
$
(
document
).
ready
(
function
()
{
notice
=
$
(
'#notice'
);
myModal
=
$
(
'#myModal'
);
validate_sale_form
(
$
(
'#secondhandForm'
));
validate_sale_form
(
$
(
'#rentForm'
));
notice
.
bind
(
'DOMNodeInserted'
,
function
()
{
$
(
this
).
children
(
':not(:first)'
).
remove
();
});
myModal
.
on
(
'hide.bs.modal'
,
function
()
{
notice
.
children
().
remove
();
});
$
(
'#tab a'
).
click
(
function
()
{
flag
=
true
;
myScroll
.
scrollTo
(
0
,
0
);
setTimeout
(
function
()
{
myScroll
.
refresh
();
},
200
);
});
});
function
validate_sale_form
(
form
)
{
form
.
validate
({
onkeyup
:
false
,
onfocusout
:
false
,
rules
:
{
community_name
:
'required'
,
bedroom
:
{
digits
:
true
,
min
:
0
},
hall
:
{
digits
:
true
,
min
:
0
},
kitchen
:
{
digits
:
true
,
min
:
0
},
bathroom
:
{
digits
:
true
,
min
:
0
},
covered_area
:
{
required
:
true
,
number
:
true
,
min
:
0
},
floor
:
{
required
:
true
,
digits
:
true
,
min
:
0
},
total_floor
:
{
required
:
true
,
digits
:
true
,
min
:
0
},
faceto
:
'required'
,
price
:
{
required
:
true
,
number
:
true
,
min
:
0
}
},
messages
:
{
community_name
:
'请输入小区名'
,
bedroom
:
'请输入户型'
,
hall
:
'请输入户型'
,
kitchen
:
'请输入户型'
,
bathroom
:
'请输入户型'
,
covered_area
:
'请输入面积'
,
floor
:
'请输入所在楼层'
,
total_floor
:
'请输入总楼层'
,
faceto
:
'请选择朝向'
,
price
:
'请输入期望价格'
},
errorLabelContainer
:
"#notice"
,
errorElement
:
'span'
,
invalidHandler
:
function
()
{
flag
=
false
;
myModal
.
modal
(
'show'
);
},
submitHandler
:
function
(
form
)
{
flag
=
true
;
}
});
form
.
submit
(
function
()
{
if
(
flag
)
{
var
house_type
=
form
.
data
(
'house'
);
$
.
ajax
({
type
:
'POST'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=submit_sale&user_id='
+
user_id
+
'&phone='
+
phone
+
'&house_type='
+
house_type
+
'&'
+
form
.
serialize
(),
success
:
function
(
data
)
{
if
(
data
.
code
==
2000
)
{
notice
.
html
(
'<span>提交成功</span>'
);
notice
.
show
();
myModal
.
modal
(
'show'
);
}
else
{
notice
.
html
(
'<span>提交失败</span>'
);
notice
.
show
();
myModal
.
modal
(
'show'
);
}
}
});
}
return
false
;
});
}
</script>
</body>
</html>
\ No newline at end of file
wp-content/themes/tospur/views/view.html
View file @
48e530a6
...
...
@@ -59,6 +59,9 @@
}
return
false
;
});
document
.
addEventListener
(
'touchmove'
,
function
(
e
){
e
.
preventDefault
();
});
});
</script>
</head>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment