<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript" src="jquery.3.0.js"></script>
<title>我要加入</title>
<style>
p.tag {
color: rgb(177, 55, 70);
margin-bottom: 3px;
margin-top: 10px;
}
form.f_join {
background-color: white;
padding: 10px;
border: 1px solid rgb(204, 204, 204);
margin-bottom: 20px;
}
form.f_join .form-control {
resize: none;
margin: 0px;
}
.imgupload {
width: 100%;
min-height: 100px;
border: 1px solid rgb(204, 204, 204);
border-radius: 2px;
text-align: center;
position: relative;
}
.imgupload input[type=file] {
/*display:none;*/
position: absolute;
opacity: 0.01;
}
.imgupload .tip {
margin-top: 30px;
font-size: 22px;
font-weight: 800;
}
.imgupload> img {
width: 100%;
height: auto;
}
.imgupload .tip> .plusico {
line-height: 1.2;
height: 26px;
width: 26px;
font-weight: 400;
font-size: 22px;
border-radius: 20px;
border: 1px solid rgb(177, 55, 70);
display: inline-block;
color: rgb(177, 55, 70);
margin-right: 4px;
}
</style>
<script>
$(function() {
initimginput("iu1");
initimginput("iu2");
})
function initimginput(cid) {
$("#" + cid).click(function() {
$(this).children("input[type='file']")[0].click();
});
var inputFile = $("#" + cid).children("input[type='file']")[0]; // document.getElementById(inputid),
var uploadInfo = {};
inputFile.addEventListener('click', function() {}, false);
inputFile.addEventListener('change', function(evt) {
$("#" + cid).children("img").show();
$("#" + cid).children(".tip").hide();
evt.stopPropagation();
evt.preventDefault();
var file = evt.dataTransfer !== undefined ? evt.dataTransfer.files[0] : evt.target.files[0];
if(file == null) {
$("#" + cid).children(".tip").show();
$("#" + cid).children("img").removeAttr("src");
$("#" + cid).children("img").hide();
return;
}
if(!file.type.match(/image.*/)) {
return;
}
var reader = new FileReader();
var oImg = $("#" + cid).children("img")[0];
reader.onload = (function() {
return function(e) {
uploadInfo.imageBase64 = e.target.result;
oImg.src = uploadInfo.imageBase64;
var imageObj = new Image();
imageObj.src = uploadInfo.imageBase64;
// console.log(imageObj.src);
$.ajax({
url:'http://localhost/upload/demo.php',
data:{'value':imageObj.src},
type:'post',
dataType:'json',
success:function(){
}
});
}
})(file);
reader.readAsDataURL(file);
}, false);
}
</script>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<p class="tag fg-red">*隐私保护:本平台会对个人申请者信息保密</p>
<form class="f_join">
<div class="form-group">
<label for="exampleInputEmail1">机构名称:</label>
<input type="text" class="form-control" placeholder="机构名称">
</div>
<div class="form-group">
<label for="exampleInputPassword1">统一社会信用代码:</label>
<input type="text" class="form-control" placeholder="统一社会信用代码">
</div>
<div class="form-group">
<label for="exampleInputPassword1">企业注册号(或登记证号):</label>
<input type="text" class="form-control" placeholder="企业注册号/登记证号">
</div>
<div class="form-group">
<label for="exampleInputPassword1">行政许可证号:</label>
<input type="text" class="form-control" placeholder="行政许可证号">
</div>
<div class="form-group">
<label for="exampleInputPassword1">许可机关</label>
<input type="text" class="form-control" placeholder="许可机关">
</div>
<div class="form-group">
<label for="exampleInputPassword1">详细地址</label>
<input type="text" class="form-control" placeholder="详细地址">
</div>
<div class="form-group">
<label for="exampleInputPassword1">联系电话</label>
<input type="tel" class="form-control" placeholder="联系电话">
</div>
<div class="form-group">
<label for="exampleInputPassword1">组织简介</label>
<textarea class="form-control" rows="4" placeholder="组织简介"></textarea>
</div>
<div class="form-group">
<label for="exampleInputPassword1">照片上传<span class="fg-red">(请上传营业执照)</span></label>
<div class="imgupload" id="iu1">
<input type="file" accept="image/*" class="form-control" placeholder="联系电话">
<div class="tip">
<div class="plusico"> + </div>添加照片</div>
<img/>
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1">照片上传<span class="fg-red">(请上传许可证)</span></label>
<div class="imgupload" id="iu2">
<input type="file" accept="image/*" class="form-control" placeholder="联系电话">
<div class="tip">
<div class="plusico"> + </div>添加照片</div>
<img/>
</div>
</div>
<button type="submit" class="btn btn-success btn-block">提交</button>
<input type="file" accept="image/*" class="form-control" placeholder="AAAAA">
</form>
</div>
</div>
</body>
php文件demo.php