截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MenuEnum.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. class MenuEnum{
  21. //首页菜单
  22. const INDEX = [
  23. //限时秒杀
  24. [
  25. 'index' => 100,
  26. 'name' => '限时秒杀',
  27. 'link' => '/bundle/pages/goods_seckill/goods_seckill',
  28. 'is_tab' => 0,
  29. 'link_type' => 1,
  30. ],
  31. //拼团活动
  32. [
  33. 'index' => 101,
  34. 'name' => '拼团活动',
  35. 'link' => '/bundle/pages/goods_combination/goods_combination',
  36. 'is_tab' => 0,
  37. 'link_type' => 1,
  38. ],
  39. //热销榜单
  40. [
  41. 'index' => 102,
  42. 'name' => '热销榜单',
  43. 'link' => '/pages/active_list/active_list?type=hot',
  44. 'is_tab' => 0,
  45. 'link_type' => 1,
  46. ],
  47. //领券中心
  48. [
  49. 'index' => 103,
  50. 'name' => '领券中心',
  51. 'link' => '/bundle/pages/get_coupon/get_coupon',
  52. 'is_tab' => 0,
  53. 'link_type' => 1,
  54. ],
  55. //会员中心
  56. [
  57. 'index' => 105,
  58. 'name' => '会员中心',
  59. 'link' => '/bundle/pages/user_vip/user_vip',
  60. 'is_tab' => 0,
  61. 'link_type' => 1,
  62. ],
  63. //我的收藏
  64. [
  65. 'index' => 106,
  66. 'name' => '我的收藏',
  67. 'link' => '/bundle/pages/user_collection/user_collection',
  68. 'is_tab' => 0,
  69. 'link_type' => 1,
  70. ],
  71. //商城资讯
  72. [
  73. 'index' => 107,
  74. 'name' => '商城资讯',
  75. 'link' => '/pages/news_list/news_list',
  76. 'is_tab' => 0,
  77. 'link_type' => 1,
  78. ],
  79. //帮助中心
  80. [
  81. 'index' => 108,
  82. 'name' => '帮助中心',
  83. 'link' => '/pages/news_list/news_list?type=1',
  84. 'is_tab' => 0,
  85. 'link_type' => 1,
  86. ],
  87. //收货地址
  88. [
  89. 'index' => 109,
  90. 'name' => '收货地址',
  91. 'link' => '/bundle/pages/user_address/user_address',
  92. 'is_tab' => 0,
  93. 'link_type' => 1,
  94. ],
  95. //商品分类
  96. [
  97. 'index' => 110,
  98. 'name' => '商品分类',
  99. 'link' => '/pages/goods_cate/goods_cate',
  100. 'is_tab' => 1,
  101. 'link_type' => 1,
  102. ],
  103. // //积分抽奖
  104. // [
  105. // 'index' => 111,
  106. // 'name' => '积分抽奖',
  107. // 'link' => '/bundle/pages/luckly_wheel/luckly_wheel',
  108. // 'is_tab' => 0,
  109. // 'link_type' => 1,
  110. // ],
  111. //砍价活动
  112. [
  113. 'index' => 112,
  114. 'name' => '砍价活动',
  115. 'link' => '/bundle/pages/bargain/bargain',
  116. 'is_tab' => 0,
  117. 'link_type' => 1,
  118. ],
  119. //新品推荐
  120. [
  121. 'index' => 113,
  122. 'name' => '新品推荐',
  123. 'link' => '/pages/active_list/active_list?type=new',
  124. 'is_tab' => 0,
  125. 'link_type' => 1,
  126. ],
  127. //店铺街
  128. [
  129. 'index' => 114,
  130. 'name' => '店铺街',
  131. 'link' => '/pages/shop_street/shop_street',
  132. 'is_tab' => 0,
  133. 'link_type' => 1,
  134. ],
  135. //商家入驻
  136. [
  137. 'index' => 115,
  138. 'name' => '商家入驻',
  139. 'link' => '/bundle/pages/store_settled/store_settled',
  140. 'is_tab' => 0,
  141. 'link_type' => 1,
  142. ],
  143. //消息通知
  144. [
  145. 'index' => 116,
  146. 'name' => '消息通知',
  147. 'link' => '/pages/message_center/message_center',
  148. 'is_tab' => 0,
  149. 'link_type' => 1,
  150. ],
  151. //品牌
  152. [
  153. 'index' => 117,
  154. 'name' => '品牌',
  155. 'link' => '/pages/brand_list/brand_list',
  156. 'is_tab' => 0,
  157. 'link_type' => 1,
  158. ],
  159. //积分签到
  160. [
  161. 'index' => 118,
  162. 'name' => '积分签到',
  163. 'link' => '/bundle/pages/integral_sign/integral_sign',
  164. 'is_tab' => 0,
  165. 'link_type' => 1,
  166. ],
  167. //积分商城
  168. [
  169. 'index' => 119,
  170. 'name' => '积分商城',
  171. 'link' => '/bundle/pages/integral_mall/integral_mall',
  172. 'is_tab' => 0,
  173. 'link_type' => 1,
  174. ],
  175. //种草社区
  176. [
  177. 'index' => 120,
  178. 'name' => '种草社区',
  179. 'link' => '/pages/community/community',
  180. 'is_tab' => 1,
  181. 'link_type' => 1,
  182. ]
  183. ];
  184. //个人中心菜单
  185. const CENTRE = [
  186. [
  187. 'index' => 200,
  188. 'name' => '我的钱包',
  189. 'link' => '/bundle/pages/user_wallet/user_wallet',
  190. 'is_tab' => 0,
  191. 'link_type' => 1,
  192. ],
  193. [
  194. 'index' => 201,
  195. 'name' => '分销推广',
  196. 'link' => '/bundle/pages/user_spread/user_spread',
  197. 'is_tab' => 0,
  198. 'link_type' => 1,
  199. ],
  200. [
  201. 'index' => 202,
  202. 'name' => '我的优惠券',
  203. 'link' => '/bundle/pages/user_coupon/user_coupon',
  204. 'is_tab' => 0,
  205. 'link_type' => 1,
  206. ],
  207. [
  208. 'index' => 203,
  209. 'name' => '等级服务',
  210. 'link' => '/bundle/pages/user_vip/user_vip',
  211. 'is_tab' => 0,
  212. 'link_type' => 1,
  213. ],
  214. [
  215. 'index' => 204,
  216. 'name' => '帮助中心',
  217. 'link' => '/pages/news_list/news_list?type=1',
  218. 'is_tab' => 0,
  219. 'link_type' => 1,
  220. ],
  221. [
  222. 'index' => 205,
  223. 'name' => '收货地址',
  224. 'link' => '/bundle/pages/user_address/user_address',
  225. 'is_tab' => 0,
  226. 'link_type' => 1,
  227. ],
  228. [
  229. 'index' => 206,
  230. 'name' => '我的收藏',
  231. 'link' => '/bundle/pages/user_collection/user_collection',
  232. 'is_tab' => 0,
  233. 'link_type' => 1,
  234. ],
  235. [
  236. 'index' => 207,
  237. 'name' => '联系客服',
  238. 'link' => '/bundle/pages/chat/chat',
  239. 'is_tab' => 0,
  240. 'link_type' => 1,
  241. 'menu_type' => 1,
  242. ],
  243. [
  244. 'index' => 208,
  245. 'name' => '我的拼团',
  246. 'link' => '/bundle/pages/user_group/user_group',
  247. 'is_tab' => 0,
  248. 'link_type' => 1,
  249. 'menu_type' => 1,
  250. ],
  251. [
  252. 'index' => 209,
  253. 'name' => '砍价记录',
  254. 'link' => '/bundle/pages/bargain_code/bargain_code',
  255. 'is_tab' => 0,
  256. 'link_type' => 1,
  257. 'menu_type' => 1,
  258. ],
  259. [
  260. 'index' => 210,
  261. 'name' => '商家入驻',
  262. 'link' => '/bundle/pages/store_settled/store_settled',
  263. 'is_tab' => 0,
  264. 'link_type' => 1,
  265. 'menu_type' => 1,
  266. ],
  267. [
  268. 'index' => 211,
  269. 'name' => '消息通知',
  270. 'link' => '/pages/message_center/message_center',
  271. 'is_tab' => 0,
  272. 'link_type' => 1,
  273. 'menu_type' => 1,
  274. ],
  275. [
  276. 'index' => 212,
  277. 'name' => '邀请海报',
  278. 'link' => '/bundle/pages/invite_fans/invite_fans',
  279. 'is_tab' => 0,
  280. 'link_type' => 1,
  281. 'menu_type' => 1,
  282. ]
  283. ];
  284. /**
  285. * Notes:获取菜单列表
  286. * @param bool $scene 指定个人或首页菜单:true时返回所有菜单
  287. * @param bool $from 返回某个菜单:true返回个人菜单或首页菜单
  288. * @return array
  289. * @author: cjhao 2021/5/15 16:51
  290. * name => 菜单名称
  291. * link => 调整链接
  292. * is_tab => 是否的tab页
  293. * link_type => 菜单类型:1-跳转;2-web-view;3-按钮(微信小程序可调用客服)
  294. */
  295. public static function getMenu($scene = true,$from = true){
  296. //首页菜单
  297. $config_index = self::INDEX;
  298. //个人菜单
  299. $config_center = self::CENTRE;
  300. $config_name = 'config_'.$scene;
  301. $content = $$config_name;
  302. if(true === $scene){
  303. $content = array_merge($config_index,$config_center);
  304. }
  305. if(true === $from){
  306. return $content;
  307. }
  308. $menu_index = array_column($content,'index');
  309. $key = array_search($from,$menu_index);
  310. if(false !== $key){
  311. return $content[$key];
  312. }
  313. return [];
  314. }
  315. }