Authored by 毕凯

Merge remote-tracking branch 'origin/feature/wap326' into feature/wap/postcss

@@ -35,6 +35,20 @@ class UserData @@ -35,6 +35,20 @@ class UserData
35 } 35 }
36 36
37 /** 37 /**
  38 + * 获取个人中心公告有关数据
  39 + *
  40 + * @return mixed
  41 + */
  42 + public static function noticeData()
  43 + {
  44 + $param = Yohobuy::param();
  45 + $param['method'] = 'app.resources.getNotices';
  46 + $param['client_secret'] = Sign::getSign($param);
  47 +
  48 + return Yohobuy::get(Yohobuy::API_URL, $param);
  49 + }
  50 +
  51 + /**
38 * 个人中心页面优惠券,收藏的商品等的数目数据 52 * 个人中心页面优惠券,收藏的商品等的数目数据
39 * 53 *
40 * @param int $uid 用户ID 54 * @param int $uid 用户ID
@@ -27,7 +27,7 @@ class HomeController extends AbstractAction @@ -27,7 +27,7 @@ class HomeController extends AbstractAction
27 /** 27 /**
28 * 通过当前用户审判是否跳到登录 28 * 通过当前用户审判是否跳到登录
29 * 29 *
30 - * @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查) 30 + * @param boolean $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
31 * @return void 31 * @return void
32 */ 32 */
33 protected function auditJumpLogin($useSession = true) 33 protected function auditJumpLogin($useSession = true)
@@ -51,6 +51,7 @@ class HomeController extends AbstractAction @@ -51,6 +51,7 @@ class HomeController extends AbstractAction
51 'myIndexPage' => true, 51 'myIndexPage' => true,
52 'showDownloadApp' => true, 52 'showDownloadApp' => true,
53 'navHome' => true, 53 'navHome' => true,
  54 + // 'notice' => UserModel::getNoticeData(),
54 'pageFooter' => true, 55 'pageFooter' => true,
55 'cartUrl' => Helpers::url('/cart/index/index', null), 56 'cartUrl' => Helpers::url('/cart/index/index', null),
56 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))), 57 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
@@ -45,6 +45,26 @@ class UserModel @@ -45,6 +45,26 @@ class UserModel
45 } 45 }
46 46
47 /** 47 /**
  48 + * 获取个人中心公告有关数据
  49 + *
  50 + * @return array
  51 + */
  52 + public static function getNoticeData()
  53 + {
  54 + $result = array();
  55 +
  56 + $notice = UserData::noticeData();
  57 +
  58 + // 处理数据
  59 + if (isset($notice['data']) && !empty($notice['data'])) {
  60 + $result = $notice['data'];
  61 + $result['open'] = ($result['open'] === 'Y');
  62 + }
  63 +
  64 + return $result;
  65 + }
  66 +
  67 + /**
48 * 处理个人中心页面优惠券,收藏的商品等的数目数据 68 * 处理个人中心页面优惠券,收藏的商品等的数目数据
49 * 69 *
50 * @param int $uid 用户ID 70 * @param int $uid 用户ID