Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
biao
9 years ago
Commit
b00d2e4d917ff7fb93188263b35d8fe089aeae70
2 parents
a669ae82
d2cf27f2
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into feature/bindMobile
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
26 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 @
b00d2e4
...
...
@@ -25,6 +25,21 @@ class HelpData
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
$param
);
}
/*
* 获取帮助中心列表
*/
public
static
function
serviceDetail
(
$code
)
{
//构建必传参数
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.help.detail'
;
$param
[
'code'
]
=
$code
;
$param
[
'return_type'
]
=
'html'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
true
);
}
}
...
...
template/m.yohobuy.com/actions/index/home/helpDetail.phtml
View file @
b00d2e4
{
{>
layout/header
}
}
{
{
iHelp
}
}
{
{{iHelp
}
}}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/i-help.phtml
View file @
b00d2e4
...
...
@@ -2,7 +2,7 @@
<div
class=
"iHelp"
>
<ul>
{
{#
iHelp
}
}
<li><a
href=
"
/home/helpDetail?code={{ code
}}"
><span>
{
{
name
}
}</span><i
class=
"iconfont num"
>
604
;</i></a></li>
<li><a
href=
"
{{url
}}"
><span>
{
{
name
}
}</span><i
class=
"iconfont num"
>
604
;</i></a></li>
{
{/
iHelp
}
}
</ul>
</div>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
b00d2e4
...
...
@@ -849,33 +849,41 @@ class HomeController extends AbstractAction
));
}
/**
* 帮助列表页
*/
/**
* 帮助中心列表页
*/
public
function
helpAction
()
{
{
$service
=
Home\HelpModel
::
serviceInfo
();
$this
->
setTitle
(
'帮助中心'
);
$this
->
setNavHeader
(
'帮助中心'
);
$data
=
array
(
'iHelp'
=>
Home\HelpModel
::
serviceInfo
()
,
'iHelp'
=>
$service
,
);
$this
->
_view
->
display
(
'i-help'
,
$data
);
}
/**
* 帮助
列表页
* 帮助
中心列表详细信息
*/
public
function
helpDetailAction
()
{
$this
->
setTitle
(
'帮助中心'
);
$this
->
setNavHeader
(
'帮助中心'
);
$data
=
array
(
'iHelp'
=>
array
(
array
(
'name'
=>
'新用户注册'
),
)
);
$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
,
));
}
/**
* YOHO币详情 新版
*/
...
...
yohobuy/m.yohobuy.com/application/models/Home/Help.php
View file @
b00d2e4
...
...
@@ -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'
];
...
...
@@ -25,12 +24,23 @@ class HelpModel
foreach
(
$cateInfo
as
$key
=>
$value
)
{
$iHelp
[
$key
][
'name'
]
=
$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
)
{
$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