keyword.blade.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight">
  8. <iframe
  9. src="https://rank.yinqingli.cn/report/keyword/id--{{md5($site->old_id??0)}}--sortby--google_rank--is_customer--1.html"
  10. frameborder="0" width="100%" height="800px">
  11. </iframe>
  12. </div>
  13. </body>
  14. @endsection
  15. @section('footer')
  16. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  17. <script>
  18. var jsSwitch = document.querySelector(".js-switch");
  19. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  20. var openIndex;
  21. var units = {
  22. import: function () {
  23. var str = '<div class="ibox-content" id="importLayer">' +
  24. '<form class="form-horizontal">' +
  25. '<div class="form-group">' +
  26. '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
  27. '<div class="col-sm-6">' +
  28. '<input type="file" id="excel_file" class="form-control">' +
  29. '<input type="hidden" id="excel_path">' +
  30. '</div>' +
  31. '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
  32. '</div>' +
  33. ' <div class="form-group">' +
  34. '<div class="col-sm-6 col-sm-offset-3">' +
  35. '<a href="{{asset('keyword.xlsx')}}">请下载导入模板</a>' +
  36. '</div>' +
  37. '</div>' +
  38. '</form>' +
  39. '</div>';
  40. openIndex = layer.open({
  41. type: 1,
  42. content: str,
  43. area: ['60%', '30%'],
  44. // btn: ['导入', '取消'],
  45. title: '导入关键词',
  46. yes: function (index, layero) {
  47. {{--var data = {excel_path: $("#excel_path").val(), siteId: "{{$siteId}}"};--}}
  48. {{--var config = {--}}
  49. {{--url: '/admin/rank/keyword/import',--}}
  50. {{--type: 'post',--}}
  51. {{--data: data,--}}
  52. {{--success: function (result) {--}}
  53. {{--layer.msg(result.message, {icon: 6, time: 1500}, function () {--}}
  54. {{--layer.close(openIndex);--}}
  55. {{--});--}}
  56. {{--}--}}
  57. {{--};--}}
  58. {{--tips.ajax(config);--}}
  59. }
  60. });
  61. },
  62. fileUpload: function () {
  63. var config = {
  64. url: '/admin/tool/excel-upload'
  65. };
  66. config.success = function (result) {
  67. // $("#excel_path").val(result.data.file_url);
  68. // layer.msg(result.message, {icon: 6, time: 1500});
  69. var data = {excel_path: result.data.file_url, siteId: "{{$siteId}}"};
  70. var config = {
  71. url: '/admin/rank/keyword/import',
  72. type: 'post',
  73. data: data,
  74. success: function (result) {
  75. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  76. layer.close(openIndex);
  77. window.location.reload();
  78. });
  79. }
  80. };
  81. tips.ajax(config);
  82. };
  83. tips.fileUpload($("#excel_file"), config);
  84. },
  85. add: function () {
  86. layer.open({
  87. type: 2,
  88. content: ['/admin/rank/site/{{$siteId}}/keyword-save'],
  89. area: ['80%', '90%'],
  90. title: '添加关键词'
  91. });
  92. },
  93. clear: function () {
  94. layer.confirm('您确定要清空全部关键词吗?', {icon: 3, title: '清空'}, function () {
  95. var config = {
  96. url: '/admin/rank/site/{{$siteId}}/keyword/all',
  97. type: 'delete'
  98. };
  99. tips.ajax(config);
  100. });
  101. },
  102. save: function () {
  103. var config = {
  104. type: 'put',
  105. url: '/admin/rank/allow-rank/{{$site->old_id??0}}',
  106. data: {isAllow: jsSwitch.checked ? 1 : 0, number: $("#cloud_type").val()}
  107. };
  108. tips.ajax(config);
  109. }
  110. {{--allowRank: function (_this) {--}}
  111. {{--if (_this.checked) {--}}
  112. {{--}--}}
  113. {{--var config = {--}}
  114. {{--type: 'put',--}}
  115. {{--url: '/admin/rank/allow-rank/{{$site->old_id??0}}',--}}
  116. {{--data: {isAllow: _this.checked ? 1 : 0}--}}
  117. {{--};--}}
  118. {{--tips.ajax(config);--}}
  119. {{--}--}}
  120. };
  121. </script>
  122. @endsection