Authored by biao

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into feature/bindMobile

... ... @@ -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);
}
}
... ...
{{> layout/header}}
{{ iHelp}}
{{{iHelp}}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<div class="iHelp">
<ul>
{{# iHelp}}
<li><a href="/home/helpDetail?code={{ code}}"><span>{{ name}}</span><i class="iconfont num">&#xe604;</i></a></li>
<li><a href="{{url}}"><span>{{ name}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
... ...
... ... @@ -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币详情 新版
*/
... ...
... ... @@ -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;
}
}
... ...