'平台首页', 'link' => '/pages/home/home', 'open_type' => "switchtab", 'params' => [] ], [ 'name' => '购物车', 'link' => '/pages/shoppingcart/shoppingcart', 'open_type' => "switchtab", 'params' => [] ], [ 'name' => '联盟会员卡', 'link' => '/user/member/saas_member', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '领券中心', 'link' => '/other/coupon_center/coupon_center', 'open_type' => "navigate", 'params' => [] ], // [ // 'name' => '联盟佣金', // 'link' => '/pages/union/user-account', // 'open_type' => "navigate", // 'params' => [] // ], [ 'name' => '足迹', 'link' => '/user/history/history', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '收货地址管理', 'link' => '/user/my/addressmanage', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '店铺列表', 'link' => '/union/class-search/index', 'open_type' => "navigate", 'params' => [ [ 'key' => "common_cat_id", 'value' => "", 'desc' => "商城分类ID", 'type' => "select", 'options' => [], 'label_name' => "商城分类" ], [ 'key' => "cat_name", 'value' => "", 'label_name' => "商城分类名称", 'hidden' => true ], ] ], [ 'name' => '用户中心', 'link' => '/pages/my/my', 'open_type' => "switchtab", 'params' => [] ], [ 'name' => "所有订单", 'link' => "/order/order/order", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待付款订单", 'link' => "/order/order/order?status=0", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待发货订单", 'link' => "/order/order/order?status=1", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待收货订单", 'link' => "/order/order/order?status=2", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "已完成订单", 'link' => "/order/order/order?status=3", 'open_type' => "navigate", 'params' => [] ], [ 'name' => '一键拨号', 'link' => 'tel', 'open_type' => 'tel', 'params' => [ [ 'key' => "tel", 'value' => "", 'desc' => "请填写联系电话" ] ], ], [ 'name' => '小程序', 'link' => 'wxapp', 'open_type' => 'wxapp', 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '客服', 'link' => 'contact', 'open_type' => 'contact', 'params' => [] ], [ 'name' => '业务员', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=yewuyuan", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], // [ // 'name' => '申请店铺', // 'link' => '/salesman/salesman/applyShop', // 'open_type' => 'navigate', // 'params' => [], // ], // [ // 'name' => '代理中心', // 'link' => '/salesman/salesman/agencyCenter', // 'open_type' => 'navigate', // 'params' => [], // ], // [ // 'name' => '商城后台', // 'link' => '/admin/home/home', // 'open_type' => 'navigate', // 'params' => [], // ], [ 'name' => '我的卡券', 'link' => '/user/write_off_card/write_off_card', 'open_type' => 'navigate', 'params' => [], ], [ 'name' => '跳转店铺', 'link' => 'store', 'open_type' => 'store', 'params' => [ [ 'key' => "store_id", 'value' => "", 'desc' => "跳转店铺首页", 'type' => "select", 'options' => [], 'label_name' => "选择店铺" ], ], ], [ 'name' => "我的积分", 'link' => "/face-pay/face-pay/storePoints", 'open_type' => "navigate", 'params' => [] ], // [ // 'name' => "分销中心", // 'link' => "/user/share/index", // 'open_type' => "navigate", // 'params' => [] // ], // [ // 'name' => "佣金统计", // 'link' => "/user/brokerageCharges/index", // 'open_type' => "navigate", // 'params' => [] // ], // [ // 'name' => "消费返利", // 'link' => "/user/rebate/index", // 'open_type' => "navigate", // 'params' => [] // ], [ 'name' => '分账账户', 'link' => '/user/share/share-account', 'open_type' => 'navigate', 'params' => [], ], [ 'name' => '服务端小程序', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "pages/index/index", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '店铺管理', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=dianpu", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '区域管理员', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=daili", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '推广代理', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=tuiguang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '云仓批发', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=1¶m=yuncang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '供货商申请', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=purchase", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '云仓选品', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=2¶m=yuncang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '联盟中心', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=fenxiao", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '代理佣金', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=1¶m=yongjin", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '司机中心', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=driver", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ] ]; public static function getNewLink() { try { $groupDiyPage = []; $template = NewDiyTemplate::find()->where([ 'store_id' => -1, 'is_index' => 0, 'is_delete' => 0, 'name' => 'DIY', ])->all(); foreach($template as $item) { $info = Json::decode($item->template); $groupDiyPage[] = [ 'name' => $info['page_name'], 'link' => "/pages/diy/diy?id=".$item->id, 'id' => $item->id, 'open_type' => "navigate", 'params' => [] ]; } $link = [ 'name' => '商城页面', 'icon' => 'shop', 'child' => [ [ 'name' => 'DIY页面', 'list' => $groupDiyPage, 'type' => 'diy-page', ], [ 'name' => '商城链接', 'child' => [ [ 'name' => '基础链接', 'list' => [ [ 'name' => '平台首页', 'link' => '/pages/home/home', 'open_type' => "switchtab", 'params' => [] ], [ 'name' => '购物车', 'link' => '/pages/shoppingcart/shoppingcart', 'open_type' => "switchtab", 'params' => [] ], [ 'name' => '用户中心', 'link' => '/pages/my/my', 'open_type' => "switchtab", 'params' => [] ], ], ], [ 'name' => '个人中心', 'list' => [ [ 'name' => '足迹', 'link' => '/user/history/history', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '收货地址管理', 'link' => '/user/my/addressmanage', 'open_type' => "navigate", 'params' => [] ], [ 'name' => "所有订单", 'link' => "/order/order/order", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待付款订单", 'link' => "/order/order/order?status=0", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待发货订单", 'link' => "/order/order/order?status=1", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "待收货订单", 'link' => "/order/order/order?status=2", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "已完成订单", 'link' => "/order/order/order?status=3", 'open_type' => "navigate", 'params' => [] ], [ 'name' => '一键拨号', 'link' => 'tel', 'open_type' => 'tel', 'params' => [ [ 'key' => "tel", 'value' => "", 'desc' => "请填写联系电话" ] ], ], [ 'name' => '小程序', 'link' => 'wxapp', 'open_type' => 'wxapp', 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '客服', 'link' => 'contact', 'open_type' => 'contact', 'params' => [] ], [ 'name' => "店铺积分", 'link' => "/face-pay/face-pay/storePoints", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "店铺收藏", 'link' => "/user/collection/collection", 'open_type' => "navigate", 'params' => [] ], [ 'name' => "核销员中心", 'link' => "/md_admin/staff-center/staff", 'open_type' => "navigate", 'params' => [] ], // [ // 'name' => "分账账户", // 'link' => "/user/share/share-account", // 'open_type' => "navigate", // 'params' => [] // ] ], ] ], ], [ 'name' => '应用', 'child' => [ [ 'name' => '优惠券', 'list' => [ [ 'name' => '领券中心', 'link' => '/pages/coupon_center/coupon_center', 'open_type' => "navigate", 'params' => [] ], ], ], [ 'name' => '卡券', 'list' => [ [ 'name' => '联盟会员卡', 'link' => '/user/member/saas_member', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '我的卡券', 'link' => '/user/write_off_card/write_off_card', 'open_type' => 'navigate', 'params' => [], ], ], ], [ 'name' => '积分商城', 'list' => [ [ 'name' => '积分首页', 'link' => '/marketing/integral/index/index', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '我的兑换', 'link' => '/marketing/integral/my/record', 'open_type' => 'navigate', 'params' => [], ] ], ], [ 'name' => '商盟活动', 'list' => [ [ 'name' => '商盟拼团', 'link' => '/marketing/other/pt/list/index', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '我的拼团', 'link' => '/marketing/other/pt/order/index', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '商盟砍价', 'link' => '/marketing/other/bargain/list/index', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '我的砍价', 'link' => '/marketing/other/bargain/order/list/index', 'open_type' => "navigate", 'params' => [] ], [ 'name' => '商盟秒杀', 'link' => '/marketing/other/seckill/list/index', 'open_type' => "navigate", 'params' => [] ],[ 'name' => '新人专享', 'link' => '/marketing/other/newUser/list/index', 'open_type' => "navigate", 'params' => [] ], ], ], [ 'name' => '分红中心', 'list' => [ [ 'name' => '分红中心', 'link' => '/dividendCenter/index/index', 'open_type' => "navigate", 'params' => [] ] ], ], ], ], [ 'name' => '服务端功能', 'type' => 'serve', 'child' => [ [ 'name' => '服务端功能', 'type' => 'serve', 'list' => [ [ 'name' => '业务员', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=yewuyuan", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '服务端小程序', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "pages/index/index", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '店铺管理', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=dianpu", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '区域管理员', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=daili", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '推广代理', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=tuiguang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '云仓批发', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=1¶m=yuncang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '供货商申请', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=purchase", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '云仓选品', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=2¶m=yuncang", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '联盟中心', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=fenxiao", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '代理佣金', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=1¶m=yongjin", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ], [ 'name' => '司机中心', 'link' => 'wxapp', 'open_type' => 'wxapp', 'is_merchant' => 1, 'params' => [ [ 'key' => "appid", 'value' => "", 'desc' => "请填写小程序appid" ], [ 'key' => "path", 'value' => "type=0¶m=driver", 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”" ], ], ] ], ], ], ], ], ]; foreach ($link['child'] as &$item) { if ($item['type'] === 'serve') { foreach ($item['child'][0]['list'] as &$s_item) { if ($s_item['is_merchant'] === 1) { if (isset($s_item['params'])) { foreach ($s_item['params'] as &$params) { if ($params['key'] === 'appid') { $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value']; $params['value'] = $platform_mch_appid; } if ($params['key'] === 'path') { $params['value'] = '/pages/index/index?' . $params['value']; } } } } } } } return [$link, [ 'name' => '店铺页面', 'icon' => 'shop', 'child' => [ [ 'name' => '店铺列表', 'type' => 'store-cat', 'typeLink' => [ 'name' => '列表', 'link' => '/union/class-search/index', 'open_type' => "navigate", 'params' => [ [ 'key' => "common_cat_id", 'valueKey' => "id", 'value' => "", 'desc' => "common_cat_id请填写在商城分类中相关分类的ID", ] ] ], ], [ 'name' => '跳转店铺', 'type' => 'change-store', 'typeLink' => [ 'name' => '跳转店铺', 'link' => 'store', 'open_type' => "store", 'params' => [ [ 'key' => "store_id", 'valueKey' => "id", 'value' => "", 'desc' => "store_id请填写在商城分类中相关分类的ID", ] ] ], ] ] ]]; } catch (\Exception $e) { return [ 'code' => 1, 'msg' => $e->getMessage() ]; } } public static function getLink() { $list = self::LIST; $template = NewDiyTemplate::find()->where([ 'store_id' => -1, 'is_delete' => 0, 'name' => 'DIY', ])->all(); foreach($template as $item) { $info = Json::decode($item->template); $list[] = [ 'name' => $info['page_name'], 'link' => "/pages/diy/diy?id=".$item->id, 'open_type' => "navigate", 'params' => [] ]; } foreach ($list as &$item) { if (!empty($item['params'])) { foreach ($item['params'] as &$param_item) { //店铺列表 if (!empty($param_item['key']) && $param_item['key'] === "common_cat_id" && $param_item['type'] === "select" ) { $param_item['options'] = SaasCategory::find()->where(['is_delete' => 0])->select('name, icon, id')->asArray()->all(); } //跳转店铺 if (!empty($param_item['key']) && $param_item['key'] === "store_id" && $param_item['type'] === "select" ) { $param_item['options'] = Store::find()->where(['is_delete' => 0])->select('name, logo, id')->asArray()->all(); } } } if ($item['is_merchant'] === 1) { if (isset($item['params'])) { foreach ($item['params'] as &$params) { if ($params['key'] === 'appid') { $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value']; $params['value'] = $platform_mch_appid; } if ($params['key'] === 'path') { $params['value'] = '/pages/index/index?' . $params['value']; } } } } } return $list; } }