123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <include file="./Application/Admin/View/head.html" />
- <style type="text/css">
- .citys{
- margin-bottom: 10px;
- }
- .citys p{
- line-height: 28px;
- }
- .warning{
- color: #c00;
- }
- table a{
- margin-right: 8px;
- color: #369;
- }
- .imgUpload {
- width: 60px;
- height: 25px;
- line-height: 25px;
- text-align: center;
- border-radius: 2px;
- background: #CC290E;
- color: #FFF;
- font-size: 12px;
- border: none;
- cursor: pointer;
- outline: none;
- }
- </style>
- </head>
- <body>
- <article class="page-container">
- <form action="" method="post" class="form form-horizontal" id="form-admin-group-add">
- <notempty name="info.id">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3">ID:</label>
- <div class="formControls col-xs-8 col-sm-9">{$info.id}</div>
- </div>
- </notempty>
- <!--图片异步上传并预览1-->
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>场馆名称:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text imgInput" value="" placeholder="" name="img" style="width: 240px;" />
- <input type="button" class="imgUpload" value="上传" style="width: 50px;"/>
- <input type="file" style="display: none;" class="imgFile">
- <div class="imgView" style="margin-top: 10px;"></div>
- </div>
- </div>
- <!--图片异步上传并预览2-->
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>场馆名称:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text imgInput" value="" placeholder="" name="img" style="width: 240px;" />
- <input type="button" class="imgUpload" value="上传" style="width: 50px;"/>
- <input type="file" style="display: none;" class="imgFile">
- <div class="imgView" style="margin-top: 10px;"></div>
- </div>
- </div>
- </form>
- </article>
- <!--_footer 作为公共模版分离出去-->
- <include file="./Application/Admin/View/foot.html" />
- <!--/_footer /作为公共模版分离出去-->
- <script src="/Public/plugins/js/jquery.citys.js"></script>
- <script type="text/javascript">
- // $('#demo').citys({code:<?php echo($res['address_code']);?>});
- </script>
- <script>
- //下面js课用于多个图片异步上传,无需重复
- $(document).on('click','.imgUpload',function(){
- $(this).siblings('.imgFile').trigger('click');
- });
- $(document).on('change','.imgFile',function(e){
- var imgFile = $(this);
- var reader = new FileReader();
- reader.onload = (function (file) {
- return function (e) {
- var imgBase64 = this.result;
- var html = '<img src="' + imgBase64 + '" style="width:240px;height:auto;" >';
- $(imgFile).siblings('.imgView').html(html);
- $.ajax({
- type: "post",
- url: "/Admin/common/upload_upyun",
- dataType:'json',
- data: {
- img: imgBase64
- },
- success: function(data) {
- if (data.status == '1') {
- $(imgFile).siblings('.imgInput').val(data.info);
- }
- }
- });
- };
- })(e.target.files[0]);
- reader.readAsDataURL(e.target.files[0]);
- });
- </script>
- </body>
- </html>
|