赵启卫 vor 2 Jahren
Ursprung
Commit
cf9e20a396

+ 91 - 4
application/admin/controller/study/Plan.php

xqd xqd xqd
@@ -13,7 +13,8 @@ namespace app\admin\controller\study;
 
 use app\admin\controller\AuthController;
 use app\admin\model\study\Plan as PlanModel;
-use app\admin\model\merchant\Merchant as MerchantModel; //可能不用
+use app\admin\model\study\PlanSteps;
+use app\admin\model\study\PlanItems;
 use service\JsonService;
 use service\FormBuilder as Form;
 use think\Url;
@@ -147,7 +148,7 @@ class Plan extends AuthController
     }
 
     /**
-     * 删除讲师
+     * 删除学习计划
      * @param int $id 修改的主键
      * @return json
      * */
@@ -164,7 +165,93 @@ class Plan extends AuthController
      * 学习计划步骤管理
      */
 
-     public function steps(){
+    public function steps($pid = 0, $op = ''){
+    if (!$pid) exit('缺少参数');
+    if ($op == 'getlist') {
+        $data = parent::getMore([
+            ['page', 1],
+            ['limit', 20],
+        ]);
+        $where = [
+            'pid' => $pid,
+            'is_del' => 0,
+        ];
+        $list = PlanSteps::where($where)->page((int)$data['page'], (int)$data['limit'])->select();
+        $count = PlanSteps::where($where)->count();
+        $return = [
+            'data' => $list,
+            'count' => $count,
+        ];
+        return JsonService::successlayui($return);
+    }
+    $this->assign('pid', $pid);
+    return $this->fetch();
+    }
+    /**
+     * 学习计划步骤添加管理
+     */
+
+    public function createsteps($pid = 0, $id = 0, $op = ''){
+        if (!$pid) exit('缺少参数');
+        if ($id) {
+            $plan = PlanSteps::get($id);
+            if (!$plan) return JsonService::fail('学习计划不存在!');
+            if ($op == 'getlist') {
+                //获取当前步骤的课程信息
+                $where = ['stepsid' => $id, ];
+                $list = PlanSteps::where($where)->select();
+                $count = count($list);
+                $return = [
+                    'data' => $list,
+                    'count' => $count,
+                ];
+                return JsonService::successlayui($return);
+            }
+        } else {
+            $plan = [];
+        }
+        $this->assign('id', $id);
+        $this->assign('pid', $pid);
+        $this->assign('plan', json_encode($plan));
         return $this->fetch();
-     }
+    }
+
+    public function savesteps($id = 0){
+        $data = parent::postMore([
+            ['stepname', ''],
+            ['pid', 0],
+            ['introduction', ''],
+            ['sort', 0],
+        ]);
+        $data['is_del'] = 0;
+        if ($id) {
+            PlanSteps::edit($data, $id);
+            return JsonService::successful('修改成功');
+        } else {
+            $data['add_time'] = time();
+            $res = PlanSteps::set($data);
+            if ($res)
+                return JsonService::successful('添加成功');
+            else
+                return JsonService::fail('添加失败');
+        }
+    }
+
+    /**
+     * 删除讲师
+     * @param int $id 删除步骤
+     * @return json
+     * */
+    public function deletestep($id = 0){
+        if (!$id) return JsonService::fail('缺少参数');
+        if (PlanSteps::delstep($id))
+            return JsonService::successful('删除成功');
+        else
+            return JsonService::fail(PlanSteps::getErrorInfo('删除失败'));
+    }
+    public function addcouse($pid = 0, $id = 0, $op = ''){
+        $this->assign('id', $id);
+        $this->assign('pid', $pid);
+        return $this->fetch();
+    }
 }

+ 1 - 1
application/admin/model/study/Plan.php

xqd
@@ -73,7 +73,7 @@ class Plan extends ModelBasic
     }
 
     /**
-     * 删除讲师
+     * 删除计划
      * @param $id
      * @return bool|int
      * @throws \think\exception\DbException

+ 36 - 0
application/admin/model/study/PlanItems.php

xqd
@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+namespace app\admin\model\study;
+
+use traits\ModelTrait;
+use basic\ModelBasic;
+
+/**
+ * Class plan 讲师
+ * @package app\admin\model\special
+ */
+class PlanItems extends ModelBasic {
+    use ModelTrait;
+    /**
+     * 删除计划
+     * @param $id
+     * @return bool|int
+     * @throws \think\exception\DbException
+     */
+    public static function delstep($id)
+    {
+        $plan = self::get($id);
+        if (!$plan) return self::setErrorInfo('删除的数据不存在');
+        return self::where('id', $id)->update(['is_del' => 1]);
+    }
+   
+}

+ 36 - 0
application/admin/model/study/PlanSteps.php

xqd
@@ -0,0 +1,36 @@
+<?php
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+namespace app\admin\model\study;
+
+use traits\ModelTrait;
+use basic\ModelBasic;
+
+/**
+ * Class plan 讲师
+ * @package app\admin\model\special
+ */
+class PlanSteps extends ModelBasic {
+    use ModelTrait;
+    /**
+     * 删除计划
+     * @param $id
+     * @return bool|int
+     * @throws \think\exception\DbException
+     */
+    public static function delstep($id)
+    {
+        $plan = self::get($id);
+        if (!$plan) return self::setErrorInfo('删除的数据不存在');
+        return self::where('id', $id)->update(['is_del' => 1]);
+    }
+   
+}

+ 92 - 0
application/admin/view/study/plan/addcouse.php

xqd
@@ -0,0 +1,92 @@
+{extend name="public/container"}
+{block name='head_top'}
+{/block}
+{block name="content"}
+<div class="layui-fluid">
+    <form class="layui-form">
+    <div class="layui-card" id="addcourse">
+        <div class="layui-card-body">
+            <div class="layui-tab layui-tab-brief couselist" lay-filter="tab">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="0">课程</li>
+                    <li lay-id="1">考试</li>
+                </ul>
+                <div class="layui-tab-content">
+                    <div class="layui-tab-item layui-show">
+                        <table id="couList" lay-filter="couList"></table>
+                        <script type="text/html" id="couid">
+                            <input class="couids" type="checkbox" data-type="couids" lay-filter="filter" value="{{d.id}}" />
+                            {{d.id}}
+                        </script>
+                        <script type="text/html" id="couimg">
+                            <img lay-event='open_image' src="{{d.image}}">
+                        </script>
+                    </div>
+                    <div class="layui-tab-item">
+                        as2
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    </form>
+</div>
+<script type="text/javascript" src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name='script'}
+<script>
+    var id={$id}, pid={$pid};
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    let $eb = parent.parent.parent.parent._mpApi;
+    layList.form.render();
+    var courselist = {};
+    // var coursechecked = {};
+    //加载列表
+    layList.tableList({o:'couList', done:function (e) {
+        for(i in e.data) {
+            courselist[e.data[i].id] = e.data[i];
+        }
+    }},"{:Url('admin/special._special_type/list', ['special_type'=> 3])}", function (){
+        return [
+            {field: 'id', title: '课程ID', align: 'center', templet:'#couid'},
+            {field: 'image', title: '封面图片',align: 'left', templet:'#couimg'},
+            {field: 'title', title: '课程名称',align: 'left'},
+            {field: 'money', title: '价格', align: 'center'},
+        ];
+    });
+    //点击事件绑定
+    layList.form.on('checkbox(filter)', function (data) {
+        // console.log(data.elem); //得到checkbox原始DOM对象
+        // console.log(data.elem.checked); //是否被选中,true或者false
+        // console.log(data.value); //复选框value值,也可以通过data.elem.value得到
+        // console.log(data.othis); //得到美化后的DOM对象
+        if (data.elem.checked) {
+            parent.coursechecked[data.value] = courselist[data.value];
+        } else {
+            delete parent.coursechecked[data.value];
+        }
+        console.log(parent.coursechecked);
+    });
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'couids':
+                console.log(data)
+                break;
+            case 'open_image':
+                $eb.openImage(data.image);
+                break;
+            case 'edit':
+                layer.open({
+                    type: 2,
+                    title: '编辑学习步骤',
+                    content: '{:Url('createsteps')}?id=' + data.id + "&pid=" + data.pid,
+                    area: ['100%', '100%'],
+                    maxmin: true
+                });
+                break;
+        }
+    })
+    
+</script>
+{/block}

+ 3 - 3
application/admin/view/study/plan/create.php

xqd xqd
@@ -44,11 +44,11 @@
                         </div>
                         <div class="layui-form-mid layui-word-aux">每个领域1-6个字,可添加1-3个领域,点击“+”按钮添加输入的领域,点击已添加领域可删除</div>
                     </div> -->
-                    <div v-if="formData.label.length" class="layui-form-item">
+                    <!-- <div v-if="formData.label.length" class="layui-form-item">
                         <div class="layui-input-block">
                             <button v-for="item in formData.label" :key="item" type="button" class="layui-btn layui-btn-normal layui-btn-sm" @click="delLabel(item)">{{item}}</button>
                         </div>
-                    </div>
+                    </div> -->
                     <div class="layui-form-item required">
                         <label class="layui-form-label">封面图片:(200*200)</label>
                         <div class="layui-input-block">
@@ -192,7 +192,7 @@
                     that.$nextTick(function () {
                         if (!that.formData.plan_name) return layList.msg('请输入学习计划名称');
                         if (!that.formData.plan_head) return layList.msg('请上传封面图片');
-                        if (!that.formData.introduction) return layList.msg('请输入讲师介绍');
+                        if (!that.formData.introduction) return layList.msg('请输入学习计划介绍');
                         layList.loadFFF();
                         layList.basePost(layList.U({a: 'save_plan', q: {id: id}}), that.formData, function (res) {
                             layList.loadClear();

+ 247 - 0
application/admin/view/study/plan/createsteps.php

xqd
@@ -0,0 +1,247 @@
+{extend name="public/container"}
+{block name='head_top'}
+<style>
+    .layui-form-item .study-label i{display: inline-block;width: 18px;height: 18px;font-size: 18px;color: #fff;}
+    .layui-form-item .label-box p{line-height: inherit;}
+    .m-t-5{margin-top:5px;}
+    #app .layui-barrage-box{margin-bottom: 10px;margin-top: 10px;margin-left: 10px;border: 1px solid #0092DC;border-radius: 5px;cursor: pointer;position: relative;}
+    #app .layui-barrage-box.border-color{border-color: #0bb20c;}
+    #app .layui-barrage-box .del-text{position: absolute;top: 0;left: 0;background-color: rgba(0,0,0,0.5);color: #ffffff;width: 92%;text-align: center;}
+    #app .layui-barrage-box p{padding:5px 5px; }
+    #app .layui-empty-text{text-align: center;font-size: 18px;}
+    #app .layui-empty-text p{padding: 10px 10px;}
+    .edui-default .edui-for-image .edui-icon {background-position: -380px 0px;}
+    .layui-form-item .label-box {border: 1px solid;border-radius: 10px;position: relative;padding: 10px;height: 30px;color: #fff;background-color: #393D49;text-align: center;cursor: pointer;display: inline-block;line-height: 10px;}
+    .layui-form-item .label-box p {line-height: inherit;}
+</style>
+{/block}
+{block name="content"}
+<div class="layui-fluid" id="app" v-cloak>
+    <div class="layui-card">
+        <div class="layui-card-header">{{id ? '编辑学习计划':'添加学习计划'}}</div>
+        <div class="layui-card-body">
+            <form action="" class="layui-form">
+                <div class="layui-form-item">
+                    <div class="layui-form-item submit">
+                        <label class="layui-form-label">排序:</label>
+                        <div class="layui-input-inline">
+                            <input type="number" name="sort" v-model="formData.sort" min="0" max="9999" class="layui-input" v-sort>
+                        </div>
+                    </div>
+                    <div class="layui-form-item required">
+                        <label class="layui-form-label">步骤名称:</label>
+                        <div class="layui-input-inline">
+                            <input type="text" name="stepname" v-model.trim="formData.stepname" required autocomplete="off" placeholder="请输入学习计划名称" maxlength="8" class="layui-input">
+                        </div>
+                    </div>
+                    <div class="layui-form-item required">
+                        <label class="layui-form-label">步骤介绍:</label>
+                        <div class="layui-input-block">
+                            <textarea name="introduction" style="width: 80%;" rows="5" v-model="formData.introduction">{{formData.introduction}}</textarea>
+                        </div>
+                    </div>
+                    <!-- <div class="layui-form-item">
+                        <label class="layui-form-label">状态:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" name="is_show" value="1" title="显示" v-model="formData.is_show" lay-filter="is_show" >
+                            <input type="radio" name="is_show" value="0" title="隐藏" v-model="formData.is_show" lay-filter="is_show">
+                        </div>
+                    </div> -->
+                    
+            </form>
+        </div>
+        <div class="layui-card-header">步骤关联课程管理</div>
+        <div>
+            <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" @click="addcouse">
+                <i class="layui-icon layui-icon-add-1"></i>添加课程
+            </button>
+        </div>
+        <table class="layui-table">
+            <tr>
+                <td>课程ID</td>
+                <td>图片</td>
+                <td>名称</td>
+                <td>类型</td>
+                <td>单价</td>
+                <td>操作</td>
+            </tr>
+            <tr v-for="(item, index) in courselist" :key="index">
+                <td>{{item.id}}</td>
+                <td>{{item.id}}</td>
+                <td>{{item.id}}</td>
+                <td>{{item.id}}</td>
+                <td>{{item.money}}</td>
+                <td>{{item.id}}</td>
+            </tr>
+        </table>
+        <script type="text/html" id="act">
+            <a  href="javascript:void(0)" @click="delitem(this)">
+                <i class="iconfont icon-shanchu"></i> 删除
+            </a>
+        </ul>
+        </script>
+        <div class="layui-form-item submit">
+            <div class="layui-input-block">
+                <button class="layui-btn layui-btn-normal" type="button" @click="save">{{id ? '立即修改':'立即提交'}}</button>
+                <button class="layui-btn layui-btn-primary clone" type="button" @click="clone_form">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript" src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name='script'}
+<script>
+    var id={$id}, pid={$pid}, plan=<?=isset($plan) ? $plan : []?>;
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var coursechecked = {};
+    //加载列表
+    require(['vue','helper','zh-cn','request','plupload','aliyun-oss','OssUpload'],function(Vue,$h) {
+        new Vue({
+            el: "#app",
+            directives: {
+                sort: {
+                    bind: function (el, binding, vnode) {
+                        var vm = vnode.context;
+                        el.addEventListener('change', function () {
+                            if (!this.value || this.value < 0) {
+                                vm.formData.sort = 0;
+                            } else if (this.value > 9999) {
+                                vm.formData.sort = 9999;
+                            } else {
+                                vm.formData.sort = parseInt(this.value);
+                            }
+                        });
+                    }
+                }
+            },
+            data: {
+                formData:{
+                    stepname:plan.stepname || '',
+                    pid:pid || 0,
+                    plan_head: plan.plan_head || '',
+                    introduction: plan.introduction || '',
+                    sort:Number(plan.sort) || 0,
+                    courseids:[]
+                },
+                courselist: [],
+            },
+            methods:{
+                addcouse:function(e){
+                    that = this
+                    layer.open({
+                        type: 2,
+                        title: '添加课程',
+                        content:'{:Url('addcouse')}?id=' + id + "&pid=" + pid,
+                        area: ['80%', '80%'],
+                        maxmin: true,
+                        btn:['确定', '取消'],
+                        btn1: function (index, layero) {
+                            that.formData.courseids = []
+                            that.courselist = []
+                            for(i in coursechecked){
+                                that.courselist.push(coursechecked[i]);
+                                that.formData.courseids.push(i);
+                            }
+                            console.log(that.formData.courseids);
+                            return false;
+                        },
+                        btn2: function (index, layero) {
+                            coursechecked = {};
+                            layer.close(index)
+                        },
+                        end: function () {
+                            //console.log(courseids);
+                            //location.reload();
+                        }
+                    });
+                    // layList.tableList({o:'couList', done:function(){
+                        
+                    // }},
+                    //     "{:Url('admin/special._special_type/list', ['special_type'=>3])}",
+                    //     function (){
+                    //         return [
+                    //             {field: 'id', title: '排序', align: 'center'},
+                    //             {field: 'title', title: '课程名称',align: 'left'},
+
+                    //         ];
+                    //     }
+                    // );
+                    
+                },
+                delitem:function (data){
+                    alert('ok');
+                },
+                clone_form: function () {
+                    var that = this;
+                    if (parseInt(id) == 0) {
+                        parent.layer.closeAll();
+                    }
+                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
+                    parent.layer.close(index); //再执行关闭
+                },
+                save:function () {
+                    var that=this;
+                    that.$nextTick(function () {
+                        if (!that.formData.stepname) return layList.msg('请输入学习步骤名称');
+                        if (!that.formData.introduction) return layList.msg('请输入学习步骤介绍');
+                        layList.loadFFF();
+                        layList.basePost(layList.U({a: 'savesteps', q: {id: id}}), that.formData, function (res) {
+                            layList.loadClear();
+                            if (parseInt(id) == 0) {
+                                layList.layer.confirm('添加成功,您要继续添加吗?', {
+                                    btn: ['继续添加', '立即提交']
+                                }, function (index) {
+                                    layList.layer.close(index);
+                                }, function (index) {
+                                    layList.layer.close(index);
+                                    var index = parent.layer.getFrameIndex(window.name);
+                                    parent.layer.close(index);
+                                });
+                            } else {
+                                layList.msg('修改成功', function () {
+                                    parent.layer.closeAll();
+                                })
+                            }
+                        }, function (res) {
+                            layList.msg(res.msg);
+                            layList.loadClear();
+                        });
+                    })
+                },
+                delect:function(key){
+                    var that=this;
+                    that.formData[key]='';
+                },
+                changeIMG: function (key, value, multiple) {
+                    if (multiple) {
+                        var that = this;
+                        value.map(function (v) {
+                            that.formData[key].push({pic: v, is_show: false});
+                        });
+                        this.$set(this.formData, key, this.formData[key]);
+                    } else {
+                        this.$set(this.formData, key, value);
+                    }
+                },
+            },
+            mounted:function () {
+                var that=this;
+                this.$nextTick(function () {
+                    layList.form.render();
+                    
+                });
+            }
+        })
+    });
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'open_image':
+                $eb.openImage(data.image);
+                break;
+        }
+    })
+    
+</script>
+{/block}

+ 2 - 12
application/admin/view/study/plan/index.php

xqd xqd
@@ -213,7 +213,7 @@
                 layer.open({
                     type: 2,
                     title: '步骤管理',
-                    content: '{:Url('steps')}?id=' + data.id,
+                    content: '{:Url('steps')}?pid=' + data.id,
                     area: ['100%', '100%'],
                     maxmin: true
                 });
@@ -284,17 +284,7 @@
     $(document).on('click', '.layui-btn', function (event) {
         var type = $(this).data('type');
         var id = $(this).data('id');
-        if (type === 'mercreate') {
-            layer.open({
-                type: 2,
-                title: '生成讲师后台',
-                content: "{:Url('mercreate')}?id=" + id,
-                area: ['800px', '700px'],
-                end: function () {
-                    location.reload();
-                }
-            });
-        } else if (type === 'add') {
+        if (type === 'add') {
             layer.open({
                 type: 2,
                 title: '添加学习计划',

+ 17 - 129
application/admin/view/study/plan/steps.php

xqd xqd xqd xqd xqd xqd
@@ -2,72 +2,30 @@
 {block name="content"}
 <div class="layui-fluid">
     <div class="layui-card">
-        <div class="layui-card-header">学习计划</div>
+        <div class="layui-card-header">学习步骤</div>
         <div class="layui-card-body">
-            <form class="layui-form layui-form-pane" action="">
-                <div class="layui-form-item">
-                    <div class="layui-inline">
-                        <label class="layui-form-label">学习计划</label>
-                        <div class="layui-input-inline">
-                            <input type="text" name="title" class="layui-input" placeholder="学习计划名称">
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">计划状态</label>
-                        <div class="layui-input-inline">
-                            <select name="is_show">
-                                <option value="">全部</option>
-                                <option value="1">显示</option>
-                                <option value="0">不显示</option>
-                            </select>
-                        </div>
-                    </div>
-                    <div class="layui-inline">
-                        <div class="layui-input-inline">
-                            <button class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="search" lay-filter="search">
-                                <i class="layui-icon layui-icon-search"></i>搜索
-                            </button>
-                        </div>
-                    </div>
-                </div>
-            </form>
             <div class="layui-btn-container">
-                <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" data-type="add">
-                    <i class="layui-icon layui-icon-add-1"></i>添加学习计划
+                <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" data-type="addsteps">
+                    <i class="layui-icon layui-icon-add-1"></i>添加学习步骤
                 </button>
                 <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" data-type="refresh">
                     <i class="layui-icon layui-icon-refresh-1"></i>刷新
                 </button>
             </div>
             <table id="List" lay-filter="List"></table>
-            <script type="text/html" id="price">
-                <p>{{d.price}} / {{d.sales}}</p>
-            </script>
-            <script type="text/html" id="is_show">
-                <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='显示|不显示'  {{ d.is_show == 1 ? 'checked' : '' }}>
-            </script>
-            <script type="text/html" id="plan_head">
-                <img width="50" height="50" lay-event='open_image' src="{{d.plan_head}}">
-            </script>
-            
             <script type="text/html" id="act">
                 <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" onclick="dropdown(this)">
                     <i class="layui-icon">&#xe625;</i>操作
                 </button>
                 <ul class="layui-nav-child layui-anim layui-anim-upbit">
-                    <li>
-                        <a href="javascript:void(0)" lay-event="steps">
-                            <i class="iconfont icon-bianji"></i> 步骤管理
-                        </a>
-                    </li>
                     <li>
                         <a href="javascript:void(0)" lay-event="edit">
-                            <i class="iconfont icon-bianji"></i> 编辑计划
+                            <i class="iconfont icon-bianji"></i> 编辑
                         </a>
                     </li>
                     <li>
                         <a lay-event='delstor' href="javascript:void(0)">
-                            <i class="iconfont icon-shanchu"></i> 删除计划
+                            <i class="iconfont icon-shanchu"></i> 删除
                         </a>
                     </li>
                 </ul>
@@ -79,22 +37,14 @@
 {/block}
 {block name="script"}
 <script>
+    let $eb = parent.parent._mpApi;
+    let pid = {$pid};
     var $ = layui.jquery;
     var layer = layui.layer;
     //实例化form
     layList.form.render();
     //加载列表
     layList.tableList({o:'List', done:function () {
-        $('.layui-btn').on('mouseover', function (event) {
-            var target = event.target;
-            var type = target.dataset.type;
-            if ('recommend' === type) {
-                layer.tips('点击即可取消此推荐', target, {
-                    tips: [1, '#0093dd']
-                });
-            }
-        });
-
         $('.layui-btn').on('mouseout', function (event) {
             var target = event.target;
             var type = target.dataset.type;
@@ -102,14 +52,11 @@
                 layer.closeAll();
             }
         });
-    }},"{:Url('plan_list')}",function (){
+    }},"{:Url('steps', ['op'=>'getlist', 'pid'=> $pid])}",function (){
         return [
-            {field: 'id', title: '编号', align: 'center'},
-            {field: 'plan_name', title: '计划名称',align: 'left'},
-            {field: 'plan_head', title: '计划封面',templet:'#plan_head',align:'center',minWidth:84},
-            {field: 'price', title: '原价/现价',align: 'center',templet:'#price'},
-            {field: 'shelf_time', title: '上架时间',align:'center'},
-            {field: 'is_show', title: '计划状态',templet:'#is_show',align: 'center',minWidth:92},
+            {field: 'sort', title: '排序', align: 'center'},
+            {field: 'stepname', title: '步骤名称',align: 'left'},
+            {field: 'introduction', title: '步骤介绍',align:'left'},
             {field: 'right', title: '操作',align:'center',toolbar:'#act',minWidth:81},
         ];
     });
@@ -190,7 +137,7 @@
     layList.tool(function (event,data,obj) {
         switch (event) {
             case 'delstor':
-                var url=layList.U({a:'delete',q:{id:data.id}});
+                var url=layList.U({a:'deletestep',q:{id:data.id}});
                 $eb.$swal('delete',function(){
                     $eb.axios.get(url).then(function(res){
                         if(res.status == 200 && res.data.code == 200) {
@@ -209,64 +156,15 @@
             case 'open_images':
                 $eb.openImage(data.image);
                 break;
-            case 'steps':
-                layer.open({
-                    type: 2,
-                    title: '步骤管理',
-                    content: '{:Url('steps')}?id=' + data.id,
-                    area: ['100%', '100%'],
-                    maxmin: true
-                });
-                break;
             case 'edit':
                 layer.open({
                     type: 2,
-                    title: '编辑计划',
-                    content: '{:Url('create')}?id=' + data.id,
+                    title: '编辑学习步骤',
+                    content: '{:Url('createsteps')}?id=' + data.id + "&pid=" + data.pid,
                     area: ['100%', '100%'],
                     maxmin: true
                 });
                 break;
-            case 'reset_pwd':
-                var url=layList.U({c:'merchant.merchant',a:'reset_pwd',q:{id:data.mer_id}});
-                $eb.$swal('delete',function(){
-                    $eb.axios.post(url).then(function(res){
-                        if(res.data.code == 200) {
-                            window.location.reload();
-                            $eb.$swal('success', res.data.msg);
-                        }else
-                            $eb.$swal('error',res.data.msg||'操作失败!');
-                    });
-                },{'title':'您确定重置选择讲师后台的密码吗?','text':'重置后的密码为1234567','confirm':'您确定重置密码吗?'});
-                break;
-            case 'modify_success':
-                var url=layList.U({c:'merchant.merchant',a:'modify',q:{id:data.mer_id,status:1}});
-                $eb.$swal('delete',function(){
-                    $eb.axios.get(url).then(function(res){
-                        if(res.status == 200 && res.data.code == 200) {
-                            window.location.reload();
-                            $eb.$swal('success',res.data.msg);
-                        }else
-                            return Promise.reject(res.data.msg || '删除失败')
-                    }).catch(function(err){
-                        $eb.$swal('error',err);
-                    });
-                },{'title':'您确定要修改讲师后台的状态吗?','text':'请谨慎操作!','confirm':'是的,我要修改'});
-                break;
-            case 'modify_error':
-                var url=layList.U({c:'merchant.merchant',a:'modify',q:{id:data.mer_id,status:0}});
-                $eb.$swal('delete',function(){
-                    $eb.axios.get(url).then(function(res){
-                        if(res.status == 200 && res.data.code == 200) {
-                            window.location.reload();
-                            $eb.$swal('success',res.data.msg);
-                        }else
-                            return Promise.reject(res.data.msg || '删除失败')
-                    }).catch(function(err){
-                        $eb.$swal('error',err);
-                    });
-                },{'title':'您确定要修改讲师后台的状态吗?','text':'请谨慎操作!','confirm':'是的,我要修改'});
-                break;
         }
     })
     //是否显示快捷按钮操作
@@ -284,21 +182,11 @@
     $(document).on('click', '.layui-btn', function (event) {
         var type = $(this).data('type');
         var id = $(this).data('id');
-        if (type === 'mercreate') {
-            layer.open({
-                type: 2,
-                title: '生成讲师后台',
-                content: "{:Url('mercreate')}?id=" + id,
-                area: ['800px', '700px'],
-                end: function () {
-                    location.reload();
-                }
-            });
-        } else if (type === 'add') {
+        if (type === 'addsteps') {
             layer.open({
                 type: 2,
-                title: '添加学习计划',
-                content: "{:Url('create')}",
+                title: '添加学习步骤',
+                content: "{:Url('createsteps')}?pid=" + pid,
                 area: ['100%', '100%'],
                 maxmin: true,
                 end: function () {