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.

183 lines
8.9 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. <!DOCTYPE html><html><head><title>修改商品信息_后台管理</title>@include('admin.common.header')
  2. <div class="container-fluid">
  3. <div class="row">
  4. <!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
  5. <!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
  6. <h5 class="sub-header"><a href="/fladmin/product">商品列表</a> > 修改商品</h5>
  7. <form id="addarc" method="post" action="/fladmin/product/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  8. <table class="table table-striped table-bordered">
  9. <tbody>
  10. <tr>
  11. <td align="right">商品标题:</td>
  12. <td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" class="required" style="width:60%" placeholder="在此输入标题"><input style="display:none;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td>
  13. </tr>
  14. <tr>
  15. <td align="right">货号:</td>
  16. <td colspan="2"><input name="serial_no" type="text" id="serial_no" style="width:180px" value="<?php echo $post["serial_no"]; ?>">&nbsp;&nbsp; 运费:<input name="delivery_fee" type="text" id="delivery_fee" style="width:100px" value="<?php echo $post["delivery_fee"]; ?>">&nbsp;&nbsp; 销量:<input name="sales" type="text" id="sales" style="width:60px" value="<?php echo $post["sales"]; ?>"></td>
  17. </tr>
  18. <tr>
  19. <td align="right">商品价格:</td>
  20. <td colspan="2"><input name="price" type="text" id="price" style="width:100px" value="<?php echo $post["price"]; ?>">&nbsp;&nbsp; 原价:<input name="origin_price" type="text" id="origin_price" style="width:100px" value="<?php echo $post["origin_price"]; ?>">&nbsp;&nbsp; 库存:<input name="inventory" type="text" id="inventory" style="width:60px" value="<?php echo $post["inventory"]; ?>">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="<?php echo $post["click"]; ?>" style="width:60px;"></td>
  21. </tr>
  22. <tr>
  23. <td align="right">上架:</td>
  24. <td>
  25. <input type="radio" value='0' name="status" <?php if($post['status']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
  26. <input type="radio" value='1' name="status" <?php if($post['status']==1){echo 'checked';} ?> />&nbsp;否
  27. </td>
  28. </tr>
  29. <tr>
  30. <td align="right">推荐:</td>
  31. <td>
  32. <select name="tuijian" id="tuijian">
  33. <?php $tuijian = config('custom.tuijian');
  34. for($i=0;$i<count($tuijian);$i++){if($i==$post["tuijian"]){?><option selected="selected" value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option>
  35. <?php }else{?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php }} ?>
  36. </select>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td align="right">seoTitle:</td>
  41. <td><input name="seotitle" type="text" id="seotitle" value="<?php echo $post["seotitle"]; ?>" style="width:60%"></td>
  42. </tr>
  43. <tr>
  44. <td align="right" style="vertical-align:middle;">缩略图:</td>
  45. <td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
  46. </tr>
  47. <script type="text/javascript">
  48. var _editor;
  49. $(function() {
  50. //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
  51. _editor = UE.getEditor('ueditorimg');
  52. _editor.ready(function () {
  53. //设置编辑器不可用
  54. _editor.setDisabled('insertimage');
  55. //隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
  56. _editor.hide();
  57. //侦听图片上传
  58. _editor.addListener('beforeInsertImage', function (t, arg) {
  59. //将地址赋值给相应的input,只取第一张图片的路径
  60. $('#litpic').val(arg[0].src);
  61. //图片预览
  62. $('#picview').attr("src",arg[0].src).css("display","inline-block");
  63. })
  64. });
  65. });
  66. //弹出图片上传的对话框
  67. function upImage()
  68. {
  69. var myImage = _editor.getDialog("insertimage");
  70. myImage.render();
  71. myImage.open();
  72. }
  73. </script>
  74. <script type="text/plain" id="ueditorimg"></script>
  75. <tr>
  76. <td align="right">商品类目:</td>
  77. <td>
  78. <select name="typeid" id="typeid">
  79. <?php $catlist = category_tree(get_category('product_type',0));foreach($catlist as $row){
  80. if($row["id"]==$post["typeid"]){ ?>
  81. <option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  82. <?php }else{ ?>
  83. <option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  84. <?php }} ?>
  85. </select>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td align="right">关键词:</td>
  90. <td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (多个用","分开)</td>
  91. </tr>
  92. <tr>
  93. <td align="right" style="vertical-align:middle;">内容摘要:</td>
  94. <td><textarea name="description" rows="5" id="description" style="width:60%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
  95. </tr>
  96. <tr>
  97. <td colspan="2"><strong>图文描述:</strong></td>
  98. </tr>
  99. <tr>
  100. <td colspan="2">
  101. <!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $post["body"]; ?></script>
  102. <!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
  103. <!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
  104. <!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
  105. </tr>
  106. <tr>
  107. <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><input type="hidden"></input></td>
  108. </tr>
  109. </tbody></table></form><!-- 表单结束 -->
  110. </div></div><!-- 右边结束 --></div></div>
  111. <script>
  112. $(function(){
  113. $(".required").blur(function(){
  114. var $parent = $(this).parent();
  115. $parent.find(".formtips").remove();
  116. if(this.value=="")
  117. {
  118. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  119. }
  120. else
  121. {
  122. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  123. }
  124. });
  125. //重置
  126. $('#addarc input[type="reset"]').click(function(){
  127. $(".formtips").remove();
  128. });
  129. $("#addarc").submit(function(){
  130. $(".required").trigger('blur');
  131. var numError = $('#addarc .onError').length;
  132. if(numError){return false;}
  133. //$("#contents").val = ue.getContent();
  134. //var datas = $('#addarc').serialize();//#form要在form里面
  135. //var content = ue.getContent();
  136. //var title = $("#title").val();
  137. //var seotitle = $("#seotitle").val();
  138. //var keywords = $("#keywords").val();
  139. //var description = $("#description").val();
  140. /*$.ajax({
  141. url: "/fladmin/product/doedit",
  142. type: "POST",
  143. dataType: "json",
  144. cache: false,
  145. data: {
  146. "id":$("#id").val(),
  147. "typeid":$("#typeid").val(),
  148. "tuijian":$("#tuijian").val(),
  149. "click":$("#click").val(),
  150. "writer":$("#writer").val(),
  151. "source":$("#source").val(),
  152. "litpic":$("#litpic").val(),
  153. "title":$("#title").val(),
  154. "seotitle":$("#seotitle").val(),
  155. "keywords":$("#keywords").val(),
  156. "description":$("#description").val(),
  157. "contents":content
  158. //"title":title.replace("'", "&#039;"),
  159. //"seotitle":seotitle.replace("'", "&#039;"),
  160. //"keywords":keywords.replace("'", "&#039;"),
  161. //"description":description.replace("'", "&#039;"),
  162. //"contents":content.replace("'", "&#039;")
  163. },
  164. success: function(data){
  165. if(data.code==200)
  166. {
  167. //alert(data.info);
  168. window.location.replace("/fladmin/product");
  169. }
  170. }
  171. }); */
  172. });
  173. });
  174. </script>
  175. </body></html>