<!DOCTYPE html>
<html xmlns="https://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/wx_material_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['server']['HTTP_HOST'] }}/tools/ueditor/ueditor.config.js?dir=article&host={{kg['server']['HTTP_HOST']}}"></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/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/wx_material_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">
			<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="" enctype="multipart/form-data">
								<input type="hidden" name="action" value="submit">
								{% if act == 'add' %}
								<div class="am-form-group">
									<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 click_in" id="type">
										<input checked=checked id="type1" name="type" type="radio" value="0" />&nbsp;<span style="font-size: 14px">图文 &nbsp; &nbsp;</span>
										<input id="type2" name="type" type="radio" value="1" />&nbsp;<span style="font-size: 14px">图片&nbsp; &nbsp;</span>
										<input id="type3" name="type" type="radio" value="2" />&nbsp;<span style="font-size: 14px">语音&nbsp; &nbsp;</span>
										<input id="type4" name="type" type="radio" value="3" />&nbsp;<span style="font-size: 14px">视频&nbsp; &nbsp;</span>
									</div>
								</div>
								{% endif %}
								<!-- 主体部分 -->
								<!-- tab1  -->
								<div class="tab" style="display: block;">
									<div class="am-form-group am-form-icon am-form-feedback">
										<label for="use_name" class="am-u-sm-3 am-form-label">图文列表&nbsp;/&nbsp;<span class="tpl-form-line-small-title">List</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3" style="padding-top: 12px;">
											<div class="appmsg_content" id="article_list">
												{% for row in data %}
												<div class="article-content {% if loop.index0 == 0 %}current{% endif %}">
													<div class="appmsg_item">
														<div class="card_appmsg background-image" {% if row['thumb_media_id'] %}style="background-image: url('/upload/wx_material/thumb/{{row['thumb_media_id']}}.jpg');"{% endif %}>

														</div>
														<div class="image-button" style="display: none">
															<span class="am-icon-long-arrow-up left-1" style="color: #f9f9f9"></span>
															<span class="am-icon-long-arrow-down left-2" style="color: #f9f9f9"></span>
															<span class="am-icon-trash-o" style="color: #f9f9f9"></span>
														</div>
													</div>
													<div style="display: none;">
														<input class="data_title" type="text" name="title[]" value="{{row['title']}}">
														<input class="data_thumb_media_id" type="text" name="thumb_media_id[]" value="{{row['thumb_media_id']}}">
														<input class="data_author" type="text" name="author[]" value="{{row['author']}}">
														<input class="data_digest" type="text" name="digest[]" value="{{row['digest']}}">
														<input class="data_show_cover_pic" type="text" name="show_cover_pic[]" value="{{row['show_cover_pic']}}">
														<input class="data_content_source_url" type="text" name="content_source_url[]" value="{{row['content_source_url']}}">
														<input class="data_need_open_comment" type="text" name="need_open_comment[]" value="">
														<input class="data_only_fans_can_comment" type="text" name="only_fans_can_comment[]" value="">
														<textarea class="data_content" name="content[]">{{row['content']}}</textarea>
													</div>
												</div>
												{% endfor %}
											</div>
											<div class="ewm-upload" id="article_add">
												<div class="shuline"></div>
												<div class="hengline"></div>
											</div>
										</div>
									</div>
									<div class="am-form-group am-form-icon am-form-feedback">
										<label for="use_name" class="am-u-sm-3 am-form-label">标题&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Title</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<input type="text" class="tpl-form-input am-reg-input ngco_Ojs_bitian" id="title" value="">
											<i class=""></i>
										</div>
									</div>
									<div class="am-form-group am-form-icon am-form-feedback">
										<label for="use_name" class="am-u-sm-3 am-form-label">作者&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Author</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<input type="text" class="tpl-form-input am-reg-input ngco_Ojs_bitian" id="author" value="">
											<i class=""></i>
										</div>
									</div>
									<div class="am-form-group am-form-icon am-form-feedback">
										<label for="use_name" class="am-u-sm-3 am-form-label">原文地址&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Source</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<input type="text" class="tpl-form-input am-reg-input ngco_Ojs_bitian" id="source" value="">
											<i class=""></i>
										</div>
									</div>
									<!-- 封面区域 -->
									<div class="am-form-group ngco-No-marginB">
										<label class="am-u-sm-3 am-form-label" id="lab">封面&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Cover</span></label>
										<ul data-am-widget="gallery" data-am-gallery="{ pureview: true }" class="ngar-uljs  am-gallery sm-block-grid-2 md-block-grid-3 lg-block-grid-4 am-gallery-bordered ngsty-Iul am-no-layout" id="picture_view">
											<li style="float: left;position: relative; display: none" id="image">
												<div class="tpl-table-images-content-i-info absolute-middle">
													<button type="button" class="btn1 btnsty am-btn-circle am-btn am-btn-success am-margin-horizontal btn-update ty-button" data-btn='update2'><span class="square1"><i class="am-icon-pencil-square-o"></i>&nbsp;修改</span></button>
													<button type="button" class="btnsty am-btn-circle am-btn am-btn-danger am-margin-horizontal btn-remove ty-button" data-btn='remove'><span class="remoe1"><i class="am-icon-remove ngsty-rem"></i>&nbsp;删除</span></button>
													<button type="button" class="btnsty am-btn-circle am-btn am-btn-secondary am-margin-horizontal btn-search ty-button" data-btn='search'><span class="search1"><i class="am-icon-search ngsty-rem"></i>&nbsp;查看</span></button>
												</div>
												<img src="" height="120" alt="">
												<input type="hidden" value="" />
											</li>
										</ul>
										<div class="ewm-upload  btn-add ngdo-GD ngar-Yjs" id="image-add" data-btn="add2">
											<input name="image" type="text" class="input-file" id="qrcodeInput">
											<div class="shuline"></div>
											<div class="hengline"></div>
										</div>
									</div>
									<!-- 封面区域结束 -->
									<div class="am-form-group auto-tpl">
										<label for="user-phone" class="am-u-sm-3 am-form-label">评论&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Comment</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3 posi_box3" id="comment" >
											<select id="event" data-am-selected="{btnSize: 'sm'}">
												<option value="0">关闭评论</option>
												<option value="1">所有人可评论</option>
												<option value="2">粉丝可评论</option>
											</select>
										</div>
									</div>
									<div class="am-form-group">
										<label for="Template" class="am-u-md-3 am-form-label">摘要&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Abstract</span></label>
										<div class="am-u-md-6  am_fl_zi_tihuan">
											<textarea type="text" id="digest" placeholder="选填，如果不填写会默认抓取正文前54个字" style="padding-top: 9px;"></textarea>
										</div>
									</div>
									<div class="am-form-group ngsty-box-pre" id="content">
										<label for="ser-intro" class="am-u-md-3 am-form-label">文章内容&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Content</span></label>
										<textarea id="KgcmsEditor" style="width:69.7%;height:400px; margin:0; padding:0; overflow:hidden;padding-top: 12px;" class="edui-default"></textarea>
										<script>

										</script>
									</div>
									<!-- 多媒体区域 -->
<!--									<div class="am-form-group ngco-No-marginB">-->
<!--										<label class="am-u-sm-3 am-form-label" id="lab">多媒体</label>-->
<!--										<div class="am-u-sm-6 am-u-sm-pull-3">-->
<!--											&lt;!&ndash; 图片区域 &ndash;&gt;-->
<!--											<div class="am-form-group am-form-file">-->
<!--												<div class="tpl-form-file-img ngco-none-display2" id="ngac_Nfu_box" style="display: block;">-->
<!--													<img src="" id="finalImg">-->
<!--												</div>-->
<!--												<button title="未选择任何图片" type="button" class="am-btn am-btn-default am-btn-sm title2div" id="originalImg">-->
<!--													<i class="am-icon-picture-o"></i>&nbsp;上传图片-->
<!--												</button>-->
<!--												<input type="file" id="originalChoose" class="ngco-No-widht" />-->
<!--												<input type="hidden" name="image" id="originalUpdate" value='' />-->
<!--											</div>-->
<!--											&lt;!&ndash; 图片区域结束 &ndash;&gt;-->
<!--										</div>-->
<!--									</div>-->
									<!-- 多媒体区域结束 -->
								</div>
								<!-- tab1结束 -->
								<!-- tab2  -->
								<div class="tab" style="display: none;">
									<!-- 上传图片 -->
									<div class="am-form-group a-clic">
										<label class="am-u-sm-3 am-form-label">上传图片&nbsp;/&nbsp;<span class="tpl-form-line-small-title">UploadImg</span></label>
										<ul data-am-widget="gallery" data-am-gallery="{ pureview: true }" class="ngar-uljs  am-gallery sm-block-grid-2 md-block-grid-3 lg-block-grid-4 am-gallery-bordered ngsty-Iul am-no-layout" id="picture_view">

										</ul>
										<div class="ewm-upload  btn-add ngdo-GD ngar-Yjs" id="qrcodeUpload" data-btn="add">
											<input name="image" type="text" class="input-file" id="qrcodeInput">
											<div class="shuline"></div>
											<div class="hengline"></div>
										</div>
									</div>
								</div>
								<!-- tab2结束 -->
								<!-- tab3 style="display: none;" -->
								<div class="tab" style="display: none">
									<div class="am-form-group a-clic">
										<label class="am-u-sm-3 am-form-label">上传语音&nbsp;/&nbsp;<span class="tpl-form-line-small-title">UploadVoice</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3" style="font-size: 14px;">
											<input type="file" name="voice" value="">
										</div>
									</div>
								</div>
								<!-- tab3结束 -->
								<!-- tab4 style="display: none;" -->
								<div class="tab" style="display: none">
									<div class="am-form-group a-clic">
										<label class="am-u-sm-3 am-form-label">上传视频&nbsp;/&nbsp;<span class="tpl-form-line-small-title">UploadVideo</span></label>
										<<div class="am-u-sm-6 am-u-sm-pull-3" style="font-size: 14px;">
											<input type="file" name="video" value="">
										</div>
									</div>
									<div class="am-form-group am-form-icon am-form-feedback">
										<label for="use_name" class="am-u-sm-3 am-form-label">标题&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Title</span></label>
										<div class="am-u-sm-6 am-u-sm-pull-3">
											<input type="text" class="tpl-form-input am-reg-input ngco_Ojs_bitian" name="v_title" value="">
											<i class=""></i>
										</div>
									</div>
									<div class="am-form-group">
										<label for="Template" class="am-u-md-3 am-form-label">摘要&nbsp;/&nbsp;<span class="tpl-form-line-small-title">Abstract</span></label>
										<div class="am-u-md-6  am_fl_zi_tihuan">
											<textarea type="text" name="v_description" style="padding-top: 9px;"></textarea>
										</div>
									</div>
								</div>
								<!-- tab3结束 -->
								<!-- 主体部分结束 -->
								<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></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、选择多图模式时，右边将会出现加减按钮，点击即可增加、减少素材数量，最多可以填写8条图片素材；<br />
								2、链接地址或KEY选项默认选择自定义链接，此时可以自己填写链接；选择其他选项时将会自动填写key值，请不要修改自动填写的值，否则将导致链接失败；<br />
								3、提交数据时请保证素材名称以及所有素材选项的标题都已填写，否则将无法完成提交。
							</li>
						</ul>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<!-- 模态框 -->
	<!-- 模态框 -->
	<div class="am-modal am-modal-confirm modal" tabindex="-1">
		<div class="am-modal-dialog">
			<div class="am-modal-hd modal-header ngdo-D2">
			</div>
			<div class="am-modal-bd am-padding-bottom-0">
				<form class="am-form" id="imgInFo">
					<div data-am-widget="list_news" class="am-list-news am-list-news-default">
						<div class="am-list-news-bd">
							<ul class="am-list">
								<li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right border-none bg-transparent am-padding-bottom-0 ngdo-Li1">
									<div class="am-col am-u-md-8 am-list-main ngdo-D1">
										<div class="am-input-group am-input-group-primary am-margin-bottom-sm" style="    margin: 0px;">
											<div class="am-form-group am-form-file" style="margin-left: 4rem; margin-bottom: 0rem;">
												<button type="button" title="未选择任何图片" class="am-btn am-btn-danger am-btn-sm title2div ngdo-Bu1" id="originalImg">
													<i class="am-icon-cloud-upload"></i>&nbsp;原始上传
												</button>
												<input type="file" id="originalChoose" class="ngco-No-widht image" />
												<input type="hidden" name="image" id="originalUpdate" value='' />
												<button type="button" title="未选择任何图片" class="am-btn am-btn-danger am-btn-sm title2div" id="replaceImg">
													<i class="am-icon-cloud-upload"></i>&nbsp;裁切上传
												</button>
												<!--图片裁剪框 -->
												<div style="display: none" class="tailoring-container">
													<div class="black-cloth ngad-Jsj-click"></div>
													<div class="tailoring-content">
														<div class="tailoring-content-one">
															<label title="上传图片" for="chooseImg" class="l-btn choose-btn">
																<input type="file" name="filename" accept="image/*" id="chooseImg" class="hidden ngad-Ksj-change">
																选择图片
																<input type="hidden" name="image" id="imgUpdate" value='' />
															</label>
															<div class="close-tailoring ngad-Usj-click">×</div>
														</div>
														<div class="tailoring-content-two">
															<!-- 大裁剪图片 -->
															<div class="tailoring-box-parcel">
																<img id="tailoringImg" src="/" alt=""/>
															</div>
															<div class="preview-box-parcel">
																<p>图片预览：</p>
																<div class="square previewImg">
																</div>
																<div class="circular previewImg">
																</div>
															</div>
														</div>
														<div class="tailoring-content-three">
															<button class="l-btn cropper-reset-btn" type="button">复位</button>
															<button class="l-btn cropper-rotate-btn" type="button">旋转</button>
															<button class="l-btn cropper-scaleX-btn" type="button">换向</button>
															<button class="l-btn sureCut" id="sureCut" type="button">确定</button>
														</div>
													</div>
												</div>
												<!--图片裁剪框 -->
												<input id="doc-form-file" type="file" multiple="" class="ngco-No-widht">
											</div>
											<!-- 图片区域结束 -->
										</div>
										<div class="am-form-group am-form-file am-hide">
											<input type="file" multiple>
										</div>
									</div>
									<div class="am-col am-u-md-4 am-list-thumb fubox_img">
										<img src="{{kg['tpl_url']}}images/a1.png" id="finalImg" />
										<div id="loading"></div>
									</div>
								</li>
							</ul>
						</div>
					</div>
			</div>
			<div class="am-modal-footer">
				<span class="am-modal-btn" id="false" data-am-modal-cancel>取消</span>
				<span class="am-modal-btn" id="true" data-am-modal-confirm>确定</span>
			</div>
		</div>
	</div>
</body>
</html>