<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>KGCMS企业应用管理平台 - Powered by KGCMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<!-- <meta http-equiv="cache-control" content="no-siteapp" /> -->
<link rel="stylesheet" type="text/css" href="{{kg['tpl_url']}}style/questions_update.css">
<script src="{{kg['tpl_url']}}script/jquery.min.js"></script>
<script src="{{kg['tpl_url']}}script/cropper.min.js"></script>
<script src="{{kg['tpl_url']}}script/amazeui.datetimepicker.min.js"></script>
<script src="{{kg['server']['HTTP_HOST']}}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{kg['tpl_url']}}script/questions_update.js"></script>
</head>
<body data-type="generalComponents">
	{% include 'component_header.tpl' %}
	<div class="tpl-page-container tpl-page-header-fixed">
		<div class="scrollbar-wrap">
		{% include 'component_left.tpl' %}
		<div class="tpl-content-wrapper ngco-Osz-marginT">
			<div class="tpl-content-page-title">
				添加关键词回复
			</div>
			<ol class="am-breadcrumb">
				<li><a href="./" class="am-icon-home">首页</a></li>
				<li class="am-active">
					添加关键词回复</li>
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title">
					<div class="caption font-green bold">
						<span class="am-icon-code"></span>&nbsp;添加关键词回复规则
					</div>
				</div>
				<div class="tpl-block">
					<div class="am-g">
						<div class="tpl-form-body tpl-form-line">
							<form class="am-form tpl-form-line-form" method="post" action="">
								<div class="am-form-group">
									<label class="am-u-sm-3 am-form-label">关键词或问题&nbsp;/&nbsp;<span class="tpl-form-line-small-title">KeyWord
										</span>
									</label>
									<div class="am-u-sm-6 am-u-sm-pull-3" id="ask">
										<div class="am-plus-box am-form-group" style="margin-bottom: 0;">
											<input type="text" class="tpl-form-input ngco_Ojs_email" name="ask[]" value="{{data['ask'][0]}}">
											<span class="am-icon-plus-circle"></span>
										</div>
										{% if data['ask']|length > 1%}
										{% for row in data['ask'] %}
										{% if loop.index0 > 0 %}
										<div class="am-plus-box">
											<input type="text" class="tpl-form-input" name="ask[]" value="{{row}}">
											<span class="am-icon-minus-circle"></span>
										</div>
										{% endif %}
										{% endfor %}
										{% endif %}
									</div>
								</div>
								<div class="am-form-group">
									<label for="title" class="am-u-sm-3 am-form-label">回复模式&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Reply
										</span></label>
									<div class="am-u-sm-6 am-u-sm-pull-3">
										<input id="type1" name="type" type="radio" value="0" {% if data['type'] == 0 %}checked=checked{% endif %}/>&nbsp;<span style="font-size:14px;">使用本地素材库 &nbsp; &nbsp;</span>
										<input id="type2" name="type" type="radio" value="1" {% if data['type'] == 1 %}checked=checked{% endif %}/>&nbsp;<span style="font-size:14px;">使用微信素材库&nbsp;&nbsp; &nbsp;</span>
										<input id="type3" name="type" type="radio" value="2" {% if data['type'] == 2 %}checked=checked{% endif %}/>&nbsp;<span style="font-size:14px;">自定义文本&nbsp;&nbsp;&nbsp; &nbsp;</span>
									</div>
								</div>
								<div style="display: none;" id="tab1">
									<div class="am-form-group default-tpl">
										<label class="am-u-sm-3 am-form-label">选择回复素材&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Material</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<select name="local" data-am-selected="{searchBox: 1}">
												{% for row in local %}
												<option value="{{row['id']}}">{{row['name']}}</option>
												{% endfor %}
											</select>
											<a class="am-icon-plus material-plus" href="material_update"></a>
										</div>
									</div>
								</div>
								<!-- tab1结束 -->
								<!-- tab2  -->
								<div style="display: none;" id="tab2">
									<div class="am-form-group default-tpl">
										<label class="am-u-sm-3 am-form-label">微信素材类型&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Type</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3" id="select-handle">
											<select name="wx_type" data-am-selected="" style="">
												<option value="0">请选择微信素材类型</option>
												<option {% if wx_type == "news" %}selected="selected"{% endif %}value="1">图文</option>
												<option {% if wx_type == "image" %}selected="selected"{% endif %}value="2">图片</option>
												<option {% if wx_type == "voice" %}selected="selected"{% endif %}value="3">语音</option>
												<option {% if wx_type == "video" %}selected="selected"{% endif %}value="4">视频</option>
											</select>
										</div>
									</div>
									<div class="am-form-group default-tpl" id="news" style="display:none">
										<label class="am-u-sm-3 am-form-label">微信素材&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Material</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<select name="news" data-am-selected="" style="">
												{% for row in news %}
												<option {% if data['mid'] == row['id'] and type == 1 %}selected="selected"{% endif %}value="{{row['id']}}">{{row['name']}}</option>
												{% endfor %}
											</select>
										</div>
									</div>
									<div class="am-form-group default-tpl" id="image" style="display:none">
										<label class="am-u-sm-3 am-form-label">微信素材&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Material</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<select name="image" data-am-selected="" style="">
												{% for row in image %}
												<option {% if data['mid'] == row['id'] and type == 1 %}selected="selected"{% endif %}value="{{row['id']}}">{{row['name']}}</option>
												{% endfor %}
											</select>
										</div>
									</div>
									<div class="am-form-group default-tpl" id="voice" style="display:none">
										<label class="am-u-sm-3 am-form-label">微信素材&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Material</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<select name="voice" data-am-selected="" style="">
												{% for row in voice %}
												<option {% if data['mid'] == row['id'] and type == 1 %}selected="selected"{% endif %}value="{{row['id']}}">{{row['name']}}</option>
												{% endfor %}
											</select>
										</div>
									</div>
									<div class="am-form-group default-tpl" id="video" style="display:none">
										<label class="am-u-sm-3 am-form-label">微信素材&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Material</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<select name="video" data-am-selected="" style="">
												{% for row in video %}
												<option {% if data['mid'] == row['id'] and type == 1 %}selected="selected"{% endif %}value="{{row['id']}}">{{row['name']}}</option>
												{% endfor %}
											</select>
										</div>
									</div>
								</div>
								<!-- tab2结束 -->
								<!-- tab3  -->
								<div id="tab3">
									<div class="am-form-group">
										<label for="Introduction" class="am-u-sm-3 am-form-label ">回复内容&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Content</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<textarea id="Introduction" name="answer" class="" rows="5">{{data['answer']}}</textarea>
										</div>
									</div>
								</div>
								<!-- tab3结束 -->
								<div class="am-form-group">
									<label for="title" class="am-u-sm-3 am-form-label">匹配规则&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Regular
										</span></label>
									<div class="am-u-sm-6 am-u-sm-pull-3">
										<input id="typeu1" name="rule" type="radio" value="0" {% if data['rule'] == 0 %}checked=checked{% endif %} />&nbsp;<span style="font-size:14px;">广泛匹配 &nbsp; &nbsp;
										<input id="typeu2" name="rule" type="radio" value="1" {% if data['rule'] == 1 %}checked=checked{% endif %}/>&nbsp;<span style="font-size:14px;">精准匹配&nbsp; &nbsp;
									</div>
								</div>
								<div class="am-form-group">
									<label for="title" class="am-u-sm-3 am-form-label">是否应用&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Apply
										</span></label>
									<div class="am-u-sm-6 am-u-sm-pull-3">
										<div class="tpl-switch">
											<input name="enable" {% if data['enable'] %}checked="checked"{% endif %} value="1" type="checkbox" class="ios-switch bigswitch tpl-switch-btn">
											<div class="tpl-switch-btn-view">
												<div></div>
											</div>
										</div>
									</div>
								</div>
								<div class="am-form-group">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success">提交</button>
										<input type="hidden" name="action" value="submit">
									</div>
								</div>
							</form>
						</div>
					</div>
					<div class="am-alert am-alert-success success-info ngco-No-marginT">
						<ul class="margin-bottom-none padding-left-lg">
							<li class="am-state-info">状态说明：</li>
							<li class="am-verify">
								1、回复内容可以支持超链接标签，如：<span class="col-f60">请访问&lt;a href=&quot;http://app.kyger.com.cn/&quot;&gt;凯格官方APP&lt;/a&gt;</span><br />
								2、匹配规则 - 精准：只有当客户回复的字符和问题完全一致时才会采用。通常用于菜单等，如回复1向客户推送指定的菜单（元素）。<br />
								3、匹配规则 - 广泛：当用户发送的字符包含了定义的关键词或定义的关键词里包含了客户发送的字符时采用。<br />
								4、优先原则：相同的关键词出现多个答案时，以精准匹配的优先。相同的匹配规则出现相同关键词多个答案时，系统随机选取一个回复规则。<br />
							</li>
						</ul>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
</div><!-- /.scrollbar-wrap -->		
	</div>
</body>
</html>