123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- @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/store" method="post" class="form form-horizontal" enctype="multipart/form-data">
- <input type="hidden" name="_token" value="{{ csrf_token() }}" />
- <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="{{old('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">
- <span class="select-box">
- <select size="1" name="goodsCategoryName">
- <option value="0" @if(old('goodsCategoryName')=='') selected @endif>选择分类</option>
- @foreach($cates as $v)
- <option value="{{$v}}" @if(old('goodsCategoryName')==$v) selected @endif>{{$v}}</option>
- @endforeach
- </select>
-
- <font color='red'>增加其他分类并选择:</font><input type="text" value="{{old('goodsCategoryName2')}}" placeholder="" name="goodsCategoryName2">
- </span>
-
- </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">
- <input type="text" class="input-text" value="{{old('productCode')}}" placeholder="请输入货号,只能是字母数字下划线组合 例如:abc2或a_bcd" name="productCode">
- <br>
- <font color='red'></font>
- </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="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">{{old('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">
- <font style='font-weight:bold;'>规格:</font><input type='text' value="" placeholder="示例:500克/包" name="propsName"/>
- <font style='font-weight:bold;'>售价:</font><input type="text" value="" placeholder="请填写对应规格价格(数字格式)" name="price">元
- <font style='font-weight:bold;'>吊牌价:</font><input type="text" value="" placeholder="请填写对应规格吊牌价(数字格式)" name="tagPrice">元<br>
- <font style='font-weight:bold;'>参考成本:</font><input type="text" value="" placeholder="请填写对应参考成本(数字格式)" name="referenceCost">元
- <font style='font-weight:bold;'>分销商价格:</font><input type="text" value="" placeholder="请填写对应分销商价格(数字格式)" name="outPrice">元
- <font style='font-weight:bold;color:red'>是否称重:</font><input type='radio' value='0' name='is_weigh' checked/>否 <input type='radio' value='1' name='is_weigh'/>是
- <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">
-
- </div>
- </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 tagPrice = $("input[name=tagPrice]").val();
- var referenceCost = $("input[name=referenceCost]").val();
- var is_weigh = $("input[name=is_weigh]:checked").val();
- var outPrice = $("input[name=outPrice]").val();
- var str = "<p id='sku"+id_n+"'><font style='font-weight:bold;'>规格:<\/font>"+propsName
- + " <font style='font-weight:bold;'>售价:<\/font>"+price+";"
- + " <font style='font-weight:bold;'>吊牌价:<\/font>"+tagPrice+";"
- + " <font style='font-weight:bold;'>参考成本:<\/font>"+referenceCost+";"
- + " <font style='font-weight:bold;'>分销商价格:<\/font>"+outPrice+";"
- + " <button type='button' onclick='del_sku("+id_n+")'> 移除<\/button> <input type='hidden' name='sku[]' value='"+propsName+'@@'+price+'@@'+tagPrice+'@@'+referenceCost+'@@'+outPrice+'@@'+is_weigh+"'\/> " +"<\/p>";
- $("#goods_o").append(str);
- return false;
- }
- function del_sku(id){
- $("#sku"+id).remove();
- }
- </script>
- </body>
- @endsection
|