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.
 
 

94 lines
3.8 KiB

<?php
namespace App\Service\v3\Implementations;
use App\Service\v3\Interfaces\UserCenterBlockServiceInterface;
class UserCenterBlockService implements UserCenterBlockServiceInterface
{
public function do()
{
// TODO: Implement do() method.
}
public function check()
{
// TODO: Implement check() method.
}
public function undo()
{
// TODO: Implement undo() method.
}
public function all($roles = [])
{
//
$img_host = config('alioss.img_host').'/';
$blocks = [
[
'type' => 'user',
'title' => '常用功能',
'items' => [
['name' => '收货地址', 'icon' => $img_host . 'user_icons/user_addr2.png', 'type' => 'page', 'path' => '/pages/address/userAddress/userAddress','command'=>'user_addr'],
['name' => '当面付订单查询', 'icon' => $img_host . 'user_icons/offline_orders2.png', 'type' => 'page', 'path' => '/pages/facepay/facepay','command'=>'offline_orders'],
['name' => '在线客服', 'icon' => $img_host . 'user_icons/online_kf2.png', 'type' => 'page', 'path' => '','command'=>'online_kf'],
['name' => '联系服务站', 'icon' => $img_host . 'user_icons/contact_fwz2.png', 'type' => 'page', 'path' => '/pages/contactMarket/contactMarket','command'=>'contact_fwz'],
['name' => '关于懒族', 'icon' => $img_host . 'user_icons/about_lz2.png', 'type' => 'page', 'path' => '/pages/aboutUs/aboutUs','command'=>'about'],
]
]
];
$blocks[] = [
'type' => 'store_user',
'title' => '商家相关',
'items' => [
['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter2.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login'],
[
'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
'type' => 'webview',
'path' => '/pages/webview/webview?data=%22%7bwebview_url%3a+%27http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%27%7d%22',
'command'=>'sp_login'
]
]
];
foreach ($roles as $key => $item) {
# code...
// if($item['key'] == 'store'){
// $blocks[] = [
// 'type' => 'store_user',
// 'title' => '商户相关',
// 'items' => [
// ['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login']
// ]
// ];
// }
if($item['key'] == 'sp'){
$blocks[] = [
'type' => 'sp_user',
'title' => '服务专员',
'items' => [
['name' => '评价', 'icon' => $img_host . 'user_icons/service2.png', 'type' => 'page', 'path' => '/zh_cjdianc/pages/appraise/index?service_personnel_id='.$item['data']['id'],'command'=>'sp_login'],
[
'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
'type' => 'webview',
'path' => '/pages/webview/webview?data=%22%7bwebview_url%3a+%27http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%27%7d%22',
'command'=>'sp_login'
]
]
];
}
}
return $blocks;
}
}