caipan_shop_admin/view/manager/config/base.html

104 lines
4.2 KiB
HTML
Executable File

{layout name="manager/layout" /}
{php}
$whereMap[] = ['id', 'in', $item['notice_list'] ?? []];
$targetList = \app\repository\AccountRepository::getInstance()->findList($whereMap)['list']->toArray();
foreach ($targetList as &$val) {
$val['account_desc2'] = $val['nickname'].'【姓名:'.$val['real_name'].'】';
$val['selected'] = true;
}
$targetListJson = json_encode($targetList, JSON_UNESCAPED_UNICODE);
{/php}
<div class="layuimini-container location-operate-page">
<div class="layuimini-main">
<div class="layui-form layuimini-form">
<div class="layui-form-item">
<label class="layui-form-label">是否开启OSS</label>
<div class="layui-input-block">
<input type="radio" name="oss" value="true" title="是" {if isset($item.oss) && $item.oss == 'true'}checked{/if}>
<input type="radio" name="oss" value="false" title="否" {if !isset($item.oss) || $item.oss == 'false'}checked{/if}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">视频管理</label>
<div class="layui-input-block">
<input type="radio" name="show_video" value="1" title="显示" {if isset($item.show_video) && $item.show_video == 1}checked{/if}>
<input type="radio" name="show_video" value="0" title="隐藏" {if !isset($item.show_video) || $item.show_video == 0}checked{/if}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">签到积分</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="sign_score" value="{$item.sign_score??0}" >
</div>
</div>
<div class="layui-form-item target-list">
<label class="layui-form-label required">消息通知</label>
<div class="layui-input-block">
<div id="receive-users" data-show="{$targetListJson ?? ''}"></div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" data-url="/manager/config/{$Request.action}" lay-submit lay-filter="saveConfig">确认保存</button>
</div>
</div>
</div>
</div>
</div>
<script>
layui.use(['jquery', 'xmSelect'], function () {
let $ = layui.jquery,
xmSelect = layui.xmSelect;
/** add and edit **/
if ($('.location-operate-page').length > 0) {
let receiveEle = $('#receive-users');
let targetList = receiveEle.data('show') ? receiveEle.data('show') : [];
let receiveUserXm = xmSelect.render({
el: '#receive-users',
autoRow: true,
radio: false,
toolbar: { show: false },
filterable: true,
remoteSearch: true,
name: 'notice_list',
tips: '通过手机号/昵称/姓名 查询',
model: {
icon: 'hidden',
},
prop: {
name: 'account_desc2',
value: 'id',
},
theme: {
color: '#1e84ff',
},
data: targetList,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax('/manager/worker/search-account', {
data: {
"keyword": val
}
,dataType : 'json'
,type: 'POST'
})
.done(function (res) {
cb(res.data);
})
.fail(function () {
cb([]);
});
}
});
}
});
</script>