123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="post" action="{:url('add')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$info['id']|default='0'}">
- <div class="form-group">
- <label class="col-sm-2 control-label">商品名称<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">商品价格<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <input type="number" class="form-control" name="price" value="{$info.price|default=''}">
- </div>
- </div>
- <!--<div class="form-group">-->
- <!--<label class="col-sm-2 control-label">库存</label>-->
- <!--<div class="col-sm-6">-->
- <!--<input type="number" class="form-control" name="stock" value="{$info.stock|default='0'}">-->
- <!--</div>-->
- <!--</div>-->
- <div class="form-group">
- <label class="col-sm-2 control-label">商品分类<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <select name="cate_id" class="form-control" onchange="setCate(this.value)">
- <option value="0">选择商品分类</option>
- {volist name='cateList' id='v'}
- <option value="{$v.id|default=''}">{$v['title']}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="form-group" id="kt" {if (isset($info) && $info.barrel_id>0) || (isset($cateInfo) && $cateInfo.is_water==1)} style="display:block" {else} style="display:none" {/if}>
- <label class="col-sm-2 control-label">空桶<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget('common/select',['name'=>'barrel_id','lists'=>$barrel,'value'=>isset($info)?$info.barrel_id:''])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">标签</label>
- <div class="col-sm-6">
- {:widget('common/select',['name'=>'label','lists'=>$label,'value'=>isset($info)?$info.label:''])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">商品图片<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/upimg',['name'=>'img','multi'=>0,'val'=>isset($info)?$info['img']:''])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">轮播图<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/upimg',['name'=>'imgs','multi'=>1,'val'=>isset($info)?$info['imgs']:''])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">排序</label>
- <div class="col-sm-6">
- <input type="number" class="form-control" name="sort" value="{$info.sort|default='0'}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">商品描述</label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="dec" value="{$info.dec|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">状态</label>
- <div class="col-sm-6">
- <label class="cr-inline">
- <input type="radio" value="1" name="enable">上架
- </label>
- <label class="cr-inline">
- <input type="radio" value="0" name="enable">下架
- </label>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">是否推荐</label>
- <div class="col-sm-6">
- <label class="cr-inline">
- <input type="radio" value="0" name="is_tj">否
- </label>
- <label class="cr-inline">
- <input type="radio" value="1" name="is_tj">是
- </label>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">详情<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/ueditor',['name'=>'content','height'=>300,'val'=>isset($info)?$info['content']:''])}
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
- <button class="btn cancel-btn btn-default" type="button">取 消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(document).ready(function(){
- formSetValue("enable", {$info.enable|default=1});
- });
- $(document).ready(function(){
- formSetValue("cate_id", {$info.cate_id|default=0});
- });
- $(document).ready(function(){
- formSetValue("is_tj", {$info.is_tj|default=0});
- });
- function setCate(value) {
- $.post("{:url('WxGoods/checkIsWater')}",{id:value},function (res) {
- console.log(res);
- if(res.code==1 && res.data.is_water==1){
- $("#kt").attr('style','display:block');
- }else {
- $("#kt").attr('style','display:none');
- }
- })
- }
- </script>
- {/block}
|