{include file="public/seller_top" /}

<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">
        <div class="seller_items">
            {include file="public/seller_items" /}
        </div>
        <div class="alert alert-block mt10">
            <h4>操作提示：</h4>
            <ul>
                <li>1、{$Think.lang.store_sns_setting_tips_1}</li>
                <li>2、{$Think.lang.store_sns_setting_tips_2}</li>
            </ul>
        </div>
        <form method="post" id="form_snssetting" action="{:url('Sellersns/setting')}">
            <input type="hidden" name="form_submit" value="ok" />
            <table class="dssc-default-table">
                <thead>
                    <tr>
                        <th class="w100">{$Think.lang.store_sns_auto}</th>
                        <th class="w400">{$Think.lang.store_sns_name}{$Think.lang.store_sns_cotent}</th>
                        <th>系统默认动态</th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="bd-line">
                        <td><input type="checkbox" name="new" <?php if(!isset($sauto_info) || $sauto_info['sauto_new'] == 1){?>checked="checked"<?php }?> value="1" /></td>
                        <td class="tl">
                            <strong>{$Think.lang.store_sns_new_selease}</strong>
                            <textarea nctype="charcount" class="textarea w400" name="new_title" rows="2" id="new_title"><?php echo $sauto_info['sauto_newtitle'];?></textarea>
                            <div id="charcount_new_title" class="tr w400"></div></td>
                        <td><p>{$Think.lang.ds_store_auto_share_new1}</p>
                            <p>{$Think.lang.ds_store_auto_share_new2}</p>
                            <p>{$Think.lang.ds_store_auto_share_new3}</p>
                            <p>{$Think.lang.ds_store_auto_share_new4}</p>
                            <p>{$Think.lang.ds_store_auto_share_new5}</p></td>
                    </tr>

                    <tr class="bd-line">
                        <td><input type="checkbox" name="xianshi" <?php if(!isset($sauto_info) || $sauto_info['sauto_xianshi'] == 1){?>checked="checked"<?php }?> value="1" /></td>
                        <td class="tl"><strong>{$Think.lang.store_sns_xianshi}</strong><textarea nctype="charcount" class="w400" name="xianshi_title" rows="2" id="xianshi_title"><?php echo $sauto_info['sauto_xianshititle'];?></textarea>
                            <div id="charcount_xianshi_title" class="tr w400"></div></td>
                        <td><p>{$Think.lang.ds_store_auto_share_xianshi1}</p>
                            <p>{$Think.lang.ds_store_auto_share_xianshi2}</p>
                            <p>{$Think.lang.ds_store_auto_share_xianshi3}</p>
                            <p>{$Think.lang.ds_store_auto_share_xianshi4}</p>
                            <p>{$Think.lang.ds_store_auto_share_xianshi5}</p></td>
                    </tr>
                    <tr class="bd-line">
                        <td><input type="checkbox" name="mansong" <?php if(!isset($sauto_info) || $sauto_info['sauto_mansong'] == 1){?>checked="checked"<?php }?> value="1" /></td>
                        <td class="tl"><strong>{$Think.lang.store_sns_mansong}</strong><textarea nctype="charcount" class="w400" name="mansong_title" rows="2" id="mansong_title"><?php echo $sauto_info['sauto_mansongtitle'];?></textarea>
                            <div id="charcount_mansong_title" class="tr w400"></div></td>
                        <td><p>{$Think.lang.ds_store_auto_share_mansong1}</p>
                            <p>{$Think.lang.ds_store_auto_share_mansong2}</p>
                            <p>{$Think.lang.ds_store_auto_share_mansong3}</p>
                            <p>{$Think.lang.ds_store_auto_share_mansong4}</p>
                            <p>{$Think.lang.ds_store_auto_share_mansong5}</p></td>
                    </tr>
                    <tr class="bd-line">
                        <td><input type="checkbox" name="bundling" <?php if(!isset($sauto_info) || $sauto_info['sauto_bundling'] == 1){?>checked="checked"<?php }?> value="1" /></td>
                        <td class="tl"><strong>{$Think.lang.store_sns_bundling}</strong><textarea nctype="charcount" class="w400" name="bundling_title" rows="2" id="bundling_title"><?php echo $sauto_info['sauto_bundlingtitle'];?></textarea>
                            <div id="charcount_bundling_title" class="tr w400"></div></td>
                        <td><p>{$Think.lang.ds_store_auto_share_bundling1}</p>
                            <p>{$Think.lang.ds_store_auto_share_bundling2}</p>
                            <p>{$Think.lang.ds_store_auto_share_bundling3}</p>
                            <p>{$Think.lang.ds_store_auto_share_bundling4}</p>
                            <p>{$Think.lang.ds_store_auto_share_bundling5}</p></td>
                    </tr>
                    <tr class="bd-line">
                        <td><input type="checkbox" name="groupbuy" <?php if(!isset($sauto_info) || $sauto_info['sauto_groupbuy'] == 1){?>checked="checked"<?php }?> value="1" /></td>
                        <td class="tl"><strong>{$Think.lang.store_sns_gronpbuy}</strong><textarea nctype="charcount" class="w400" name="groupbuy_title" rows="2" id="groupbuy_title"><?php echo $sauto_info['sauto_bundlingtitle'];?></textarea>
                            <div id="charcount_groupbuy_title" class="tr w400"></div></td>
                        <td><p>{$Think.lang.ds_store_auto_share_groupbuy1}</p>
                            <p>{$Think.lang.ds_store_auto_share_groupbuy2}</p>
                            <p>{$Think.lang.ds_store_auto_share_groupbuy3}</p>
                            <p>{$Think.lang.ds_store_auto_share_groupbuy4}</p>
                            <p>{$Think.lang.ds_store_auto_share_groupbuy5}</p></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="20" class="bottom"><input type="submit" value="{$Think.lang.ds_common_button_save}" class="submit mt10 mb5" style="display: inline-block;"></td>
                    </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript" src="{$Think.config.url_domain_root}static/plugins/jquery.charCount.js"></script> 
<script type="text/javascript">
$(function(){
	$('#form_snssetting').validate({
		errorLabelContainer: $('#warning'),
		invalidHandler: function(form, validator) {
			$('#warning').show();
		},
		submitHandler:function(form){
			ajaxpost('form_snssetting', '', '', 'onerror');
		},
		rules : {
			new_title : {
				maxlength : 140
			},
			coupon_title : {
				maxlength : 140
			},
			xianshi_title : {
				maxlength : 140
			},
			mansong_title : {
				maxlength : 140
			},
			bundling_title : {
				maxlength : 140
			},
			groupbuy_title : {
				maxlength : 140
			}
		},
		messages : {
			new_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			},
			coupon_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			},
			voucher_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			},
			mansong_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			},
			bundling_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			},
			groupbuy_title : {
				maxlength : '{$Think.lang.store_sns_content_less_than}'
			}
		}
	});

	//评论字符个数动态计算
	$('*[nctype="charcount"]').each(function(){
		$(this).charCount({
			allowed: 140,
			warning: 10,
			counterContainerID:'charcount_'+$(this).attr('id'),
			firstCounterText:'{$Think.lang.sns_charcount_tip1}',
			endCounterText:'{$Think.lang.sns_charcount_tip2}',
			errorCounterText:'{$Think.lang.sns_charcount_tip3}'
		});
	});
});
</script>