Files
2026-04-14 17:46:22 +08:00

355 lines
14 KiB
PHP
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 BASE_INDEX = 101;//商城首页
const BASE_GOODS_CATEGORY = 102;//商品分类
const BASE_COMMUNITY = 103;//种草社区
const BASE_CART = 104;//购物车
const BASE_USER = 105;//个人中心
//个人中心
const SHOP_SECKILL = 201;//秒杀列表
const SHOP_TEAM = 202;//拼团列表
const SHOP_BARGAIN = 203;//砍价列表
const SHOP_COUPON = 204;//领券中心
const SHOP_VIP = 205;//会员中心
const SHOP_LIVE_ROOM = 206;//小程序直播
const SHOP_TEAM_LOG = 207;//拼团记录
const SHOP_BARGAIN_LOG = 208;//砍价记录
const SHOP_STREET = 209;//店铺街
const SHOP_APPLY = 210;//商家入驻
const SHOP_MY_COUPON = 211;//我的优惠券
const SHOP_ACTIVE_NEW = 212;//新品推荐
const SHOP_INTEGRAL_MALL = 213;//积分商城
const SHOP_INTEGRAL_SIGN = 214;//积分签到
const SHOP_ACTIVE_HOT = 215;//热销榜单
const SHOP_WALLET = 216;//我的钱包
const SHOP_COLLECTION = 217;//我的收藏
const SHOP_HELP = 218;//帮助中心
const SHOP_ADDRESS = 219;//收货地址
const SHOP_NEWS = 220;//商城资讯
const SHOP_COMMENTS = 221;//我的评价
const SHOP_USER_SETTING = 222;//个人设置
const SHOP_RECHARGE = 223;//用户充值
const SHOP_GOODS_SEARCH = 224;//商品搜索
const SHOP_CONTACT = 225;//联系客服
const SHOP_MESSAGE = 226;//消息通知
const SHOP_SERVER_EXPLAN_1 = 227;//隐私政策
const SHOP_SERVER_EXPLAN_0 = 228;//服务协议
//分销菜单
const DISTRIBUTION_PROMOTION = 301;//分销推广
const DISTRIBUTION_POSTER = 302;//分销海报
/**
* Notes: 菜单内容
* @param bool $scene 场景1-基础链接2-商城链接3-分销链接
* @param bool $from 菜单来源:获取具体的某个菜单
* @return array
* name => '菜单名称'
* link => 调整链接
* is_tab => 是否的tab页
* link_type => 菜单类型1-跳转2-web-view3-按钮(微信小程序可调用客服)
* menu_type => 菜单内容类型1-正常内容2-分销菜单
*
*/
public static function getMenuContent($scene = true,$from = true){
//基础链接
$base = [
self::BASE_INDEX => [
'name' => '商城首页',
'link' => '/pages/index/index',
'is_tab' => 1,
'link_type' => 1,
'menu_type' => 1,
],
self::BASE_GOODS_CATEGORY => [
'name' => '商品分类',
'link' => '/pages/goods_cate/goods_cate',
'is_tab' => 1,
'link_type' => 1,
'menu_type' => 1,
],
self::BASE_COMMUNITY => [
'name' => '种草社区',
'link' => '/pages/community/community',
'is_tab' => 1,
'link_type' => 1,
'menu_type' => 1,
],
self::BASE_CART => [
'name' => '购物车',
'link' => '/pages/shop_cart/shop_cart',
'is_tab' => 1,
'link_type' => 1,
'menu_type' => 1,
],
self::BASE_USER => [
'name' => '个人中心',
'link' => '/pages/user/user',
'is_tab' => 1,
'link_type' => 1,
'menu_type' => 1,
],
];
//商城链接
$user = [
self::SHOP_SECKILL => [
'name' => '秒杀列表',
'link' => '/bundle/pages/goods_seckill/goods_seckill',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_TEAM => [
'name' => '拼团列表',
'link' => '/bundle/pages/goods_combination/goods_combination',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_BARGAIN => [
'name' => '砍价列表',
'link' => '/bundle/pages/bargain/bargain',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_COUPON => [
'name' => '领券中心',
'link' => '/bundle/pages/get_coupon/get_coupon',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_VIP => [
'name' => '会员中心',
'link' => '/bundle/pages/user_vip/user_vip',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_LIVE_ROOM => [
'name' => '小程序直播',
'link' => '/bundle_b/pages/live_room/live_room',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_TEAM_LOG => [
'name' => '拼团记录',
'link' => '/bundle/pages/user_group/user_group',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_BARGAIN_LOG => [
'name' => '砍价记录',
'link' => '/bundle/pages/bargain_code/bargain_code',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_STREET => [
'name' => '店铺街',
'link' => '/pages/shop_street/shop_street',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_APPLY => [
'name' => '商家入驻',
'link' => '/bundle/pages/store_settled/store_settled',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_MY_COUPON => [
'name' => '我的优惠券',
'link' => '/bundle/pages/user_coupon/user_coupon',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_ACTIVE_NEW => [
'name' => '新品推荐',
'link' => '/pages/active_list/active_list?type=new',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_INTEGRAL_MALL => [
'name' => '积分商城',
'link' => '/bundle/pages/integral_mall/integral_mall',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_INTEGRAL_SIGN => [
'name' => '积分签到',
'link' => '/bundle/pages/integral_sign/integral_sign',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_ACTIVE_HOT => [
'name' => '热销榜单',
'link' => '/pages/active_list/active_list?type=hot',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_WALLET => [
'name' => '我的钱包',
'link' => '/bundle/pages/user_wallet/user_wallet',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_COLLECTION => [
'name' => '我的收藏',
'link' => '/bundle/pages/user_collection/user_collection',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_HELP => [
'name' => '帮助中心',
'link' => '/pages/news_list/news_list?type=1',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_ADDRESS => [
'name' => '收货地址',
'link' => '/bundle/pages/user_address/user_address',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_NEWS => [
'name' => '商城资讯',
'link' => '/pages/news_list/news_list',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_COMMENTS => [
'name' => '我的评价',
'link' => '/bundle/pages/all_comments/all_comments',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_USER_SETTING => [
'name' => '个人设置',
'link' => '/bundle/pages/user_set/user_set',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_RECHARGE => [
'name' => '用户充值',
'link' => '/bundle/pages/user_payment/user_payment',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_GOODS_SEARCH => [
'name' => '商品搜索',
'link' => '/pages/goods_search/goods_search',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_CONTACT => [
'name' => '联系客服',
'link' => '/bundle/pages/chat/chat',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_MESSAGE => [
'name' => '消息通知',
'link' => '/pages/message_center/message_center',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_SERVER_EXPLAN_1 => [
'name' => '隐私政策',
'link' => '/bundle/pages/server_explan/server_explan?type=1',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
self::SHOP_SERVER_EXPLAN_0 => [
'name' => '服务协议',
'link' => '/bundle/pages/server_explan/server_explan?type=0',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
];
//分销链接
$distribution = [
self::DISTRIBUTION_PROMOTION => [
'name' => '分销推广',
'link' => '/bundle/pages/user_spread/user_spread',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 2,
],
self::DISTRIBUTION_POSTER => [
'name' => '分销海报',
'link' => '/bundle/pages/invite_fans/invite_fans',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 2,
],
];
if($scene === true){
$content = array_merge($base,$user,$distribution);
} else {
switch ($scene) {
case 1:
$content = $base;
break;
case 2:
$content = $user;
break;
case 3:
$content = $distribution;
break;
default:
$config_name = 'config'.$scene;
$content = $$config_name;
break;
}
}
if($from === true){
return $content;
}
return $content[$from] ?? [];
}
}