<!DOCTYPE html>
<html>
    <head>
    <meta charset="UTF-8">
   {include="style"}
  </head>
    </head>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>系统设置</cite></a>
              <a><cite>基本设置</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="iconfont" style="line-height:30px">&#xe6aa;</i></a>
        </div>
		<form class="layui-form layui-form-pane" >
        <div class="x-body">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
              <ul class="layui-tab-title">
                <li class="layui-this">网站设置</li>
                <li>高级设置</li>
                <li>邮箱订单</li>
                <li>支付配置</li>
                <li>公众号绑定</li>
               
                
              </ul>
			 
              <div class="layui-tab-content" >
			 
                <div class="layui-tab-item layui-show">
                    
                        <div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>网站SEO名称
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_name" value="{$config['web_name']}" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>网站SEO关键词
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_keyword" value="{$config['web_keyword']}" autocomplete="off" placeholder="5个左右,8汉字以内,用英文,隔开"
                                class="layui-input">
                            </div>
                        </div>
                      
						
						<div class="layui-form-item layui-form-text">
                            <label  class="layui-form-label">
                                <span class='x-red'>*</span>网站SEO描述
                            </label>
                            <div class="layui-input-block">
                                <textarea placeholder="空制在80个汉字，160个字符以内"  name="web_desc" class="layui-textarea">{$config['web_desc']}</textarea>
                            </div>
                        </div>
                        
                        <div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>底部版权
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_copyright" value="{$config['web_copyright']}" autocomplete="off" placeholder="&copy; 2016 X-admin"
                                class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>备案号
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_beian" value="{$config['web_beian']}" autocomplete="off" placeholder="京ICP备00000000号"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>网站电话
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_tel" value="{$config['web_tel']}" autocomplete="off" placeholder=""
                                class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                                <label style="width:150px" class="layui-form-label">
                                    <span class='x-red'>*</span>400电话
                                </label>
                                <div style="margin-left:150px" class="layui-input-block">
                                    <input type="text" name="web_tel_400" value="{$config['web_tel_400']}" autocomplete="off" placeholder=""
                                    class="layui-input">
                                </div>
                            </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>网站QQ
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_qq" value="{$config['web_qq']}" autocomplete="off" placeholder=""
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>网站邮箱
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_email" value="{$config['web_email']}" autocomplete="off" placeholder=""
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>公司地址
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="web_address" value="{$config['web_address']}" autocomplete="off" placeholder=""
                                class="layui-input">
                            </div>
                        </div>
					
						{if($custom)}
						{foreach $custom as $k=>$v}
						<?php
						switch($v['type']){
							case 1:
							echo '<div class="layui-form-item" id="custom_'.$v['field'].'">
									<label style="width:150px" class="layui-form-label">
										<span class=\'x-red\'>*</span>'.$v['title'].'
									</label>
									<div  class="layui-inline">
									   
									  <input name="'.$v['field'].'" type="text" class="layui-input" id="'.$v['field'].'" value="'.$v['data'].'" />
									</div>
									 <div class="layui-inline">
										 
										 
										  <button type="button" class="layui-btn" id="LAY_'.$v['field'].'_upload">
											  <i class="layui-icon">&#xe67c;</i>上传图片
										  </button>
									 </div>';
							if($admin['gid']==1){
								echo	 '<div class="layui-inline">
										<button type="button" lay-filter="del" data="custom_'.$v['field'].'"  lay-submit=""  class="layui-btn layui-btn-danger">删除</button>
									 </div>[  '.$v['field'].'  ]';
							}
								echo	'<div class="layui-block">
									<img src="'.$v['data'].'"  width="400"  id="'.$v['field'].'_img" />
									</div>
								</div>
                        
						<script>
				
						layui.use("upload", function(){
							  var upload_'.$v['field'].' = layui.upload;
							   
							  //执行实例
							  var uploadInst = upload_'.$v['field'].'.render({
								elem: "#LAY_'.$k.'_upload" //绑定元素
								,url: "'.U('Common/uploads').'" //上传接口
								,accept:"images"
								,acceptMime:"image/*"
								,done: function(res){
								  
									if(res.code==0){
										 $("#'.$v['field'].'_img").attr("src","/"+res.url);
										 $("#'.$v['field'].'").val("/"+res.url);
									}else{
										 layer.alert(res.error, {icon: 5});
									}
								}
								,error: function(){
								  //请求异常回调
								  layer.alert("上传异常！");
								}
							  });
							});
						</script>';
							
							break;
							case 2:
							echo '<div class="layui-form-item" id="custom_'.$v['field'].'">
                            <label style="width:150px" class="layui-form-label">
                                <span class=\'x-red\'>*</span>'.$v['title'].'
                            </label>
                            <div  class="layui-inline">
                                <input type="text" name="'.$v['field'].'" value="'.$v['data'].'" autocomplete="off" placeholder="请输入内容"
                                class="layui-input">
                            </div>';
							if($admin['gid']==1){
							echo '<div class="layui-inline">
								<button type="button" lay-filter="del" data="custom_'.$v['field'].'"  lay-submit=""  class="layui-btn layui-btn-danger">删除</button>
							 </div>[  '.$v['field'].'  ]';
							 }
							echo '</div>';
							
							break;
							case 3:
							echo '<div class="layui-form-item layui-form-text"  id="custom_'.$v['field'].'">
                            <label class="layui-form-label">
                                <span class=\'x-red\'>*</span>'.$v['title'].'
                            </label>
							
                            <div class="layui-input-block">
                                <textarea placeholder="请输入内容"   name="'.$v['field'].'" class="layui-textarea">'.$v['data'].'</textarea>
                            </div>';
							if($admin['gid']==1){
							echo '<div class="layui-inline">
								<button type="button" lay-filter="del" data="custom_'.$v['field'].'"  lay-submit="" class="layui-btn layui-btn-danger">删除</button>
							 </div>[  '.$v['field'].'  ]';
							 }
							echo '</div>';
							break;
							
						}
						
						?>
						{/foreach}
						{/if}
						{if($admin['gid']==1)}
                        <div class="layui-form-item layui-input-inline">
							<label style="width:150px" class="layui-form-label">
                                <span class='x-red'></span>新增参数
                            </label>
							<div class="layui-inline">
                                <input type="text" id="custom_title" name="custom_title" autocomplete="off" placeholder="请填写参数名"
                                class="layui-input">
                            </div>
							<div class="layui-inline" >
								<select class="layui-btn layui-btn-normal" name="custom_type" id="custom_type" >
								<option value="0">选择类型</option>
								<option value="1">图片</option>
								<option value="2">输入框</option>
								<option value="3">简短文字</option>
								
								</select>
								
								
							</div>
							<div class="layui-inline">
							 <button lay-filter="*" lay-submit="" class="layui-btn"><i class="iconfont">&#xe6b9;</i>添加</button>
								
							</div>
							 
							  
                        </div>
                        {/if}

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">
                                <span class='x-red'>*</span>统计代码
                            </label>
                            <div class="layui-input-block">
                                <textarea placeholder="将百度统计、cnzz等平台的流量统计JS代码放到这里"  name="web_js" class="layui-textarea">{$config['web_js']}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn" lay-submit="" lay-filter="*">
                                保存
                            </button>
                        </div>
                    
                    <div style="height:100px;"></div>
                </div>
                <div class="layui-tab-item">
                   
                       <div  class="layui-form-item">
                            <label style="width:150px"  class="layui-form-label">
                                <span class='x-red'>*</span>PC网站模板
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="pc_template" value="{$config['pc_template']}" autocomplete="off" placeholder="请把模板放到Home/template/目录下面"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item" pane>
							<label for="iswap" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>是否开启手机端
							</label>
							<div  style="margin-left: 150px;" class="layui-input-block">
								<input type="radio" name="iswap" value="0" title="不显示" {if($config['iswap']==0)}checked{/if}>
								<input type="radio" name="iswap" value="1" title="显示" {if($config['iswap']==1)}checked{/if}>
							</div>
							 
							
						</div>
						<div  class="layui-form-item">
                            <label style="width:150px"  class="layui-form-label">
                                WAP网站模板
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="wap_template" value="{$config['wap_template']}" autocomplete="off" placeholder="请把模板放到Home/template/目录下面"
                                class="layui-input">
                            </div>
                        </div>
						<div  class="layui-form-item">
                            <label style="width:150px"  class="layui-form-label">
                                微信网站模板
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="weixin_template" value="{$config['weixin_template']}" autocomplete="off" placeholder="请把模板放到Home/template/目录下面"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item" >
							<label for="iswap" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>后台模板风格
							</label>
							<div  class="layui-input-inline">
							<select class="layui-btn layui-btn-normal" name="admintpl" id="admintpl" >
							<option value="tpl" {if($config['admintpl']=='tpl')}selected{/if}>默认</option>
							<option value="default" {if($config['admintpl']=='default')}selected{/if}>原始</option>
							
							
							</select>
							
							</div>
							<div class="layui-form-mid layui-word-aux">
								该风格主要是指链接跳转方面，是否弹窗形式打开页面
							</div>
							 
							
						</div>
						<div class="layui-form-item" pane>
							<label for="isopenwebsite" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>是否绑定多域名
							</label>
							<div  style="margin-left: 150px;" class="layui-input-inline">
								<input type="radio" name="isopenwebsite" value="0" title="不开启" {if($config['isopenwebsite']==0)}checked{/if}>
								<input type="radio" name="isopenwebsite" value="1" title="开启" {if($config['isopenwebsite']==1)}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux">
								  开启绑定多域名后，需要到插件中配置
							</div>
							
						</div>
						<div  class="layui-form-item">
                            <label  style="width:150px"  class="layui-form-label">
                                缓存时间
                            </label>
                            <div  style="margin-left: 150px;"   class="layui-input-block">
                                <input type="text" name="cache_time" value="{$config['cache_time']}" autocomplete="off" placeholder="留空或0则不设置缓存"
                                class="layui-input">
                            </div>
                        </div>
						
                        <div class="layui-form-item" pane>
							<label for="isopenhomeupload" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>是否开启前台上传
							</label>
							<div  style="margin-left: 150px;" class="layui-input-block">
								<input type="radio" name="isopenhomeupload" value="0" title="关闭" {if($config['isopenhomeupload']==0)}checked{/if}>
								<input type="radio" name="isopenhomeupload" value="1" title="开启" {if($config['isopenhomeupload']==1)}checked{/if}>
							</div>
							 
							
						</div>
                        <div  class="layui-form-item">
                            <label  style="width:150px"  class="layui-form-label">
                                允许上传文件类型
                            </label>
                            <div  style="margin-left: 150px;"   class="layui-input-block">
                                <input type="text" name="fileType" value="{$config['fileType']}" autocomplete="off" placeholder="请用|分割"
                                class="layui-input">
                            </div>
                        </div>
                        <div  class="layui-form-item">
                            <label  style="width:150px"  class="layui-form-label">
                                限制上传文件大小
                            </label>
                            <div  style="margin-left: 150px;"   class="layui-input-block">
                                <input type="text" name="fileSize" value="{$config['fileSize']}" autocomplete="off" placeholder="0代表不限"
                                class="layui-input">
                            </div>
                        </div>
						
						<div  class="layui-form-item">
                            <label style="width:150px"  class="layui-form-label">
                                上传图片压缩比例
                            </label>
							 <div  class="layui-input-inline">
							<select class="layui-btn layui-btn-normal" name="imagequlity" id="imagequlity" >
							<option value="100" {if($config['imagequlity']==100)}selected{/if}>100%</option>
							<option value="95" {if($config['imagequlity']==95)}selected{/if}>95%</option>
							<option value="90" {if($config['imagequlity']==90)}selected{/if}>90%</option>
							<option value="85" {if($config['imagequlity']==85)}selected{/if}>85%</option>
							<option value="80" {if($config['imagequlity']==80)}selected{/if}>80%</option>
							<option value="75" {if($config['imagequlity']==75)}selected{/if}>75%</option>
							<option value="70" {if($config['imagequlity']==70)}selected{/if}>70%</option>
							<option value="65" {if($config['imagequlity']==65)}selected{/if}>65%</option>
							<option value="60" {if($config['imagequlity']==60)}selected{/if}>60%</option>
							<option value="55" {if($config['imagequlity']==55)}selected{/if}>55%</option>
							<option value="50" {if($config['imagequlity']==50)}selected{/if}>50%</option>
							
							
							</select>
							
							</div>
							<div class="layui-form-mid layui-word-aux">
								  100%则不压缩，如果PNG是透明图，压缩后背景变黑色
							</div>
							
						</div>
						<div class="layui-form-item" pane>
							<label for="ispngcompress" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>PNG是否压缩
							</label>
							<div style="margin-left: 150px;"  class="layui-input-block">
								<input type="radio" name="ispngcompress" value="0" title="关闭" {if($config['ispngcompress']==0)}checked{/if}>
								<input type="radio" name="ispngcompress" value="1" title="启用" {if($config['ispngcompress']==1)}checked{/if}>
							</div>
							 
							
						</div>
						
						<div class="layui-form-item layui-form-text">
                            <label  class="layui-form-label">
                                <span class='x-red'>*</span>UEditor编辑器导航条配置
                            </label>
                            <div class="layui-input-block">
                                <textarea placeholder="留空表示默认全局"  name="ueditor_config" class="layui-textarea">{$config['ueditor_config']}</textarea>
                            </div>
                        </div>
                        
						
						
						<div  class="layui-form-item">
                            <label  style="width:150px"  class="layui-form-label">
                                允许前台搜索的表
                            </label>
                            <div  style="margin-left: 150px;"   class="layui-input-block">
                                <input type="text" name="search_table" value="{$config['search_table']}" autocomplete="off" placeholder="防止数据泄露,填写允许搜索的表名,留空表示不允许搜索,多个表可用|分割,如：article|product "
                                class="layui-input">
                            </div>
                        </div>
						
						 <div class="layui-form-item" pane>
							<label for="isopenhomepower" style="width:150px" class="layui-form-label">
								<span class="x-red"></span>是否开启前台权限
							</label>
							<div  style="margin-left: 150px;" class="layui-input-block">
								<input type="radio" name="isopenhomepower" value="0" title="关闭" {if($config['isopenhomepower']==0)}checked{/if}>
								<input type="radio" name="isopenhomepower" value="1" title="开启" {if($config['isopenhomepower']==1)}checked{/if}>
							</div>
							 
							
						</div>
						
						<div class="layui-form-item">
                            <button class="layui-btn" lay-submit="" lay-filter="*">
                                保存
                            </button>
                        </div>
                    
                </div>
				
				
				
				
               <div class="layui-tab-item">
                    
						{if($admin['gid']==1)}
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>邮件服务器
                            </label>
                            <div   style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="email_server" value="{$config['email_server']}" autocomplete="off" placeholder="请输入邮件服务器"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>收发端口
                            </label>
                            <div   style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="email_port" value="{$config['email_port']}" autocomplete="off" placeholder="邮件收发端口"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>Email地址
                            </label>
                            <div   style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="send_email" value="{$config['send_email']}" autocomplete="off" placeholder="请输入您的Email"
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>Email密码
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="password" name="send_pass" value="{$config['send_pass']}" autocomplete="off" placeholder="请输入您的Email秘钥，需要先开通安全秘钥，推荐163,126邮箱"
                                class="layui-input">
                            </div>
                        </div>
						{/if}
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span class='x-red'>*</span>收件邮箱
                            </label>
                            <div style="margin-left:150px" class="layui-input-block">
                                <input type="text" name="shou_email" value="{$config['shou_email']}" autocomplete="off" placeholder=""
                                class="layui-input">
                            </div>
                        </div>
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span  class='x-red'>*</span>发件人
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="send_name" value="{$config['send_name']}" autocomplete="off" placeholder="请输入邮件发送方"
                                class="layui-input">
                            </div>
                        </div>
						
						<div class="layui-form-item layui-form-text">
                            <label  class="layui-form-label">
                                <span class='x-red'>*</span>客户订单通知  <i class='x-red'>     请输入发送信件通知内容，用{xxx}占位</i>
                            </label>
                            <div class="layui-input-block">
                                <textarea placeholder="请输入发送信件通知内容，用{xxx}占位"  name="tj_msg" class="layui-textarea">{$config['tj_msg']}</textarea>
                            </div>
                        </div>
						
						
						
						<div class="layui-form-item layui-form-text">
                            <label  class="layui-form-label">
                                <span class='x-red'>*</span>订单出货通知  <i class='x-red'>请输入发送信件通知内容，用{xxx}占位</i>
                            </label>
                            <div class="layui-input-block">
                                <textarea placeholder="请输入发送信件通知内容，用{xxx}占位"  name="send_msg" class="layui-textarea">{$config['send_msg']}</textarea>
                            </div>
                        </div>
						
						<div class="layui-form-item">
                            <label style="width:150px" class="layui-form-label">
                                <span  class='x-red'>*</span>订单运费
                            </label>
                            <div  style="margin-left: 150px;" class="layui-input-block">
                                <input type="text" name="yunfei" value="{$config['yunfei']}" autocomplete="off" placeholder="请输入订单运费价格"
                                class="layui-input">
                            </div>
                        </div>
						
						
						<div class="layui-form-item">
                            <button class="layui-btn" lay-submit="" lay-filter="*">
                                保存
                            </button>
                        </div>
                   
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item" pane>
						<label for="paytype" style="width:150px"  class="layui-form-label">
							<span class="x-red"></span>支付方式
						</label>
						<div  style="margin-left: 150px;" class="layui-input-block">
							<input type="radio" name="paytype" value="0" title="关闭支付" {if($config['paytype']==0)}checked{/if}>
							<input type="radio" name="paytype" value="1" title="极致平台" {if($config['paytype']==1)}checked{/if}>
							<input type="radio" name="paytype" value="2" title="自主平台" {if($config['paytype']==2)}checked{/if}>
							
							
						</div>
					</div>
					
					<fieldset class="layui-elem-field layui-field-title">
					  <legend>极致平台&nbsp;&nbsp;<b class="x-red">同时支持：支付宝 & 微信支付</b></legend>
					  <div class="layui-field-box">
						<div class="layui-form-item">
							<label style="width:150px" class="layui-form-label">
								<span class='x-red'>*</span>平台接口
							</label>
							<div style="margin-left: 150px;" class="layui-input-block">
								<input type="text" name="jizhi_pay_url" value="{$config['jizhi_pay_url']}" autocomplete="off" placeholder="请填写极致平台支付域名"
								class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label style="width:150px" class="layui-form-label">
								<span class='x-red'>*</span>平台商户
							</label>
							<div style="margin-left: 150px;" class="layui-input-block">
								<input type="text" name="jizhi_mchid" value="{$config['jizhi_mchid']}" autocomplete="off" placeholder="请填写极致平台的商户号"
								class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label style="width:150px" class="layui-form-label">
								<span class='x-red'>*</span>应用appid
							</label>
							<div  style="margin-left: 150px;" class="layui-input-block">
								<input type="text" name="jizhi_appid" value="{$config['jizhi_appid']}" autocomplete="off" placeholder="请填写极致平台应用的appid"
								class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label style="width:150px" class="layui-form-label">
								<span class='x-red'>*</span>应用秘钥
							</label>
							<div  style="margin-left: 150px;" class="layui-input-block">
								<input type="password" name="jizhi_key" value="{$config['jizhi_key']}" autocomplete="off" placeholder="请填写极致平台应用的密钥"
								class="layui-input">
							</div>
						</div>
						
					  </div>
					</fieldset>
					
					<fieldset class="layui-elem-field layui-field-title">
					  <legend>自主平台</legend>
					  <div class="layui-field-box">
					
							
						    <div class="layui-form-item">
								  <label style="width:150px" for="alipay_partner" class="layui-form-label">
									  <span class="x-red">*</span>支付宝合作者
								  </label>
								  <div  class="layui-input-inline">
									
									   <input type="text" id="alipay_partner" value="{$config['alipay_partner']}" name="alipay_partner"  style="width:400px;"  autocomplete="off" class="layui-input">
								  </div>
								  <div class="layui-form-mid layui-word-aux">
										<span class="x-red">*</span>合作身份者ID，签约账号，以2088开头由16位纯数字组成的字符串
									</div>
								  
							  </div>
							<div class="layui-form-item">
								  <label style="width:150px" for="alipay_key" class="layui-form-label">
									  <span class="x-red">*</span>支付宝key
								  </label>
								  <div class="layui-input-inline">
									
									   <input type="text" id="alipay_key" value="{$config['alipay_key']}" name="alipay_key"  style="width:400px;"  autocomplete="off" class="layui-input">
								  </div>
								  <div class="layui-form-mid layui-word-aux">
										<span class="x-red">*</span>MD5密钥，安全检验码，由数字和字母组成的32位字符串
									</div>
								  
							  </div>
						   
								
								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label">
										<span class='x-red'>*</span>支付宝私钥
									</label>
									<div class="layui-input-block">
										<textarea placeholder="支付宝私钥"  name="alipay_private_key" class="layui-textarea">{$config['alipay_private_key']}</textarea>
									</div>
								</div>
								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label">
										<span class='x-red'>*</span>支付宝公钥
									</label>
									<div class="layui-input-block">
										<textarea placeholder="支付宝公钥"  name="alipay_public_key" class="layui-textarea">{$config['alipay_public_key']}</textarea>
									</div>
								</div>
								
							 
							
							  
							   <div class="layui-form-item">
									<label style="width:150px" class="layui-form-label">
										<span class='x-red'>*</span>微信商户mchid
									</label>
									<div style="margin-left:150px" class="layui-input-block">
										<input type="text" name="wx_mchid" value="{$config['wx_mchid']}" autocomplete="off" placeholder=""
										class="layui-input">
									</div>
								</div>
							  
							  
							 
							  <div class="layui-form-item">
									<label style="width:150px" class="layui-form-label">
										<span class='x-red'>*</span>微信商户key
									</label>
									<div style="margin-left:150px" class="layui-input-block">
										<input type="text" name="wx_key" autocomplete="off"  value="{$config['wx_key']}"  placeholder=""
										class="layui-input">
									</div>
								</div>
							   <div class="layui-form-item">
									<label style="width:150px" class="layui-form-label">
										<span class='x-red'>*</span>微信公众号appid
									</label>
									<div style="margin-left:150px" class="layui-input-block">
										<input type="text" name="wx_appid" autocomplete="off" value="{$config['wx_appid']}" placeholder=""
										class="layui-input">
									</div>
								</div>
								 <div class="layui-form-item">
									<label style="width:150px" class="layui-form-label">
										<span class='x-red'>*</span>微信公众号token
									</label>
									<div style="margin-left:150px" class="layui-input-block">
										<input type="text" name="wx_token" autocomplete="off" value="{$config['wx_token']}" placeholder=""
										class="layui-input">
									</div>
								</div>
							  <div class="layui-form-item">
									<label style="width:150px" class="layui-form-label">
										<span class='x-red'>*</span>公众号appsecret
									</label>
									<div style="margin-left:150px" class="layui-input-block">
										<input type="text" name="wx_appsecret" autocomplete="off" value="{$config['wx_appsecret']}" placeholder=""
										class="layui-input">
									</div>
								</div>
							 
							  
							  <div class="layui-form-item">
									<label style="width:150px" for="wx_client_cert" class="layui-form-label">
										
										<span class="x-red">*</span>微信apiclient_cert  
										
									</label>
									
									<div  class="layui-input-inline">
									  <div class="site-demo-upbar">
									  
									   <input name="wx_client_cert" type="text" class="layui-input" id="wx_client_cert" value="{$config['wx_client_cert']}" />
										
									  </div>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn" id="wx_client_cert_upload">
										  <i class="layui-icon">&#xe67c;</i>上传文件
										</button>
									  
									</div>
									
								</div>
							  <div class="layui-form-item">
									<label  style="width:150px" for="wx_client_key" class="layui-form-label">
										
										<span class="x-red">*</span>微信apiclient_key  
										
									</label>
									
									<div  class="layui-input-inline">
									  <div class="site-demo-upbar">
									   <input name="wx_client_key"  type="text" class="layui-input" id="wx_client_key" value="{$config['wx_client_key']}" />
										
									  </div>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn" id="wx_client_key_upload">
										  <i class="layui-icon">&#xe67c;</i>上传文件
										</button>
									</div>
								</div>
							
					
					
					  </div>
					</fieldset>
					
					<div class="layui-form-item">
							
						  
						<button class="layui-btn" lay-submit="" lay-filter="*">
							保存
						</button>
					</div>
                   
                </div>
			    <div class="layui-tab-item">
				
						<blockquote class="layui-elem-quote">仅仅是配置菜单栏，不需要接入服务器</blockquote>
						<div class="layui-form-item">
								<label style="width:150px" class="layui-form-label">
									<span class='x-red'>*</span>服务器URL
								</label>
								<div style="margin-left:150px" class="layui-input-block">
									<input type="text"  autocomplete="off" value="{fun get_domain()}/Wechat/index" disabled placeholder=""
									class="layui-input">
								</div>
							</div>
						<div class="layui-form-item">
								<label style="width:150px" class="layui-form-label">
									<span class='x-red'>*</span>公众号appid
								</label>
								<div style="margin-left:150px" class="layui-input-block">
									<input type="text" name="wx_login_appid" autocomplete="off" value="{$config['wx_login_appid']}" placeholder=""
									class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label style="width:150px" class="layui-form-label">
									<span class='x-red'>*</span>公众号appsecret
								</label>
								<div style="margin-left:150px" class="layui-input-block">
									<input type="text" name="wx_login_appsecret" autocomplete="off" value="{$config['wx_login_appsecret']}" placeholder=""
									class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label style="width:150px" class="layui-form-label">
									<span class='x-red'>*</span>公众号token
								</label>
								<div style="margin-left:150px" class="layui-input-block">
									<input type="text" name="wx_login_token" autocomplete="off"  value="{$config['wx_login_token']}"  placeholder=""
									class="layui-input">
								</div>
							</div>
							<div class="layui-form-item layui-form-text">
								<label  class="layui-form-label">
									<span class='x-red'>*</span>公众号欢迎语  <i class='x-red'>用户关注公众号推送的文字</i>
								</label>
								<div class="layui-input-block">
									<textarea placeholder="请输入公众号欢迎语"  name="huanying" class="layui-textarea">{$config['huanying']}</textarea>
								</div>
							</div>
						
					
						<div class="layui-form-item">
                            <button class="layui-btn" lay-submit="" lay-filter="*">
                                保存
                            </button>
                        </div>
						
                    
				</div>
              
			 
				
              </div>
            </div> 
			
        </div>
		</form>
     
        <script>
            layui.use(['element','layer','form','upload'], function(){
                $ = layui.jquery;//jquery
            var  lement = layui.element;//面包导航
            var  layer = layui.layer;//弹出层
            var  form = layui.form;
             var upload = layui.upload;
            
			
			 //图片上传接口
              upload.render({
			    elem: '#wx_client_cert_upload',
				accept:'file',
                url: "{fun U('Sys/uploadcert')}" //上传接口
                ,done: function(res){ //上传成功后的回调
					if(res.code==0){
						 $('#wx_client_cert').val('/'+res.url);
					}else{
						 layer.alert(res.error, {icon: 5});
					}
                 
                }
              });
			upload.render({
			    elem: '#wx_client_key_upload',
				accept:'file',
                url: "{fun U('Sys/uploadcert')}"  //上传接口
                ,done: function(res){ //上传成功后的回调
					if(res.code==0){
						 $('#wx_client_key').val('/'+res.url);
					}else{
						 layer.alert(res.error, {icon: 5});
					}
                 
                }
              });
             
             //监听提交
              form.on('submit(*)', function(data){
			
				$.post("{fun U('Sys/index')}",data.field,function(r){
					//console.log(r);
					var r = JSON.parse(r);
					if(r.code==0){
						 layer.alert(r.msg, {icon: 6},function(){
							 
							 window.location.reload();
							 
							 });
						
					}else{
						 layer.alert(r.msg, {icon: 6});
						 
					}
				
				});
				
				return false;
               
                
              });
			  
			   form.on('submit(del)', function(data){
			   
				var s = $(this).attr('data');
				layer.confirm('确认要删除吗？',function(index){
					 $("#"+s).remove();
					 layer.close(index);
					 var ss = s.split('custom_');
					$.post("{fun U('Sys/custom_del')}",{field:ss[1]},function(r){
						var r = JSON.parse(r);
						if(r.code==0){
							 layer.alert(r.msg, {icon: 6},function(){
							 window.location.reload();
							 });
							 
						}else{
							 layer.alert(r.msg, {icon: 6});
							 
						}
					
					});
					
				});
				
				
				
				return false;
               
                
              });
			  
			  

              })
			  
			  function custom_delete(s){
				layer.confirm('确认要删除吗？',function(index){
					 $("#"+s).remove();
					 layer.close(index);
					
			
				});
			  }
			 
			  
            </script>
            
    </body>
</html>