...
|
...
|
@@ -68,19 +68,51 @@ |
|
|
</div>
|
|
|
{include file="public/js" /}
|
|
|
<script>
|
|
|
// 营业执照
|
|
|
function fileImg() {
|
|
|
var reads = new FileReader();
|
|
|
var img = document.getElementById("imgFile").files[0];
|
|
|
reads.readAsDataURL(img);
|
|
|
reads.onload = function(e) {
|
|
|
document.getElementById('img1').src = this.result;
|
|
|
console.log($("#img1"))
|
|
|
console.log(e)
|
|
|
};
|
|
|
};
|
|
|
$(".btn_box").click(function() {
|
|
|
window.location.href = "examine.html"
|
|
|
$(function(){
|
|
|
wx.config(
|
|
|
{$jssdk}
|
|
|
);
|
|
|
wx.ready(function () {
|
|
|
$('.upload').click(function () {
|
|
|
wx.chooseImage({
|
|
|
count: 1, // 默认9
|
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
success: function (res) {
|
|
|
$(res.localIds).each(function (key, localId) {
|
|
|
uploadImages(localId);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
function uploadImages(localId) {
|
|
|
wx.uploadImage({
|
|
|
localId: localId,
|
|
|
isShowProgressTips: 1,
|
|
|
success: function (res) {
|
|
|
var serverId = res.serverId; // 返回图片的服务器端ID
|
|
|
$.ajax({
|
|
|
url:"{:url('home/upload/fetImage')}",
|
|
|
type:"GET",
|
|
|
data:{'media':serverId},
|
|
|
success:function(res){
|
|
|
console.log(res);
|
|
|
if(res.code == 1){
|
|
|
$('.upload').find('img').attr('src',res.data);
|
|
|
$('#avatar').val(res.data);
|
|
|
}
|
|
|
},
|
|
|
error:function(res){
|
|
|
toast('与服务器断开连接');
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
toast(JSON.stringify(res));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
...
|
...
|
|