dlh_test_server/app/common/enum/MenuEnum.php
2024-09-06 10:20:30 +08:00

510 lines
17 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载:https://gitee.com/likeshop_gitee
// | github下载:https://github.com/likeshop-github
// | 访问官网:https://www.likeshop.cn
// | 访问社区:https://home.likeshop.cn
// | 访问手册:http://doc.likeshop.cn
// | 微信公众号:likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\common\enum;
class MenuEnum{
//首页菜单
const INDEX = [
//限时秒杀
[
'index' => 100,
'name' => '限时秒杀',
'link' => '/bundle/pages/goods_seckill/goods_seckill',
'is_tab' => 0,
'link_type' => 1,
],
//拼团活动
[
'index' => 101,
'name' => '拼团活动',
'link' => '/bundle/pages/goods_combination/goods_combination',
'is_tab' => 0,
'link_type' => 1,
],
//热销榜单
[
'index' => 102,
'name' => '热销榜单',
'link' => '/pages/active_list/active_list?type=hot',
'is_tab' => 0,
'link_type' => 1,
],
//领券中心
[
'index' => 103,
'name' => '领券中心',
'link' => '/pages/get_coupon/get_coupon',
'is_tab' => 0,
'link_type' => 1,
],
//会员中心
[
'index' => 105,
'name' => '会员中心',
'link' => '/bundle/pages/user_vip/user_vip',
'is_tab' => 0,
'link_type' => 1,
],
//我的收藏
[
'index' => 106,
'name' => '我的收藏',
'link' => '/bundle/pages/user_collection/user_collection',
'is_tab' => 0,
'link_type' => 1,
],
//商城资讯
[
'index' => 107,
'name' => '商城资讯',
'link' => '/pages/news_list/news_list',
'is_tab' => 0,
'link_type' => 1,
],
//帮助中心
[
'index' => 108,
'name' => '帮助中心',
'link' => '/pages/news_list/news_list?type=1',
'is_tab' => 0,
'link_type' => 1,
],
//收货地址
[
'index' => 109,
'name' => '收货地址',
'link' => '/bundle/pages/user_address/user_address',
'is_tab' => 0,
'link_type' => 1,
],
//商品分类
[
'index' => 110,
'name' => '商品分类',
'link' => '/pages/goods_cate/goods_cate',
'is_tab' => 1,
'link_type' => 1,
],
// //积分抽奖
// [
// 'index' => 111,
// 'name' => '积分抽奖',
// 'link' => '/bundle/pages/luckly_wheel/luckly_wheel',
// 'is_tab' => 0,
// 'link_type' => 1,
// ],
//砍价活动
[
'index' => 112,
'name' => '砍价活动',
'link' => '/bundle/pages/bargain/bargain',
'is_tab' => 0,
'link_type' => 1,
],
//新品推荐
[
'index' => 113,
'name' => '新品推荐',
'link' => '/pages/active_list/active_list?type=new',
'is_tab' => 0,
'link_type' => 1,
],
//店铺街
[
'index' => 114,
'name' => '店铺街',
'link' => '/pages/shop_street/shop_street',
'is_tab' => 0,
'link_type' => 1,
],
// 我的排名
[
'index' => 219,
'name' => '我的排名',
'link' => '/bundle_b/pages/subsidy_shop/subsidy_shop',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
// 百亿返现
[
'index' => 220,
'name' => '百亿返现',
'link' => '/bundle_b/pages/subsidy_withdrawal/index',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
//商家入驻
[
'index' => 115,
'name' => '商家入驻',
'link' => '/bundle/pages/store_settled/store_settled',
'is_tab' => 0,
'link_type' => 1,
],
//消息通知
[
'index' => 116,
'name' => '消息通知',
'link' => '/pages/message_center/message_center',
'is_tab' => 0,
'link_type' => 1,
],
//品牌
[
'index' => 117,
'name' => '品牌',
'link' => '/pages/brand_list/brand_list',
'is_tab' => 0,
'link_type' => 1,
],
//积分签到
[
'index' => 118,
'name' => '积分签到',
'link' => '/bundle/pages/integral_sign/integral_sign',
'is_tab' => 0,
'link_type' => 1,
],
//积分商城
[
'index' => 119,
'name' => '积分商城',
'link' => '/bundle/pages/integral_mall/integral_mall',
'is_tab' => 0,
'link_type' => 1,
],
//种草社区
[
'index' => 120,
'name' => '种草社区',
'link' => '/pages/community/community',
'is_tab' => 1,
'link_type' => 1,
],
//积分商城
[
'index' => 121,
'name' => '卡密核销',
'link' => '/bundle/pages/kamihexiao/kamihexiao',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 122,
'name' => '本地商家入驻',
'link' => '/bundle_b/pages/local_settled/index',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
]
,
[
'index' => 123,
'name' => '商家信息',
'link' => '/bundle_b/pages/local_shop/local_shop',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
]
];
//个人中心菜单
const CENTRE = [
[
'index' => 200,
'name' => '我的钱包',
'link' => '/bundle/pages/user_wallet/user_wallet',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 201,
'name' => '分销推广',
'link' => '/bundle/pages/user_spread/user_spread',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 202,
'name' => '我的优惠券',
'link' => '/bundle/pages/user_coupon/user_coupon',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 203,
'name' => '等级服务',
'link' => '/bundle/pages/user_vip/user_vip',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 204,
'name' => '帮助中心',
'link' => '/pages/news_list/news_list?type=1',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 205,
'name' => '收货地址',
'link' => '/bundle/pages/user_address/user_address',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 206,
'name' => '我的收藏',
'link' => '/bundle/pages/user_collection/user_collection',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 207,
'name' => '联系客服',
'link' => '/bundle/pages/chat/chat',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 208,
'name' => '我的拼团',
'link' => '/bundle/pages/user_group/user_group',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 209,
'name' => '砍价记录',
'link' => '/bundle/pages/bargain_code/bargain_code',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 210,
'name' => '商家入驻',
'link' => '/bundle/pages/store_settled/store_settled',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 211,
'name' => '消息通知',
'link' => '/pages/message_center/message_center',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 212,
'name' => '邀请海报',
'link' => '/bundle/pages/invite_fans/invite_fans',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 213,
'name' => '私人定制',
'link' => '/bundle/pages/jicai/jicai',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 214,
'name' => '集采身份',
'link' => '/bundle/pages/procurement/procurement',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 215,
'name' => '集采价格',
'link' => '/bundle/pages/procurement_qrcode/procurement_qrcode',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 216,
'name' => '我的订单',
'link' => '/bundle_b/pages/my_order/my_order',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 217,
'name' => '补贴商家',
'link' => '/bundle_b/pages/subsidy_shop/subsidy_shop',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 218,
'name' => '兑换大厅',
'link' => '/bundle_b/pages/exchange/exchange',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
// 我的排名
[
'index' => 219,
'name' => '我的排名',
'link' => '/bundle_b/pages/subsidy_shop/subsidy_shop',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[
'index' => 221,
'name' => '领券中心',
'link' => '/pages/get_coupon/get_coupon',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 222,
'name' => '积分商城',
'link' => '/bundle/pages/integral_mall/integral_mall',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 223,
'name' => '积分签到',
'link' => '/bundle/pages/integral_sign/integral_sign',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 224,
'name' => '本地账单',
'link' => '/bundle_b/pages/local_shop_pay/order',
'is_tab' => 0,
'link_type' => 1,
]
];
// 本地生活
const LOCAL = [
[
'index' => 300,
'name' => '商家入驻',
'link' => '/bundle_b/pages/local_settled/index',
'is_tab' => 0,
'link_type' => 1,
],
[
'index' => 301,
'name' => '家电',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 302,
'name' => '数码',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 303,
'name' => '食品酒饮',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 304,
'name' => '居家日用',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 305,
'name' => '服饰箱包',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 306,
'name' => '户外用品',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
],
[
'index' => 307,
'name' => '办公用品',
'link' => '/pages/local_life/local_life',
'is_tab' => 1,
'link_type' => 1,
]
];
/**
* Notes:获取菜单列表
* @param bool $scene 指定个人或首页菜单:true时返回所有菜单
* @param bool $from 返回某个菜单:true返回个人菜单或首页菜单
* @return array
* @author: cjhao 2021/5/15 16:51
* name => 菜单名称
* link => 调整链接
* is_tab => 是否的tab页
* link_type => 菜单类型:1-跳转;2-web-view;3-按钮(微信小程序可调用客服)
*/
public static function getMenu($scene = true,$from = true){
//首页菜单
$config_index = self::INDEX;
//个人菜单
$config_center = self::CENTRE;
// 本地生活菜单
$config_local = self::LOCAL;
$config_name = 'config_' . $scene;
$content = $$config_name;
if(true === $scene){
$content = array_merge($config_index, $config_center, $config_local);
}
if(true === $from){
return $content;
}
$menu_index = array_column($content,'index');
$key = array_search($from,$menu_index);
if(false !== $key){
return $content[$key];
}
return [];
}
}