virtualEdit.html 3.88 KB
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
    <form name="topicForm" id="topicForm" method="post">
        <div style="margin-top: 20px;margin-left: 30px">
            <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">

                <tr style="height: 60px">

                    <td>
                        <span style="color:red">*</span><label>UID</label> <br>
                        <input id="uid" name="uid" class="easyui-textbox" style="width: 380px;" readonly='readonly'/>
                    </td>
                </tr>

                <tr style="height: 60px">

                    <td>
                        <span style="color:red">*</span><label>马甲昵称</label> <br>
                        <input id="nickName" name="nickName" class="easyui-textbox" style="width: 380px;"/>
                    </td>
                </tr>

                <tr style="height: 60px">
                    <td>
                        <span style="color:red">*</span><label>头像</label> <br>

                        <div id="imageUpload">
                        </div>
                        <!-- <span style=" margin-left: 10px; color: red"> 图片宽高(186x170)</span>-->
                    </td>
                </tr>
                <tr style="height: 60px">

                    <td>
                        <span style="color:red">*</span><label>马甲简介</label> <br>
                        <textarea id="signature" name="signature" style="width: 380px;" rows="6" placeholder=""
                                  required="true" maxlength="500"></textarea>
                    </td>
                </tr>


            </table>
        </div>
    </form>

</div>


<script>


    $(function () {
        $("#nickName").textbox({
            required: true,
            missingMessage: "昵称不能为空",
            prompt: "请输入昵称"
        });


        $("#imageUpload").imageUpload({
            width: 171,
            height: 120,
            realInputName: "headIcon",
            url: serverContextPath + '/fileupload/uploadFile',
            queryParams: {
                bucket: "activity"
            },
            onBeforeSubmit: function () {
                $.messager.progress({
                    title: "正在执行",
                    msg: "正在执行,请稍后...",
                    interval: 500,
                    text: ""
                });
            },
            filterFileName: function (data) {
                debugger;
                if (!data || data.code != 200) {
                    $.messager.progress("close");
                    $.messager.alert("错误", data.message);
                    return "";
                }
                return data.data.url;
            },
            onLoadSuccess: function (data) {
                $.messager.progress("close");
                //$("#imageUpload").hide();
                //$("#fileName").val(data.data.fileName);
                //$("#videoSize").val(data.data.fileSize); //如果有大小校验
                /*$("#callBackDiv").html("<div id='videoUploadDiv' class='image-upload' style='position: relative;top:19px;width: 120px; height: 150px;'><img id='imageShow' src='"+data.data.url+"?vframe/jpg/offset/0' width='120' height='150'/></div>"
                 +"<span style='position: relative;top: -40px;left: 30px;'>"+data.data.fileName+"</span><span style='position: relative;left: 50px;top: -40px;'>"+data.data.fileSize+"M</span>").show();
                 */
                return false;
            }
        });

        //加载数据
        var data = paramObject.mkData;
        $("#uid").textbox("setValue", data.uid);
        $("#nickName").textbox("setValue", data.nickName);
        $("#signature").html(data.signature);
        //图片
        $("#imageUpload").imageUpload('setValue', data.headIcon);

    });


</script>

</html>