1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- ##tlayout("admin/layout.htm"){
- <!-- 文件上传所需要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="breadcrumbs" style="height: 50px;">
- <div class="breadcrumbs_title">添加轮播图</div>
- </div>
- <div class="page-content">
- <div class="row" style="margin-top: 30px;">
- <div class="col-xs-12">
- <form class="form-horizontal" action="/admin/carousel/save" method="post" id="submit_form">
- <div class="form-group">
- <label class="col-sm-2 control-label"><span style="color: #f00">*</span>标题</label>
- <div class="col-sm-10">
- <input type="text" name="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-2 control-label"><span style="color: #f00">*</span>链接</label>
- <div class="col-sm-10">
- <input type="text" name="url" 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">
- <input type="text" name="idx" 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;display: none;" id="img_url" />
- </div>
- </div>
- </div>
- <div class="space-4"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label"></label>
- <div class="col-sm-10">
- <button class="btn btn-info" type="button" onclick="submitForm()"><i class="icon-ok bigger-110"></i>确定</button>
-
- <button class="btn" type="button" onclick="javascript:history.back(-1)"><i class="icon-undo bigger-110"></i>取消</button>
- </div>
- </div>
- <input type="hidden" name="img_url" />
- </form>
- </div>
- </div>
- </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.href="/admin/carousel";
- }
- }
- });
- }
- </script>
- ##}
|