Authored by yangyang

频道选择页写了一半,等待继续

  1 +<?php
  2 +namespace LibModels\Wap\Index;
  3 +
  4 +use Api\Sign;
  5 +use Api\Yohobuy;
  6 +/*
  7 + * To change this license header, choose License Headers in Project Properties.
  8 + * To change this template file, choose Tools | Templates
  9 + * and open the template in the editor.
  10 + */
  11 +
  12 +/**
  13 + * Description of IndexChannel
  14 + *
  15 + * @author Administrator
  16 + */
  17 +class IndexData {
  18 + public static function channelData()
  19 + {
  20 + $param = Yohobuy::param();
  21 + $param['client_secret'] = Sign::getSign($param);
  22 + print_r($param);
  23 + Yohobuy::post('http://service.api.yohobuy.com/operations/api/v5/entrance/getEntrance',$param);
  24 + }
  25 +}
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use Plugin\Helpers; 4 use Plugin\Helpers;
  5 +use LibModels\Wap\Index\IndexData;
5 6
6 /** 7 /**
7 * 频道选择 8 * 频道选择
@@ -14,16 +15,16 @@ class IndexController extends AbstractAction @@ -14,16 +15,16 @@ class IndexController extends AbstractAction
14 */ 15 */
15 public function indexAction() 16 public function indexAction()
16 { 17 {
17 - if (null !== $this->get('go')) {  
18 - // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页  
19 - Index\HomeModel::goSwitchChannel();  
20 - } else {  
21 - // 设置客户端浏览器1小时内不改变,  
22 - $this->setLastModified(mktime(date('H'), 0, 0, date('n'), date('j'), date('Y')));  
23 - // 设置浏览器缓存5分钟  
24 - $this->setExpires(300);  
25 - }  
26 - 18 +// if (null !== $this->get('go')) {
  19 +// // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
  20 +// Index\HomeModel::goSwitchChannel();
  21 +// } else {
  22 +// // 设置客户端浏览器1小时内不改变,
  23 +// $this->setLastModified(mktime(date('H'), 0, 0, date('n'), date('j'), date('Y')));
  24 +// // 设置浏览器缓存5分钟
  25 +// $this->setExpires(300);
  26 +// }
  27 + var_dump(IndexData::channelData());
27 // 渲染模板 28 // 渲染模板
28 $this->_view->display('index', array( 29 $this->_view->display('index', array(
29 'background' => Index\HomeModel::getBgImage(), 30 'background' => Index\HomeModel::getBgImage(),