<!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/wx_material_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['tpl_url']}}script/common.js"></script>
<script src="{{kg['tpl_url']}}script/wx_material_manage.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">
			<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 am-no-margintop">
						<div class="am-form-group am-fl am-no-marginbtm am-select-hover  am-no-outline" style="margin-right:10px;">
							<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{btnSize: 'sm'}" name="menu" class="" style="display: none;" id="selected-searcha">
								<option {% if type == 'news' %}selected="selected"{% endif %}value="wx_material_manage?{{url['type']}}type=news">单图文</option>
								<option {% if type == 'news1' %}selected="selected"{% endif %}value="wx_material_manage?{{url['type']}}type=news1">多图文</option>
								<option {% if type == 'image' %}selected="selected"{% endif %}value="wx_material_manage?{{url['type']}}type=image">图片</option>
								<option {% if type == 'voice' %}selected="selected"{% endif %}value="wx_material_manage?{{url['type']}}type=voice">语音</option>
								<option {% if type == 'video' %}selected="selected"{% endif %}value="wx_material_manage?{{url['type']}}type=video">视频</option>
							</select>
						</div>
						<div class="am-form-group am-fl am-no-marginbtm am-select-hover  am-no-outline" style="margin-right:10px;">
							<select onchange="window.open(this.options[this.selectedIndex].value,'_self')" data-am-selected="{btnSize: 'sm'}" style="display: none;">
								<option {% if sort == 0 %}selected="selected"{% endif %}value="wx_material_manage?{{url['sort']}}sort=0">发布日期降序</option>
								<option {% if sort == 1 %}selected="selected"{% endif %}value="wx_material_manage?{{url['sort']}}sort=1">发布日期升序</option>
								<option {% if sort == 2 %}selected="selected"{% endif %}value="wx_material_manage?{{url['sort']}}sort=2">修改日期降序</option>
								<option {% if sort == 3 %}selected="selected"{% endif %}value="wx_material_manage?{{url['sort']}}sort=3">修改日期升序</option>
							</select>
						</div>
						<div class="portlet-input input-small input-inline am-fl">
							<form action="" method="get" id="search">
								<div class="input-icon right">
									<i class="am-icon-search log-search"></i>
									<input type="text" class="form-control form-control-solid" placeholder="搜索..." name="word" value="{{word}}" id="word">
								</div>
							</form>
						</div>
						<div class="ngar-xiugai-width portlet-input input-small input-inline " style="float: right;">
							<div class="input-icon right am-fr top-1">
								<div class="am-btn-group am-btn-group-xs">
									<a href="wx_material_manage?{{kg['run_start_time'][1]}}" class="am-btn am-btn-secondary ng-add-hightB"><span class="am-icon-search"></span>&nbsp;刷新</a>
									<a class="am-btn am-btn-default am-btn-warning" href="wx_material_update"><span class="am-icon-plus"></span>&nbsp;添加素材</a>
									<a class="am-btn am-btn-default am-btn-success" href="wx_material_manage?action=syn" target="_blank"><span class="am-icon-recycle"></span>&nbsp;数据同步</a>
								</div>
							</div>
							<div class="am-cf"></div>
						</div>
<!--						<div class="input-icon right am-fr" style="margin-left: 10px">-->
<!--							<div class="am-btn-group am-btn-group-xs">-->
<!--								<a class="am-btn am-btn-default am-btn-success" href="role_update"><span class="am-icon-plus"></span>&nbsp;刷新</a>-->
<!--							</div>-->
<!--						</div>-->
<!--						<div class="input-icon right am-fr" style="margin-left: 10px">-->
<!--							<div class="am-btn-group am-btn-group-xs">-->
<!--								<a class="am-btn am-btn-default am-btn-success" href="role_update"><span class="am-icon-plus"></span>&nbsp;数据同步</a>-->
<!--							</div>-->
<!--						</div>-->
					</div>
				</div>
				<div class="tpl-block">
					{% if type == 'news1' or type == "news" %}
					<div class="am-g tab-news">
						<div class="tpl-table-images">
							{% if type == "news1" %}
							{% for row in data %}
							<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>
									<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>
													<a href="{{var['url']}}" target="_blank">
														<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>
													</a>
												</li>
												{% endfor %}
										  	</ul>
										</div>
									</a>
									<div class="tpl-table-images-content-block">
										<div class="am-btn-toolbar" style="border-top: 1px solid #e7ecf1; margin-top: 10px;">
											<div class="am-btn-group am-btn-group-xs tpl-edit-content-btn">
												<a href="wx_material_update?id={{row['id']}}" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-edit"></span> 编辑</a>
												<a href="wx_material_send?id={{row['id']}}" class="am-btn am-btn-default am-btn-success"><span class="am-icon-paper-plane"></span> 群发</a>
												<a href="wx_material_manage?action=del&id={{row['id']}}&mediaid={{row['media_id']}}" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</a>
											</div>
										</div>
									</div>
								</div>
							</div>
							{% endfor %}
							{% else %}
							{% for row in data %}
							<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>
									<div class="tpl-i-title">{{row['news']['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/thumb/{{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 class="am-btn-toolbar" style="border-top: 1px solid #e7ecf1; margin-top: 10px;">
											<div class="am-btn-group am-btn-group-xs tpl-edit-content-btn">
												<a href="wx_material_update?id={{row['id']}}" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-edit"></span> 编辑</a>
												<a href="wx_material_send?id={{row['id']}}" class="am-btn am-btn-default am-btn-success"><span class="am-icon-paper-plane"></span> 群发</a>
												<a href="wx_material_manage?action=del&id={{row['id']}}&mediaid={{row['media_id']}}" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</a>
											</div>
										</div>
									</div>
								</div>
							</div>
							{% endfor %}
							{% endif %}
						</div>

					{% elif type == 'image' %}
					<div class="am-g tab-image">
						{% for row in data %}
						<div class="tpl-table-images">

							<div class="am-u-sm-12 am-u-md-6 am-u-lg-4 picture-div image-div">
								<div class="tpl-table-images-content">
									<div class="tpl-table-images-content-i-time">更新于：{{row['update_time']}}
										<div class="am-btn-group am-btn-group-xs" style="float: right">
											 <a href="wx_material_manage?action=del&mediaid={{row['media_id']}}" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi" style="font-size: 8px">
												<span class="am-icon-trash-o"></span>&nbsp;删除
											</a>
										</div>
									</div>
									<div class="tpl-i-title image-title">
										{{row['name']}}
									</div>
									<ul data-am-widget="gallery" class="am-gallery sm-block-grid-2 md-block-grid-3 lg-block-grid-4 am-gallery-bordered  am-no-layout" data-am-gallery="{ pureview: true }">
										<li class="move-padding">
											<img src="{{row['localpath']}}"  alt="" style="display: none">
											<i class="weui-desktop-appmsg__cover__thumb" style="background-image: url('{{row['localpath']}}');"></i>
										</li>

									</ul>
								</div>
							</div>
						</div>
						{% endfor %}

					{% elif type == 'voice' %}
					<div class="am-g tab-voice">
						<div class="am-u-sm-12">
							<table class="am-table am-table-striped am-table-hover table-main">
								<thead>
									<tr>
										<th class="table-title">文件名</th>
										<th class="table-type">播放</th>
										<th class="table-author am-hide-sm-only">更新时间</th>
										<th class="table-set">操作</th>
									</tr>
								</thead>
								<tbody>
								{% for row in data %}
									<tr>
										<td>{{row['name']}}</td>
										<td><a href="#"><audio src="{{row['localpath']}}" controls="controls" style="width:270px;height: 30px;"></a></td>
										<td class="am-hide-sm-only">{{row['update_time']}}</td>
										<td class="am-hide-sm-only">
											<div class="am-btn-toolbar li-div7">
												<div class="am-btn-group am-btn-group-xs">
													<div class="am-btn-group am-btn-group-xs ngco-TNo-paddingLR">
														<a href="{{row['localpath']}}" download="{{row['name']}}" title="" class="am-btn am-btn-default am-btn-xs am-text-secondary title2div" style="cursor: pointer;"><span class="am-icon-pencil-square-o"></span>&nbsp;下载</a>
														<a href="wx_material_manage?action=del&id={{row['id']}}&mediaid={{row['media_id']}}" title="" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
													</div>
												</div>
											</div>
										</td>
									</tr>
								{% endfor %}
								</tbody>
							</table>
						</div>
					{% elif type == 'video' %}
					<div class="am-g tab-video">
						<div class="am-u-sm-12">
							<table class="am-table am-table-striped am-table-hover table-main">
								<thead>
									<tr>
										<th class="table-title">ID</th>
										<th class="table-type">标题</th>
										<th class="table-author am-hide-sm-only">视频介绍</th>
										<th class="table-date am-hide-sm-only">视频连接</th>
										<th class="table-date am-hide-sm-only">添加时间</th>
										<th class="table-set">操作</th>
									</tr>
								</thead>
								<tbody>
								{% for row in data %}
									<tr>
										<td>{{row['id']}}</td>
										<td>{{row['name']}}</td>
										<td><a href="#">{{row['description']}}</a></td>
										<td class="am-hide-sm-only">
											<a href="{{row['localpath']}}" target="_blank">视频</a>
										<td class="am-hide-sm-only">{{row['update_time']}}</td>
										<td class="am-hide-sm-only">
											<div class="am-btn-toolbar li-div7">
												<div class="am-btn-group am-btn-group-xs">
													<div class="am-btn-group am-btn-group-xs ngco-TNo-paddingLR">
														<a href="{{row['localpath']}}" download="{{row['name']}}.mp4" title="" class="am-btn am-btn-default am-btn-xs am-text-secondary title2div" style="cursor: pointer;"><span class="am-icon-pencil-square-o"></span>&nbsp;下载</a>
														<a href="wx_material_manage?action=del&id={{row['id']}}&mediaid={{row['media_id']}}" title="" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div"><span class="am-icon-trash-o"></span>&nbsp;删除</a>
													</div>
												</div>
											</div>
										</td>
									</tr>
								{% endfor %}
								</tbody>
							</table>
							{% if not data %}<div class="no-data"><ul>没有相关数据</ul></div>{% endif %}
						</div>
					{% endif %}

					</div>

				</div>
			{% if page_data['total_page'] > 1 %}
			{{page_html}}
			{% endif %}
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
</body>
</html>