push.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  5. {{--<link href="{{asset('js/plugins/bootstrap-select-1.13.5/css/bootstrap-select.min.css')}}" rel="stylesheet">--}}
  6. <link rel="stylesheet"
  7. href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
  8. @endsection
  9. @section('content')
  10. <body class="gray-bg">
  11. <div class="wrapper wrapper-content animated fadeInRight">
  12. <div class="row">
  13. <div class="col-sm-12">
  14. <div class="ibox float-e-margins">
  15. <div class="ibox-content">
  16. <form method="get" class="form-horizontal" id="form">
  17. {{-- <div class="form-group">
  18. <label class="col-sm-2 control-label" for="order_at"><span
  19. class="red">* </span>到期时间:</label>
  20. <div class="col-sm-4">
  21. <div class="input-group m-b">
  22. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  23. <input type="text" class="form-control" id="expireDate" name="expireDate"
  24. value="" autocomplete="off">
  25. </div>
  26. </div>
  27. </div>--}}
  28. {{-- <div class="form-group">
  29. <label class="col-sm-2 control-label" for="database">联系电话:</label>
  30. <div class="col-sm-4">
  31. <input type="text" class="form-control" id="mobile" name="mobile"
  32. value="">
  33. </div>
  34. </div>--}}
  35. <div class="form-group" id="siteAssign">
  36. <label class="col-sm-2 control-label" for="site_ids">站点分配:</label>
  37. <div class="col-sm-2">
  38. {{--<select class="chosen-select form-control" data-placeholder="选择站点..." multiple--}}
  39. <select class="selectpicker form-control"
  40. id="site_ids" name="site_ids" data-live-search="true" multiple
  41. title="请选择站点" autocomplete="off">
  42. <option value="">请选择站点</option>
  43. @foreach ($siteList as $site)
  44. <option value="{{$site->id}}"
  45. >{{$site->cn_title}}</option>
  46. @endforeach
  47. </select>
  48. </div>
  49. </div>
  50. {{-- <div class="form-group">
  51. <label class="col-sm-2 control-label" for="type"><span
  52. class="red">* </span>项目名称:</label>
  53. <div class="col-sm-8">
  54. <select class="form-control" style="width:350px;"
  55. id="siteId" name="siteId">
  56. <option value="0">请选择推送的项目</option>
  57. @foreach($siteList as $role)
  58. <option value="{{$role->id}}">{{$role->cn_title}}</option>
  59. @endforeach
  60. </select>
  61. </div>
  62. </div>--}}
  63. <div class="form-group">
  64. <div class="col-sm-4 col-sm-offset-2">
  65. <button class="btn btn-primary" type="button" data-id="{{$id??0}}" id="save">
  66. 推送消息
  67. </button>
  68. <button class="btn btn-white" type="button" id="cancel">取消</button>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </body>
  78. @endsection
  79. @section('footer')
  80. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  81. <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
  82. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  83. <script>
  84. $(function () {
  85. laydate.render({
  86. elem: '#expireDate', //指定元素
  87. type: 'datetime'
  88. });
  89. });
  90. var jsSwitch = document.querySelector(".js-switch");
  91. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  92. $(document).on('click', '#cancel', function () {
  93. tips.closeParentLayer();
  94. });
  95. $(document).on('click', '#save', function () {
  96. var data = tips.getFormValues('#form');
  97. data.id = $(this).data('id');
  98. data.siteIds = $("#site_ids").val();
  99. var url = '/admin/message/push/' + data.id;
  100. var type = 'get';
  101. var ajaxConfig = {
  102. url: url,
  103. type: type,
  104. data: data,
  105. success: function (result) {
  106. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  107. tips.closeParentLayer();
  108. window.parent.tips.tableRefresh('#table');
  109. });
  110. }
  111. };
  112. tips.ajax(ajaxConfig);
  113. });
  114. </script>
  115. @endsection