caipan_shop_admin/view/manager/config/mini_program.html

104 lines
4.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{layout name="manager/layout" /}
<link rel="stylesheet" href="__MANAGER__/css/config.css" media="all">
{include file="manager/public/file" /}
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<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">
{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="1">
<i class="fa fa-upload"></i> 上传
</button>
</div>
<p class="word-aux">图标大小为 40 * 40 第1图为默认图第2图为高亮图</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>