|
|
@@ -47,39 +47,7 @@ class IndexController extends webApp
|
|
|
'withdraw_min' => ConfigService::make()->getConfigByCode('withdraw_min', 0),
|
|
|
'withdraw_fee' => ConfigService::make()->getConfigByCode('withdraw_fee', 0),
|
|
|
'notices' => NoticeService::make()->getRecommandList(),
|
|
|
- 'menuList' => [
|
|
|
- [
|
|
|
- "name" => '首页',
|
|
|
- "code" => 'home',
|
|
|
- "icon" => 'home',
|
|
|
- "status"=> 1,
|
|
|
- "page" => '/pages/index/index'
|
|
|
- ], [
|
|
|
- "name" => '客服',
|
|
|
- "code" => 'custom',
|
|
|
- "icon" => 'custom',
|
|
|
- "status"=> 1,
|
|
|
- ], [
|
|
|
- "name" => '',
|
|
|
- "code" => 'social',
|
|
|
- "icon" => 'social',
|
|
|
- "status"=> $socialOpen?1:0,
|
|
|
- "page" => '/pages/social/index'
|
|
|
- ], [
|
|
|
- "name" => '购物车',
|
|
|
- "code" => 'cart',
|
|
|
- "icon" => 'cart',
|
|
|
- "badge" => OrderService::make()->getCountByStatus($this->userId,1),
|
|
|
- "status"=> 1,
|
|
|
- "page" => '/pages/cart/index'
|
|
|
- ], [
|
|
|
- "name" => '我的',
|
|
|
- "code" => 'mine',
|
|
|
- "icon" => 'mine',
|
|
|
- "status"=> 1,
|
|
|
- "page" => '/pages/mine/index'
|
|
|
- ]
|
|
|
- ]
|
|
|
+ 'menuList' => $this->getMenus($socialOpen)
|
|
|
];
|
|
|
RedisService::set($cacheKey, $config, 3600);
|
|
|
}
|
|
|
@@ -92,6 +60,49 @@ class IndexController extends webApp
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 菜单
|
|
|
+ * @param int $socialOpen
|
|
|
+ * @return array[]
|
|
|
+ */
|
|
|
+ public function getMenus($socialOpen=-1)
|
|
|
+ {
|
|
|
+ $socialOpen = $socialOpen>=0?$socialOpen:ConfigService::make()->getConfigByCode('social_open', 0);
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ "name" => '首页',
|
|
|
+ "code" => 'home',
|
|
|
+ "icon" => 'home',
|
|
|
+ "status"=> 1,
|
|
|
+ "page" => '/pages/index/index'
|
|
|
+ ], [
|
|
|
+ "name" => '客服',
|
|
|
+ "code" => 'custom',
|
|
|
+ "icon" => 'custom',
|
|
|
+ "status"=> 1,
|
|
|
+ ], [
|
|
|
+ "name" => '',
|
|
|
+ "code" => 'social',
|
|
|
+ "icon" => 'social',
|
|
|
+ "status"=> $socialOpen?1:0,
|
|
|
+ "page" => '/pages/social/index'
|
|
|
+ ], [
|
|
|
+ "name" => '购物车',
|
|
|
+ "code" => 'cart',
|
|
|
+ "icon" => 'cart',
|
|
|
+ "badge" => OrderService::make()->getCountByStatus($this->userId,1),
|
|
|
+ "status"=> 1,
|
|
|
+ "page" => '/pages/cart/index'
|
|
|
+ ], [
|
|
|
+ "name" => '我的',
|
|
|
+ "code" => 'mine',
|
|
|
+ "icon" => 'mine',
|
|
|
+ "status"=> 1,
|
|
|
+ "page" => '/pages/mine/index'
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 首页数据
|
|
|
* @return array
|
|
|
*/
|
|
|
@@ -110,6 +121,7 @@ class IndexController extends webApp
|
|
|
$data['socials'] = SocialCircleService::make()->getIndexList();
|
|
|
} else {
|
|
|
$data['notices'] = NoticeService::make()->getRecommandList();
|
|
|
+ $data['menuList'] = $this->getMenus();
|
|
|
}
|
|
|
|
|
|
return showJson(1010, true, $data);
|