#@layer()

#define script()
<script src="#(CPATH)/static/components/jquery-file-upload/js/vendor/jquery.ui.widget.js"></script>
<script src="#(CPATH)/static/components/jquery-file-upload/js/jquery.iframe-transport.js"></script>
<script src="#(CPATH)/static/components/jquery-file-upload/js/jquery.fileupload.js"></script>
<script>

    $('#cfile').fileupload({
        dropZone: $('#uploader'),
        url: '#(CPATH)/commons/attachment/upload',
        sequentialUploads: true,
        done: function (e, data) {
            if (data.result.state == "ok") {
                $('#paidProof').val(data.result.src);
                toastr.success("文件上传成功...")
            } else {
                toastr.error(data.result.message)
            }
        }
    });

    function closeLayer() {
        parent.layer.data.needRefresh = true;
        parent.layer.closeAll();
    }
</script>
#end

#define css()
<link rel="stylesheet" href="#(CPATH)/static/components/jquery-file-upload/css/jquery.fileupload.css">
<style>
    #uploader {
        height: 180px;
        border: 1px dashed #999;
        padding: 10px;
    }

    .myPanel {
        font-size: 25px;
        color: #ccc;
        text-align: center;
        padding-top: 30px;
    }
</style>
#end

#define content()

<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <form class="form-horizontal form-setting autoAjaxSubmit" autocomplete="off"
                  action="#(CPATH)/admin/finance/doPayoutProcess"
                  method="POST"
                  data-ok-function="closeLayer()"
            >
                <input type="hidden" name="id" value="#(payout.id ??)">
                <div class="box-body ">



                    <div class="form-group">
                        <label class="col-sm-2 control-label">实际转账金额</label>
                        <div class="col-sm-8">
                            <input type="input" name="amount" class="form-control"
                                   value=""
                                   placeholder="请输入实际给用户打款金额">
                        </div>
                    </div>



                    <div class="form-group">
                        <label class="col-sm-2 control-label">入账截图（证明）</label>
                        <div class="col-sm-8 ">
                            <input type="hidden" id="paidProof" name="proof" value="">
                            <div id="uploader">
                                <span class="btn btn-block btn-primary fileinput-button" style="width: 120px">
                                    <i class="glyphicon glyphicon-plus"></i>
                                    <span>选择图片...</span>
                                    <input id="cfile" type="file" name="files" multiple>
                                </span>

                                <div class="myPanel">
                                    或者拖动图片到这里进行上传...
                                </div>
                            </div>

                        </div>
                    </div>



                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <div class="col-sm-offset-9 col-sm-2 submit-block">
                        <div class="box-submit">
                            <button type="submit" class="btn btn-primary">确定</button>
                        </div>
                    </div>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </div>

</section>

#end
