Showing
3 changed files
with
38 additions
and
20 deletions
@@ -24,7 +24,17 @@ class HelpData | @@ -24,7 +24,17 @@ class HelpData | ||
24 | 24 | ||
25 | return Yohobuy::post(Yohobuy::API_URL, $param, $param); | 25 | return Yohobuy::post(Yohobuy::API_URL, $param, $param); |
26 | } | 26 | } |
27 | - | 27 | + |
28 | + public static function serviceDetail($code) | ||
29 | + { | ||
30 | + //获取帮助详情 | ||
31 | + $param = Yohobuy::param(); | ||
32 | + $param['method'] = 'app.help.detail'; | ||
33 | + $param['code'] = $code; | ||
34 | + $param['return_type'] = 'html'; | ||
35 | + $param['client_secret'] = Sign::getSign($param); | ||
36 | + return Yohobuy::post(Yohobuy::API_URL, $param,$param ); | ||
37 | + } | ||
28 | 38 | ||
29 | 39 | ||
30 | } | 40 | } |
@@ -874,30 +874,28 @@ class HomeController extends AbstractAction | @@ -874,30 +874,28 @@ class HomeController extends AbstractAction | ||
874 | /** | 874 | /** |
875 | * 帮助列表页 | 875 | * 帮助列表页 |
876 | */ | 876 | */ |
877 | - public function helpAction() | ||
878 | - { | ||
879 | - $this->setTitle('帮助中心'); | ||
880 | - $this->setNavHeader('帮助中心'); | ||
881 | - $data = array( | ||
882 | - 'iHelp' => array( | ||
883 | - array('caption' => '新用户注册'), | ||
884 | - ) | ||
885 | - ); | ||
886 | - $this->_view->display('i-help', $data); | ||
887 | - } | 877 | + public function helpAction() |
878 | + { | ||
879 | + $service = Home\HelpModel::serviceInfo(); | ||
880 | + $this->setTitle('帮助中心'); | ||
881 | + $this->setNavHeader('帮助中心'); | ||
882 | + $data = array( | ||
883 | + 'iHelp' =>$service, | ||
884 | + ); | ||
885 | + $this->_view->display('i-help', $data); | ||
886 | + } | ||
888 | 887 | ||
889 | /** | 888 | /** |
890 | * 帮助列表页 | 889 | * 帮助列表页 |
891 | */ | 890 | */ |
892 | public function helpDetailAction() | 891 | public function helpDetailAction() |
893 | - { | ||
894 | - $this->setTitle('帮助中心'); | ||
895 | - $this->setNavHeader('帮助中心'); | 892 | + { |
893 | + $code = $this->get('code', 0); | ||
894 | + $service = Home\HelpModel::serviceDetail($code); | ||
896 | $data = array( | 895 | $data = array( |
897 | - 'iHelp' => array( | ||
898 | - array('name' => '新用户注册'), | ||
899 | - ) | 896 | + 'iHelp' => $service, |
900 | ); | 897 | ); |
898 | + print_r($service); | ||
901 | $this->_view->display('helpDetail', $data); | 899 | $this->_view->display('helpDetail', $data); |
902 | } | 900 | } |
903 | } | 901 | } |
@@ -20,16 +20,26 @@ class HelpModel | @@ -20,16 +20,26 @@ class HelpModel | ||
20 | $res = json_decode(HelpData::serviceInfo(), TRUE); | 20 | $res = json_decode(HelpData::serviceInfo(), TRUE); |
21 | $cateInfo = $res['data']; | 21 | $cateInfo = $res['data']; |
22 | $iHelp = array(); | 22 | $iHelp = array(); |
23 | - $list = array(); | ||
24 | if ($cateInfo) { | 23 | if ($cateInfo) { |
25 | foreach ($cateInfo as $key => $value) { | 24 | foreach ($cateInfo as $key => $value) { |
26 | - $iHelp[$key]['name'] = $value['caption']; | 25 | + $iHelp[$key]['caption'] = $value['caption']; |
27 | $iHelp[$key]['code'] = $value['code']; | 26 | $iHelp[$key]['code'] = $value['code']; |
28 | } | 27 | } |
29 | 28 | ||
30 | } | 29 | } |
31 | return $iHelp; | 30 | return $iHelp; |
32 | } | 31 | } |
32 | + | ||
33 | + /* | ||
34 | + * 获取帮助中心详细内容 | ||
35 | + */ | ||
36 | + | ||
37 | + public static function serviceDetail($code) | ||
38 | + { | ||
39 | + | ||
40 | + $res = HelpData::serviceDetail($code); | ||
41 | + return $res; | ||
42 | + } | ||
33 | 43 | ||
34 | 44 | ||
35 | } | 45 | } |
-
Please register or login to post a comment