JS解析ipa/apk

2021-03-29  本文已影响0人  哎哟我去
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>upload模块快速使用</title>
    <link rel="stylesheet" href="/static/zsign/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-upload-drag" id="test10">
    <i class="layui-icon"></i>
    <p>点击上传,或将文件拖拽到此处</p>
    <br>
    <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="demo">
        <div class="layui-progress-bar" lay-percent="0%"></div>
    </div>
</div>

<script src="/static/zsign/layui/layui.js"></script>
<script src="/static/admin/js/zsign/app-info-parser.js"></script>
<script>
    layui.use(['upload', 'element'], function () {
        let upload = layui.upload;
        let element = layui.element;
        //拖拽上传
        upload.render({
            elem: '#test10'
            , accept: 'file'
            , auto: false
            , url: '{:url("admin/zsign.Upload/uploadIpa")}'
            , choose: function (obj) {
                obj.preview(function (index, file, result) {
                    new AppInfoParser(file).parse().then(appInfo => {
                        console.log(appInfo);
                    });
                });
                layer.load();
            }
            , progress: function (n, elem) {
                let percent = n + '%'
                element.progress('demo', percent);
            }
            , done: function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg);
                } else {
                    layer.alert(res.msg);
                }
            }
        });
    });
</script>
</body>
</html>
上一篇下一篇

猜你喜欢

热点阅读