162 lines
8.2 KiB
HTML
Executable File
162 lines
8.2 KiB
HTML
Executable File
{layout name="manager/layout" /}
|
|
<link rel="stylesheet" href="__MANAGER__/css/config.css?{:time()}" media="all">
|
|
<style>
|
|
.recommend-item .recommend-img .preview-list .preview-li img{
|
|
background: #ddd;
|
|
}
|
|
</style>
|
|
{include file="manager/public/file" /}
|
|
|
|
<div class="layuimini-container">
|
|
<div class="layuimini-main">
|
|
<div class="layui-form layuimini-form">
|
|
|
|
<div class="layui-form-item layui-hide">
|
|
<label class="layui-form-label">主色调设置</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="mainColor" lay-verify="title" autocomplete="off" placeholder="#3875F6" class="layui-input" value="{:$mainColor ?? '#3875F6'}">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">请使用16进制色值</div>
|
|
</div>
|
|
<hr/>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">首页推荐位</label>
|
|
<div class="layui-input-block">
|
|
<div class="recommend-item upload-file-div layui-hide" >
|
|
<div class="recommend-img">
|
|
<ul class="preview-list"></ul>
|
|
<input type="hidden" class="upload-file-value" name="recommendMore" value="{:$recommendMore ?? ''}">
|
|
</div>
|
|
<div class="recommend-content">
|
|
<span class="layui-input">更多</span>
|
|
<div class="img-change-operate">
|
|
<button type="button" class="layui-btn layui-btn-info upload-btn">
|
|
<i class="fa fa-upload"></i> 上传
|
|
</button>
|
|
</div>
|
|
<p class="word-aux">更多只能修改ICON图片</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="recommend-list">
|
|
{if isset($recommend) && !empty($recommend)}
|
|
{foreach $recommend as $i => $item}
|
|
<div class="recommend-item upload-file-div">
|
|
<div class="recommend-img">
|
|
<ul class="preview-list"></ul>
|
|
<input type="hidden" class="upload-file-value" name="recommend[{$i}][icon]" value="{:$item['icon'] ?? ''}">
|
|
</div>
|
|
<div class="recommend-content">
|
|
<input type="text" name="recommend[{$i}][name]" autocomplete="off" placeholder="ICON标题" class="layui-input" value="{:$item['name'] ?? ''}">
|
|
<input type="text" name="recommend[{$i}][link]" autocomplete="off" placeholder="跳转页面" class="layui-input" value="{:$item['link'] ?? ''}">
|
|
<input type="text" name="recommend[{$i}][sort]" autoComplete="off" placeholder="排序号" class="layui-input" value="{:$item['sort'] ?? 1}">
|
|
<div class="img-change-operate">
|
|
<button type="button" class="layui-btn layui-btn-info upload-btn" data-multiple="0">
|
|
<i class="fa fa-upload"></i> 上传
|
|
</button>
|
|
<button type="button" class="layui-btn layui-btn-danger del-recommend">
|
|
<i class="fa fa-trash"></i> 删除
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/foreach}
|
|
{/if}
|
|
</div>
|
|
|
|
<div class="recommend-item">
|
|
<button type="button" class="layui-btn layui-btn-normal btn-add-recommend">
|
|
<i class="fa fa-plus-square-o"></i> 添加推荐位
|
|
</button>
|
|
<span class="word-aux">图标大小为 120 * 120</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">底部导航设置</label>
|
|
<div class="layui-input-block">
|
|
{foreach $footBar as $i => $icon}
|
|
<div class="footBar-item upload-file-div">
|
|
|
|
<div class="layui-row">
|
|
<div class="footBar-img ">
|
|
<ul class="preview-list"></ul>
|
|
<input type="hidden" class="upload-file-value" name="footBar[{$i}][icon]" value="{:$footBar[$i]['icon'] ?? ''}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-row">
|
|
<div class="footBar-content layui-row">
|
|
<input type="hidden" name="footBar[{$i}][key]" value="{:$footBar[$i]['key'] ?? $icon['key']}">
|
|
<input type="text" name="footBar[{$i}][name]" autocomplete="off" placeholder="ICON标题" class="layui-input" value="{:$footBar[$i]['name'] ?? $icon['name']}" readonly>
|
|
|
|
<div class="img-change-operate">
|
|
<button type="button" class="layui-btn layui-btn-info upload-btn" data-multiple="0">
|
|
<i class="fa fa-upload"></i> 上传
|
|
</button>
|
|
</div>
|
|
<p class="word-aux">图标大小为 40 * 40</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/foreach}
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>
|
|
|
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn layui-btn-normal" data-url="/manager/config/mini-program" lay-submit lay-filter="saveConfig">确认保存</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="__MANAGER__/js/upload_image.js?v={:mt_rand()}" charset="utf-8"></script>
|
|
<script>
|
|
let recommendLen = parseInt('{:count($recommend ?? [])}');
|
|
layui.use(['jquery'], function () {
|
|
let $ = layui.jquery,upload=layui.upload;
|
|
|
|
function addRecommend() {
|
|
recommendLen++;
|
|
|
|
let tpl = '<div class="recommend-item upload-file-div">'
|
|
+ '<div class="recommend-img">'
|
|
+ '<ul class="preview-list"></ul>'
|
|
+ '<input type="hidden" class="upload-file-value" name="recommend['+recommendLen+'][icon]" value="">'
|
|
+ '</div>'
|
|
+ '<div class="recommend-content">'
|
|
+ '<input type="text" name="recommend['+recommendLen+'][name]" autoComplete="off" placeholder="ICON标题" class="layui-input" value="">'
|
|
+ '<input type="text" name="recommend['+recommendLen+'][link]" autoComplete="off" placeholder="跳转页面" class="layui-input" value="">'
|
|
+ '<input type="text" name="recommend['+recommendLen+'][sort]" autoComplete="off" placeholder="排序号" class="layui-input" value="'+recommendLen+'">'
|
|
+ '<div class="img-change-operate">'
|
|
+ '<button type="button" class="layui-btn layui-btn-info upload-btn dynamic-add" data-multiple="0" id="recommend-new-'+recommendLen+'">'
|
|
+ '<i class="fa fa-upload"></i> 上传'
|
|
+ '</button>'
|
|
+ '<button type="button" class="layui-btn layui-btn-danger del-recommend">'
|
|
+ '<i class="fa fa-trash"></i> 删除'
|
|
+ '</button>'
|
|
+ '</div>'
|
|
+ '</div>'
|
|
+ '</div>';
|
|
|
|
$('.recommend-list').append(tpl);
|
|
}
|
|
|
|
$('body').on('click', '.btn-add-recommend', function () {
|
|
addRecommend();
|
|
renderUpload('#recommend-new-'+recommendLen);
|
|
});
|
|
$('body').on('click', '.del-recommend', function () {
|
|
$(this).parents('.recommend-item').remove();
|
|
});
|
|
});
|
|
|
|
</script> |