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
768a71cc
Commit
768a71cc
authored
Aug 10, 2015
by
shz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台:
1.房源分配置业顾问功能 2.评分列表 评分验证设为有效或无效 可以批量操作 前台:置业顾问登录验证
parent
f950c045
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
311 additions
and
115 deletions
+311
-115
wp-content/themes/tospur/const.php
+11
-0
wp-content/themes/tospur/forget.php
+5
-6
wp-content/themes/tospur/functions.php
+113
-0
wp-content/themes/tospur/js/public.js
+42
-9
wp-content/themes/tospur/list.php
+3
-6
wp-content/themes/tospur/login.php
+10
-0
wp-content/themes/tospur/my.php
+2
-2
wp-content/themes/tospur/register.php
+13
-7
wp-content/themes/tospur/view.php
+11
-34
wp-content/themes/tospur/views/forget.html
+6
-20
wp-content/themes/tospur/views/list.html
+31
-1
wp-content/themes/tospur/views/register.html
+3
-2
wp-content/themes/tospur/views/view.html
+61
-28
No files found.
wp-content/themes/tospur/const.php
View file @
768a71cc
<?php
<?php
//登录
$const_login_page
=
home_url
()
.
'/?page=login'
;
$const_login_page
=
home_url
()
.
'/?page=login'
;
//注册
$const_register_page
=
home_url
()
.
'/?page=register'
;
$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_view_page
=
home_url
()
.
'/?page=view'
;
$const_view_page
=
home_url
()
.
'/?page=view'
;
//约看清单
$const_list_page
=
home_url
()
.
'/?page=list'
;
$const_list_page
=
home_url
()
.
'/?page=list'
;
//置业顾问 信息
$const_consultant_info_page
=
home_url
()
.
'/?page=consultant_info'
;
//置业顾问 评分
$const_score_page
=
home_url
()
.
'/?page=score'
;
?>
?>
\ No newline at end of file
wp-content/themes/tospur/forget.php
View file @
768a71cc
...
@@ -2,26 +2,25 @@
...
@@ -2,26 +2,25 @@
$context
=
array
();
$context
=
array
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'url'
]
=
home_url
();
if
(
$_POST
)
{
if
(
$_POST
)
{
$phone
=
$_POST
[
'phone'
];
$phone
=
$_POST
[
'phone'
];
$code
=
$_POST
[
'code'
];
$code
=
$_POST
[
'code'
];
$password
=
$_POST
[
'password'
];
$password
=
$_POST
[
'password'
];
$repeatPassword
=
$_POST
[
'repeatPassword'
];
if
(
!
$phone
)
{
if
(
!
$phone
)
{
$context
[
'phoneError'
]
=
'请输入11位手机号'
;
$context
[
'phoneError'
]
=
'请输入11位手机号'
;
}
else
if
(
!
$code
)
{
}
else
if
(
!
$code
)
{
$context
[
'codeError'
]
=
'请输入验证码'
;
$context
[
'codeError'
]
=
'请输入验证码'
;
}
else
if
(
!
$password
)
{
}
else
if
(
!
$password
)
{
$context
[
'passwordError'
]
=
'请输入新密码'
;
$context
[
'passwordError'
]
=
'请输入新密码'
;
}
else
if
(
!
$repeatPassword
)
{
$context
[
'repeatPasswordError'
]
=
'请输入确认密码'
;
}
else
{
}
else
{
$
user
=
get_user_by
(
'login'
,
$phon
e
);
$
search_code
=
dao
::
search_tospur_verify
(
$phone
,
$cod
e
);
if
(
$
user
)
{
if
(
$
code
==
$search_code
)
{
wp_set_password
(
$password
,
$user
->
data
->
ID
);
wp_set_password
(
$password
,
$user
->
data
->
ID
);
dao
::
update_tospur_verify
(
$phone
);
echo
'成功修改密码'
;
echo
'成功修改密码'
;
}
else
{
}
else
{
$context
[
'
phoneError'
]
=
'请输入有效的手机号
'
;
$context
[
'
codeError'
]
=
'请输入正确的验证码
'
;
}
}
}
}
}
}
...
...
wp-content/themes/tospur/functions.php
View file @
768a71cc
<?php
<?php
require_once
(
dirname
(
__FILE__
)
.
'/dao.php'
);
add_filter
(
'template_include'
,
'page_template'
);
add_filter
(
'template_include'
,
'page_template'
);
function
page_template
(
$template
)
function
page_template
(
$template
)
{
{
...
@@ -24,6 +26,12 @@ function page_template($template)
...
@@ -24,6 +26,12 @@ function page_template($template)
case
'list'
:
case
'list'
:
$page
=
$theme
.
'/list.php'
;
$page
=
$theme
.
'/list.php'
;
break
;
break
;
case
'consultant_info'
:
$page
=
$theme
.
'/consultant_info.php'
;
break
;
case
'score'
:
$page
=
$theme
.
'/score.php'
;
break
;
default
:
default
:
$page
=
$template
;
$page
=
$template
;
break
;
break
;
...
@@ -31,4 +39,108 @@ function page_template($template)
...
@@ -31,4 +39,108 @@ function page_template($template)
return
$page
;
return
$page
;
}
}
function
generate_code
()
{
$characters
=
'0123456789'
;
$charactersLength
=
strlen
(
$characters
);
$random
=
''
;
for
(
$i
=
0
;
$i
<
4
;
$i
++
)
{
$random
.=
$characters
[
rand
(
0
,
$charactersLength
-
1
)];
}
return
$random
;
}
//发送验证码
add_action
(
'wp_ajax_send_code'
,
'send_code'
);
add_action
(
'wp_ajax_nopriv_send_code'
,
'send_code'
);
function
send_code
()
{
$phone
=
$_POST
[
'phone'
];
$validate
=
(
bool
)
$_POST
[
'validate'
];
$array
=
array
();
if
(
isset
(
$phone
))
{
$user
=
get_user_by
(
'login'
,
$phone
);
if
((
$user
&&
$validate
==
0
)
||
(
!
$user
&&
$validate
==
1
))
{
$array
[
'code'
]
=
2002
;
}
else
{
$code
=
generate_code
();
$insert_result
=
dao
::
insert_tospur_verify
(
$phone
,
strtolower
(
$code
));
$response
=
wp_remote_post
(
'http://218.1.67.130:8988/api/NanTongWechat/MobileSendMessage'
.
'?mobilePhone='
.
$phone
.
'&VerificationCode='
.
$code
);
if
(
$response
[
'response'
][
'code'
]
==
200
)
{
$array
[
'code'
]
=
2000
;
}
else
{
$array
[
'code'
]
=
2001
;
}
}
wp_send_json
(
$array
);
}
}
//预约看房
add_action
(
'wp_ajax_view_house'
,
'view_house'
);
function
view_house
()
{
$index
=
$_POST
[
'index'
];
if
(
isset
(
$index
))
{
$date
=
null
;
if
(
$_POST
[
'day'
])
{
$cureent_time
=
current_time
(
'Y-m-d'
);
$datetime
=
new
DateTime
(
$cureent_time
.
'+'
.
$_POST
[
'day'
]
.
' day'
);
$date
=
$datetime
->
format
(
'Y-m-d'
);
}
else
{
$date
=
$_POST
[
'date'
];
}
$time
=
(
9
+
$index
)
.
':00-'
.
(
10
+
$index
)
.
':00'
;
$result
=
dao
::
insert_view_house
(
$_POST
[
'house_id'
],
$_POST
[
'user_id'
],
$date
,
$index
,
$time
,
$_POST
[
'consultant_id'
]);
$array
=
array
();
if
(
$result
)
{
$array
[
'code'
]
=
2000
;
}
else
{
$array
[
'code'
]
=
2001
;
}
wp_send_json
(
$array
);
}
}
//置业顾问接受 预约看房
add_action
(
'wp_ajax_handle_view_house'
,
'handle_view_house'
);
function
handle_view_house
()
{
$id
=
$_POST
[
'id'
];
if
(
isset
(
$id
))
{
$result
=
dao
::
update_view_house
(
$id
);
$array
=
array
();
if
(
$result
)
{
$array
[
'code'
]
=
2000
;
}
else
{
$array
[
'code'
]
=
2001
;
}
wp_send_json
(
$array
);
}
}
//添加 置业顾问 评分
add_action
(
'wp_ajax_add_score'
,
'add_consultant_score'
);
function
add_consultant_score
()
{
if
(
isset
(
$_POST
[
'score'
]))
{
$result
=
dao
::
insert_consultant_score
(
$_POST
[
'consultant_id'
],
$_POST
[
'user_id'
],
$_POST
[
'score'
]);
$array
=
array
();
if
(
$result
)
{
$array
[
'code'
]
=
2000
;
}
else
{
$array
[
'code'
]
=
2001
;
}
wp_send_json
(
$array
);
}
}
//置业顾问信息 评分
function
get_consultant_score
(
$consultant_id
)
{
return
dao
::
search_consultant_score
(
$consultant_id
);
}
?>
?>
\ No newline at end of file
wp-content/themes/tospur/js/public.js
View file @
768a71cc
function
sendCodeBindClick
()
{
function
sendCodeBindClick
(
ajaxUrl
,
validate
)
{
$
(
'#send'
).
bind
(
'click'
,
clickSendCode
);
$
(
'#send'
).
bind
(
'click'
,
{
ajaxUrl
:
ajaxUrl
,
validate
:
validate
},
clickSendCode
);
}
}
function
clickSendCode
()
{
function
clickSendCode
(
event
)
{
if
(
$
(
'#phone'
).
val
().
trim
())
{
var
ajaxUrl
=
event
.
data
.
ajaxUrl
;
var
second
=
60
;
var
validate
=
event
.
data
.
validate
;
var
phone
=
$
(
'#phone'
).
val
().
trim
();
if
(
phone
.
length
==
11
)
{
var
self
=
$
(
this
);
var
self
=
$
(
this
);
self
.
unbind
(
'click'
);
self
.
unbind
(
'click'
);
ajaxSendCode
(
ajaxUrl
,
self
,
phone
,
validate
);
}
else
{
$
(
'#phone-error'
).
text
(
'请输入11位手机号'
);
}
}
function
countDown
(
ajaxUrl
,
self
,
validate
)
{
var
second
=
60
;
self
.
text
(
second
+
'秒后重发'
);
self
.
text
(
second
+
'秒后重发'
);
var
interval
=
setInterval
(
function
()
{
var
interval
=
setInterval
(
function
()
{
second
--
;
second
--
;
self
.
text
(
second
+
'秒后重发'
);
self
.
text
(
second
+
'秒后重发'
);
if
(
second
==
0
)
{
if
(
second
==
0
)
{
window
.
clearInterval
(
interval
);
window
.
clearInterval
(
interval
);
second
=
60
;
self
.
text
(
'发送验证码'
);
self
.
text
(
'发送验证码'
);
self
.
bind
(
'click'
,
clickSendCode
);
self
.
bind
(
'click'
,
{
ajaxUrl
:
ajaxUrl
,
validate
:
validate
}
,
clickSendCode
);
}
}
},
1000
);
},
1000
);
}
else
{
}
$
(
'#phone-error'
).
text
(
'请输入11位手机号'
);
function
ajaxSendCode
(
ajaxUrl
,
self
,
phone
,
validate
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
ajaxUrl
+
'/wp-admin/admin-ajax.php/'
,
data
:
'action=send_code&phone='
+
phone
+
'&validate='
+
validate
,
success
:
function
(
data
)
{
switch
(
data
.
code
)
{
case
2000
:
countDown
(
ajaxUrl
,
self
,
validate
);
break
;
case
2001
:
self
.
bind
(
'click'
,
{
ajaxUrl
:
ajaxUrl
,
validate
:
validate
},
clickSendCode
);
alert
(
'发送验证码失败'
);
break
;
case
2002
:
var
phoneError
=
$
(
'#phone-error'
);
phoneError
.
text
(
'请输入有效的手机号'
);
phoneError
.
removeAttr
(
'style'
);
self
.
bind
(
'click'
,
{
ajaxUrl
:
ajaxUrl
,
validate
:
validate
},
clickSendCode
);
break
;
default
:
break
;
}
}
}
});
}
}
Date
.
prototype
.
Format
=
function
(
fmt
)
{
Date
.
prototype
.
Format
=
function
(
fmt
)
{
...
...
wp-content/themes/tospur/list.php
View file @
768a71cc
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
require_once
(
dirname
(
__FILE__
)
.
'/dao.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/dao.php'
);
$context
=
array
();
$context
=
array
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'url'
]
=
home_url
();
$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
)
{
...
@@ -13,17 +14,13 @@ if ($current_user_id == 0) {
...
@@ -13,17 +14,13 @@ if ($current_user_id == 0) {
$result
=
null
;
$result
=
null
;
switch
(
$role
)
{
switch
(
$role
)
{
case
'contributor'
:
case
'contributor'
:
$result
=
TospurD
ao
::
search_view_house_by_user_id
(
$current_user_id
);
$result
=
d
ao
::
search_view_house_by_user_id
(
$current_user_id
);
break
;
break
;
case
'editor'
:
case
'editor'
:
$result
=
TospurD
ao
::
search_view_house_by_consultant_id
(
$current_user_id
);
$result
=
d
ao
::
search_view_house_by_consultant_id
(
$current_user_id
);
break
;
break
;
}
}
if
(
$result
)
{
if
(
$result
)
{
foreach
(
$result
as
$item
)
{
$item
->
time
=
(
$item
->
time
==
0
)
?
'上午'
:
((
$item
->
time
==
1
)
?
'中午'
:
'下午'
);
$item
->
handle
=
(
$item
->
handle
==
0
)
?
'未接受'
:
'接受'
;
}
$context
[
'result'
]
=
$result
;
$context
[
'result'
]
=
$result
;
}
else
{
}
else
{
$context
[
'message'
]
=
'not found'
;
$context
[
'message'
]
=
'not found'
;
...
...
wp-content/themes/tospur/login.php
View file @
768a71cc
...
@@ -16,6 +16,16 @@ if (is_user_logged_in()) {
...
@@ -16,6 +16,16 @@ if (is_user_logged_in()) {
}
else
if
(
!
$password
)
{
}
else
if
(
!
$password
)
{
$context
[
'passwordError'
]
=
'请输入密码'
;
$context
[
'passwordError'
]
=
'请输入密码'
;
}
else
{
}
else
{
if
(
strlen
(
$phone
)
!=
11
)
{
$response
=
wp_remote_post
(
'http://218.1.67.130:8988/api/NanTongWechat/LoginWechat'
.
'?userName='
.
$phone
.
'&password='
.
$password
);
$body
=
json_decode
(
$response
[
'body'
]);
$data
=
$body
->
data
;
if
(
$data
)
{
$password
=
$data
->
WorkNoAndId
;
}
}
$creds
[
'user_login'
]
=
$phone
;
$creds
[
'user_login'
]
=
$phone
;
$creds
[
'user_password'
]
=
$password
;
$creds
[
'user_password'
]
=
$password
;
$creds
[
'remember'
]
=
true
;
$creds
[
'remember'
]
=
true
;
...
...
wp-content/themes/tospur/my.php
View file @
768a71cc
...
@@ -21,8 +21,8 @@ if ($current_user_id == 0) {
...
@@ -21,8 +21,8 @@ if ($current_user_id == 0) {
break
;
break
;
case
'editor'
:
case
'editor'
:
$user_role
=
'置业顾问'
;
$user_role
=
'置业顾问'
;
header
(
'Location: '
.
$const_list_page
);
/*
header('Location: ' . $const_list_page);
exit
;
exit;
*/
break
;
break
;
case
'administrator'
:
case
'administrator'
:
$user_role
=
'管理员'
;
$user_role
=
'管理员'
;
...
...
wp-content/themes/tospur/register.php
View file @
768a71cc
...
@@ -2,31 +2,37 @@
...
@@ -2,31 +2,37 @@
$context
=
array
();
$context
=
array
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'url'
]
=
home_url
();
if
(
$_POST
)
{
if
(
$_POST
)
{
$phone
=
$_POST
[
'phone'
];
$phone
=
$_POST
[
'phone'
];
$code
=
$_POST
[
'code'
];
$code
=
$_POST
[
'code'
];
$password
=
$_POST
[
'password'
];
$password
=
$_POST
[
'password'
];
if
(
!
$phone
)
{
if
(
!
$phone
)
{
$context
[
'phoneError'
]
=
'请输入11位手机号'
;
$context
[
'phoneError'
]
=
'请输入11位手机号'
;
}
else
if
(
!
$code
)
{
}
else
if
(
!
$code
)
{
$context
[
'codeError'
]
=
'请输入验证码'
;
$context
[
'codeError'
]
=
'请输入验证码'
;
}
else
if
(
!
$password
)
{
}
else
if
(
!
$password
)
{
$context
[
'passwordError'
]
=
'请输入密码'
;
$context
[
'passwordError'
]
=
'请输入密码'
;
}
else
{
}
else
{
$search_code
=
dao
::
search_tospur_verify
(
$phone
,
$code
);
if
(
$code
==
$search_code
)
{
$result
=
wp_create_user
(
$phone
,
$password
);
$result
=
wp_create_user
(
$phone
,
$password
);
if
(
is_integer
(
$result
))
{
if
(
is_integer
(
$result
))
{
dao
::
update_tospur_verify
(
$phone
);
$creds
[
'user_login'
]
=
$phone
;
$creds
[
'user_login'
]
=
$phone
;
$creds
[
'user_password'
]
=
$password
;
$creds
[
'user_password'
]
=
$password
;
$creds
[
'remember'
]
=
true
;
$creds
[
'remember'
]
=
true
;
echo
'注册成功'
;
echo
'注册成功'
;
$user
=
wp_signon
(
$creds
,
false
);
$user
=
wp_signon
(
$creds
,
false
);
if
(
!
is_wp_error
(
$user
))
{
if
(
!
is_wp_error
(
$user
))
{
echo
'自动登录,跳转页面'
;
echo
'自动登录,跳转页面'
;
}
}
}
else
{
}
else
{
$context
[
'phoneError'
]
=
'抱歉,用户名已存在'
;
$context
[
'phoneError'
]
=
'抱歉,用户名已存在'
;
}
}
}
else
{
$context
[
'codeError'
]
=
'请输入正确的验证码'
;
}
}
}
}
}
Timber
::
render
(
'register.html'
,
$context
);
Timber
::
render
(
'register.html'
,
$context
);
...
...
wp-content/themes/tospur/view.php
View file @
768a71cc
<?php
<?php
require_once
(
dirname
(
__FILE__
)
.
'/dao.php'
);
$context
=
array
();
$context
=
array
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$context
[
'theme'
]
=
get_template_directory_uri
();
$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
)
{
$context
[
'message'
]
=
'请先登录'
;
}
else
if
(
isset
(
$_POST
[
'time'
]))
{
}
else
{
$house_id
=
$_GET
[
'house_id'
];
$consultant_id
=
$_GET
[
'consultant_id'
];
$date
=
null
;
switch
(
$_POST
[
'time'
])
{
case
0
:
case
1
:
case
2
:
$date
=
current_time
(
'Y-m-d'
);
$date
=
current_time
(
'Y-m-d'
);
break
;
case
3
:
case
4
:
case
5
:
$cureent_time
=
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'
);
break
;
$context
[
'data'
]
=
array
(
case
6
:
'jt'
=>
$date
,
case
7
:
'mt'
=>
new
DateTime
(
$date
.
'+1 day'
),
case
8
:
'ht'
=>
$date
$cureent_time
=
current_time
(
'Y-m-d'
);
);
$datetime
=
new
DateTime
(
$cureent_time
.
'+2 day'
);
$context
[
'user_id'
]
=
$user_id
;
$date
=
$datetime
->
format
(
'Y-m-d'
);
$context
[
'house_id'
]
=
$_GET
[
'house_id'
];
break
;
$context
[
'consultant_id'
]
=
$_GET
[
'consultant_id'
];
case
9
:
case
10
:
case
11
:
$date
=
$_POST
[
'date'
];
break
;
}
$time
=
$_POST
[
'time'
]
%
3
;
$result
=
TospurDao
::
insert_view_house
(
$house_id
,
$user_id
,
$date
,
$time
,
$consultant_id
);
if
(
$result
)
{
$context
[
'message'
]
=
'预约成功'
;
}
}
}
Timber
::
render
(
'view.html'
,
$context
);
Timber
::
render
(
'view.html'
,
$context
);
...
...
wp-content/themes/tospur/views/forget.html
View file @
768a71cc
...
@@ -16,26 +16,19 @@
...
@@ -16,26 +16,19 @@
phone
:
{
phone
:
{
required
:
true
,
required
:
true
,
minlength
:
11
,
minlength
:
11
,
maxlength
:
11
maxlength
:
11
,
digits
:
true
},
},
code
:
'required'
,
code
:
'required'
,
password
:
'required'
,
password
:
'required'
repeatPassword
:
{
required
:
true
,
equalTo
:
'#password'
}
},
},
messages
:
{
messages
:
{
phone
:
'请输入11位手机号'
,
phone
:
'请输入11位手机号'
,
code
:
'请输入验证码'
,
code
:
'请输入验证码'
,
password
:
'请输入新密码'
,
password
:
'请输入新密码'
repeatPassword
:
{
required
:
'请输入确认密码'
,
equalTo
:
'确认密码和新密码不匹配'
}
}
}
});
});
sendCodeBindClick
();
sendCodeBindClick
(
"{{ url }}"
,
1
);
});
});
</script>
</script>
</head>
</head>
...
@@ -63,15 +56,8 @@
...
@@ -63,15 +56,8 @@
</label>
</label>
</p>
</p>
<p>
<label
for=
"repeatPassword"
>
确认密码
<br>
<input
type=
"password"
name=
"repeatPassword"
id=
"repeatPassword"
>
<label
id=
"repeatPassword-error"
class=
"error"
for=
"repeatPassword"
>
{{ repeatPasswordError }}
</label>
</label>
</p>
<p
class=
"submit"
>
<p
class=
"submit"
>
<input
type=
"submit"
id=
"
register
_submit"
value=
"修改密码"
>
<input
type=
"submit"
id=
"
forget
_submit"
value=
"修改密码"
>
</p>
</p>
</form>
</form>
</body>
</body>
...
...
wp-content/themes/tospur/views/list.html
View file @
768a71cc
...
@@ -11,6 +11,23 @@
...
@@ -11,6 +11,23 @@
<script
src=
"{{ theme }}/js/public.js"
></script>
<script
src=
"{{ theme }}/js/public.js"
></script>
<script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'[data-name=handle]'
).
click
(
function
()
{
var
self
=
$
(
this
);
var
id
=
self
.
data
(
'id'
);
$
.
ajax
({
type
:
'POST'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=handle_view_house&id='
+
id
,
success
:
function
(
data
)
{
if
(
data
.
code
==
2000
)
{
self
.
parent
().
html
(
'已接受'
);
alert
(
'接受成功'
);
}
else
{
alert
(
'接受失败'
);
}
}
});
});
{
%
if
message
%
}
{
%
if
message
%
}
alert
(
'{{ message }}'
);
alert
(
'{{ message }}'
);
{
%
endif
%
}
{
%
endif
%
}
...
@@ -23,13 +40,26 @@
...
@@ -23,13 +40,26 @@
<ul>
<ul>
<li>
楼盘 {{ item.house_id }}
</li>
<li>
楼盘 {{ item.house_id }}
</li>
<li>
预约时间 {{ item.date }} {{ item.time }}
</li>
<li>
预约时间 {{ item.date }} {{ item.time }}
</li>
<!--用户 约看清单-->
{% if item.consultant_id %}
{% if item.consultant_id %}
<li>
置业顾问 {{ item.consultant_id }}
</li>
<li>
置业顾问 {{ item.consultant_id }}
</li>
{% if item.handle==0 %}
<li>
未接受
</li>
{% else %}
<li>
接受
</li>
{% endif %}
{% endif %}
{% endif %}
<!--置业顾问 约看清单-->
{% if item.user_id %}
{% if item.user_id %}
<li>
用户 {{ item.user_id }}
</li>
<li>
用户 {{ item.user_id }}
</li>
{% if item.handle==0 %}
<li>
<button
data-name=
"handle"
data-id=
"{{ item.id }}"
>
接受
</button>
</li>
{% else %}
<li>
已接受
</li>
{% endif %}
{% endif %}
{% endif %}
<li>
{{ item.handle }}
</li>
</ul>
</ul>
</div>
</div>
{% endfor %}
{% endfor %}
...
...
wp-content/themes/tospur/views/register.html
View file @
768a71cc
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
phone
:
{
phone
:
{
required
:
true
,
required
:
true
,
minlength
:
11
,
minlength
:
11
,
maxlength
:
11
maxlength
:
11
,
digits
:
true
},
},
code
:
'required'
,
code
:
'required'
,
password
:
'required'
password
:
'required'
...
@@ -27,7 +28,7 @@
...
@@ -27,7 +28,7 @@
password
:
'请输入密码'
password
:
'请输入密码'
}
}
});
});
sendCodeBindClick
();
sendCodeBindClick
(
"{{ url }}"
,
0
);
});
});
</script>
</script>
</head>
</head>
...
...
wp-content/themes/tospur/views/view.html
View file @
768a71cc
...
@@ -9,56 +9,89 @@
...
@@ -9,56 +9,89 @@
<style></style>
<style></style>
<script
src=
"{{ theme }}/js/jquery.min.js"
></script>
<script
src=
"{{ theme }}/js/jquery.min.js"
></script>
<script
src=
"{{ theme }}/js/jquery.validate.js"
></script>
<script
src=
"{{ theme }}/js/jquery.validate.js"
></script>
<script
src=
"{{ theme }}/js/date-selector.js"
></script>
<script
src=
"{{ theme }}/js/public.js"
></script>
<script
src=
"{{ theme }}/js/public.js"
></script>
<script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
var
date
=
new
Date
().
Format
(
'yyyy-MM-dd'
);
var
ds
=
new
DateSelector
(
'year'
,
'month'
,
'day'
,
{
$
(
'#date'
).
val
(
date
);
MaxYear
:
new
Date
().
getFullYear
()
+
1
,
$
(
'#viewForm'
).
validate
({
onChange
:
function
()
{
$
(
'#date'
).
val
(
this
.
Year
+
'-'
+
this
.
Month
+
'-'
+
this
.
Day
);
}
});
ds
.
onChange
();
var
viewForm
=
$
(
'#viewForm'
);
viewForm
.
validate
({
rules
:
{
rules
:
{
time
:
'required'
time
:
'required'
},
},
messages
:
{
messages
:
{
time
:
'请选择时间'
time
:
'请选择时间'
},
},
errorPlacement
:
function
(
error
,
element
)
{
errorPlacement
:
function
(
error
,
element
)
{
error
.
appendTo
(
'body'
);
console
.
log
(
error
);
console
.
log
(
element
);
alert
(
'请选择时间'
);
}
});
viewForm
.
submit
(
function
()
{
$
.
ajax
({
type
:
'POST'
,
url
:
'{{ url }}/wp-admin/admin-ajax.php/'
,
data
:
'action=view_house&'
+
viewForm
.
serialize
(),
success
:
function
(
data
)
{
if
(
data
.
code
==
2000
)
{
alert
(
'预约成功'
);
}
else
{
alert
(
'预约失败'
);
}
}
}
});
});
{
%
if
message
%
}
return
false
;
alert
(
'{{ message }}'
);
});
{
%
endif
%
}
});
});
</script>
</script>
</head>
</head>
<body>
<body>
<form
id=
"viewForm"
method=
"post"
>
<form
id=
"viewForm"
method=
"post"
>
<div>
<div>
<p>
今天
</p>
<label
for=
"jt"
>
今天
</label>
<input
type=
"radio"
name=
"time"
id=
"js"
value=
"0"
/><label
for=
"js"
>
上午
</label>
<input
type=
"radio"
name=
"day"
id=
"jt"
value=
"0"
/>
<input
type=
"radio"
name=
"time"
id=
"jz"
value=
"1"
/><label
for=
"jz"
>
中午
</label>
<label
for=
"mt"
>
明天
</label>
<input
type=
"radio"
name=
"time"
id=
"jx"
value=
"2"
/><label
for=
"jx"
>
下午
</label>
<input
type=
"radio"
name=
"day"
id=
"mt"
value=
"1"
/>
</div>
<label
for=
"ht"
>
后天
</label>
<div>
<input
type=
"radio"
name=
"day"
id=
"ht"
value=
"2"
/>
<p>
明天
</p>
<input
type=
"radio"
name=
"time"
id=
"ms"
value=
"3"
/><label
for=
"ms"
>
上午
</label>
<input
type=
"radio"
name=
"time"
id=
"mz"
value=
"4"
/><label
for=
"mz"
>
中午
</label>
<input
type=
"radio"
name=
"time"
id=
"mx"
value=
"5"
/><label
for=
"mx"
>
下午
</label>
</div>
</div>
<div>
<div>
<p>
后天
</p>
<p>
指定日期
</p>
<input
type=
"radio"
name=
"time"
id=
"hs"
value=
"6"
/><label
for=
"hs"
>
上午
</label>
<input
type=
"radio"
name=
"time"
id=
"hz"
value=
"7"
/><label
for=
"hz"
>
中午
</label>
<p>
<input
type=
"radio"
name=
"time"
id=
"hx"
value=
"8"
/><label
for=
"hx"
>
下午
</label>
<label
for=
"year"
>
年
</label>
<select
id=
"year"
></select>
<label
for=
"month"
>
月
</label>
<select
id=
"month"
></select>
<label
for=
"day"
>
日
</label>
<select
id=
"day"
></select>
</p>
</div>
</div>
<div>
<div>
<p><label
for=
"date"
>
指定时间
</label></p>
<label
for=
"index"
>
选择时间
</label>
<select
id=
"index"
name=
"index"
>
<p><input
type=
"date"
name=
"date"
id=
"date"
></p>
<option
value=
"0"
>
9:00-10:00
</option>
<input
type=
"radio"
name=
"time"
id=
"zs"
value=
"9"
/><label
for=
"zs"
>
上午
</label>
<option
value=
"1"
>
10:00-11:00
</option>
<input
type=
"radio"
name=
"time"
id=
"zz"
value=
"10"
/><label
for=
"zz"
>
中午
</label>
<option
value=
"2"
>
11:00-12:00
</option>
<input
type=
"radio"
name=
"time"
id=
"zx"
value=
"11"
/><label
for=
"zx"
>
下午
</label>
<option
value=
"3"
>
12:00-13:00
</option>
<option
value=
"4"
>
13:00-14:00
</option>
<option
value=
"5"
>
14:00-15:00
</option>
<option
value=
"6"
>
15:00-16:00
</option>
<option
value=
"7"
>
16:00-17:00
</option>
</select>
</div>
</div>
<input
type=
"hidden"
name=
"date"
id=
"date"
value=
""
>
<input
type=
"hidden"
name=
"user_id"
value=
"{{ user_id }}"
>
<input
type=
"hidden"
name=
"house_id"
value=
"{{ house_id }}"
>
<input
type=
"hidden"
name=
"consultant_id"
value=
"{{ consultant_id }}"
>
<p
class=
"submit"
>
<p
class=
"submit"
>
<input
type=
"submit"
id=
"view_submit"
value=
"提交"
>
<input
type=
"submit"
id=
"view_submit"
value=
"提交"
>
...
...
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