<!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" href="{{ kg['tpl_url'] }}style/weixin_menu_manage.css">
<script src="{{ kg['tpl_url'] }}script/jquery.min.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/ueditor/ueditor.config.js?dir=article"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/ueditor/ueditor.all.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/ueditor/lang/zh-cn/zh-cn.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['tpl_url']}}script/common.js"></script>
<script src="{{ kg['tpl_url'] }}script/weixin_menu_manage.js"></script>
</head>
<body data-type="generalComponents">
	{% print(row) %}
	{% 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">
			<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 class="tpl-portlet-input tpl-fz-ml ngco-No-marginT">
						<div class="am-btn-toolbar ngre-Hdadd-paddidngT">
							<div class="am-btn-group am-btn-group-xs">
								<a class="am-btn am-btn-success"><span class="am-icon-close"></span>&nbsp;关闭菜单</a>
							</div>
						</div>
					</div>
				</div>
				<div class="tpl-block ">
					<div class="am-g">
						<div class="tpl-form-body tpl-form-line">
							<div class="menu_setting_area js_editBox">
								<form id="menu_form" class="am-form tpl-form-line-form" action="#" method="post" data="{{data}}">
									<div class="menu_preview_area mobile_menu_preview">
										<div class="mobile_hd tc">凯格科技</div>
										<div class="mobile_bd">
											<div class="keyboard border_r">
												<span class="am-icon-keyboard-o"></span>
											</div>
											<ul class="pre_menu_list grid_line ui-sortable ui-sortable-disabled" id="menu">
												{% if 'menu' in data %}
												{% for var in data['menu']['button'] %}
												{% set menu_index = loop.index0 %}
												<li class="jsMenu pre_menu_item border_r jslevel1 selected size1of{% if data['menu']['button']|length == 3%}3{% else %}{{data['menu']['button']|length + 1}}{% endif %}">
													<input type="hidden" class="menu_index" value="{{loop.index0}}" />
													<!-- <a href="javascript:void(0);" class="pre_menu_link pre_menu_link_txt"> -->
														<span class="js_l1Title menu_name menu_name_parent ty-title">{{var['name']}}</span>
														<div class="wx_form_hide">
															<input class="input_name" type="text" name="menu_name[]" value="{{var['name']}}">
															<input class="input_type" type="text" name="menu_type[]" value="{{var['type']}}">
															<input class="input_appid" type="text" name="menu_appid[]" value="{{var.get('appid', '')}}">
															<input class="input_url" type="text" name="menu_url[]" value="{{var.get('url', '')}}">
															<input class="input_pagepath" type="text" name="menu_pagepath[]" value="{{var.get('pagepath', '')}}">
															<input class="input_media_id" type="text" name="menu_media_id[]" value="{{var.get('media_id', '')}}">
															<input class="input_key" type="text" name="menu_key[]" value="{{var.get('key', '')}}">
														</div>
													<!-- </a> -->
													<div class="sub_pre_menu_box js_l2TitleBox" style="display: none;">
														<ul class="sub_pre_menu_list">
															<!--子菜单-->
															{% for row in var['sub_button'] %}
															<li  class="pre_menu_txt pre_menu_link_txt border_b jslevel2">
																<!-- <a href="javascript:void(0);" class="pre_menu_link pre_menu_link_txt jsSubView"> -->
																	<span class="js_sub_pre_menu_inner">
																		<span class="js_l2Title sub_menu_name menu_name_children ty-title">{{row['name']}}</span>
																	</span>
																<!-- </a> -->
																<div class="wx_form_hide">
																	<input class="subinput input_sub_name" type="text" name="button_name[{{menu_index}}][]" value="{{row['name']}}">
																	<input class="subinput input_sub_type" type="text" name="button_type[{{menu_index}}][]" value="{{row['type']}}">
																	<input class="subinput input_sub_appid" type="text" name="button_appid[{{menu_index}}][]" value="{{row.get('appid', '')}}">
																	<input class="subinput input_sub_url" type="text" name="button_url[{{menu_index}}][]" value="{{row.get('url', '')}}">
																	<input class="subinput input_sub_pagepath" type="text" name="button_pagepath[{{menu_index}}][]" value="{{row.get('pagepath', '')}}">
																	<input class="subinput input_sub_media_id" type="text" name="button_media_id[{{menu_index}}][]" value="{{row.get('media_id', '')}}">
																	<input class="subinput input_sub_key" type="text" name="button_key[{{menu_index}}][]" value="{{row.get('key', '')}}">
																</div>
															</li>
															{% endfor %}
															<!--加号-->
															<li class="js_addMenuBox son-plus" data-menu="2" data-key="0">
																<a href="javascript:void(0);" class="jsSubView js_addL2Btn pre_menu_link" title="最多添加5个子菜单">
																	<span class="am-icon-plus"></span>
																</a>
															</li>
														</ul>
														<i class="arrow arrow_out"></i>
														<i class="arrow arrow_in"></i>
													</div>
												</li>
												{% endfor %}
												{% endif %}
												<!-- 主菜单 -->
												<li class="pre_menu_item js_addMenuBox grid_item no_extra father-plus size1of{% if 'menu' in data %}{% if data['menu']['button']|length == 3%}3{% else %}{{data['menu']['button']|length + 1}}{% endif %}{% endif %}" data-menu="1">
													<a href="javascript:void(0);" class="pre_menu_link js_addL1Btn">
														<span class="am-icon-plus"></span>
													</a>
												</li>
											</ul>
										</div>
									</div>
									<div class="menu_form_area float_l">
										<div id="js_rightBox" class="portable_editor">
											<div class="portable_js_editor" id="menu-set" style="display: none">
												<div class="menu_form_hd js_second_title_bar">
													<div id="lbl_menu_name" class="global_info global_info_js float_l">菜单名称</div>
													<div class="global_extra am-btn-toolbar float_r">
														<div class="am-btn-group am-btn-group-xs">
															<a href="javascript:;" id="jsDelBt" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div jsDelBt" style="cursor: pointer;">
																<span class="am-icon-trash-o"></span>&nbsp;删除菜单
															</a>
														</div>
													</div>
												</div>
												<div class="menu_form_bd" id="view">
													<div class="msg_sender_tips tips_global"></div>
													<div class="am-form-group wx_form_group js_setNameBox" id="menu_name_div">
														<label class="am-form-label wx_form_label frm_label js_menuTitle">菜单名称&nbsp;/&nbsp;MenuName</label>
														<div class="frm_controls am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan">
															<input type="text" id="menu_name" class="js_menu_name" placeholder="字数不超过4个汉字或8个字母" value="菜单名称">
														</div>
													</div>
													<div class="am-form-group wx_form_group frm_control_group">
														<label class="am-form-label wx_form_label js_menuContent">菜单内容&nbsp;/&nbsp;MenuContent</label>
														<div class="am_fl_zi_tihuan wx_fl_zi_tihuan" id="type_set">
															<label class="frm_radio_label js_radio_sendMsg">
																<input type="radio" name="type" class="frm_radio frm_radio_int" value="1">
																<span class="lbl_content">发送消息</span>
															</label>
															<label class="frm_radio_label js_radio_url">
																<input type="radio" name="type" class="frm_radio frm_radio_int" value="2">
																<span class="lbl_content">跳转网页</span>
															</label>
															<label class="frm_radio_label js_radio_weapp">
																<input type="radio" name="type" class="frm_radio frm_radio_int" value="3">
																<span class="lbl_content">跳转小程序</span>
															</label>
															<label class="frm_radio_label js_radio_weapp">
																<input type="radio" name="type" class="frm_radio frm_radio_int" value="4">
																<span class="lbl_content">其他事件</span>
															</label>
														</div>
													</div>
													<div id="type1" class="menu_content_container wx_form_js_ctent wx_form_js_material wx_type">
														<div class="menu_content weapp wx_form_ctent wx_form_show">
															<div class="am-form-group wx_form_group">
																<label class="frm_label am-form-label wx_form_label">消息类型&nbsp;/&nbsp;Type</label>
																<div class="am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																	<span class="js_weapp_backup_url_input">
																		<select id="material" class="material" style="display: none;" data-am-selected="{btnSize: 'sm'}">
																			<option value="local_material">本地素材推送</option>
																			<option value="js_msgSender">腾讯素材推送</option>
																		</select>
																	</span>
																</div>
																<div id="local_material" class="am_fl_zi_tihuan wx_fl_zi_tihuan">
																	<div class="js_weapp_backup_url_input_wrapper">
																		<span class="js_weapp_backup_url_input">
																			<select class="material" id="local" name="category" style="display: none;" data-am-selected="{btnSize: 'sm'}">
																				{% for row in local %}
																				<option value="{{row['id']}}">{{row['name']}}</option>
																				{% endfor %}
																			</select>
																		</span>
																	</div>
																</div>
																<div id="js_msgSender" class="msg_sender material_choose am-form-group wx_form_group frm_control_group wx_form_hide" style="display: none;">
																	<div class="msg_tab">
																		<div class="tab_navs_panel">
																			<span class="tab_navs_switch_wrp switch_prev js_switch_prev">
																				<span class="tab_navs_switch"></span>
																			</span>
																			<span class="tab_navs_switch_wrp switch_next js_switch_next">
																				<span class="tab_navs_switch"></span>
																			</span>
																			<div class="tab_navs_wrp">
																				<ul class="tab_navs js_tab_navs" style="margin-left:0;">
																					<li class="tab_nav tab_appmsg width6 selected" data-type="10" data-tab=".js_appmsgArea" data-tooltip="图文消息">
																						{% if row %}
																						{% for row in wx %}
																						{% if row['news_type'] == 0 %}
																						<div class="am-u-sm-12 am-u-md-6 am-u-lg-4 picture-div">
																							<div class="tpl-table-images-content">
																								<div class="tpl-table-images-content-i-time">
																									更新时间：{{row['update_time']}}
																									<div class="tpl-switch" style="float:right">
<!--																										<input type="radio" name="mater" value="{{row['media_id']}}" class="ios-switch bigswitch tpl-switch-btn" />-->
																										<input type="radio" name="mater" value="{{row['id']}}" class="ios-switch bigswitch tpl-switch-btn" />
																										<div class="tpl-switch-btn-view"><div></div></div>
																									</div>
																								</div>
																								<div class="tpl-i-title">{{row['title']}}</div>
																								<a href="{{row['news']['url']}}" target="_blank" class="tpl-table-images-content-i" style="z-index: 10;color:#fff">
																									<img src="/upload/wx_material/image/{{row['news']['thumb_media_id']}}.jpg" alt="" style="height: 251px">
																								</a>
																								<div class="tpl-table-images-content-block">
																									<div class="tpl-i-font">
																										{{row['news']['digest']}}
																									</div>
																								</div>
																							</div>
																						</div>

																						{% else %}
																						<div class="am-u-sm-12 am-u-md-6 am-u-lg-4 picture-div">
																							<div class="tpl-table-images-content">
																								<div class="tpl-table-images-content-i-time">
																									更新时间：{{row['update_time']}}
																									<div class="tpl-switch" style="float:right">
<!--																										<input type="radio" name="mater" value="{{row['media_id']}}" class="ios-switch bigswitch tpl-switch-btn" />-->
																										<input type="radio" name="mater" value="{{row['id']}}" class="ios-switch bigswitch tpl-switch-btn" />
																										<div class="tpl-switch-btn-view"><div></div></div>
																									</div>
																								</div>
																								<div class="tpl-i-title">
																								</div>
																								<a href="javascript:;" class="tpl-table-images-content-i" style="z-index: 10;color:#fff">
																									<div class="am-slider am-slider-default" data-am-flexslider id="demo-slider-0">
																										<ul class="am-slides">
																											{% for var in row['news'] %}
																											<li>
																												<img src="/upload/wx_material/image/{{var['thumb_media_id']}}.jpg" style="height: 251px"/>
																												<div class="tpl-table-images-content-i-info news-shadow-title">
																													<span class="ico">{{var['title']}}</span>
																												</div>
																											</li>
																											{% endfor %}
																										</ul>
																									</div>
																								</a>

																							</div>
																						</div>
																						{% endif %}
																						{% endfor %}
																						{% endif %}
																					</li>
																				</ul>
																			</div>
																		</div>
																		<div class="tab_panel">
																			<div class="tab_content" style="display: block;">
																				<div class="js_appmsgArea inner ">
																					<div id="msgSender_media_1_10" class="material_box">
																						<div class="weui-desktop-media__list-col" style="width: 25%;">
																							<div class="inner"></div>
																						</div>
																						<div class="weui-desktop-media__list-col" style="width: 25%;">
																							<div class="inner"></div>
																						</div>
																						<div class="weui-desktop-media__list-col" style="width: 25%;">
																							<div class="inner"></div>
																						</div>
																						<div class="weui-desktop-media__list-col" style="width: 25%;">
																							<div class="inner"></div>
																						</div>
																					</div>
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</div>
													</div>
													<div id="type2" class="menu_content_container wx_form_js_ctent wx_form_hide wx_type">
														<div class="weapp am-form-group wx_form_group">
															<label class="am-form-label wx_form_label">页面地址&nbsp;/&nbsp;Address</label>
															<div class="am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																<span class="js_weapp_backup_url_input">
																	<input class="js_weapp_backup_url key2url" id="page" type="text" placeholder="订阅者点击该子菜单会跳到以下链接">
																</span>
															</div>
														</div>
													</div>
													<div id="type3" class="menu_content_container wx_form_js_ctent wx_form_hide wx_type">
														<div class="weapp">
															<div class="am-form-group wx_form_group">
																<label class="am-form-label wx_form_label">APPID&nbsp;/&nbsp;APPID</label>
																<div class="am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																	<span class="js_weapp_backup_url_input">
																		<input class="js_weapp_backup_url key2appid" id="appid" type="text" placeholder="小程序appid值 ，进入小程序后台获取">
																	</span>
																</div>
															</div>
															<div class="am-form-group wx_form_group">
																<label class="am-form-label wx_form_label">路径&nbsp;/&nbsp;Route</label>
																<div class="am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																	<span class="js_weapp_backup_url_input">
																		<input class="js_weapp_backup_url key2pagepath" id="pagepath" type="text" placeholder="小程序页面路径 如： pages/index/index （不需要加 .html ）">
																	</span>
																</div>
															</div>
															<div class="am-form-group wx_form_group">
																<label class="am-form-label wx_form_label">备用网页&nbsp;/&nbsp;webpage</label>
																<div class="am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																	<span class="js_weapp_backup_url_input">
																		<input class="js_weapp_backup_url key2url" id="pagepath2" type="text" placeholder="">
																	</span>
																</div>
															</div>
														</div>
													</div>
													<div id="type4" class="menu_content_container wx_form_js_ctent wx_form_hide wx_type">
														<div class="weapp am-form-group wx_form_group">
															<label class="am-form-label wx_form_label">消息类型&nbsp;/&nbsp;Type</label>
															<div class="am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																<span class="js_weapp_backup_url_input">
																	<select id="event" name="category" style="display: none;" data-am-selected="{btnSize: 'sm'}">
																		<option value="scancode_push">扫码推事件</option>
																		<option value="scancode_waitmsg">扫码带提示</option>
																		<option value="pic_sysphoto">系统拍照发图</option>
																		<option value="pic_photo_or_album">拍照或者相册发图</option>
																		<option value="pic_weixin">微信相册发图</option>
																		<option value="location_select">发送位置</option>
																		<option value="click">自定义开发 (click)</option>
																	</select>
																</span>
															</div>
														</div>
														<div id="event_key" class="weapp am-form-group wx_form_group wx_form_hide">
															<label class="am-form-label wx_form_label">KEY值&nbsp;/&nbsp;KEY值</label>
															<div class="am-u-md-4  am_fl_zi_tihuan wx_fl_zi_tihuan js_weapp_backup_url_input_wrapper">
																<span class="js_weapp_backup_url_input">
																	<input class="js_weapp_backup_url key2url" id="key" value="" type="text" placeholder="">
																</span>
															</div>
														</div>
													</div>
												</div>
											</div>
											<div id="js_none" class="menu_initial_tips tips_global">点击左侧菜单进行编辑操作</div>
											<span class="editor_arrow_wrp">
												<i class="editor_arrow editor_arrow_out"></i>
												<i class="editor_arrow editor_arrow_in"></i>
											</span>
										</div>
									</div>
									<input type="hidden" id="act" name="action" value="submit">
								</form>
							</div>
							<div class="am-u-sm-12 am-u-md-12 wx_btn">
								<div class="am-btn-toolbar ng-xno-borderL" id="select-handle">
									<button type="submit" id="submit" class="am-btn am-btn-primary">提交</button>
									<a href="./weixin_menu_manage" class="am-btn am-btn-danger">重置</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
</body>
</html>