<!DOCTYPE html>
<html lang="zh">
<head>
    <@meta/>
	<title>渠道配置</title>
    <#include "admin/common/include_hplus.ftl">
    <#include "admin/common/include_form.ftl">
    <#include "admin/common/include_upload.ftl">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h3>${entity.channelSubName}渠道配置</h3><a href="<@contextPath/>/marketing/golist?channelConfigId=${channelConfigId}" class="btn btn-link">| 返回列表</a>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" action="<@contextPath/>/saveEntity" method="post">
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span class="text-danger">*</span>企微成员的userid列表：</label>
                            <div class="col-sm-8">
                                <input class="form-control input-sm" type="text" required="" aria-required="true" name="wxCorpUseridList" value="${entity.wxCorpUseridList }">
                                <span class="help-block m-b-none">有多个userid时，用英文逗号分隔。注意最前和最后不要出现逗号，不要出现空格。建议保留上次的，在后面追加最新的。</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span class="text-danger">*</span>企微成员的二维码：<p>(仅微信渠道支持活码)</p></label>
                            <div class="col-sm-8">
                                <table class="table table-bordered">
                                    <thead><th>
                                        <table class="table-image">
                                            <tr>
                                                <td></td>
                                                <td><input type="hidden" name="qrcodeUrl" value="${entity.qrcodeUrl }" data-type="gif,jpg,jpeg,bmp,png" data-fileNumLimit="30" data-fileSingleSizeLimit=""></td>
                                            </tr>
                                        </table>
                                    </th></thead>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">企微成员的个人码：<p>(仅支持个人码,微信渠道必须)</p></label>
                            <div class="col-sm-8">
                                <table class="table table-bordered">
                                    <thead><th>
                                        <table class="table-image">
                                            <tr>
                                                <td></td>
                                                <td><input type="hidden" name="wxCorpUserQrcodeList" value="${entity.wxCorpUserQrcodeList }" data-type="gif,jpg,jpeg,bmp,png" data-fileNumLimit="30" data-fileSingleSizeLimit=""></td>
                                            </tr>
                                        </table>
                                    </th></thead>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
						<input type="hidden" name="landingConfigExtendId" value="${entity.landingConfigExtendId }">
                    </form>
                </div>
            </div>
            </div>
        </div>
    </div>
<script>
    $(function(){

        $('[name="qrcodeUrl"]').uploadMultipleImage();
        $('[name="wxCorpUserQrcodeList"]').uploadMultipleImage();

        $('.form-horizontal').validate({
            onkeyup:false,
            focusCleanup:true,
            submitHandler:function(form){
                App.Ajax.request({
                    url		: '${updateConfigExtendUrl}',
                    headers : {
                        'ffrom' : '${entity.ffrom }'
                    },
                    params  : JSON.stringify({
                        'landingConfigExtendId': $('input[name="landingConfigExtendId"]').val(),
                        'wxCorpUseridList': $('input[name="wxCorpUseridList"]').val(),
                        'qrcodeUrl': $('input[name="qrcodeUrl"]').val(),
                        'wxCorpUserQrcodeList': $('input[name="wxCorpUserQrcodeList"]').val()
                    }),
                    contentType: "application/json",
                    success: function(result){
                        // window.location.href = Config.ROOT + '/marketing/info?ffrom=${entity.ffrom}';
                        window.location.href = Config.ROOT + '/marketing/golist?channelConfigId=${channelConfigId}';
                    }
                });
            }
        });

    });
</script>
</body>
</html>
