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.

93 lines
3.8 KiB

5 years ago
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\Service\v3\Interfaces\UserCenterBlockServiceInterface;
  4. class UserCenterBlockService implements UserCenterBlockServiceInterface
  5. {
  6. public function do()
  7. {
  8. // TODO: Implement do() method.
  9. }
  10. public function check()
  11. {
  12. // TODO: Implement check() method.
  13. }
  14. public function undo()
  15. {
  16. // TODO: Implement undo() method.
  17. }
  18. public function all($roles = [])
  19. {
  20. //
  21. $img_host = config('alioss.img_host').'/';
  22. $blocks = [
  23. [
  24. 'type' => 'user',
  25. 'title' => '常用功能',
  26. 'items' => [
  27. ['name' => '收货地址', 'icon' => $img_host . 'user_icons/user_addr2.png', 'type' => 'page', 'path' => '/pages/address/userAddress/userAddress','command'=>'user_addr'],
  28. ['name' => '当面付订单查询', 'icon' => $img_host . 'user_icons/offline_orders2.png', 'type' => 'page', 'path' => '/pages/facepay/facepay','command'=>'offline_orders'],
  29. ['name' => '在线客服', 'icon' => $img_host . 'user_icons/online_kf2.png', 'type' => 'page', 'path' => '','command'=>'online_kf'],
  30. ['name' => '联系服务站', 'icon' => $img_host . 'user_icons/contact_fwz2.png', 'type' => 'page', 'path' => '/pages/contactMarket/contactMarket','command'=>'contact_fwz'],
  31. ['name' => '关于懒族', 'icon' => $img_host . 'user_icons/about_lz2.png', 'type' => 'page', 'path' => '/pages/aboutUs/aboutUs','command'=>'about'],
  32. ]
  33. ]
  34. ];
  35. $blocks[] = [
  36. 'type' => 'store_user',
  37. 'title' => '商家相关',
  38. 'items' => [
  39. ['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter2.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login'],
  40. [
  41. 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
  42. 'type' => 'webview',
  43. 'path' => '/pages/webview/webview?data=%27%7b%22webview_url%22%3a%22http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%22%7d%27',
  44. 'command'=>'sp_login'
  45. ]
  46. ]
  47. ];
  48. foreach ($roles as $key => $item) {
  49. # code...
  50. // if($item['key'] == 'store'){
  51. // $blocks[] = [
  52. // 'type' => 'store_user',
  53. // 'title' => '商户相关',
  54. // 'items' => [
  55. // ['name' => '商家入口', 'icon' => $img_host . 'user_icons/shop_enter.png', 'type' => 'page', 'path' => '/pages/shopLogin/shopLogin','command'=>'store_login']
  56. // ]
  57. // ];
  58. // }
  59. if($item['key'] == 'sp'){
  60. $blocks[] = [
  61. 'type' => 'sp_user',
  62. 'title' => '服务专员',
  63. 'items' => [
  64. ['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'],
  65. [
  66. 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png',
  67. 'type' => 'webview',
  68. 'path' => '/pages/webview/webview?data=%27%7b%22webview_url%22%3a%22http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%22%7d%27',
  69. 'command'=>'sp_login'
  70. ]
  71. ]
  72. ];
  73. }
  74. }
  75. return $blocks;
  76. }
  77. }