部分思路借用网友,部分是自己细化的. 先声明.
不多说,参考代码
@{ ViewBag.Title = "费用填报"; Layout = "~/Views/Shared/_MForm.cshtml";} 费用填报备注附件上传:
0/2
//$.ajax({});
}; reader.readAsDataURL(file); } }); var index; //第几张图片 $uploaderFiles.on("click", "li", function () { index = $(this).index(); $galleryImg.attr("style", this.getAttribute("style")); $gallery.fadeIn(100); }); $gallery.on("click", function () { $gallery.fadeOut(100); }); //删除图片 $(".weui-gallery__del").click(function () { $uploaderFiles.find("li").eq(index).remove(); var num = $('.weui-uploader__file').length; $('#uploadCount').text(num); }); $("#btnsaveCharge").click(function () { //或者在这里实现批量上传, 不建议批量上传 }); }); //生成guid function genGUID() { var G1 = (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); var G2 = (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); return (G1 + G2); }
//引入示例
@RenderBody()