Authored by cailing

帮助中心

@@ -25,6 +25,16 @@ class HelpData @@ -25,6 +25,16 @@ class HelpData
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 }
@@ -876,12 +876,11 @@ class HomeController extends AbstractAction @@ -876,12 +876,11 @@ class HomeController extends AbstractAction
876 */ 876 */
877 public function helpAction() 877 public function helpAction()
878 { 878 {
  879 + $service = Home\HelpModel::serviceInfo();
879 $this->setTitle('帮助中心'); 880 $this->setTitle('帮助中心');
880 $this->setNavHeader('帮助中心'); 881 $this->setNavHeader('帮助中心');
881 $data = array( 882 $data = array(
882 - 'iHelp' => array(  
883 - array('caption' => '新用户注册'),  
884 - ) 883 + 'iHelp' =>$service,
885 ); 884 );
886 $this->_view->display('i-help', $data); 885 $this->_view->display('i-help', $data);
887 } 886 }
@@ -891,13 +890,12 @@ class HomeController extends AbstractAction @@ -891,13 +890,12 @@ class HomeController extends AbstractAction
891 */ 890 */
892 public function helpDetailAction() 891 public function helpDetailAction()
893 { 892 {
894 - $this->setTitle('帮助中心');  
895 - $this->setNavHeader('帮助中心'); 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,10 +20,9 @@ class HelpModel @@ -20,10 +20,9 @@ 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
@@ -31,6 +30,17 @@ class HelpModel @@ -31,6 +30,17 @@ class HelpModel
31 return $iHelp; 30 return $iHelp;
32 } 31 }
33 32
  33 + /*
  34 + * 获取帮助中心详细内容
  35 + */
  36 +
  37 + public static function serviceDetail($code)
  38 + {
  39 +
  40 + $res = HelpData::serviceDetail($code);
  41 + return $res;
  42 + }
  43 +
34 44
35 } 45 }
36 46