social_publish_bak.blade.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. <link rel="stylesheet" href="{{asset('js/plugins/zTree_v3-master/css/zTreeStyle/zTreeStyle.css')}}">
  4. <style type="text/css">
  5. .ztree li span.button.add {
  6. margin-left: 2px;
  7. margin-right: -1px;
  8. background-position: -144px 0;
  9. vertical-align: top;
  10. *vertical-align: middle
  11. }
  12. .ztree li span.button.reset {
  13. margin-right: 2px;
  14. background-position: -110px -48px;
  15. vertical-align: top;
  16. *vertical-align: middle
  17. }
  18. </style>
  19. @endsection
  20. @section('right')
  21. <div class="row">
  22. <div class="col-sm-3">
  23. <div class="ibox float-e-margins">
  24. <div class="ibox-title">
  25. 平台页面
  26. </div>
  27. <div class="ibox-content">
  28. <ul id="treeDemo" class="ztree"></ul>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="col-sm-9">
  33. <div class="ibox float-e-margins">
  34. <div class="ibox-title">概要
  35. {{--<button class="btn btn-info" type="button" style="float: right;margin: 0 5px;padding: 4px 12px"--}}
  36. {{--onclick="units.batchDelete()">删除--}}
  37. {{--</button>--}}
  38. {{--<button class="btn btn-info" type="button" style="float: right;margin: 0 5px;padding: 4px 12px"--}}
  39. {{--onclick="units.saveView(0)">添加--}}
  40. {{--</button>--}}
  41. </div>
  42. <div class="ibox-content">
  43. <form id="form">
  44. <div class="form-group">
  45. <label>主标题</label>
  46. <input type="text" placeholder="" class="form-control" id="title" name="title">
  47. </div>
  48. {{--<div class="form-group">--}}
  49. {{--<label>副标题</label>--}}
  50. {{--<input type="text" placeholder="" class="form-control" id="subtitle" name="subtitle">--}}
  51. {{--</div>--}}
  52. <div class="form-group">
  53. <label>uri地址</label>
  54. <input type="text" placeholder="" class="form-control" id="uri" name="uri">
  55. </div>
  56. <div class="form-group">
  57. <label>缩略图 </label>
  58. <img
  59. src="http://admin.yinqingli.com/storage/201906/jpg/1Q987Ryl6mdPFhJljhy5O1EhPol9M79dSVFbGnod.jpeg"
  60. alt="" style="height: 100px" id="thumb">
  61. </div>
  62. <div class="form-group">
  63. <label>内容摘要</label>
  64. <textarea class="form-control" rows="5" placeholder="" id="summary"
  65. name="summary"></textarea>
  66. </div>
  67. <div class="hr-line-dashed"></div>
  68. <div class="form-group">
  69. <label>需填内容</label>
  70. </div>
  71. <div class="form-group">
  72. <label for="release_at">发布日期:</label>
  73. <div>
  74. <div class="input-group m-b">
  75. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  76. <input type="text" class="form-control" id="release_at" name="release_at">
  77. </div>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <label for="release_interval">发布间隔:</label>
  82. <div>
  83. <div class="input-group m-b">
  84. <input type="text" class="form-control" name="release_interval"
  85. id="release_interval">
  86. <span class="input-group-addon">天</span>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label for="release_interval">linkedIn组织ID:</label>
  92. <div>
  93. <div class="input-group m-b">
  94. {{$linkedInOrgId}}
  95. </div>
  96. </div>
  97. </div>
  98. <div class="form-group">
  99. <label for="pin_board">pinterest board:</label>
  100. <div>
  101. <div class="input-group m-b">
  102. @if($boardsErr==null)
  103. <select name="pin_board" id="pin_board" class="form-control">
  104. <option value="">请选择board</option>
  105. @foreach($boards as $board)
  106. <option value="{{$board}}">{{$board}}</option>
  107. @endforeach
  108. </select>
  109. @else
  110. <input type="hidden" name="pin_board" id="pin_board" value="">
  111. {{$boardsErr}}
  112. @endif
  113. </div>
  114. </div>
  115. </div>
  116. <button class="btn btn-info btn-sm" type="button" onclick="units.syncSocial()">同步社交</button>
  117. </form>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. @endsection
  123. @section('footer_extend')
  124. <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.core.min.js')}}"></script>
  125. {{--<script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.exedit.min.js')}}"></script>--}}
  126. <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.excheck.min.js')}}"></script>
  127. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  128. <script>
  129. laydate.render({
  130. elem: '#release_at', //指定元素
  131. type: 'datetime'
  132. });
  133. var zTreeObj;
  134. // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
  135. var setting = {
  136. check: {
  137. enable: true,
  138. chkboxType: {"Y": "s", "N": "s"}
  139. },
  140. data: {
  141. simpleData: {
  142. enable: true
  143. }
  144. },
  145. callback: {
  146. onClick: function (event, treeId, treeNode) {
  147. // config.otherParams = {parentId: treeNode.id};
  148. console.log(treeNode);
  149. $("#title").val(treeNode.name);
  150. // $("#subtitle").val(treeNode.subtitle);
  151. $("#summary").val(treeNode.summary);
  152. $("#thumb").attr('src', '{{sprintf('http://%s',$site->domain)}}' + treeNode.thumb);
  153. $("#uri").val(treeNode.uri);
  154. // tips.tableRefresh();
  155. }
  156. }
  157. // edit: {
  158. // enable: true,
  159. // showRenameBtn: false,
  160. // showRemoveBtn: false
  161. // }
  162. // view: {
  163. // addHoverDom: units.addHoverDom,
  164. // removeHoverDom: function (treeId, treeNode) {
  165. // $("#addBtn_" + treeNode.tId).unbind().remove();
  166. // $("#resetBtn_" + treeNode.tId).unbind().remove();
  167. // },
  168. // selectedMulti: false
  169. // }
  170. };
  171. // zTree 的数据属性,深入使用请参考 API 文档(zTreeNode 节点数据详解)
  172. var trees = JSON.parse('{!! addslashes(json_encode($trees)) !!}');
  173. console.log(trees);
  174. $(document).ready(function () {
  175. zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, trees);
  176. });
  177. var units = {
  178. syncSocial: function () {
  179. {{--var data = tips.getFormValues('#form');--}}
  180. {{--data.thumb = $("#thumb").attr('src');--}}
  181. {{--var ajaxConfig = {--}}
  182. {{--url: '/admin/sites/' + {{$siteId}} +'/social-publish',--}}
  183. {{--type: 'post',--}}
  184. {{--data: data--}}
  185. {{--};--}}
  186. {{--tips.ajax(ajaxConfig);--}}
  187. var checkedNodes = zTreeObj.getCheckedNodes();
  188. var nodeIds = [];
  189. $.each(checkedNodes, function (inx, val) {
  190. nodeIds.push(val.id);
  191. });
  192. var ajaxConfig = {
  193. url: '/admin/sites/' + {{$siteId}} +'/social-publish',
  194. type: 'post',
  195. data: {
  196. checkIds: nodeIds,
  197. release_at: $("#release_at").val(),
  198. release_interval: $("#release_interval").val(),
  199. pin_board: $("#pin_board").val()
  200. }
  201. };
  202. tips.ajax(ajaxConfig);
  203. }
  204. };
  205. </script>
  206. @endsection