这是我上传部分的,求解
layui.use('upload', function () {
layui.upload({
url: url + '/app_upload/index',
elem: '#test' //指定原始元素,默认直接查找class="layui-upload-file" ,
method: 'post' //上传接口的http类型
, before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
$('#load_img').css("visibility", "visible");
setTimeout(function () {
if ($(".layui-layer-move").html() == "") {
$('#load_img').css("visibility", "hidden");
}
}, 4000);
},
success: function (res) {
console.log(res);
// $('#img').val(res);
LAY_demo_upload.src = res;
proof = res;
$("#LAY_demo_upload").load(function () {
$(".mui-btn-success").attr("disabled", false).text("提交审核");
$('#load_img').css("visibility", "hidden");
});
}
});
});
网友评论