Authored by cailing

帮助

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