123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- {include file="common/header"/}
- <div class="LM-container">
- <div class="LM-main">
- <fieldset class="layui-elem-field layui-field-title">
- <legend>{:lang('config')}{:lang('list')}</legend>
- </fieldset>
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li class="layui-this">{:lang('site setting')}</li>
- <li class="">{:lang('email setting')}</li>
- <li class="">{:lang('sms setting')}</li>
- <li class="">{:lang('upload setting')}</li>
- </ul>
- <div class="layui-tab-content">
- <!--网站配置-->
- <div class="layui-tab-item layui-show">
- <form class="layui-form layui-form-pane" lay-filter="form-config">
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('site name')}</label>
- <div class="layui-input-block">
- <input type="text" name="site_name" lay-verify="required" lay-reqtext="{:lang('site name can not empty')}"
- placeholder="{:lang('site name')}" value="" class="layui-input">
- <!-- <tip>填写自己部署网站的名称。</tip>-->
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('site domain')}</label>
- <div class="layui-input-block">
- <input type="text" name="site_domain" lay-verify="url" lay-reqtext="{:lang('site domain can not empty')}"
- placeholder="{:lang('site domain')}" value="" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('site email')}</label>
- <div class="layui-input-block">
- <input type="text" name="site_email" lay-verify="email" lay-reqtext="{:lang('site email can not empty')}"
- placeholder="{:lang('site email')}" value="" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">{:lang('site logo')}</label>
- <input type="hidden" name="site_logo" id="logo">
- <div class="layui-input-block">
- <div class="layui-upload">
- <button type="button" class="layui-btn layui-btn-primary" id="logoBtn"><i
- class="icon icon-upload3"></i>{:lang('upload')}
- </button>
- <div class="layui-upload-list">
- <img class="layui-upload-img" id="site_logo">
- <p id="demoText"></p>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label required">{:lang('site title')}</label>
- <div class="layui-input-block">
- <textarea name="site_seo_title" placeholder="{:lang('site title')}" class="layui-textarea"></textarea>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label">{:lang('meta keywords')}</label>
- <div class="layui-input-block">
- <textarea name="site_seo_keywords" class="layui-textarea"
- placeholder="多个关键词用英文状态 , 号分割"></textarea>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label">{:lang('meta description')}</label>
- <div class="layui-input-block">
- <textarea name="site_seo_desc" placeholder="建议200字以内"
- class="layui-textarea"></textarea>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label required">{:lang('all right')}</label>
- <div class="layui-input-block">
- <textarea name="site_copyright" class="layui-textarea">© 2019 www.lemocms.com MIT license</textarea>
- </div>
- </div>
- <div class="layui-form-item">
- <button type="button" class="layui-btn" lay-submit lay-filter="submit">{:lang('submit')}</button>
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="cancel">{:lang('reset')}</button>
- </div>
- </form>
- </div>
- <!--邮箱设置-->
- <div class="layui-tab-item">
- <form class="layui-form layui-form-pane" lay-filter="form-config">
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('email server')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_host" lay-verify="required" lay-reqtext="{:lang('email server is not empty')}"
- placeholder="{:lang('email server')}" value="" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('email port')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_port" lay-verify="required" lay-reqtext="{:lang('port can not empty')}"
- placeholder="{:lang('email port')}" value="" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('email addr')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_addr" lay-verify="required" lay-reqtext="{:lang('email addr can not empty')}"
- placeholder="{:lang('email addr')}" value="" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('send email person')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_id" placeholder="{:lang('send email person')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('email password')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_pass" placeholder="{:lang('email password')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('server mailbox protocol')}</label>
- <div class="layui-input-block">
- <input type="text" name="email_secure" placeholder="{:lang('Server mailbox protocol')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <button type="button" class="layui-btn" lay-submit lay-filter="submit">{:lang('submit')}</button>
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="cancel">{:lang('reset')}</button>
- </div>
- </form>
- </div>
- <!-- 短信设置-->
- <div class="layui-tab-item">
- <form class="layui-form layui-form-pane" lay-filter="form-config">
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('sms appid')}</label>
- <div class="layui-input-block">
- <input type="text" name="sms_appid" lay-verify="required" placeholder="{:lang('sms appid')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('sms appsecret')}</label>
- <div class="layui-input-block">
- <input type="text" name="sms_secret" lay-verify="required" placeholder="{:lang('sms appsecret')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('sms product name')}</label>
- <div class="layui-input-block">
- <input type="text" name="sms_product" lay-verify="required" placeholder="{:lang('sms product name')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label required">{:lang('sms template id')}</label>
- <div class="layui-input-block">
- <input type="text" name="sms_template" lay-verify="required" placeholder="{:lang('sms template id')}" value=""
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <button type="button" class="layui-btn" lay-submit lay-filter="submit">{:lang('submit')}</button>
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="cancel">{:lang('reset')}</button>
- </div>
- </form>
- </div>
- <!--上传配置-->
- <div class="layui-tab-item">
- <form class="layui-form layui-form-pane" lay-filter="form-config">
- <div class="layui-form-item">
- <label class="layui-form-label">{:lang('file type')}</label>
- <div class="layui-input-block">
- <input type="text" name="upload_file_type"
- value="bmp|png|gif|jpg|jpeg|zip|rar|txt|ppt|xls|doc|mp3|mp4"
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">{:lang('maxfilesize')}</label>
- <div class="layui-input-inline" style="width: 80px;">
- <input type="text" name="upload_file_max" lay-verify="number" value="2048"
- class="layui-input">
- </div>
- <div class="layui-input-inline layui-input-company"><label class="layui-form-label">M</label></div>
- <div class="layui-form-mid layui-word-aux">{:lang('tips')}:1 M = 1024 KB</div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-inline">
- <button type="button" class="layui-btn" lay-submit lay-filter="submit">{:lang('submit')}</button>
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="cancel">{:lang('reset')}</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- {include file="common/footer"/}
- <script>
- layui.use(['form', 'layer','upload','element'], function () {
- var form = layui.form,layer = layui.layer,upload = layui.upload,$ = layui.jquery,element = layui.element;
- var config = {$config|raw};
- console.log(config)
- form.val("form-config", config);
- $('#site_logo').attr('src',config.site_logo);
- //普通图片上传
- var uploadInst = upload.render({
- elem: '#logoBtn'
- ,url: '{:url("uploads/uploads")}'
- ,before: function(obj){
- //预读本地文件示例,不支持ie8
- obj.preview(function(index, file, result){
- $('#site_logo').attr('src', result); //图片链接(base64)
- });
- }
- ,done: function(res){
- //上传成功
- if(res.code>0){
- $('#logo').val(res.url);
- }else{
- //如果上传失败
- return layer.msg('上传失败');
- }
- }
- ,error: function(){
- //演示失败状态,并实现重传
- var demoText = $('#demoText');
- demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
- demoText.find('.demo-reload').on('click', function(){
- uploadInst.upload();
- });
- }
- });
- //提交监听
- form.on('submit(submit)', function (data) {
- loading =layer.load(1, {shade: [0.1,'#fff']});
- $.post("{:url('system/site')}",data.field,function(res){
- layer.close(loading);
- if(res.code > 0){
- layer.msg(res.msg,{icon: 1, time: 1000},function(){
- location.href = res.url;
- });
- }else{
- layer.msg(res.msg,{icon: 2, time: 1000});
- }
- });
- })
- })
- </script>
|