<?php
if (!defined('ROOT'))
	exit ;
$uid=session("user_auth.id");
$userconfig=userconfig_get($uid);
?>
<!DOCTYPE html>
<html>

	<head>
		<title>网盘装饰</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
		include 'Inc_files.php';
		?>
		<style type="text/css">
		textarea{ text-indent: 0!important; padding-left: 5px!important;}
		.btn_indexbg_del{ cursor: pointer;}
		.help{ cursor: pointer;}
		.help_img{ max-width: 100%; display: none;}
		.pt7{ padding-top: 7px;}
		
		#list_wpzs_textlink .form input{ width: 200px;float: left; margin-right: 5px;}
		#list_wpzs_textlink .form{ margin-bottom: 10px;}
		#list_wpzs_textlink .list{ overflow: hidden;}
		#list_wpzs_textlink .list input{ width: 200px;float: left; margin-right: 5px;}
		#list_wpzs_textlink .list .bordernone{ border: none;}
		
		#list_wpzs_topflash .form input{ width: 405px;float: left; margin-right: 5px;}
		#list_wpzs_topflash .form{ margin-bottom: 10px;}
		#list_wpzs_topflash .list{ overflow: hidden;}
		#list_wpzs_topflash .list input{ width: 405px;float: left; margin-right: 5px;}
		#list_wpzs_topflash .list .bordernone{ border: none;}
		
		.webuploader-element-invisible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);}
		#huandengpian {position: relative;}
		#huandengpian div { width: 100%!important; height: 100%!important;}
		
		.imglist{ margin: 0 -10px;}
		.imglist li{ width: 100px; height: 100px; padding: 10px; float: left;}
		.imglist li img{ width: 100%; height: 100%;}
		.imglist li div{ width: 100%; height: 100%; position: relative;}
		.imglist li div .uploading{ position: absolute;left: 0;top: 0;right: 0;bottom: 0; margin: auto; width: 100%; height: 20px; line-height: 20px; text-align: center; font-weight: 700; color: #fff;font-size: 14px;}
		.imglist .beforeupload{ opacity: 0.5;}
		.imglist .btn_img_del{position: absolute;right: 0;bottom: 0;font-weight: 700; color: #fff; font-size: 14px;}
		
		.plupload_btn_box{ position: relative; width: 100px; height: 100px; float: left; vertical-align:middle;}
		.plupload_btn_box .beforeupload{ width: 100%; height: 100%; text-align: center; line-height: 100px; position: absolute;left: 0;top: 0;right: 0;bottom: 0; display: none; color: #fff; z-index: 99;}
		.plupload_btn_box .btn_indexbg_del{ color: #fff; position: absolute;right: 0;bottom: 0; z-index: 100;}
		.plupload_btn_box .btn_indexbg_del1{  display: none;}
		</style>
	</head>

	<body  data-type="index">
		<script src="<?php echo C('TMPL_PARSE_STRING.__TPL__'); ?>/assets/js/theme.js"></script>
		<div class="am-g tpl-g">
			<?php include 'Inc_head.php'?>
			<!-- 侧边导航栏 -->
			<?php
				include 'Inc_left.php';
			?>
			<!-- 内容区域 -->
			<div class="tpl-content-wrapper">
				<div class="row-content am-cf">
					<div class="row">
	                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
	                        <div class="widget am-cf">
	                            <div class="widget-head am-cf">
	                                <div class="widget-title am-fl">网盘装饰</div>
	                            </div>	
	                            <div class="widget-body am-fr">
	                                <form  class="am-form tpl-form-border-form tpl-form-border-br">
	                                	<input type="hidden" name="model_id" value="87" />
	                                	<input type="hidden" name="wpzs" value="1" />
	                                	<input type="hidden" name="uid" value="<?php echo session('user_auth.id');?>" />
	                                	<input type="hidden" name="pk1" value="<?php echo session('user_auth.id');?>" />
										<div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">网盘模板 </label>
	                                        <div class="am-u-sm-9">
												     <select name="tpl" data-am-selected="{searchBox: 0}" style="display: none;">
													<option value="sy106"  <?php if($modval['tpl']=='sy106'){echo 'selected="selected"';}?>>106简约样式</option>
													<option value="mulu" <?php if($modval['tpl']=='mulu'){echo 'selected="selected"';}?>>ys简约样式</option>	
													<option value="ay106"  <?php if($modval['tpl']=='ay106'){echo 'selected="selected"';}?>>106经典简约</option>												
													<option value="style01" <?php if($modval['tpl']=='style01'){echo 'selected="selected"';}?>>ys橙色样式</option>
													<option value="style05" <?php if($modval['tpl']=='style05'){echo 'selected="selected"';}?>>ys黑色样式</option>
													<option value="style06" <?php if($modval['tpl']=='style06'){echo 'selected="selected"';}?>>ys红色样式</option>
													<option value="style07" <?php if($modval['tpl']=='style07'){echo 'selected="selected"';}?>>ys黄金龙样式</option>
													<option value="style08" <?php if($modval['tpl']=='style08'){echo 'selected="selected"';}?>>ys灰色样式</option>
													<option value="style09" <?php if($modval['tpl']=='style09'){echo 'selected="selected"';}?>>ys蓝色样式</option>
													<option value="style10" <?php if($modval['tpl']=='style10'){echo 'selected="selected"';}?>>ys绿色样式</option>
													<option value="style18" <?php if($modval['tpl']=='style18'){echo 'selected="selected"';}?>>ys白色样式</option>
													<option value="style19" <?php if($modval['tpl']=='style19'){echo 'selected="selected"';}?>>黑色简约样式</option>
													<option value="style02" <?php if($modval['tpl']=='style02'){echo 'selected="selected"';}?>>ys发光标题（发光字）</option>
													<option value="style11" <?php if($modval['tpl']=='style11'){echo 'selected="selected"';}?>>ys黑灰样式（发光字）</option>
													<option value="style12" <?php if($modval['tpl']=='style12'){echo 'selected="selected"';}?>>ys黑色样式1（发光字）</option>
													<option value="style13" <?php if($modval['tpl']=='style13'){echo 'selected="selected"';}?>>ys黑色样式2（发光字）</option>
													<option value="style14" <?php if($modval['tpl']=='style14'){echo 'selected="selected"';}?>>ys红色样式（发光字）</option>
													<option value="style15" <?php if($modval['tpl']=='style15'){echo 'selected="selected"';}?>>ys黄金龙样式（发光字）</option>
													<option value="style16" <?php if($modval['tpl']=='style16'){echo 'selected="selected"';}?>>ys蓝色样式（发光字）</option>
													<option value="style17" <?php if($modval['tpl']=='style17'){echo 'selected="selected"';}?>>ys绿色样式（发光字）</option>
			
													
												</select>
	                                            <small>选择一个您喜欢的网盘模板</small>
	                                        </div>
	                                    </div>
	                                    <hr>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">售卖单页模板 </label>
	                                        <div class="am-u-sm-9">
												<select name="shoumaidanye_tpl" data-am-selected="{searchBox: 0}" style="display: none;">
													<option value="001"  <?php if($modval['shoumaidanye_tpl']=='001'){echo 'selected="selected"';}?>>001</option>
												</select>
	                                            <small>选择一个您喜欢的售卖单页模板</small>
	                                        </div>
	                                    </div>
																				
										<hr>
										<div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">是否显示IP</label>
	                                        <div class="am-u-sm-9">
	                                            <select name="wpzs_ip" data-am-selected="{searchBox: 0}" style="display: none;" placeholder="请选择">
	                                            	<option value=""></option>
													<option value="显示"  <?php if($modval['wpzs_ip']=='显示'){echo 'selected="selected"';}?>>显示</option>
													<option value="隐藏" <?php if($modval['wpzs_ip']=='隐藏'){echo 'selected="selected"';}?>>隐藏</option>
												</select>
	                                            <small></small>
	                                        </div>
	                                    </div>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">显示时间</label>
	                                        <div class="am-u-sm-9">
	                                            <select name="wpzs_time" data-am-selected="{searchBox: 0}" style="display: none;" placeholder="请选择">
	                                            	<option value=""></option>
													<option value="显示"  <?php if($modval['wpzs_time']=='显示'){echo 'selected="selected"';}?>>显示</option>
													<option value="隐藏" <?php if($modval['wpzs_time']=='隐藏'){echo 'selected="selected"';}?>>隐藏</option>
												</select>
	                                            <small></small>
	                                        </div>
	                                    </div>
										
										<hr>

	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">发光字</label>
	                                        <div class="am-u-sm-9">
	                                            <select name="wpzs_faguangzi" data-am-selected="{searchBox: 0}" style="display: none;" >
	                                            	<option value="0">不启用</option>
													<option value="black"  <?php if($modval['wpzs_faguangzi']=='black'){echo 'selected="selected"';}?>>黑色</option>
													<option value="white"  <?php if($modval['wpzs_faguangzi']=='white'){echo 'selected="selected"';}?>>白色</option>
													<option value="gray"  <?php if($modval['wpzs_faguangzi']=='gray'){echo 'selected="selected"';}?>>灰色</option>
													<option value="silver"  <?php if($modval['wpzs_faguangzi']=='silver'){echo 'selected="selected"';}?>>银色</option>
													<option value="maroon"  <?php if($modval['wpzs_faguangzi']=='maroon'){echo 'selected="selected"';}?>>褐红色</option>
													<option value="red"  <?php if($modval['wpzs_faguangzi']=='red'){echo 'selected="selected"';}?>>红色</option>
													<option value="olive"  <?php if($modval['wpzs_faguangzi']=='olive'){echo 'selected="selected"';}?>>橄榄</option>
													<option value="yellow"  <?php if($modval['wpzs_faguangzi']=='yellow'){echo 'selected="selected"';}?>>黄色</option>
													<option value="green"  <?php if($modval['wpzs_faguangzi']=='green'){echo 'selected="selected"';}?>>绿色</option>
													<option value="lime"  <?php if($modval['wpzs_faguangzi']=='lime'){echo 'selected="selected"';}?>>石灰</option>
													<option value="blue"  <?php if($modval['wpzs_faguangzi']=='blue'){echo 'selected="selected"';}?>>蓝色</option>
													<option value="purple"  <?php if($modval['wpzs_faguangzi']=='purple'){echo 'selected="selected"';}?>>紫色</option>
													<option value="magenta"  <?php if($modval['wpzs_faguangzi']=='magenta'){echo 'selected="selected"';}?>>品红</option>
													
												</select>
	                                            <small></small>
	                                        </div>
	                                    </div>
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">顶部动画</label>
                                          	<div class="am-u-sm-9" id="list_wpzs_topflash">
                                       		  <div class="form">
                                   		  			<input type="text" class="title" placeholder="flash地址">
                                      				<button type="button" class="am-btn am-btn-secondary am-btn-sm btn_topflash_add">添加</button>
												  	<small style="clear: both; display: block;"><a href="http://pan.106pan.com/file/show/pk1/53/pk4/1522065563104" target="_blank">flash 软件下载地址：点击下载</a></small>                                          		</div>
                                          		<div class="list ng_hide" ng-repeat="v in topflash_add">
                                          			<input type="text" name="wpzs_topflash[{{$index}}][url]" readonly="readonly" value="{{v.url}}" class="title bordernone btn_topflash_link" placeholder="flash地址">
                                          			<button type="button" class="am-btn  am-btn-xs btn_topflash_mod">编辑</button> <button type="button" class="am-btn  am-btn-xs btn_topflash_del">删除</button>
                                          		</div>
                                            </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">音乐地址 </label>
	                                        <div class="am-u-sm-9">
	                                        	<input type="text" style="width: 405px;" name="wpzs_music_url" value="<?php echo $modval['wpzs_music_url'];?>">
	                                            <small></small>
	                                        </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <?php if($userconfig['member_wangpan_type']>1){?>
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">开场动画</label>
                                          	<div class="am-u-sm-9">
                                          		<div class="form">
                              <input type="text" name="wpzs_kaichangdonghua" value="<?php echo $userconfig['wpzs_kaichangdonghua'];?>" class="title" placeholder="动画地址" style="width: 200px; float: left;">
                              <input type="text" name="wpzs_kaichangdonghua_time" value="<?php echo $userconfig['wpzs_kaichangdonghua_time'];?>" class="link" placeholder="动画播放秒数" style="width: 200px; float: left; margin-left: 5px;"><!--type="number"-->
                                          		</div>
                                            </div>
	                                    </div>
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">右侧模块排序 </label>
	                                        <div class="am-u-sm-9">
	                                        	幻灯：<input type="number" style="width: 80px; display: inline-block;" name="wpzs_huandeng_sort" value="<?php echo $modval['wpzs_huandeng_sort'];?>">
												链接：<input type="number" style="width: 80px; display: inline-block;" name="wpzs_textlink_sort" value="<?php echo $modval['wpzs_textlink_sort'];?>">
	                                        	视频：<input type="number" style="width: 80px; display: inline-block;" name="wpzs_video_sort" value="<?php echo $modval['wpzs_video_sort'];?>">
	                                            <small></small>
	                                        </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">幻灯片标题 </label>
	                                        <div class="am-u-sm-9">
	                                        	<input type="text" style="width: 200px;" name="wpzs_huandeng_title" value="<?php echo $modval['wpzs_huandeng_title'];?>">
	                                            <small></small>
	                                        </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">右侧幻灯片 </label>
	                                        <div class="am-u-sm-9">
	                                        	<div ng-repeat="v in files" ng-if="v.url!=''">
	                                        		<input type="hidden" name="wpzs_huandeng[{{$index}}][src]" id="" value="{{v.url}}" />
		                                        	<input type="hidden" name="wpzs_huandeng[{{$index}}][url]" id="" value="{{v.url}}" />
		                                        	<input type="hidden" name="wpzs_huandeng[{{$index}}][key]" id="" value="{{v.key}}" />
	                                        	</div>
	                                        	
												<ul class="imglist">
													<li ng-repeat="v in files">
														<div ng-class="{beforeupload:!v.url}" style="background: url({{v.src}}) no-repeat; background-size: cover;"><span class="uploading"  ng-if="!v.url">上传中</span><a href="javascript:;" class="btn_img_del" ng-if="v.url" data-key="{{v.key}}" data-index='{{$index}}'>删除</a></div>
													</li>
													<li id="huandengpian"><img  src="/static/public/images/btn_upload_img01.jpg"/></li>
												</ul>
	                                        </div>
	                                    </div>
	                                    										
										<hr>

	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">链接标题 </label>
	                                        <div class="am-u-sm-9">
	                                        	<input type="text" style="width: 200px;" name="wpzs_textlink_title" value="<?php echo $modval['wpzs_textlink_title'];?>">
	                                            <small></small>
	                                        </div>
	                                    </div>
	
	                                    <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">网盘链接</label>
                                          	<div class="am-u-sm-9" id="list_wpzs_textlink">
                                          		<div class="form">
                                          			<input type="text" class="title" placeholder="标题">
                                          			<input type="text" class="link" placeholder="链接">
                                          			<button type="button" class="am-btn am-btn-secondary am-btn-sm btn_textlink_add">添加</button>
                                          		</div>
                                          		<div class="list" ng-repeat="v in textlink_add">
                                          			<input type="text" name="wpzs_textlink[{{$index}}][title]" readonly="readonly" value="{{v.title}}" class="title bordernone" placeholder="标题">
                                          			<input type="text" name="wpzs_textlink[{{$index}}][link]" readonly="readonly" value="{{v.link}}" class="link bordernone btn_link" placeholder="链接">
                                          			<button type="button" class="am-btn  am-btn-xs btn_textlink_mod">编辑</button> <button type="button" class="am-btn  am-btn-xs btn_textlink_del">删除</button>
                                          		</div>
                                            </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <div class="am-form-group">
	                                    	<label for="user-name" class="am-u-sm-3 am-form-label">视频管理</label>
                                    	  <div class="am-u-sm-9 indexbg">
	                                    		<input type="text" name="wpzs_video_title" value="<?php echo $modval['wpzs_video_title']; ?>" class="title" placeholder="视频标题" style="width: 200px; float: left;">
	                                    		<input type="text" name="wpzs_video_url" value="<?php echo htmlspecialchars($modval['wpzs_video_url']); ?>" class="title" placeholder="视频地址" style="width: 200px; float: left; margin-left: 5px;">
												<br>

	                                    		<div class="am-g">  <small>  自定义视频名称与视频地址，<a href="http://pan.106pan.com/file/show/pk1/53/pk4/1522065563104" target="_blank">点击下载软件</a></small></div>

	                                    		<input type="hidden" name="wpzs_video_img"  value="<?php echo $modval['wpzs_video_img']; ?>" />
	                                    		<?php if($modval['wpzs_video_img']){?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100"  src="<?php echo S('STATIC').'/'.$modval['wpzs_video_img'];?>?<?php echo $modval['indexbg_time']; ?>&imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_key_uid/key/wpzs_video_img",save_key:false,key:"wpzs_video_img_<?php echo session('user_auth.id');?>",url:"wpzs_video_img"}'/><a href="javascript:;" class="btn_indexbg_del" data-name="wpzs_video_img" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}else{?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100" src="<?php echo S('STATIC');?>/static/public/images/btn_upload_img02.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_key_uid/key/wpzs_video_img",save_key:false,key:"wpzs_video_img_<?php echo session('user_auth.id');?>",url:"wpzs_video_img"}'/><a href="javascript:;" class="btn_indexbg_del btn_indexbg_del1" data-name="wpzs_video_img" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}?>
	                                    	
												<small>自定义视频图片，如果是优酷、腾讯视频不需要上传</small>
                                    	  </div>
										</div>
										
																				
										<hr>

	
	                                    <?php }?>
	                                    <?php if($modval['member_wangpan_type']>1){?>
	                                      <div class="am-form-group">
	                                        <label for="user-name" class="am-u-sm-3 am-form-label">自定义代码 </label>
	                                        <div class="am-u-sm-9">
	                                             <textarea name="index_code" maxlength="500" rows="10" cols="5"><?php echo $modval['index_code']; ?> </textarea>
	                                            <small></small>
												<small> 部分模板支持：限制500字符，防止空间内挂马，空间不支持写入script和javascript和Stylesheet  权限支持106简约模板使用</a></small>
	                                        </div>
	                                    </div>
										
																				
										<hr>

	
	                                    <?php }?>
	                                    
	                                    <div class="am-form-group">
	                                    	<label for="user-name" class="am-u-sm-3 am-form-label">顶部背景图 </label>
                                    	  <div class="am-u-sm-9 indexbg">
	                                    		<input type="hidden" name="indexbg_head"  value="<?php echo $modval['indexbg_head']; ?>" />
	                                    		<?php if($modval['indexbg_head']){?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100"  src="<?php echo S('STATIC').'/'.$modval['indexbg_head'];?>?<?php echo $modval['indexbg_time']; ?>&imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg",save_key:false,key:"indexbg_head_<?php echo session('user_auth.id');?>",url:"indexbg_head"}'/><a href="javascript:;" class="btn_indexbg_del" data-name="indexbg_head" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}else{?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100" src="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg_head",save_key:false,key:"indexbg_head_<?php echo session('user_auth.id');?>",url:"indexbg_head"}'/><a href="javascript:;" class="btn_indexbg_del btn_indexbg_del1" data-name="indexbg_head" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}?>
												 <small>建议：顶部图片大小：1000*200（长1000像素或以上，高200像素）</a></small>	
	                                    	</div>
										
										</div>
										<div class="am-form-group">
	                                    	<label for="user-name" class="am-u-sm-3 am-form-label">公告栏背景图 </label>
	                                    	<div class="am-u-sm-9 indexbg">
	                                    		<input type="hidden" name="indexbg_notes"  value="<?php echo $modval['indexbg_notes']; ?>" />
	                                    		<?php if($modval['indexbg_notes']){?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100"  src="<?php echo S('STATIC').'/'.$modval['indexbg_notes'];?>?<?php echo $modval['indexbg_time']; ?>&imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg_notes",save_key:false,key:"indexbg_notes_<?php echo session('user_auth.id');?>",url:"indexbg_notes"}'/><a href="javascript:;" class="btn_indexbg_del" data-name="indexbg_notes" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}else{?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100" src="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg_notes",save_key:false,key:"indexbg_notes_<?php echo session('user_auth.id');?>",url:"indexbg_notes"}'/><a href="javascript:;" class="btn_indexbg_del btn_indexbg_del1" data-name="indexbg_notes" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}?>
												
	                                    	</div>
										</div>
										<div class="am-form-group">
	                                    	<label for="user-name" class="am-u-sm-3 am-form-label">目录背景图 </label>
	                                    	<div class="am-u-sm-9 indexbg">
	                                    		<input type="hidden" name="indexbg"  value="<?php echo $modval['indexbg']; ?>" />
	                                    		<input type="hidden" name="indexbg_time"  />
	                                    		<?php if($modval['indexbg']){?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100"  src="<?php echo S('STATIC').'/'.$modval['indexbg'];?>?<?php echo $modval['indexbg_time']; ?>&imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg",save_key:false,key:"indexbg_<?php echo session('user_auth.id');?>",url:"indexbg"}'/><a href="javascript:;" class="btn_indexbg_del" data-name="indexbg" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div> 
	                                    		<?}else{?>
	                                    			<div class="plupload_btn_box"><img width="100" height="100" src="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80" data-plupload='{uptoken_url:"/api/upload_token_indexbg",save_key:false,key:"indexbg_<?php echo session('user_auth.id');?>",url:"indexbg"}'/><a href="javascript:;" class="btn_indexbg_del btn_indexbg_del1" data-name="indexbg" data-defaultimg="<?php echo S('STATIC');?>/static/public/images/btn_upload_img01.jpg?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80">删除</a><div class="beforeupload">上传中</div></div>
	                                    		<?}?>
												
										  </div>
									  </div>
									  										
										<hr>

	
										<table width="1040" border="0" align="center">
  <tr>
    <td width="1034">
	
	<label>免责声明：勿将他人版权图片用于商业用途，否则视为侵权版本，一切后果自负；请支持原创及正版作品； </label>
	
	</td>
  </tr>
</table>

	                                    <div class="am-form-group">
	                                        <div class="am-u-sm-9 am-u-sm-push-3">
	                                            <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success btn_submit">
	                                            	提交
	                                            </button>
	                                        </div>
	                                    </div>
	                                </form>
	                            </div>
	                        </div>
	                    </div>
	                </div>
				</div>
			</div>
		</div>
		<?php
		include 'Inc_files_boot1.php';
		?>
		<script src="/static/public/js/webuploader/webuploader.min.js" type="text/javascript"></script>
		<script src="/static/public/js/webuploader/qiniu_img_more.js" type="text/javascript"></script>
		<script type="text/javascript">
		var textlink_add=<?php echo empty($userconfig['wpzs_textlink'])?'[]':$userconfig['wpzs_textlink'];?>;
		var topflash_add=<?php echo empty($userconfig['wpzs_topflash'])?'[]':$userconfig['wpzs_topflash'];?>;
		var wpzs_huandeng=<?php echo empty($userconfig['wpzs_huandeng'])?'[]':$userconfig['wpzs_huandeng'];?>;
		for(var i in wpzs_huandeng){
			wpzs_huandeng[i].src+='?imageMogr2/thumbnail/!100x100r/gravity/center/crop/100x100/interlace/1/quality/80';
		}
		</script>
		<script>
			jQuery(document).ready(function($){ 
				try{
					scope.textlink_add=textlink_add;
					scope.topflash_add=topflash_add;
					scope.files=wpzs_huandeng;
					scope.$apply();
			    }catch(e){}
			    try{
			        jQuery(document).on('click','.btn_submit',function () {
			            var the=jQuery(this);
			            var url="<?php echo $modval['pk1']?'/x/mod':'/x/add';?>";
			            jQuery('[name="indexbg_time"]').val(new Date().getTime());
			            jQuery.ajax({
			            	url:url,
			                data:the.closest('form').serializeArray(),
			                dataType: "json",
			                type: "post",
			                timeout: 10000,
			                success: function(data) {
			                	if (data.status==1) {
			                		wd_alert({
			                			msg:'设置成功',
			                			timeout:5000,
			                			background:'#45B54A',
			                			color:'#fff'
			                		});
			                		jQuery(".domain").prop('disabled',true);
			                		
			                	}else{
			                		wd_alert({
			                			msg:data.info,
			                			timeout:1000,
			                			background:'#f00',
			                			color:'#fff'
			                		});
			                	}
			                },
			                error: function() {
			                    mui.toast("网络连接超时");
			                }
			            });          
			        })   
			    }catch(e){}
			});
			jQuery(document).on('click','.help',function () {
			    var the=jQuery(this);
			    the.next('.help_img').toggle();          
			})
			//幻灯片管理
			jQuery(document).on('click','.btn_img_del',function () {
				var the=jQuery(this);
				jQuery.ajax({
					url:"/api/qiniu_delete",
				    data:{
				    	buket:'QINIU_TU',
				    	key:the.data('key')
				    },
				    dataType: "json",
				    type: "post",
				    timeout: 10000,
				    success: function(data) {
				    	scope.files.splice(the.data('index'),1);
				    	scope.$apply();
				    },
				    error: function() {
				        mui.toast("网络连接超时");
				    }
				});       
			})
			//链接管理
			jQuery(document).on('click','.btn_textlink_add',function () {
				var the=jQuery(this);
				if(jQuery.trim(the.closest('.form').find('.title').val())==''){
					return false;
				}
				var obj={};
				obj.title=the.closest('.form').find('.title').val();       
				obj.link=the.closest('.form').find('.link').val();  
				textlink_add.push(obj);  
				scope.textlink_add=textlink_add;
				scope.$apply();
				the.closest('.form').find('input').val('');
			})
			jQuery(document).on('click','.btn_textlink_mod',function () {
				var the=jQuery(this);
				if (the.html()=='编辑') {
					the.html('保存');
					the.closest('.list').find('input').removeClass('bordernone');  
					the.closest('.list').find('input').removeAttr('readonly');
				}else{
					the.html('编辑');
					the.closest('.list').find('input').addClass('bordernone');  
					the.closest('.list').find('input').attr('readonly','readonly');
				}
				
			})
			jQuery(document).on('click','.btn_textlink_del',function () {
				var the=jQuery(this);
				var index=the.closest('.list').index()-1;
				the.closest('.list').remove();  
				textlink_add.splice(index,1);  
				scope.textlink_add=textlink_add;
				scope.$apply();
			})
			jQuery(document).on('blur','.btn_link',function () {
				var the=jQuery(this);
				the.closest('.list').find('.btn_textlink_mod').click();  
			})
			//顶部透明flash管理
			//链接管理
			jQuery(document).on('click','.btn_topflash_add',function () {
				var the=jQuery(this);
				if(jQuery.trim(the.closest('.form').find('.title').val())==''){
					return false;
				}
				var obj={};
				obj.url=the.closest('.form').find('.title').val();       
				topflash_add.push(obj);  
				scope.topflash_add=topflash_add;
				scope.$apply();
				the.closest('.form').find('input').val('');
			})
			jQuery(document).on('click','.btn_topflash_mod',function () {
				var the=jQuery(this);
				if (the.html()=='编辑') {
					the.html('保存');
					the.closest('.list').find('input').removeClass('bordernone');  
					the.closest('.list').find('input').removeAttr('readonly');
				}else{
					the.html('编辑');
					the.closest('.list').find('input').addClass('bordernone');  
					the.closest('.list').find('input').attr('readonly','readonly');
				}
				
			})
			jQuery(document).on('click','.btn_topflash_del',function () {
				var the=jQuery(this);
				var index=the.closest('.list').index()-1;
				the.closest('.list').remove();  
				topflash_add.splice(index,1);  
				scope.topflash_add=topflash_add;
				scope.$apply();
			})
			jQuery(document).on('blur','.btn_topflash_link',function () {
				var the=jQuery(this);
				the.closest('.list').find('.btn_topflash_mod').click();  
			})
			//删除背景图片
			jQuery(document).on('click','.btn_indexbg_del',function () {
			    var the=jQuery(this);
			    the.prev('img').attr('src',the.data('defaultimg'));     
			    jQuery('[name="'+the.data('name')+'"]').val('');   
			    the.hide();  
			})
			jQuery('[data-plupload]').each(function (index) {
				var the=jQuery(this);
				var opts = the.attr("data-plupload") ? the.attr("data-plupload") : "{}";
				opts = eval("(" + opts + ")");
				var the_id='btn'+index+new Date().getTime();
				the.attr('id',the_id);
				var browse_button=the_id;
				var runtimes=typeof(opts.runtimes)!="undefined"?opts.runtimes:'html5,flash,html4';
				var uptoken_url=opts.uptoken_url;
				var domain=typeof(opts.domain)!="undefined"?opts.domain:'http://www.qiniu.com';
				var get_new_uptoken=typeof(opts.get_new_uptoken)!="undefined"?opts.get_new_uptoken:false;
				var max_file_size=typeof(opts.max_file_size)!="undefined"?opts.max_file_size:'5mb';
				var flash_swf_url=typeof(opts.flash_swf_url)!="undefined"?opts.flash_swf_url:'js/plupload/Moxie.swf';
				var max_retries=typeof(opts.max_retries)!="undefined"?opts.max_retries:3;
				var chunk_size=typeof(opts.chunk_size)!="undefined"?opts.chunk_size:'4mb';
				var auto=typeof(opts.auto)!="undefined"?opts.auto:true;
				var multi=typeof(opts.multi)!="undefined"?opts.multi:false;
				var key=typeof(opts.key)!="undefined"?opts.key:false;
				if (key!==false) {
					var save_key=false;
				}
				var runtimes=typeof(opts.runtimes)!="undefined"?opts.runtimes:'html5,flash,html4';
				var runtimes=typeof(opts.runtimes)!="undefined"?opts.runtimes:'html5,flash,html4';
				var runtimes=typeof(opts.runtimes)!="undefined"?opts.runtimes:'html5,flash,html4';
				var runtimes=typeof(opts.runtimes)!="undefined"?opts.runtimes:'html5,flash,html4';
				new QiniuJsSDK().uploader({
					runtimes: runtimes, 
					browse_button: browse_button,
					uptoken_url:uptoken_url ,
					save_key: save_key,   // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`，则开启，SDK会忽略对key的处理
					domain: domain, //bucket 域名，下载资源时用到，**必需**
					get_new_uptoken: get_new_uptoken, //设置上传文件的时候是否每次都重新获取新的token
					//container: 'container', //上传区域DOM ID，默认是browser_button的父元素，
					max_file_size: max_file_size, //最大文件体积限制
					flash_swf_url: flash_swf_url, //引入flash,相对路径
					max_retries: max_retries, //上传失败最大重试次数
					//dragdrop: true, //开启可拖曳上传
					//drop_element: 'container', //拖曳上传区域元素的ID，拖曳文件或文件夹后可触发上传
					chunk_size: chunk_size, //分块上传时，每片的体积
					auto_start: auto, //选择文件后自动上传，若关闭需要自己绑定事件触发上传,
					multi_selection:multi,
					init: {
						'FileFiltered':function(up, file) { //当文件添加到上传队列后
							if (typeof(opts.FileFiltered)=="function") {
								opts.FileFiltered(up, file);
							}else{
								if (multi===false) {
									var reader = new FileReader();
							        reader.readAsDataURL(file.getNative());
							        reader.onload = function(e){
							        	the.attr('src',this.result);
							        }
								}
							}
						},
						'FilesAdded': function(up, files) { //当文件添加到上传队列后
							if (typeof(opts.FilesAdded)=="function") {
								opts.FilesAdded(up, files);
							}
							the.next('.beforeupload').show();
						},
						'BeforeUpload': function(up,file) { //当队列中的某一个文件正要开始上传前
							if (typeof(opts.BeforeUpload)=="function") {
								opts.BeforeUpload(up, file);
							}
						},
						'UploadProgress': function(up, file) { //会在文件上传过程中不断触发，可以用此事件来显示上传进度
							if (typeof(opts.UploadProgress)=="function") {
								opts.UploadProgress(up, file);
							}
						},
						'UploadComplete': function(up, file) { //当上传队列中所有文件都上传完成后触发
							if (typeof(opts.UploadComplete)=="function") {
								opts.UploadComplete(up, file);
							}
						},
						'FileUploaded': function(up, file, info) { //当队列中的某一个文件上传完成后触发
							if (typeof(opts.FileUploaded)=="function") {
								opts.FileUploaded(up, file, info);
							}else{
								info=JSON.parse(info.response);
								jQuery('[name="'+opts.url+'"]').val(info.key);
							}
							the.next('.beforeupload').hide();
							the.closest('div').find('.btn_indexbg_del').show();
						},
						'Error': function(up, err, errTip) { //当发生错误时触发监听
							if (typeof(opts.Error)=="function") {
								opts.Error(up, err, errTip);
							}
						},
						'Key': function(up, file) {
							return key;
			            }
					}
				});
			});
		</script>
		
</body>

</html>