master
wangxinglong 2022-05-27 17:33:47 +08:00
parent c83dc9cd28
commit f191f49024
3 changed files with 13 additions and 10 deletions

View File

@ -64,6 +64,9 @@ class Index extends Base
public function miniProgramSetting(): Json
{
$conf = ExtraConfig::miniProgram();
foreach ($conf["footBar"] as &$item) {
$item["icon"] = resourceJoin($item["icon"],$this->request->domain());
}
return $this->json(0, 'success', $conf);
}

View File

@ -89,10 +89,10 @@ class Config extends Base
// 字符串与数组转换
$data['poster'] = empty($data['poster'] ?? '') ? [] : explode(',', $data['poster']);
$footBarList = array_values($data['footBar'] ?? []);
foreach ($footBarList as &$item) {
$icons = empty($item['icon']) ? [] : explode(',', $item['icon']);
$item['icon'] = array_filter($icons);
}
// foreach ($footBarList as &$item) {
// $icons = empty($item['icon']) ? [] : explode(',', $item['icon']);
// $item['icon'] = array_filter($icons);
// }
unset($item);
$data['footBar'] = $footBarList;
// 按sort排序
@ -113,9 +113,9 @@ class Config extends Base
if ($data) {
$data['poster'] = implode(',', $data['poster'] ?? []);
$footBarList = $data['footBar'] ?? [];
foreach ($footBarList as &$item) {
$item['icon'] = implode(',', $item['icon'] ?? []);
}
// foreach ($footBarList as &$item) {
// $item['icon'] = implode(',', $item['icon'] ?? []);
// }
unset($item);
$data['footBar'] = $footBarList;
}

View File

@ -7,7 +7,7 @@
<div class="layuimini-main">
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<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'}">
@ -36,11 +36,11 @@
<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">
<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 第1图为默认图第2图为高亮图</p>
<p class="word-aux">图标大小为 40 * 40</p>
</div>
</div>
</div>