Jelajahi Sumber

Merge branch 'master' of http://git.bocai108.com:10180/Ethan/Customer-Service

Jonlin 6 tahun lalu
induk
melakukan
5ff0a1f98b

+ 4 - 1
application/admin/controller/Kfnotice.php

@@ -99,12 +99,14 @@ class Kfnotice extends Base
     // 添加留言
     public function add()
     {
+        $uid = intval(input('param.uid', 0));
+
         if (request()->isPost()) {
 
             $atext = input('post.atext');
             $title = input('post.title', 0);
             $group = intval(input('post.groupid', 0));
-            $uid = intval(input('post.uid', 0));
+
 
             if (empty($atext) || empty($title)) {
                 return json(['code' => -1, 'data' => '', 'msg' => '标题和内容不能为空']);
@@ -160,6 +162,7 @@ class Kfnotice extends Base
 
         $goups = (new GroupsModel)->where(['status' => 1])->select();
         $this->assign('groups', $goups);
+        $this->assign('userid', $uid);
 
         return $this->fetch();
     }

+ 22 - 11
application/admin/view/kfnotice/add.html

@@ -31,6 +31,8 @@
                             </div>
                         </div>
 
+
+                        {eq name="userid" value="0"}
                         <div class="layui-form-item">
                             <label class="layui-form-label">分组</label>
                             <div class="layui-input-block">
@@ -42,12 +44,21 @@
                                 </select>
                             </div>
                         </div>
+                        {else/}
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">用户ID</label>
+                            <div class="layui-input-block">
+                                <input type="text" class="layui-input" name="uid" id="uid" value="{$userid}"
+                                       placeholder="" readonly>
+                            </div>
+                        </div>
+                        {/eq}
 
                         <div class="layui-form-item">
-                                <label class="layui-form-label">时间</label>
-                                <div class="layui-input-block">
-                                    <input type="text" class="layui-input" name="sendtime" id="sendtime" placeholder="">
-                                </div>
+                            <label class="layui-form-label">时间</label>
+                            <div class="layui-input-block">
+                                <input type="text" class="layui-input" name="sendtime" id="sendtime" placeholder="">
+                            </div>
                         </div>
 
 
@@ -95,11 +106,11 @@
 
         layer.ready(function () {
             layer.close(index);
-            if(1 == res.code){
-               layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
-                   window.location.href = '/admin/kfnotice/index.html';
-               });
-            }else if(111 == res.code){
+            if (1 == res.code) {
+                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function () {
+                    window.location.href = '/admin/kfnotice/index.html';
+                });
+            } else if (111 == res.code) {
                 window.location.reload();
             } else {
                 layer.msg(res.msg, {anim: 6});
@@ -136,12 +147,12 @@
         validClass: "help-block m-b-none"
     });
 
-    layui.use('laydate', function() {
+    layui.use('laydate', function () {
         var laydate = layui.laydate;
         //日期时间选择器
         laydate.render({
             elem: '#sendtime'
-            ,type: 'datetime'
+            , type: 'datetime'
         });
     });
 

+ 5 - 11
application/admin/view/kfonitoring/kfjiankong.html

@@ -139,17 +139,11 @@
 
     function msg(id) {
         layui.use('layer', function () {
-                layer.prompt({
-                    formType: 2,
-                    value: '',
-                    title: '请输入消息内容 ',
-                    area: ['400px', '200px'] //自定义文本域宽高
-                }, function (value, index, elem) {
-                    $.post("{:url('Kfnotice/add')}", {atext: value, uid: id},
-                        function (data) {
-                            layer.msg(data.msg);
-                            layer.close(index);
-                        }, "json");
+                layer.open({
+                    type: 2,
+                    title: '请输入消息内容',
+                    area: ['500px', '600px'], //自定义文本域宽高
+                    content:'/admin/kfnotice/add.html?uid='+id
                 });
             }
         )