Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
cailing
9 years ago
Commit
016553b20b46d9a86541e480ba70a44d8293b9a9
1 parent
11609314
帮助
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
47 deletions
library/LibModels/Wap/Home/HelpData.php
template/m.yohobuy.com/actions/index/home/helpDetail.phtml
template/m.yohobuy.com/actions/index/home/i-help.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Home/Help.php
library/LibModels/Wap/Home/HelpData.php
View file @
016553b
...
...
@@ -33,10 +33,10 @@ class HelpData
//构建必传参数
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.help.detail'
;
$param
[
'code'
]
=
$code
;
$param
[
'code'
]
=
$code
;
$param
[
'return_type'
]
=
'html'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
true
);
}
...
...
template/m.yohobuy.com/actions/index/home/helpDetail.phtml
View file @
016553b
{
{>
layout/header
}
}
{
{{iHelp
}
}}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/i-help.phtml
View file @
016553b
{
{>
layout/header
}
}
<div
class=
"iHelp"
>
<ul>
{
{#
iHelp
}
}
<li><a
href=
"/home/helpDetail?code={{ code}}"
><span>
{
{
caption
}
}</span><i
class=
"iconfont num"
>
604
;</i></a></li>
{
{/
iHelp
}
}
</ul>
<ul>
{
{#
iHelp
}
}
<li><a
href=
"{{url}}"
><span>
{
{caption
}
}</span><i
class=
"iconfont num"
>
604
;</i></a></li>
{
{/
iHelp
}
}
</ul>
</div>
{
{>
layout/footer
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
016553b
...
...
@@ -871,31 +871,23 @@ class HomeController extends AbstractAction
$this
->
_view
->
display
(
'order-detail'
,
array
(
'orderDetail'
=>
$data
,
'orderDetailPage'
=>
true
));
}
/**
* 帮助中心列表页
*/
public
function
helpAction
()
{
$service
=
Home\HelpModel
::
serviceInfo
();
$this
->
setTitle
(
'帮助中心'
);
$this
->
setNavHeader
(
'帮助中心'
);
$data
=
array
(
'iHelp'
=>
$service
,
);
$this
->
_view
->
display
(
'i-help'
,
$data
);
}
/**
* 帮助中心列表详细信息
*/
public
function
helpDetailAction
()
{
$code
=
$this
->
get
(
'code'
,
0
);
$service
=
Home\HelpModel
::
serviceDetail
(
$code
);
$data
=
array
(
'iHelp'
=>
$service
,
);
print_r
(
$service
);
$this
->
_view
->
display
(
'helpDetail'
,
$data
);
}
/**
* 帮助中心列表详细信息
*/
public
function
helpDetailAction
()
{
$caption
=
$this
->
get
(
'caption'
,
'帮助中心'
);
$code
=
$this
->
get
(
'code'
,
0
);
if
(
empty
(
$code
))
{
$this
->
error
();
}
$this
->
setTitle
(
$caption
);
$this
->
setNavHeader
(
$caption
);
$service
=
Home\HelpModel
::
serviceDetail
(
$code
);
$this
->
_view
->
display
(
'helpDetail'
,
array
(
'iHelp'
=>
$service
,
));
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Home/Help.php
View file @
016553b
...
...
@@ -8,14 +8,13 @@ use Plugin\Helpers;
/*
* 帮助中心相关数据处理
*/
class
HelpModel
{
class
HelpModel
{
/*
* 获取帮助列表
*/
public
static
function
serviceInfo
()
{
public
static
function
serviceInfo
()
{
//调用接口获取数据
$res
=
json_decode
(
HelpData
::
serviceInfo
(),
TRUE
);
$cateInfo
=
$res
[
'data'
];
...
...
@@ -24,23 +23,24 @@ class HelpModel
foreach
(
$cateInfo
as
$key
=>
$value
)
{
$iHelp
[
$key
][
'caption'
]
=
$value
[
'caption'
];
$iHelp
[
$key
][
'code'
]
=
$value
[
'code'
];
}
$iHelp
[
$key
][
'url'
]
=
Helpers
::
url
(
'/home/helpDetail'
,
array
(
'code'
=>
$value
[
'code'
],
'caption'
=>
$value
[
'caption'
])
);
}
}
return
$iHelp
;
}
/*
* 获取帮助中心详细内容
*/
public
static
function
serviceDetail
(
$code
)
{
public
static
function
serviceDetail
(
$code
)
{
$res
=
HelpData
::
serviceDetail
(
$code
);
if
(
!
empty
(
$res
))
{
if
(
false
!==
(
$part
=
strstr
(
$res
,
'<div class="deal_main">'
)))
{
$res
=
strstr
(
$part
,
'</body>'
,
TRUE
);
}
}
return
$res
;
}
}
...
...
Please
register
or
login
to post a comment