$(function() {
    var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
        $gallery = $("#gallery"),
        $galleryImg = $("#galleryImg"),
        $uploaderInput = $("#uploaderInput"),
        $uploaderFiles = $("#uploaderFiles");

    $uploaderInput.on("change", function(e) {
        var src, url = window.URL || window.webkitURL || window.mozURL,
            files = e.target.files;
        for (var i = 0, len = files.length; i < len; ++i) {
            var file = files[i];
            console.log(files)
            if (url) {
                src = url.createObjectURL(file);
            } else {
                src = e.target.result;
            }
            console.log(src)
            $uploaderFiles.append($(tmpl.replace('#url#', src)));
        }
    });
});