mainSidebar.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!-- sidebar: style can be found in sidebar.less -->
  2. <!-- <section class="sidebar" data-active-color="blue" style="background:#23232f" data-image="../assets/img/sidebar-1.jpg"> -->
  3. <style>
  4. .sidebar-wrapper {
  5. position: relative;
  6. }
  7. .first-nav::-webkit-scrollbar {
  8. width:4px;
  9. height:4px;
  10. background-color:transparent;
  11. }
  12. .first-nav::-webkit-scrollbar-thumb {
  13. background-color:#111;
  14. }
  15. .second-nav {
  16. margin-top:60px!important;
  17. }
  18. .last-nav {
  19. position:absolute;
  20. bottom:0;
  21. left:0;
  22. width:100%;
  23. }
  24. </style>
  25. <section class="sidebar" data-image="../assets/img/sidebar-1.jpg">
  26. <div class="sidebar-wrapper">
  27. <div style="width:96px;text-align:center;height:80px;">
  28. <img src="{{\Setting::get('shop.shop.logo') ? yz_tomedia(\Setting::get('shop.shop.logo')) : resource_absolute('static/assets/img/default-avatar.png')}}"
  29. style="border-radius:50%;width:62px;height:62px;margin:10px auto;background-color:white;border-radius:50%;"
  30. alt="">
  31. </div>
  32. {{--upload_image_local().\Setting::get('shop.shop.logo')--}}
  33. <ul class="nav first-nav">
  34. @if(in_array(\YunShop::app()->role,['founder','manager','owner']))
  35. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  36. <a href="{{yzWebUrl('survey.survey.index')}}">
  37. <i class="fa fa-archive"></i>
  38. <span style=" margin-top: -5px;font-size:14px !important">概况</span>
  39. </a>
  40. </li>
  41. @else
  42. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  43. <a href="{{yzWebUrl('index.index')}}">
  44. <i class="fa fa-home"></i>
  45. <span style=" margin-top: -5px;font-size:14px !important">商城</span>
  46. </a>
  47. </li>
  48. @endif
  49. @php
  50. $first = \app\backend\modules\menu\Menu::current()->getFirst();
  51. @endphp
  52. {{--顶部主要菜单--}}
  53. @foreach($first['top'] as $key=>$value)
  54. @if(isset($value['menu']) && $value['menu'] == 1 && can($key) && $value['left_first_show'] == 1)
  55. @if(isset($value['child']) && array_child_kv_exists($value['child'],'menu',1))
  56. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  57. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  58. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  59. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
  60. @if($value['name'] == '消息')
  61. @if(app\common\models\systemMsg\SysMsgLog::getLogCount() > 0)
  62. <span class="badge"
  63. style="background-color:#F15353;position: absolute">{{app\common\models\systemMsg\SysMsgLog::getLogCount()<99?app\common\models\systemMsg\SysMsgLog::getLogCount():'...'}}</span>
  64. @endif
  65. @endif
  66. </a>
  67. </li>
  68. @elseif($value['menu'] == 1)
  69. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  70. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  71. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  72. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name'] ?? ''}}</span>
  73. </a>
  74. </li>
  75. @endif
  76. @endif
  77. @endforeach
  78. </ul>
  79. <ul class="nav second-nav">
  80. {{--中间插件--}}
  81. @foreach($first['bottom'] as $key=>$value)
  82. @if(isset($value['menu']) && $value['menu'] == 1 && can($key) && $value['left_first_show'] == 1)
  83. @switch($key)
  84. @case('install_plugins')
  85. @if(\YunShop::app()->role === 'founder')
  86. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  87. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  88. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  89. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name'] ?? ''}}</span>
  90. </a>
  91. </li>
  92. @endif
  93. @break
  94. @case('charts')
  95. @if(app('plugins')->isEnabled('shop-statistics'))
  96. @if(!can('shop-statistics'))
  97. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  98. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  99. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  100. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
  101. </a>
  102. </li>
  103. @endif
  104. @else
  105. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  106. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  107. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  108. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
  109. </a>
  110. </li>
  111. @endif
  112. @break
  113. @default
  114. @if(isset($value['child']) && array_child_kv_exists($value['child'],'menu',1))
  115. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  116. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  117. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  118. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name']}}</span>
  119. </a>
  120. </li>
  121. @elseif($value['menu'] == 1)
  122. <li class="{{in_array($key,\app\backend\modules\menu\Menu::current()->getCurrentItems()) ? 'active' : ''}}">
  123. <a href="{{ \app\common\services\MenuService::canAccess($key) }}">
  124. <i class="fa {{array_get($value,'icon','fa-circle-o') ?: 'fa-circle-o'}}"></i>
  125. <span style=" margin-top: -5px;font-size:14px !important">{{$value['name'] ?? ''}}</span>
  126. </a>
  127. </li>
  128. @endif
  129. @endswitch
  130. @endif
  131. @endforeach
  132. </ul>
  133. {{--菜单结束--}}
  134. </div>
  135. <!-- Sidebar Menu -->
  136. <!-- /.sidebar-menu -->
  137. </section>