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.

109 lines
4.3 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Model\v3\ServicePersonnel;
  4. use App\Service\v3\Interfaces\UserCenterBlockServiceInterface;
  5. class UserCenterBlockService implements UserCenterBlockServiceInterface
  6. {
  7. public function do()
  8. {
  9. // TODO: Implement do() method.
  10. }
  11. public function check()
  12. {
  13. // TODO: Implement check() method.
  14. }
  15. public function undo()
  16. {
  17. // TODO: Implement undo() method.
  18. }
  19. public function all($roles = [])
  20. {
  21. //
  22. $img_host = config('alioss.img_host').'/';
  23. $blocks = [
  24. [
  25. 'type' => 'user',
  26. 'title' => '常用功能',
  27. 'items' => [
  28. ['name' => '收货地址', 'icon' => $img_host . 'user_icons/user_addr2.png', 'type' => 'page', 'path' => '/pages/address/userAddress/userAddress','command'=>'user_addr'],
  29. ['name' => '当面付订单查询', 'icon' => $img_host . 'user_icons/offline_orders2.png', 'type' => 'page', 'path' => '/pages/facepay/facepay','command'=>'offline_orders'],
  30. ['name' => '在线客服', 'icon' => $img_host . 'user_icons/online_kf2.png', 'type' => 'page', 'path' => '','command'=>'online_kf'],
  31. ['name' => '联系服务站', 'icon' => $img_host . 'user_icons/contact_fwz2.png', 'type' => 'page', 'path' => '/pages/contactMarket/contactMarket','command'=>'contact_fwz'],
  32. ['name' => '关于懒族', 'icon' => $img_host . 'user_icons/about_lz2.png', 'type' => 'page', 'path' => '/pages/aboutUs/aboutUs','command'=>'about'],
  33. ]
  34. ]
  35. ];
  36. $blocks[] = [
  37. 'type' => 'store_user',
  38. 'title' => '商家相关',
  39. 'items' => [
  40. ['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter2.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login']
  41. ]
  42. ];
  43. foreach ($roles as $key => $item) {
  44. # code...
  45. // if($item['key'] == 'store'){
  46. // $goodsEditor = [
  47. // 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
  48. // 'type' => 'webview',
  49. // 'path' => 'http://localhost:8080/#/pages/goodsManagement/goodsManagement?market_id='.$item['data']['market_id'].'&user_id='.$item['data']['user_id'].'&store_id='.$item['data']['id'],
  50. // 'command'=>'sp_login'
  51. // ];
  52. // array_push($blocks[1]['items'],$goodsEditor);
  53. // }
  54. if($item['key'] == 'sp'){
  55. $tags = [];
  56. if(in_array(29,$item['data']['position'])){
  57. array_push($tags,
  58. [
  59. 'name' => '骑手端', 'icon' => $img_host . 'user_icons/service2.png',
  60. 'type' => 'page',
  61. 'path' => '/pages/deliverymanOrders/deliverymanOrders?employees_id='.$item['data']['id'],
  62. 'command'=>'sp_login'
  63. ]
  64. );
  65. }
  66. if(in_array(30,$item['data']['position'])){
  67. $personalId = ServicePersonnel::query()->where('user_id',$item['data']['user_id'])->value('id');
  68. array_push($tags,
  69. [
  70. 'name' => '评价',
  71. 'icon' => $img_host . 'user_icons/service2.png',
  72. 'type' => 'page',
  73. 'path' => '/zh_cjdianc/pages/appraise/index?service_personnel_id='.$personalId,'command'=>'sp_login'
  74. ],
  75. [
  76. 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
  77. 'type' => 'page',
  78. 'path' => '/pages/shopList/shopList?personal_id='.$personalId,
  79. 'command'=>'sp_login'
  80. ]
  81. );
  82. }
  83. $blocks[] = [
  84. 'type' => 'sp_user',
  85. 'title' => '服务专员',
  86. 'items' => $tags
  87. ];
  88. }
  89. }
  90. return $blocks;
  91. }
  92. }