<?xml version="1.0" encoding="UTF-8"?>
<h:screen xmlns:h="http://www.hand-china.com/hap">


    <script><![CDATA[

    var materialId = ${RequestParameters.materialId!-1};
    var viewModel = kendo.observable({
        enabled: true,
        isEnabled: false,
        data: {},


    });
    /*初始化viewModel.data*/
    $.ajax({
        type: "GET",
        async: false,
        url: "${base.contextPath}/wechat/material/query?materialId=" + materialId,
        contentType: "application/json; charset=utf-8",
        success: function (datas) {
            var data = datas.rows[0];
            for (var key in data) {
                viewModel.data.set(key, data[key])
            }
        }
    })

    ]]></script>
    <h:hlsForm title="基本信息" width="100%" id="memberForm">
        <h:hlsHBox id="firstBox">
            <h:hlsMaskedTextBox name="materialDesc" id="materialDesc" bind="enabled: enabled, value:data.materialDesc" colspan="2"
                                prompt="描述" promptColspan="1" style="width:100%" required="true"/>
            <!--<h:hlsCombobox name="gender" id="gender"
                           bind="enabled: enabled,source: gender, value:data.gender"
                           colspan="2" dataTextField="meaning" dataValueField="value"
                           placeholder="性别" prompt="性别" promptColspan="1" valuePrimitive="true"
                           style="width:100%"/>-->
            <h:hlsMaskedTextBox name="type" id="type" bind="enabled: enabled, value:data.type" colspan="2"
                                prompt="素材类型" promptColspan="1" style="width:100%" required="true"/>

        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="createdAt" id="createdAt" bind="enabled: enabled, value:data.createdAt" colspan="2"
                                prompt="创建时间戳" promptColspan="1" style="width:100%" required="true"/>
            <h:hlsMaskedTextBox name="validAt" id="validAt" bind="enabled: enabled, value:data.validAt" colspan="2"
                                prompt="有效期截止时间戳" promptColspan="1" style="width:100%"/>

        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="directory" id="directory" bind="enabled: enabled, value:data.directory" colspan="2"
                                prompt="文件存储路径" promptColspan="1" style="width:100%"/>
            <!--<h:hlsCombobox name="isleader" id="isleader"
                           bind="enabled: enabled,source: isleader, value:data.isleader"
                           colspan="2" dataTextField="meaning" dataValueField="value"
                           placeholder="是否上级" prompt="是否上级" promptColspan="1" valuePrimitive="true"
                           style="width:100%"/>-->
            <h:hlsMaskedTextBox name="contentSourceUrl" id="contentSourceUrl" bind="enabled: enabled, value:data.contentSourceUrl" colspan="2"
                                prompt="图文消息原文链接" promptColspan="1" style="width:100%"/>
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="remoteUrl" id="remoteUrl" bind="enabled: enabled, value:data.remoteUrl"
                                colspan="2"
                                prompt="图文页或者视频素材" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="content" id="content" bind="enabled: enabled, value:data.content"
                                colspan="2"
                                prompt="图文消息内容html" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="showCoverPic" id="show_cover_pic" bind="enabled: enabled, value:data.show_cover_pic" colspan="2"
                                prompt="是否显示封面" promptColspan="1" style="width:100%"/>

            <!-- <h:hlsDatePicker id="englishName" bind="enabled: enabled,value:data.validTo"
                              style="width:100%;"
                              placeholder="授信期限到"
                              prompt="授信期限到"
                              colspan="2"
                              promptColspan="1"
             />-->
            <!--
                            <h:hlsMaskedTextBox name="currency" id="currency" bind="enabled: enabled, value:data.currency" colspan="2" prompt="币种:" promptColspan="1"  style="width: 100%"/>
            -->

        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="mediaId" id="mediaId" bind="enabled: enabled, value:data.mediaId" colspan="2"
                                prompt="mediaId" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="description" id="description" bind="enabled: enabled, value:data.description" colspan="2"
                                prompt="视频素材描述" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="title" id="title" bind="enabled: enabled, value:data.title" colspan="2"
                                prompt="视频或图文消息标题" promptColspan="1" style="width:100%"/>

            <!--<h:hlsMaskedTextBox name="description" id="description" bind="enabled: enabled, value:data.description" colspan="10" prompt="备注:" promptColspan="2"  style="width: 81%"/>-->
        </h:hlsHBox>
        <h:hlsHBox>
            <h:hlsMaskedTextBox name="author" id="author" bind="enabled: enabled, value:data.author" colspan="2"
                                prompt="作者" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="digest" id="digest" bind="enabled: enabled, value:data.digest" colspan="2"
                                prompt="摘要" promptColspan="1" style="width:100%"/>
            <h:hlsMaskedTextBox name="thumbMediaId" id="thumbMediaId" bind="enabled: enabled, value:data.thumbMediaId" colspan="2"
                                prompt="图文消息封面id" promptColspan="1" style="width:100%"/>
        </h:hlsHBox>

    </h:hlsForm>
    <h:hlsToolBar>
        <h:hlsButton id="save" text="提交修改"></h:hlsButton>
    </h:hlsToolBar>
    <script><![CDATA[

    ]]></script>
</h:screen>