<?php /* Smarty version 2.6.17, created on 2018-05-17 18:54:58
         compiled from admin/activity/setPage_event.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<style>
.set-nav {
	margin: 0 auto;
}
.set-nav-hr {
	background-color: #ddd;
    height: 1px;
    position: relative;
}
.form-group label {
	font-weight: 600;
}
.checkbox-inline, .radio-inline {
	font-weight: 400!important;
}
.rowlabel {
	font-weight: 300!important;
}
.music_play_hide {
	display:none;
}
.ke-container {
	width:640px!important
}
</style>


<div id="activity_container">

<form id="activity_form">

<div class="activity_center">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

	<input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
">
	
	<div  class="panel panel-default">
		<div class="panel-body">

			<div class="form-group">
				<label class="control-label rowlabel">显示顶部数据栏目:</label>
				<?php $_from = $this->_tpl_vars['eventsTopData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['info']):
?>
				<label class="radio-inline">
					<input name="top_data" type="radio" value="<?php echo $this->_tpl_vars['key']; ?>
" <?php if ($this->_tpl_vars['eventData']['top_data'] == $this->_tpl_vars['key']): ?>checked<?php endif; ?>> <?php echo $this->_tpl_vars['info']['desc']; ?>

				</label>
				<?php endforeach; endif; unset($_from); ?>
			</div>

			<div class="form-group">
				<label class="control-label rowlabel">显示分栏标签:</label>

				<input name="is_column_tag_1" type="checkbox" value="1" <?php if ($this->_tpl_vars['eventData']['is_column_tag_1'] == 1): ?>checked<?php endif; ?>>

				<input name="column_tag_1" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['column_tag_1']): ?><?php echo $this->_tpl_vars['eventData']['column_tag_1']; ?>
<?php else: ?> 活动介绍<?php endif; ?>"/>

				<input name="is_column_tag_2" type="checkbox" value="1" <?php if ($this->_tpl_vars['eventData']['is_column_tag_2'] == 1): ?>checked<?php endif; ?>>

				<input name="column_tag_2" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['column_tag_2']): ?><?php echo $this->_tpl_vars['eventData']['column_tag_2']; ?>
<?php else: ?> 中奖信息<?php endif; ?>"/>

				<input name="is_column_tag_3" type="checkbox" value="1" <?php if ($this->_tpl_vars['eventData']['is_column_tag_3'] == 1): ?>checked<?php endif; ?>>

				<input name="column_tag_3" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['column_tag_3']): ?><?php echo $this->_tpl_vars['eventData']['column_tag_3']; ?>
<?php else: ?> 试用评价<?php endif; ?>"/>
			</div>

			<div class="form-group">
				<label class="control-label rowlabel">正文内容:</label>
				<textarea name="events_tips" class="form-control" rows="15" style="width:;"><?php echo $this->_tpl_vars['eventData']['events_tips']; ?>
</textarea>
			</div>
			
			<div class="form-group">
				<label class="control-label rowlabel">是否显示分享按钮:</label>
				<?php $_from = $this->_tpl_vars['eventsShareButton']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['info']):
?>
				<label class="radio-inline">
					<input name="share_button" type="radio" value="<?php echo $this->_tpl_vars['key']; ?>
" <?php if ($this->_tpl_vars['eventData']['share_button'] == $this->_tpl_vars['key']): ?>checked<?php endif; ?>> <?php echo $this->_tpl_vars['info']['desc']; ?>

				</label>
				<?php endforeach; endif; unset($_from); ?>

				<input name="share_button_tips" class="form-control" style="display:inline;width:300px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['share_button_tips']): ?><?php echo $this->_tpl_vars['eventData']['share_button_tips']; ?>
<?php else: ?>分享优惠给好友<?php endif; ?>"/>
			</div>

			<div class="form-group">
				<label class="control-label rowlabel">是否显示导购按钮:</label>
				<?php $_from = $this->_tpl_vars['eventsBuyButton']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['info']):
?>
				<label class="radio-inline">
					<input name="buy_button" type="radio" value="<?php echo $this->_tpl_vars['key']; ?>
" <?php if ($this->_tpl_vars['eventData']['buy_button'] == $this->_tpl_vars['key']): ?>checked<?php endif; ?>> <?php echo $this->_tpl_vars['info']['desc']; ?>

				</label>
				<?php endforeach; endif; unset($_from); ?>

				<input name="buy_button_tips" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['buy_button_tips']): ?><?php echo $this->_tpl_vars['eventData']['buy_button_tips']; ?>
<?php else: ?> 立即购买通道<?php endif; ?>"/>

				<input name="buy_button_link" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['buy_button_link']): ?><?php echo $this->_tpl_vars['eventData']['buy_button_link']; ?>
<?php else: ?> 微信链接<?php endif; ?>"/>

				<input name="buy_button_app" class="form-control" style="display:inline;width:150px;" type="text" value="<?php if ($this->_tpl_vars['eventData']['buy_button_app']): ?><?php echo $this->_tpl_vars['eventData']['buy_button_app']; ?>
<?php else: ?> APP链接<?php endif; ?>"/>
			</div>

			<div class="form-group">
				<label class="control-label rowlabel">互动提示语:</label>
				<input name="events_hd_tips" class="form-control" type="text" style="width:300px;" value="<?php echo $this->_tpl_vars['eventData']['events_hd_tips']; ?>
"/>
			</div>

			<div class="form-group">
				<label class="control-label rowlabel">活动规则提示语:</label>
				<input name="operationt_tips" class="form-control" type="text" style="width:300px;" value="<?php echo $this->_tpl_vars['eventData']['operationt_tips']; ?>
"/>
			</div>
			<div class="form-group">
				<label class="control-label rowlabel">活动规则:</label>
				<textarea name="events_rules" class="form-control" rows="15" style="width:;"><?php echo $this->_tpl_vars['eventData']['events_rules']; ?>
</textarea>
			</div>
			<a id="activity_submit" href="javascript:;" class="button button-3d button-primary button-rounded"><i class="fa fa-refresh fa-spin" style="display:none;"></i> 保存设置</a>
 		</div>
	</div>
</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div style="clear:both;"></div>
</form>
</div>

<script>
var tips_editor,rules_editor;
KISSY.use('node, io, uri', function (S, Node, IO, Uri) {
	var $ = S.all;
	var Query = Uri.Query;
	
	var activity_submit_status = false; //按钮状态
    function submit_button_active() {
    	activity_submit_status = true;
    	$("#activity_submit").addClass('active').all('i').show();
    }
    function submit_button_default() {
    	activity_submit_status = false;
    	$("#activity_submit").removeClass('active').all('i').hide();
    }
    
	$("#activity_submit").on('click', function () {
    	if (activity_submit_status) {
    		return false;
    	}
    	submit_button_active();
    	
    	var events_tips = tips_editor.html();
    	var events_rules = rules_editor.html();
    	
    	formData = IO.serialize("#activity_form");
    	formData = new Query(formData).set('events_tips', events_tips).toString();
    	formData = new Query(formData).set('events_rules', events_rules).toString();
    	
    	new IO({
			type: "post"
			, url: VG.conf.root_domain + '/?c=Admin_Activity_SetPage&a=ReqUpRoutine'
			, data: formData
			, success: function (data) {
				if (data.ok) { //ok
					location.href = location.href;
				} else {
					alert('操作失败,原因:'+data.msg);
					location.href = location.href;
				}
				return false;
			}
			, error: function (NULL, textStatus) {
				alert("请求服务器失败,原因:"+textStatus);
			}
			, dataType: "json"
		});
	});
});

var KCONFIG = {
	allowFileManager : true,
	uploadJson : VG.conf.root_domain + '/?c=kindeditor&a=updateJson',
	fileManagerJson : VG.conf.root_domain + '/?c=kindeditor&a=fileManagerJson',
	items : [
				'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'lineheight', 'flash']
}
KindEditor.ready(function(K) {
	tips_editor = K.create('textarea[name=events_tips]', KCONFIG);
});

KindEditor.ready(function(K) {
	rules_editor = K.create('textarea[name=events_rules]', KCONFIG);
});
</script>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>