You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.7 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '轮播图修改')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/slide">轮播图列表</a> > 轮播图修改</h5>
  5. <form id="addarc" method="post" action="/fladmin/slide/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  6. <table class="table table-striped table-bordered">
  7. <tbody>
  8. <tr>
  9. <td align="right">标题:</td>
  10. <td><input name="title" type="text" id="title" value="<?php echo $post['title']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
  11. </tr>
  12. <tr>
  13. <td align="right">链接网址:</td>
  14. <td><input name="url" type="text" id="url" value="<?php echo $post['url']; ?>" style="width:60%" class="required"> (请用绝对地址)</td>
  15. </tr>
  16. <tr>
  17. <td align="right">跳转方式:</td>
  18. <td>
  19. <input type="radio" value='0' name="target" <?php if(isset($post['target']) && $post['target']==0){echo 'checked';} ?> />&nbsp;_blank&nbsp;&nbsp;
  20. <input type="radio" value='1' name="target" <?php if(isset($post['target']) && $post['target']==1){echo 'checked';} ?> />&nbsp;_self
  21. </td>
  22. </tr>
  23. <tr>
  24. <td align="right">是否显示:</td>
  25. <td>
  26. <input type="radio" value='0' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
  27. <input type="radio" value='1' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==1){echo 'checked';} ?> />&nbsp;否
  28. </td>
  29. </tr>
  30. <tr>
  31. <td align="right">排序:</td>
  32. <td>
  33. <input name="rank" type="text" id="rank" value="<?php echo $post['rank']; ?>" size="3" />
  34. </td>
  35. </tr>
  36. <tr>
  37. <td align="right">所属的组:</td>
  38. <td>
  39. <input name="group_id" type="text" id="group_id" value="<?php echo $post['group_id']; ?>" size="3" />
  40. </td>
  41. </tr>
  42. <tr>
  43. <td style="vertical-align:middle;" align="right">图片:</td>
  44. <td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="pic" type="text" id="pic" value="<?php echo $post['pic']; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["pic"]) || !imgmatch($post["pic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["pic"])){echo $post["pic"];} ?>" width="120" height="80" id="picview"></td>
  45. </tr>
  46. <!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
  47. <!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
  48. <script type="text/javascript">
  49. var _editor;
  50. $(function() {
  51. //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
  52. _editor = UE.getEditor('ueditorimg');
  53. _editor.ready(function () {
  54. //设置编辑器不可用
  55. _editor.setDisabled('insertimage');
  56. //隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
  57. _editor.hide();
  58. //侦听图片上传
  59. _editor.addListener('beforeInsertImage', function (t, arg) {
  60. //将地址赋值给相应的input,只取第一张图片的路径
  61. $('#pic').val(arg[0].src);
  62. //图片预览
  63. $('#picview').attr("src",arg[0].src).css("display","inline-block");
  64. })
  65. });
  66. });
  67. //弹出图片上传的对话框
  68. function upImage()
  69. {
  70. var myImage = _editor.getDialog("insertimage");
  71. myImage.render();
  72. myImage.open();
  73. }
  74. </script>
  75. <script type="text/plain" id="ueditorimg"></script>
  76. <tr>
  77. <td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
  78. </tr>
  79. </tbody></table></form><!-- 表单结束 -->
  80. <script>
  81. $(function(){
  82. $(".required").blur(function(){
  83. var $parent = $(this).parent();
  84. $parent.find(".formtips").remove();
  85. if(this.value=="")
  86. {
  87. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  88. }
  89. else
  90. {
  91. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  92. }
  93. });
  94. //重置
  95. $('#addarc input[type="reset"]').click(function(){
  96. $(".formtips").remove();
  97. });
  98. $("#addarc").submit(function(){
  99. $(".required").trigger('blur');
  100. var numError = $('#addarc .onError').length;
  101. if(numError){return false;}
  102. });
  103. });
  104. </script>
  105. @endsection