e: 0.5}); $.post("https://www.allicdata.com/goods/goodsconsultinsert.html",data,function (res) { layer.close(index); if(res.code > 0){ ga('send', 'event', 'RFQ send', 'Click', 'Good detail page' ); layer.msg("Rfq send success!", {icon: 1, time: 3000,shade:0.7,shadeClose:true},function() { window.location.reload(); }); }else{ showErrMsg("Rfq send failed!"); } }); }); }); layui.use('upload', function(){ var upload = layui.upload; var uploadInst = upload.render({ elem: '#upload' //绑定元素 ,url: "https://www.allicdata.com/wap/upload/uploaddoc.html" //上传接口 ,accept:'file' ,exts:'pdf|doc|docx|xls|xlsx|ppt|pptx|txt' ,done: function(res){ if(res.status == 1){ showSuccessMsg('File upload success!'); $('#file').val(res.name); var path = res.name.split('/'); $('#file_name').html(path[path.length-1]); $('#file_box').show(); $('#file_btn_box').hide(); }else{ showErrMsg('File upload failed!'); } } ,error: function(){ showErrMsg('File upload failed!'); } }); });