123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- @extends('admin/master')
- @section('content')
- <body>
- @if(count($errors) > 0)
- <div class="Huialert Huialert-info" id="error">
- @foreach($errors->all() as $error)
- <li>{{$error}}</li>
- @endforeach
- </div>
- @endif
- <div class="page-container">
- <form action="/admin/goods/update" method="post" class="form form-horizontal" enctype="multipart/form-data">
- <input type="hidden" name="_token" value="{{ csrf_token() }}" />
- <input type="hidden" name="id" value="{{$id}}" />
- <input type="hidden" name="page" value="{{$page}}">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">
- 商品标题:</label>
- <div class="formControls col-xs-6 col-sm-6">
- <input type="text" class="input-text" value="{{$goods['name']}}" placeholder="" name="name">
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">
- 商品图片:</label>
- <div class="formControls col-xs-6 col-sm-6">
- <div><img width="100" src="{{$goods['picUrl']?$goods['picUrl']:'/empty.png'}}"/></div><br>
- <span class="btn-upload">
- <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"></i> 上传图片</a>
- <input type="file" multiple name="img" class="input-file">
- </span><br>
- 文件类型支持:jpg ,png ,ico ,文件大小不能超过1M
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">
- 商品描述:</label>
- <div class="formControls col-xs-6 col-sm-6">
- <textarea class="textarea" name="description">{{$goods['description']}}</textarea>
- </div>
- </div>
- <!--div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">添加规格:</label>
- <div class="formControls col-xs-6 col-sm-6">
- <span class="select-box">
- 规格:<input type='text' value="" placeholder="示例:500克/包" name="propsName"/>
- 价格:<input type="text" value="" placeholder="请填写对应规格价格(数字格式)" name="price">元
- <button type='button' onclick='add_goods()'> 确认</button>
- </span>
- </div>
- </div><br-->
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">
- 已有规格:</label>
- <div id = 'goods_o' class="formControls col-xs-6 col-sm-6">
- @foreach( $sku_list as $sku )
- <p id='sku{{$sku["id"]}}'><font style='font-weight:bold;'>规格:</font>{{$sku['propsName']}}; </p>
- @endforeach
- </div>
- <input type='hidden' name='del_sku_ids' value = ''/>
- </div><br>
-
- <div class="row cl">
- <div class="col-9 col-offset-2">
- <button class="btn btn-primary radius" type="submit" value=" 提交 "> 修改 </button>
- <button class="btn btn-default" type="reset" onclick="return_index();"> 返回 </button>
- {{--<a href="javascript:void(0)" class="btn btn-default radius" onclick="redirect('{{url('/admin/admin/all')}}')">返回并查看结果</a>--}}
- </div>
- </div>
- </form>
- </div>
- <!--_footer 作为公共模版分离出去-->
- <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
- <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
- <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
- <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
- <!--/_footer 作为公共模版分离出去-->
- <!--请在下方写此页面业务相关的脚本-->
- <script type="text/javascript">
- $(function(){
- setTimeout("$('#error').hide()",3000);
- });
- /*返回*/
- function return_index(){
- location.href='/admin/goods/index';
- }
- //全局变量
- id_n = -101;
- function add_goods(){
- id_n++;
- var propsName = $("input[name=propsName]").val();
- var price = $("input[name=price]").val();
- var str = "<p id='sku"+id_n+"'><font style='font-weight:bold;'>规格:<\/font>"+propsName+ " <font style='font-weight:bold;'>价格:<\/font>"+price+";"+ " <button type='button' onclick='del_sku("+id_n+")'> 移除<\/button> <input type='hidden' name='sku[]' value='"+propsName+'@@'+price+"'\/> " +"<\/p>";
- $("#goods_o").append(str);
- return false;
- }
- function del_sku_y(id){
- var del_id = $("input[name=del_sku_ids]").val();
- var del_ids = del_id + id+',';
- $("input[name=del_sku_ids]").val(del_ids);
- $("#sku"+id).remove();
- }
- function del_sku(id){
- $("#sku"+id).remove();
- }
- </script>
- </body>
- @endsection
|