save.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css?v=1')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css?v=1')}}" rel="stylesheet">
  5. <link href="{{asset('js/plugins/bootstrap-select-1.13.5/css/bootstrap-select.min.css')}}" rel="stylesheet">
  6. @endsection
  7. @section('content')
  8. <body class="gray-bg">
  9. <div class="wrapper wrapper-content animated fadeInRight">
  10. <div class="row">
  11. <div class="col-sm-12">
  12. <div class="ibox float-e-margins">
  13. <div class="ibox-content">
  14. <form method="get" class="form-horizontal" id="form">
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label" for="type">外链类型:</label>
  17. <div class="col-sm-8 ">
  18. <select class=" form-control"
  19. id="type" name="type" data-live-search="true"
  20. title="请选择外链类型" autocomplete="off">
  21. @foreach ($typeList as $key=>$item)
  22. <option value="{{$key}}"
  23. @if(($data->type??null)==$key) selected @endif>{{$item}}</option>
  24. @endforeach
  25. </select>
  26. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-sm-2 control-label" for="tag">标签:</label>
  30. <div class="col-sm-8">
  31. <input type="text" class="form-control" id="tag" name="tag"
  32. value="{{$data->tag??''}}">
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label" for="url">平台链接:</label>
  37. <div class="col-sm-8">
  38. <input type="text" class="form-control" id="url" name="url"
  39. value="{{$data->url??''}}">
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="col-sm-2 control-label" for="cost">费用:</label>
  44. <div class="col-sm-8">
  45. <select class="selectpicker form-control"
  46. id="cost" name="cost" data-live-search="true" multiple
  47. title="费用" autocomplete="off">
  48. <option value="1"
  49. @if(isset($data->cost) && in_array(1,explode(',',$data->cost))) selected @endif>
  50. 免费
  51. </option>
  52. <option value="2"
  53. @if(isset($data->cost) && in_array(2,explode(',',$data->cost))) selected @endif>
  54. 付费
  55. </option>
  56. </select>
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-sm-2 control-label" for="business_ids">行业:</label>
  61. <div class="col-sm-8">
  62. <select class="selectpicker form-control"
  63. id="business_ids" name="business_ids" data-live-search="true" multiple
  64. title="请选择行业" autocomplete="off">
  65. @foreach ($businesses as $business)
  66. <option value="{{$business->id}}"
  67. @if(isset($data->business_ids) && in_array($business->id,explode(',',$data->business_ids))) selected @endif>{{$business->title}}</option>
  68. @endforeach
  69. </select>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label class="col-sm-2 control-label" for="country">国家:</label>
  74. <div class="col-sm-8">
  75. <input type="text" class="form-control" id="country" name="country"
  76. value="{{$data->country??''}}">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-sm-2 control-label" for="big_ball">锚文本:</label>
  81. <div class="col-sm-8 ">
  82. <select class=" form-control"
  83. id="big_ball" name="big_ball" data-live-search="true"
  84. title="请选择锚文本" autocomplete="off">
  85. <option value="0" @if(($data->big_ball??null)==0) selected @endif>否</option>
  86. <option value="1" @if(($data->big_ball??null)==1) selected @endif>是</option>
  87. </select>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label class="col-sm-2 control-label" for="quantitative_restrictions">数量限制:</label>
  92. <div class="col-sm-8">
  93. <input type="text" class="form-control" id="quantitative_restrictions"
  94. name="quantitative_restrictions"
  95. value="{{$data->quantitative_restrictions??''}}">
  96. </div>
  97. </div>
  98. <div class="form-group">
  99. <label class="col-sm-2 control-label" for="phone_verification">手机验证:</label>
  100. <div class="col-sm-8 ">
  101. <select class=" form-control"
  102. id="phone_verification" name="phone_verification" data-live-search="true"
  103. title="手机验证" autocomplete="off">
  104. <option value="0" @if(($data->phone_verification??null)==0) selected @endif>否
  105. </option>
  106. <option value="1" @if(($data->phone_verification??null)==1) selected @endif>是
  107. </option>
  108. </select>
  109. </div>
  110. </div>
  111. <div class="form-group">
  112. <label class="col-sm-2 control-label" for="timed_release">定时发布:</label>
  113. <div class="col-sm-8 ">
  114. <select class=" form-control"
  115. id="timed_release" name="timed_release" data-live-search="true"
  116. title="定时发布" autocomplete="off">
  117. <option value="0" @if(($data->timed_release??null)==0) selected @endif>否
  118. </option>
  119. <option value="1" @if(($data->timed_release??null)==1) selected @endif>是
  120. </option>
  121. </select>
  122. </div>
  123. </div>
  124. <div class="form-group">
  125. <label class="col-sm-2 control-label" for="authority_score">Authority Score:</label>
  126. <div class="col-sm-8">
  127. <input type="text" class="form-control" id="authority_score" name="authority_score"
  128. value="{{$data->authority_score??''}}">
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="col-sm-2 control-label" for="spam_score">Spam Score:</label>
  133. <div class="col-sm-8">
  134. <input type="text" class="form-control" id="spam_score" name="spam_score"
  135. value="{{$data->spam_score??''}}">
  136. </div>
  137. </div>
  138. <div class="form-group">
  139. <label class="col-sm-2 control-label" for="home_page">个人主页加网址:</label>
  140. <div class="col-sm-8 ">
  141. <select class=" form-control"
  142. id="home_page" name="home_page" data-live-search="true"
  143. title="个人主页加网址" autocomplete="off">
  144. <option value="0" @if(($data->home_page??null)==0) selected @endif>否
  145. </option>
  146. <option value="1" @if(($data->home_page??null)==1) selected @endif>是
  147. </option>
  148. </select>
  149. </div>
  150. </div>
  151. <div class="form-group">
  152. <label class="col-sm-2 control-label" for="remark">备注:</label>
  153. <div class="col-sm-8">
  154. <textarea class="form-control" id="remark"
  155. name="remark">{{$data->remark??''}}</textarea>
  156. </div>
  157. </div>
  158. <div class="hr-line-dashed"></div>
  159. <div class="form-group">
  160. <div class="col-sm-4 col-sm-offset-2">
  161. <button class="btn btn-primary" type="button"
  162. onclick="units.save({{$data->id??0}})">
  163. 保存
  164. </button>
  165. <button class="btn btn-white closeLayer" type="button">取消</button>
  166. </div>
  167. </div>
  168. </form>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </body>
  175. @endsection
  176. @section('footer')
  177. <script src="{{asset('js/plugins/switchery/switchery.js?v=1')}}"></script>
  178. <script src="{{asset('js/plugins/bootstrap-select-1.13.9/dist/js/bootstrap-select.min.js')}}"></script>
  179. <script>
  180. var units = {
  181. save: function (id) {
  182. var url = '/admin/link/' + id + '/save';
  183. var data = tips.getFormValues('#form');
  184. if ($("#business_ids").val()) {
  185. data.business_ids = $("#business_ids").val().toLocaleString();
  186. }
  187. if ($("#cost").val()) {
  188. data.cost = $("#cost").val().toLocaleString();
  189. }
  190. var ajaxConfig = {
  191. url: url,
  192. type: 'put',
  193. data: data,
  194. success: function (result) {
  195. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  196. tips.closeParentLayer();
  197. window.parent.tips.tableRefresh('#table');
  198. });
  199. }
  200. };
  201. tips.ajax(ajaxConfig);
  202. }
  203. };
  204. </script>
  205. @endsection