Authored by cailing

帮助

... ... @@ -36,7 +36,7 @@ class HelpData
$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);
}
... ...
{{> layout/header}}
{{{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>{{ caption}}</span><i class="iconfont num">&#xe604;</i></a></li>
<li><a href="{{url}}"><span>{{caption}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
... ...
... ... @@ -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()
{
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);
$data = array(
$this->_view->display('helpDetail', array(
'iHelp' => $service,
);
print_r($service);
$this->_view->display('helpDetail', $data);
));
}
}
... ...
... ... @@ -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,8 +23,8 @@ 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;
}
... ... @@ -34,13 +33,14 @@ class HelpModel
* 获取帮助中心详细内容
*/
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;
}
}
... ...