pluginslist.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('应用中心'))
  4. <style>
  5. .main-panel>.content{
  6. padding-left: 0px;
  7. }
  8. .el-button+.el-button{
  9. margin-left: 0px;
  10. }
  11. .plugin-span{
  12. overflow: hidden;
  13. text-overflow: ellipsis;
  14. white-space: nowrap;
  15. /* max-width: 150px; */
  16. /* line-height: 1 !important; */
  17. line-height: normal !important;
  18. display: flex;
  19. flex-direction: column;
  20. justify-content: space-between;
  21. width: 100%;
  22. }
  23. .description{
  24. font-size: 13px;
  25. margin: 3px 0;
  26. white-space: nowrap;
  27. text-overflow: ellipsis;
  28. overflow: hidden;
  29. word-break: break-all;
  30. }
  31. .icon_detail{
  32. display: flex;
  33. justify-content: flex-end;
  34. }
  35. .application-center{
  36. position: relative;
  37. top: 0;
  38. }
  39. .left-box{
  40. position: fixed;
  41. top: 30px;
  42. bottom: 0;
  43. left: 96px;
  44. width: 150px;
  45. padding-top: 10px;
  46. font-size: 14px;
  47. height: 100%;
  48. border-right: 1px solid #e0e0e0;
  49. color: #464646;
  50. font-weight: bold;
  51. z-index: 100;
  52. background: #fff;
  53. }
  54. .left-box div{
  55. margin: 15px 0;
  56. width: 100%;
  57. display: flex;
  58. flex-direction: column;
  59. align-items: center;
  60. cursor: pointer;
  61. }
  62. .left-box .nav-detail{
  63. display: flex;
  64. flex-direction: row;
  65. padding: 5px 20px;
  66. }
  67. .left-box .nav-detail i{
  68. margin-right: 5px;
  69. }
  70. .rigth-box{
  71. position: relative;
  72. float: right;
  73. width: calc(100% - 148px);
  74. background: #eff3f6;
  75. padding-top: 10px;
  76. min-height: 100%;
  77. }
  78. .selected{
  79. background-color: #eff3f6;
  80. color: #42bea4;
  81. }
  82. .panel .panel-body{
  83. background: #eff3f6;
  84. display: flex;
  85. flex-wrap: wrap;
  86. }
  87. .panel-heading{
  88. background: #eff3f6 !important;
  89. border-bottom: 1px solid #eff3f6 !important;
  90. }
  91. .panel-title{
  92. display: flex;
  93. align-items: center;
  94. margin-left: 20px;
  95. }
  96. .nav-line{
  97. width: 3px;
  98. height: 18px;
  99. background: #42bea4;
  100. margin-right: 5px;
  101. }
  102. .panel-default .panel-body a{
  103. width: 100%;
  104. }
  105. @media (max-width: 991px) {
  106. .left-box {
  107. display: none;
  108. }
  109. .rigth-box {
  110. width: 100%;
  111. }
  112. }
  113. </style>
  114. <div class="w1200 m0a application-center">
  115. <script language="javascript" src="{{static_url('js/dist/nestable/jquery.nestable.js')}}"></script>
  116. <link rel="stylesheet" type="text/css" href="{{static_url('js/dist/nestable/nestable.css')}}" />
  117. <!--应用列表样式-->
  118. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/plugins/list-icon/css/list-icon.css')}}">
  119. <!-- 左侧导航栏 -->
  120. <section class="left-box" id="plugins_list_left">
  121. @foreach( $class as $key1 => $value)
  122. @if(is_array($data[$key1]))
  123. <div class="nav-detail" >
  124. <i class="fa"></i><span>{{ $value['name'] }}</span>
  125. </div>
  126. @endif
  127. @endforeach
  128. </section>
  129. <div class="rigth-box">
  130. <!-- 新增加右侧顶部三级菜单 -->
  131. <div style="position: fixed; right: 20px; top: 60px;z-index:999">
  132. <input id="key" type="text" class="el-input__inner" style="width: 150px;height: 32px;line-height: 32px;" placeholder="请输入关键字" />
  133. <input type="button" class="el-button el-button--small" value="下一个" onclick="next()" />
  134. <input type="button" class="el-button el-button--small" value="上一个" onclick="previous()" />
  135. </div>
  136. <div class="row">
  137. @foreach( $class as $key1 => $value)
  138. @if(is_array($data[$key1]))
  139. <div class="panel panel-default">
  140. <div class="panel-heading" style="background-color: #f6f6f6">
  141. <h3 class="panel-title">
  142. <div class="nav-line"></div>
  143. {{ $value['name'] }}
  144. </h3>
  145. </div>
  146. <div class="panel-body">
  147. @foreach($data[$key1] as $key => $plugin)
  148. @if(can($key))
  149. <div class=" col-lg-3 col-md-4 col-sm-4" style="display:flex; align-items: center;">
  150. <a href="{{yzWebFullUrl($plugin['url']).'&'.$plugin['url_params']}}" class="plugin-a col-md-10 col-sm-12" style="display:flex;height:85px">
  151. <div class="plugin-i-div" style="flex: 0 0 50px;">
  152. <i class="plugin-i" style="background-color: {{$value['color']}}; background-image: url({{ $plugin['icon_url'] }})"></i>
  153. </div>
  154. <div class="plugin-span">
  155. <div style="display: flex;">
  156. <span style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width: 150px; display:block;">{{$plugin['name']}}</span>
  157. <object style="height:0px" style="flex: 0 0 20px;">
  158. <a class="top_show" style="display: none;position:relative;top:3px;padding-left:5px;" href="{{yzWebUrl('plugins.setTopShow',['name'=>$key,'action'=>(app('plugins')->isTopShow($key) ? 1 : 0)])}}">
  159. <i class="fa fa-tags" @if(app('plugins')->isTopShow($key))style="color: red;position: absolute;" @endif
  160. data-toggle="tooltip" data-placement="top" style="position: absolute;"
  161. @if(app('plugins')->isTopShow($key))title="取消顶部显示?" @else title="选择顶部显示?"@endif></i>
  162. </a>
  163. </object>
  164. </div>
  165. <div class="description">{{$plugin['description']}}</div>
  166. <!-- <span class="description">{{$plugin['description']}}</span> -->
  167. <span class="icon_detail">
  168. @if(in_array('wechat',$plugin['terminal'])) <i class="iconfont icon-all_wechat_public" style="margin-left: 10px;color: #0cb287;"></i> @endif</i>
  169. @if(in_array('min',$plugin['terminal'])) <i class="iconfont icon-all_smallprogram" style="margin-left: 10px;color: #52b459;"></i> @endif</i>
  170. @if(in_array('wap',$plugin['terminal'])) <i class="iconfont icon-ht_btn_wap" style="margin-left: 10px;color: #5632f4;"></i> @endif</i>
  171. </span>
  172. </div>
  173. {{--<span class="plugin-span-down">{{$plugin['description']}}</span>--}}
  174. </a>
  175. </div>
  176. @endif
  177. @endforeach
  178. </div>
  179. </div>
  180. @endif
  181. @endforeach
  182. <div>
  183. </div>
  184. </div>
  185. <!-- <script src="{{static_url('js/pluginslist.js')}}"></script> -->
  186. <script src="{{resource_get('resources/views/admin/pluginslist.js?time='.time())}}"></script>
  187. @endsection
  188. <style type="text/css">
  189. .res {
  190. color: Red;
  191. }
  192. .result {
  193. background: yellow;
  194. }
  195. </style>
  196. <script type="text/javascript">
  197. var oldKey = "";
  198. var index = -1;
  199. var pos = new Array(); //用于记录每个关键词的位置,以方便跳转
  200. var oldCount = 0; //记录搜索到的所有关键词总数
  201. // 先获取全部再添类名
  202. function checkIcon(str) {
  203. switch (str) {
  204. case '入口类' :
  205. return 'fa-star';
  206. case '行业类' :
  207. return 'fa-sitemap';
  208. case '营销类' :
  209. return 'fa-money';
  210. case '企业管理类' :
  211. return 'fa-suitcase';
  212. case '工具类' :
  213. return 'fa-tags';
  214. case '门店应用类' :
  215. return 'fa-truck';
  216. case '区块链类' :
  217. return 'fa-chain';
  218. default :
  219. return 'fa-cubes';
  220. }
  221. }
  222. function checkScroll() {
  223. // 默认是第一个
  224. $('.nav-detail').eq(0).addClass('selected');
  225. // 监听滚动添加选中
  226. $('.panel-title').each(function (i,ele) {
  227. if ($(document).scrollTop() >= $(ele).offset().top - 100){
  228. $('.nav-detail').eq(i).addClass('selected').siblings().removeClass('selected')
  229. }
  230. })
  231. }
  232. function previous() {
  233. index--;
  234. index = index < 0 ? oldCount - 1 : index;
  235. search();
  236. }
  237. function next() {
  238. ++index;
  239. //index = index == oldCount ? 0 : index;
  240. if (index == oldCount) {
  241. index = 0;
  242. }
  243. search();
  244. }
  245. function search() {
  246. $(".result").removeClass("res"); //去除原本的res样式
  247. var key = $("#key").val(); //取key值
  248. if (!key) {
  249. // console.log("key为空则退出");
  250. $(".result").each(function() { //恢复原始数据
  251. $(this).replaceWith($(this).html());
  252. });
  253. oldKey = "";
  254. return; //key为空则退出
  255. }
  256. if (oldKey != key) {
  257. // console.log("进入重置方法");
  258. //重置
  259. index = 0;
  260. $(".result").each(function() {
  261. $(this).replaceWith($(this).html());
  262. });
  263. pos = new Array();
  264. var regExp = new RegExp(key + '(?!([^<]+)?>)', 'ig'); //正则表达式匹配
  265. $(".row").html($(".row").html().replace(regExp, "<span id='result" + index + "' class='result'>" + key + "</span>")); // 高亮操作
  266. $("#key").val(key);
  267. oldKey = key;
  268. $(".result").each(function() {
  269. pos.push($(this).offset().top);
  270. });
  271. oldCount = $(".result").length;
  272. // console.log("oldCount值:", oldCount);
  273. }
  274. $(".result:eq(" + index + ")").addClass("res"); //当前位置关键词改为红色字体
  275. // $("body").scrollTop(pos[index]);//跳转到指定位置
  276. window.scrollTo(0, pos[index] - 60);
  277. // console.log(pos[index]);
  278. // console.log(index);
  279. }
  280. </script>
  281. <!-- 左侧导航栏 -->
  282. <script type="text/javascript">
  283. window.onload = function() {
  284. // 循环添加图标
  285. for(let index=0; index<$('.nav-detail').length; index++) {
  286. $('.nav-detail').eq(index).children("i").addClass(checkIcon($('.nav-detail').eq(index).children("span").text()));
  287. }
  288. checkScroll();
  289. let flag = true
  290. // 移动滚动条,使左侧导航有相应的变化
  291. $(document).scroll(function (e) {
  292. if (flag){
  293. checkScroll();
  294. }
  295. });
  296. // 点击左侧导肮,滑到对应的元素上
  297. let {prevObject} = $(".nav-detail").find("*")
  298. let dataList = []
  299. for(let i = 0;i<prevObject.length;i++){
  300. dataList.push(prevObject[i].innerText)
  301. }
  302. $(".nav-detail").bind("click",function(data){
  303. flag = false
  304. $(this).siblings('div').removeClass('selected'); // 删除其他兄弟元素的样式
  305. $(this).addClass('selected');
  306. let name = data.currentTarget.innerText //获取左侧导航的name
  307. let index = dataList.indexOf(name) //获取左侧导航的下标值
  308. $('html,body').animate({ scrollTop: $(".panel-title").eq(index).offset().top - 60}, ()=>{
  309. flag = true
  310. })
  311. });
  312. // 点击回车
  313. $('#key').keyup(function(e){
  314. if(e.keyCode===13){
  315. next()
  316. }
  317. })
  318. }
  319. </script>