Sin descripción

edit.blade.php 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. @if(count($errors) > 0)
  5. <div class="Huialert Huialert-info" id="error">
  6. @foreach($errors->all() as $error)
  7. <li>{{$error}}</li>
  8. @endforeach
  9. </div>
  10. @endif
  11. <div class="page-container">
  12. <form action="/admin/goods/update" method="post" class="form form-horizontal" enctype="multipart/form-data">
  13. <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  14. <input type="hidden" name="id" value="{{$id}}" />
  15. <input type="hidden" name="page" value="{{$page}}">
  16. <div class="row cl">
  17. <label class="form-label col-xs-4 col-sm-2">
  18. 商品标题:</label>
  19. <div class="formControls col-xs-6 col-sm-6">
  20. <input type="text" class="input-text" value="{{$goods['name']}}" placeholder="" name="name">
  21. </div>
  22. </div>
  23. <div class="row cl">
  24. <label class="form-label col-xs-4 col-sm-2">
  25. 商品图片:</label>
  26. <div class="formControls col-xs-6 col-sm-6">
  27. <div><img width="100" src="{{$goods['picUrl']?$goods['picUrl']:'/empty.png'}}"/></div><br>
  28. <span class="btn-upload">
  29. <input class="input-text upload-url radius" type="text" name="uploadfile-1" id="uploadfile-1" readonly><a href="javascript:void();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe642;</i> 上传图片</a>
  30. <input type="file" multiple name="img" class="input-file">
  31. </span><br>
  32. 文件类型支持:jpg ,png ,ico ,文件大小不能超过1M
  33. </div>
  34. </div>
  35. <div class="row cl">
  36. <label class="form-label col-xs-4 col-sm-2">
  37. 商品描述:</label>
  38. <div class="formControls col-xs-6 col-sm-6">
  39. <textarea class="textarea" name="description">{{$goods['description']}}</textarea>
  40. </div>
  41. </div>
  42. <!--div class="row cl">
  43. <label class="form-label col-xs-4 col-sm-2">添加规格:</label>
  44. <div class="formControls col-xs-6 col-sm-6">
  45. <span class="select-box">
  46. 规格:<input type='text' value="" placeholder="示例:500克/包" name="propsName"/>
  47. &nbsp;&nbsp;价格:<input type="text" value="" placeholder="请填写对应规格价格(数字格式)" name="price">元
  48. &nbsp;&nbsp;<button type='button' onclick='add_goods()'> 确认</button>
  49. </span>
  50. </div>
  51. </div><br-->
  52. <div class="row cl">
  53. <label class="form-label col-xs-4 col-sm-2">
  54. 已有规格:</label>
  55. <div id = 'goods_o' class="formControls col-xs-6 col-sm-6">
  56. @foreach( $sku_list as $sku )
  57. <p id='sku{{$sku["id"]}}'><font style='font-weight:bold;'>规格:</font>{{$sku['propsName']}}; &nbsp; </p>
  58. @endforeach
  59. </div>
  60. <input type='hidden' name='del_sku_ids' value = ''/>
  61. </div><br>
  62. <div class="row cl">
  63. <div class="col-9 col-offset-2">
  64. <button class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">&nbsp;&nbsp;修改&nbsp;&nbsp;</button>&nbsp;
  65. <button class="btn btn-default" type="reset" onclick="return_index();">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>&nbsp;
  66. {{--<a href="javascript:void(0)" class="btn btn-default radius" onclick="redirect('{{url('/admin/admin/all')}}')">返回并查看结果</a>--}}
  67. </div>
  68. </div>
  69. </form>
  70. </div>
  71. <!--_footer 作为公共模版分离出去-->
  72. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  73. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  74. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  75. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  76. <!--/_footer 作为公共模版分离出去-->
  77. <!--请在下方写此页面业务相关的脚本-->
  78. <script type="text/javascript">
  79. $(function(){
  80. setTimeout("$('#error').hide()",3000);
  81. });
  82. /*返回*/
  83. function return_index(){
  84. location.href='/admin/goods/index';
  85. }
  86. //全局变量
  87. id_n = -101;
  88. function add_goods(){
  89. id_n++;
  90. var propsName = $("input[name=propsName]").val();
  91. var price = $("input[name=price]").val();
  92. var str = "<p id='sku"+id_n+"'><font style='font-weight:bold;'>规格:<\/font>"+propsName+ " <font style='font-weight:bold;'>价格:<\/font>"+price+";"+ "&nbsp;&nbsp;<button type='button' onclick='del_sku("+id_n+")'> 移除<\/button> <input type='hidden' name='sku[]' value='"+propsName+'@@'+price+"'\/> " +"<\/p>";
  93. $("#goods_o").append(str);
  94. return false;
  95. }
  96. function del_sku_y(id){
  97. var del_id = $("input[name=del_sku_ids]").val();
  98. var del_ids = del_id + id+',';
  99. $("input[name=del_sku_ids]").val(del_ids);
  100. $("#sku"+id).remove();
  101. }
  102. function del_sku(id){
  103. $("#sku"+id).remove();
  104. }
  105. </script>
  106. </body>
  107. @endsection