addupd.blade.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. @extends('admin.frame_form')
  2. @if (!isset($product))
  3. @section('action', '添加')
  4. @else
  5. @section('action', '编辑')
  6. @endif
  7. @section('who', '产品')
  8. @section('enctype', 'multipart/form-data')
  9. @section('form_content')
  10. <tr>
  11. <td class="txt-right width-20p"><i>*</i>产品名称:</td>
  12. <td class="txt-left">
  13. <input type="text" style="width: 350px;" maxlength="50" placeholder="请输入小于50个字符" name="name" value="{{ old('name') ? old('name') : (isset($product->name) ? $product->name : '') }}" required="required" />
  14. &nbsp;&nbsp;&nbsp;
  15. <span class="red">{{ $errors->first('name') }}</span>
  16. </td>
  17. </tr>
  18. <tr>
  19. <td class="txt-right"><i>*</i>排序:</td>
  20. <td class="txt-left">
  21. <input type="number" min="1" max="50" name="sort" value="{{ old('sort') ? old('sort') : (isset($product->sort) ? $product->sort : '') }}" required="required" />
  22. &nbsp;&nbsp;&nbsp;
  23. <span class="red">{{ $errors->first('sort') }}</span>
  24. </td>
  25. </tr>
  26. <tr>
  27. <td class="txt-right"><i>*</i>产品介绍:</td>
  28. <td class="txt-left">
  29. <textarea rows="5" cols="60" maxlength="255" placeholder="请输入小于255个字符" name="txt" required="required">{{ old('txt') ? old('txt') : (isset($product->txt) ? $product->txt : '') }}</textarea>
  30. &nbsp;&nbsp;&nbsp;
  31. <span class="red">{{ $errors->first('txt') }}</span>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td class="txt-right"><i>*</i>产品图片:</td>
  36. <td class="txt-left">
  37. @if (!isset($product))
  38. @include('admin.upload_image', ['action' => '上传', 'name' => 'image'])
  39. @else
  40. <img src="{{ asset($article->cover) }}" style="width: 198px; height: 148px;" />
  41. </br></br>
  42. @include('admin.upload_image', ['action' => '更换', 'name' => 'image'])
  43. @endif
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="txt-right">购买地址:</td>
  48. <td class="txt-left">
  49. <textarea rows="2" cols="60" maxlength="100" placeholder="请输入小于100个字符" name="href">{{ old('href') ? old('href') : (isset($product->href) ? $product->href : '') }}</textarea>
  50. &nbsp;&nbsp;&nbsp;
  51. <span class="red">{{ $errors->first('href') }}</span>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="txt-right"><i>*</i>所属菜单:</td>
  56. <td class="txt-left">
  57. @foreach ($menus as $menu)
  58. @if (isset($product) && in_array($menu->id, $product->belong))
  59. <input type="checkbox" id="menu{{ $loop->index }}" name="belong[]" value="{{ $menu->id }}" checked="checked" />
  60. @else
  61. <input type="checkbox" id="menu{{ $loop->index }}" name="belong[]" value="{{ $menu->id }}" />
  62. @endif
  63. <label for="menu{{ $loop->index }}">{{ $menu->name }}</label>
  64. @endforeach
  65. &nbsp;&nbsp;&nbsp;
  66. <span class="red">{{ $errors->first('belong') }}</span>
  67. </td>
  68. </tr>
  69. @stop