123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php /*a:1:{s:63:"D:\project\gyx\gaoyixia\application\user\view\message\form.html";i:1709606242;}*/ ?>
- <div class="think-box-shadow"><form class="layui-form layui-card" action="<?php echo request()->url(); ?>" data-auto="true" method="post" autocomplete="off"><div class="layui-card-body"><div class="layui-form-item"><label class="layui-form-label label-required">推送类型</label><div class="layui-input-inline"><select name="type" lay-filter ="type"><?php foreach([2=>'搜索标签',3=>'模块详情',4=>'智能标签'] as $ck=>$cv): if(isset($vo['type'])): ?><option <?php if($vo['type'] == $ck): ?> selected <?php endif; ?> value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php else: ?><option <?php if($ck == 2): ?> selected <?php endif; ?> value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php endif; ?><?php endforeach; ?></select></div></div><div class="layui-form-item"><label class="layui-form-label ">标签</label><div class="layui-input-block"><input name="label" value='<?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:"")); ?>' placeholder="请输入标签 不填默认全部发送" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label label-required">标题</label><div class="layui-input-block"><input name="title" required value='<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:"")); ?>' placeholder="请输入推送标题" class="layui-input"></div></div><div class="label_div layui-form-item" <?php if(!isset($vo['type']) || $vo['type'] !== 4): ?>style="display:none" <?php endif; ?>><label class="layui-form-label label-required">智能标签</label><div class="layui-input-block"><div id="demo1"></div></div></div><div class="module_div" <?php if(!isset($vo['type']) || $vo['type'] == 2): ?>style="display:none" <?php endif; ?>><div class="layui-form-item"><label class="layui-form-label label-required">模块</label><div class="layui-input-inline"><select name="module" lay-filter ="module"><?php foreach($module_arr as $ck=>$cv): ?><option data-sel_module="<?php echo htmlentities($ck); ?>" <?php if(isset($vo['module']) && $vo['module'] == $ck): ?> selected <?php endif; ?> value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php endforeach; ?></select></div></div><div class="layui-form-item"><label class="layui-form-label label-required">详情</label><div class="layui-input-inline"><select name="first_id" id="first_id" lay-filter ="first_id" lay-search=""></select></div><div class="layui-input-inline second_div"><select name="second_id" id="second_id" lay-filter ="second_id" lay-search=""></select></div></div></div><div class="layui-form-item"><label class="layui-form-label label-required">推送内容</label><div class="layui-input-block"><textarea name="content" required rows="10" cols="98"><?php echo htmlentities((isset($vo['content']) && ($vo['content'] !== '')?$vo['content']:'')); ?></textarea></div></div><div class="layui-form-item"><label class="layui-form-label label-required">是否定时推送</label><div class="layui-input-inline"><select name="is_regular" lay-filter ="is_regular"><?php if(isset($vo['is_regular'])): ?><option <?php if($vo['type'] == 1): ?> selected <?php endif; ?> value="1">否</option><option <?php if($vo['type'] == 0): ?> selected <?php endif; ?> value="0">是</option><?php else: ?><option selected value="1">否</option><option value="0">是</option><?php endif; ?></select></div></div><div class="layui-form-item push_time" <?php if(!isset($vo['is_regular']) || $vo['is_regular'] == 1): ?>style="display:none"<?php endif; ?>><label class="layui-form-label label-required">推送时间</label><div class="layui-input-block"><input name="push_time" id="push_time" required class="layui-input" placeholder="" value="<?php echo htmlentities((isset($vo['push_time']) && ($vo['push_time'] !== '')?$vo['push_time']:'')); ?>"></div></div><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><input type='hidden' value='<?php echo htmlentities($vo['id']); ?>' name='id'><?php endif; ?><div class="layui-form-item text-center"><button class="layui-btn" type='submit'>保 存</button><button class="layui-btn layui-btn-danger" type='button' data-close>取消编辑</button></div></div></form><!-- <script src="/static/xm-select.js"></script>--><script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script><script src="https://webapi.amap.com/maps?v=1.4.15&key=5295cbb966c063bde1ed33c1de7ed6bd&callback=init"></script><script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script><script> layui.use('form', function () {
- var form = layui.form;
- //日期时间范围
- laydate.render({
- elem: '#push_time'
- ,type: 'datetime'
- });
- //监听指定开关
- })
- form.on('select(is_regular)', function(data) {
- if (data.value == 0) {
- $(".push_time").show();
- } else {
- $(".push_time").hide();
- }
- })
- </script><script> var user_label = <?php echo json_encode($user_label); ?>;
- console.log(user_label);
- var demo1 = xmSelect.render({
- el: '#demo1',
- language: 'zn',
- filterable: true,
- data: user_label
- })
- </script><script> form.on('select(type)', function(data){
- if(data.value == 3) {
- $(".module_div").show();
- }else{
- $(".module_div").hide();
- }
- if(data.value == 4) {
- $(".label_div").show();
- $(".module_div").show();
- }else{
- $(".label_div").hide();
- }
- window.form.render();
- })
- var sel_first = <?php echo isset($vo['first_id']) ? $vo['first_id']:0; ?>;
- var sel_second = <?php echo isset($vo['second_id']) ? $vo['second_id']:0; ?>;
- var module_list = <?php echo json_encode($module_list); ?>;
- // 分类选择监听
- var arr = ['video','article','datum','supplier','recruit','mall'];
- first(1);
- form.on('select(module)', function(data){
- first(2)
- })
- // 详情关联监听
- form.on('select(first_id)', function(data){
- second(2);
- })
- function first(source) {
- sel_module = $("select[name='module']").find("option:selected").data('sel_module');
- if(arr.indexOf(sel_module) != -1) {
- $(".second_div").show();
- }else{
- $(".second_div").hide();
- }
- var cl_html = '<option value="0">请选择</option>';
- if(sel_module == '') {
- $("select[name='first_id']").html(cl_html);
- $("select[name='second_id']").html(cl_html);
- window.form.render();
- return true;
- }else{
- $.each(module_list,function (ck,cv) {
- if(cv.module == sel_module) {
- if(source == 1 && sel_first == cv.id) {
- cl_html +='<option selected value="'+cv.id+'">'+cv.title+'</option>';
- }else{
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- }
- }
- })
- $("select[name='first_id']").html(cl_html);
- $("select[name='second_id']").html('');
- }
- second(source);
- window.form.render();
- }
- function second(source) {
- var cl_html = '<option value="0">请选择</option>';
- sel_module = $("select[name='module']").find("option:selected").data('sel_module');
- first_id = $("select[name='first_id']").find("option:selected").val();
- $.each(module_list,function (ck,cv) {
- if(sel_module == cv.module && first_id == cv.id && arr.indexOf(sel_module) != -1) {
- $.each(cv.children,function (sk,sv) {
- if(source == 1 && sel_second == sv.id) {
- cl_html +='<option selected value="'+sv.id+'">'+sv.title+'</option>';
- }else{
- cl_html +='<option value="'+sv.id+'">'+sv.title+'</option>';
- }
- })
- $("select[name='second_id']").html(cl_html);
- $(".second_div").show();
- form.render();
- }
- })
- }
- </script></div>
|