123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <link rel="stylesheet" href="/admin/assets/css/bootstrap.min.css" />
- <link rel="stylesheet" href="/admin/assets/css/font-awesome.min.css" />
- <link rel="stylesheet" href="/admin/assets/css/ace.min.css" />
- <link rel="stylesheet" href="/admin/assets/css/ace-rtl.min.css" />
- <link rel="stylesheet" href="/admin/assets/css/ace-skins.min.css" />
- <link rel="stylesheet" href="/admin/css/style.css" />
- <script src="/admin/script/jquery.min.js"></script>
- <script src="/admin/script/jquery.form.js"></script>
- <!-- 文件上传所需要css和js -->
- <link rel="stylesheet" href="/admin/script/FileUpload/css/jquery.fileupload.css">
- <script type="text/javascript" src="/admin/script/FileUpload/jquery.iframe-transport.js"></script>
- <script type="text/javascript" src="/admin/script/FileUpload/vendor/jquery.ui.widget.js"></script>
- <script type="text/javascript" src="/admin/script/FileUpload/jquery.fileupload.js"></script>
- <div class="page-content" style="height:450px;overflow:scroll;">
- <div class="page-header">
- <h1>编辑瓶子</h1>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <form class="form-horizontal" action="/admin/bottle/update" method="post" id="submit_form">
- <div class="form-group">
- <label class="col-sm-3 control-label"><span style="color: #f00">*</span>名称</label>
- <div class="col-sm-9">
- <input type="text" name="title" value="${bottle.title!}" class="col-xs-10 col-sm-5" style="border: 1px solid #ccc" />
- </div>
- </div>
- <div class="space-4"></div>
- <div class="form-group">
- <label class="col-sm-3 control-label"><span style="color: #f00">*</span>重量/g</label>
- <div class="col-sm-9">
- <input type="text" name="weight" value="${bottle.weight!}" class="col-xs-10 col-sm-5" style="border: 1px solid #ccc" />
- </div>
- </div>
- <div class="space-4"></div>
- <div class="form-group">
- <label class="col-sm-3 control-label"><span style="color: #f00">*</span>标签宽度/mm</label>
- <div class="col-sm-9">
- <input type="text" name="diy_width" value="${bottle.diy_width!}" class="col-xs-10 col-sm-5" style="border: 1px solid #ccc" />
- </div>
- </div>
- <div class="space-4"></div>
- <div class="form-group">
- <label class="col-sm-3 control-label"><span style="color: #f00">*</span>标签高度/mm</label>
- <div class="col-sm-9">
- <input type="text" name="diy_height" value="${bottle.diy_height!}" class="col-xs-10 col-sm-5" style="border: 1px solid #ccc" />
- </div>
- </div>
- <div class="space-4"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label"><span style="color: #f00">*</span>图片</label>
- <div class="col-sm-10">
- <a href="javascript:void(0);" class="file">选择图片
- <input type="file" class="autosize-transition form-control" name="image" id="uploadImg" style="overflow: hidden; word-wrap: break-word; resize: horizontal;border: 1px #ccc solid;" />
- </a>
- <div style="margin-top:10px;">
- <img style="height:100px;" id="img_url" src="${bottle.img_url!}" />
- </div>
- </div>
- </div>
- <input type="hidden" name="img_url" value="${bottle.img_url!}" />
- <input type="hidden" name="id" value="${bottle.id!}" />
- </form>
- </div>
- </div>
- </div>
- <div style="width:100%;text-align: center;">
- <button type="button" class="btn btn-info" onclick="return submitForm()" style="padding:0px 5px;margin-top:5px;">
- <i class="icon-ok bigger-110"></i>确定
- </button>
-
- <button type="reset" class="btn" onclick="parent.hideAlert()" style="padding:0px 5px;margin-top:5px;">
- <i class="icon-undo bigger-110"></i>取消
- </button>
- </div>
- <script>
- $('#uploadImg').fileupload({
- url: '/admin/uploadImg',
- dataType: 'json',
- done: function (e,data) {
- var json = $.parseJSON(data.jqXHR.responseText);
- if(json.success){
- $("#img_url").attr("src", json.img_url);
- $("#img_url").show();
- $("input[name='img_url']").val(json.img_url);
- }else{
- alert(json.msg);
- }
- }
- });
- function submitForm(){
-
- $('#submit_form').ajaxSubmit({
- success: function(data){
- alert(data.msg);
- if(data.success){
- parent.location.reload();
- }
- }
- });
- }
- </script>
|