Browse Source

Merge branch 'master' of http://git.cc-lotus.info/ball-court/ball-applet

zs 2 years ago
parent
commit
bd6c2ca811

+ 5 - 0
app.json

@@ -46,6 +46,11 @@
         "pages/coaAdmin/cashout/add",
         "pages/coaAdmin/course/list",
         "pages/coaAdmin/course/add",
+        "pages/coaAdmin/course/info",
+        "pages/coaAdmin/course/coachlist",
+        "pages/coaAdmin/course/coachadd",
+        "pages/coaAdmin/course/statuslist",
+        "pages/coaAdmin/course/statusadd",
         "pages/coaAdmin/student/list",
         "pages/coaAdmin/lecturestat/list",
         "pages/coaAdmin/incomestat/list",

+ 82 - 18
pages/coaAdmin/course/add.js

@@ -2,19 +2,61 @@ const app = getApp()
 import WxValidate from '../../../utils/wxValidate';
 Page({
     data: {
-        frameStyle: { useTop: true, name: '课程信息', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '信息维护', leftArrow: true, useBar: false },
+        // 教练和学校的关系
+        schoolInfo: {},
         form: {},
+        statusList: []
     },
     initValidate() {
-        const rules = { salary: { required: false } }
+        const rules = { title: { required: true }, start_date: { required: true }, start_time: { required: true }, end_date: { required: true }, end_time: { required: true }, brief: { required: true }, money: { required: true }, limit: { required: true }, refund_date: { required: false }, refund_time: { required: false } }
         // 验证字段的提示信息,若不传则调用默认的信息
-        const messages = { salary: { required: '请输入提现金额' } };
+        const messages = { title: { required: '课程标题' }, start_date: { required: '课程开始日期' }, start_time: { required: '课程开始时间' }, end_date: { required: '课程结束日期' }, end_time: { required: '课程结束时间' }, brief: { required: '请输入课程简介' }, money: { required: '报名费用' }, limit: { required: '人数限制' }, refund_date: { required: '退款期限日期' }, refund_time: { required: '退款期限时间' } };
         this.WxValidate = new WxValidate(rules, messages)
     },
     // 返回
     back: function () {
         wx.navigateBack({ delta: 1 })
     },
+    // 课程开始日期
+    startdChange: function (e) {
+        const that = this;
+        that.setData({ 'form.start_date': e.detail.value })
+    },
+    // 课程开始时间
+    starttChange: function (e) {
+        const that = this;
+        that.setData({ 'form.start_time': e.detail.value })
+    },
+    // 课程结束日期
+    enddChange: function (e) {
+        const that = this;
+        that.setData({ 'form.end_date': e.detail.value })
+    },
+    // 课程结束时间
+    endtChange: function (e) {
+        const that = this;
+        that.setData({ 'form.end_time': e.detail.value })
+    },
+    // 退款期限日期
+    refunddChange: function (e) {
+        const that = this;
+        that.setData({ 'form.refund_date': e.detail.value })
+    },
+    // 退款期限时间
+    refundtChange: function (e) {
+        const that = this;
+        that.setData({ 'form.refund_time': e.detail.value })
+    },
+    // 选择状态
+    statusChange: function (e) {
+        const that = this;
+        let data = that.data.statusList[e.detail.value];
+        if (data) {
+            that.setData({ 'form.status': data.value })
+            that.setData({ 'form.zhStatus': data.label })
+        }
+    },
     //提交
     onSubmit: async function (e) {
         const that = this;
@@ -24,10 +66,14 @@ Page({
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
             return false
         } else {
-            console.log(params);
-            // const arr = await app.$post(`/billApply`, params)
-            // if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
-            // else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+            params.time_start = params.start_date + '-' + params.start_time;
+            params.time_end = params.end_date + '-' + params.end_time;
+            params.refund_hour = params.refund_date + '-' + params.refund_time;
+            let arr;
+            if (params._id) { arr = await app.$post(`/lesson/${params._id}`, params) }
+            else { arr = await app.$post(`/lesson`, params) }
+            if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+            else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
         }
     },
     /**
@@ -43,31 +89,49 @@ Page({
         // 监听用户是否登录
         await that.watchLogin();
     },
-    // 查询其他信息
-    searchOther: function () {
-        const that = this;
-        let arr;
-    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        let statusList = that.data.statusList;
         wx.getStorage({
             key: 'user',
             success: async res => {
                 let data = res.data;
-                // 教练与学校的关系
-                // const school = await app.$get(`/rcs`, { coach_id: form.coach_id });
-                // if (school.errcode == '0' && school.total > 0) { form.school_id = school.data[0].school_id }
-                // let form = { coach_id: data.info.id };
+                let arr;
+                // 教练与学校关系
+                arr = await app.$get(`/rcs`, { coach_id: data.info._id });
+                if (arr.errcode == '0' && arr.total > 0) that.setData({ schoolInfo: arr.data[0] });
+                let form = { school_id: that.data.schoolInfo.school_id, type: '1' };
+                if (that.data.id) {
+                    arr = await app.$get(`/lesson/${that.data.id}`);
+                    if (arr.errcode == '0') {
+                        arr.data.start_date = arr.data.time_start.slice(0, 10);
+                        arr.data.start_time = arr.data.time_start.slice(11, arr.data.time_start.length);
+                        arr.data.end_date = arr.data.time_end.slice(0, 10);
+                        arr.data.end_time = arr.data.time_end.slice(11, arr.data.time_end.length);
+                        arr.data.refund_date = arr.data.refund_hour.slice(0, 10);
+                        arr.data.refund_time = arr.data.refund_hour.slice(11, arr.data.refund_hour.length);
+                        // 查询状态
+                        let status = statusList.find(i => i.value = arr.data.status);
+                        if (status) arr.data.zhStatus = status.label;
+                        form = arr.data;
 
-                // else { wx.showToast({ title: `缺少必要信息`, icon: 'error', duration: 2000 }) };
-                // that.setData({ form })
+                    }
+                };
+                that.setData({ form: form })
             },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },
+    // 查询其他信息
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 93 - 1
pages/coaAdmin/course/add.wxml

@@ -2,12 +2,104 @@
     <view slot="info" class="container main">
         <view class="one">
             <form catchsubmit="onSubmit">
-                <view class="content">
+                <view class="content" style="display: none;">
+                    <view class="label">数据id:</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
                     <view class="label">学校id:</view>
                     <view class="value">
                         <input type="text" name="school_id" value="{{form.school_id}}" placeholder="请输入学校id" />
                     </view>
                 </view>
+                <view class="content">
+                    <view class="label">课程类型:</view>
+                    <view class="value">
+                        <input type="text" name="type" value="{{form.type}}" placeholder="请输入课程类型" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程标题:</view>
+                    <view class="value">
+                        <input type="text" name="title" value="{{form.title}}" placeholder="请输入课程标题" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程开始日期:</view>
+                    <view class="value">
+                        <picker mode="date" name="start_date" value="{{form.start_date}}" bindchange="startdChange">
+                            <view class="picker">{{form.start_date||'请选择课程开始日期'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程开始时间:</view>
+                    <view class="value">
+                        <picker mode="time" name="start_time" value="{{form.start_time}}" bindchange="starttChange">
+                            <view class="picker">{{form.start_time||'请选择课程开始时间'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程结束日期:</view>
+                    <view class="value">
+                        <picker mode="date" name="end_date" value="{{form.end_date}}" bindchange="enddChange">
+                            <view class="picker">{{form.end_date||'请选择课程结束日期'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程结束时间:</view>
+                    <view class="value">
+                        <picker mode="time" name="end_time" value="{{form.end_time}}" bindchange="endtChange">
+                            <view class="picker">{{form.end_time||'请选择课程结束时间'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程简介:</view>
+                    <view class="value">
+                        <textarea name="brief" value="{{form.brief}}" auto-height maxlength="-1" placeholder="请输入课程简介" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">报名费用:</view>
+                    <view class="value">
+                        <input type="number" name="money" value="{{form.money}}" placeholder="请输入报名费用" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">人数限制:</view>
+                    <view class="value">
+                        <input type="number" name="limit" value="{{form.limit}}" placeholder="请输入人数限制" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">退款期限日期:</view>
+                    <view class="value">
+                        <picker mode="date" name="refund_date" value="{{form.refund_date}}" bindchange="refunddChange">
+                            <view class="picker">{{form.refund_date||'请选择退款期限日期'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">退款期限时间:</view>
+                    <view class="value">
+                        <picker mode="time" name="refund_time" value="{{form.refund_time}}" bindchange="refundtChange">
+                            <view class="picker">{{form.refund_time||'请选择退款期限时间'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程状态:</view>
+                    <view class="value">
+                        <picker mode="selector" name="status" value="{{form.status}}" bindchange="statusChange" range="{{statusList}}" range-key="label">
+                            <view class="picker">{{form.zhStatus||'请选择状态'}}</view>
+                        </picker>
+                    </view>
+                </view>
                 <view class="btn">
                     <button type="primary" size="mini" formType="submit">提交保存</button>
                 </view>

+ 119 - 0
pages/coaAdmin/course/coachadd.js

@@ -0,0 +1,119 @@
+const app = getApp()
+import WxValidate from '../../../utils/wxValidate'
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '信息维护', leftArrow: true, useBar: false },
+        lesson_id: '',
+        form: {},
+    },
+    initValidate() {
+        const rules = { money: { required: true }, }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { money: { required: '请输入金额', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    // 返回
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 提交保存
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
+            let arr;
+            if (params._id) arr = await app.$post(`/lessonCoach/${params._id}`, params);
+            else arr = await app.$post(`/lessonCoach`, params)
+            if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+            else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ lesson_id: options.lesson_id || '', id: options.id || '' })
+        //验证规则函数
+        that.initValidate();
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let data = res.data;
+                // 教练与学校的关系
+                let arr = await app.$get(`/rcs`, { coach_id: data.info.id });
+                if (arr.errcode == '0' && arr.total > 0) that.setData({ schoolInfo: arr.data[0] });
+                let form = { school_id: that.data.schoolInfo.school_id, lesson_id: that.data.lesson_id, coach_id: res.data.info._id };
+                if (that.data.id) arr = await app.$get(`/lessonCoach/${that.data.id}`);
+                if (arr.errcode == '0') form.money = arr.data.money; form._id = arr.data._id;
+                that.setData({ form })
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/coaAdmin/course/coachadd.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "mobile-main": "/commpents/mobile-frame/index"
+    }
+}

+ 34 - 0
pages/coaAdmin/course/coachadd.less

@@ -0,0 +1,34 @@
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        .content {
+            display: flex;
+            flex-direction: row;
+            border-bottom: 1px dashed var(--f1Color);
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
+
+            .value {
+                flex-grow: 1;
+                color: var(--blackColor);
+
+                textarea {
+                    position: static;
+                    width: 73vw;
+                }
+            }
+        }
+
+        .btn {
+            text-align: center;
+            margin: 5vw 0 0 0;
+
+            button {
+                width: 40vw;
+                margin: 0 2vw;
+                padding: 1vw 0;
+            }
+        }
+    }
+}

+ 41 - 0
pages/coaAdmin/course/coachadd.wxml

@@ -0,0 +1,41 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <form catchsubmit="onSubmit">
+                <view class="content" style="display: none;">
+                    <view class="label">数据id:</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">学校id:</view>
+                    <view class="value">
+                        <input type="text" name="school_id" value="{{form.school_id}}" placeholder="请输入学校id" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">课程id:</view>
+                    <view class="value">
+                        <input type="text" name="lesson_id" value="{{form.lesson_id}}" placeholder="请输入课程id" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">教练id:</view>
+                    <view class="value">
+                        <input type="text" name="coach_id" value="{{form.coach_id}}" placeholder="请输入教练id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课时费(元):</view>
+                    <view class="value">
+                        <input type="number" name="money" value="{{form.money}}" placeholder="请输入金额" />
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 0
pages/coaAdmin/course/coachadd.wxss

@@ -0,0 +1,27 @@
+.main {
+  background-color: var(--mainColor);
+}
+.main .one .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .one .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+}
+.main .one .content .value textarea {
+  position: static;
+  width: 73vw;
+}
+.main .one .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.main .one .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}

+ 139 - 0
pages/coaAdmin/course/coachlist.js

@@ -0,0 +1,139 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '教练信息', leftArrow: true, useBar: false },
+        // 课程id
+        id: '',
+        // 课程信息
+        lessonInfo: {},
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+    },
+    // 返回
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 添加
+    toAdd() {
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: `/pages/coaAdmin/course/coachadd?lesson_id=${that.data.id}` })
+    },
+    // 修改
+    toEdit: function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: `/pages/coaAdmin/course/coachadd?id=${item._id}` })
+    },
+    // 删除
+    toDel: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/lessonCoach/${item.id}`);
+                    if (arr.errcode == '0') {
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ id: options.id || '' })
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let arr;
+                arr = await app.$get(`/lesson/${that.data.id}`);
+                if (arr.errcode == '0') { that.setData({ lessonInfo: arr.data }) };
+                let info = { skip: that.data.skip, limit: that.data.limit, lesson_id: that.data.id };
+                arr = await app.$get(`/lessonCoach`, { ...info });
+                if (arr.errcode == '0') {
+                    that.setData({ list: [...that.data.list, ...arr.data] });
+                    that.setData({ total: arr.total });
+                }
+                else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/coaAdmin/course/coachlist.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+      "mobile-main": "/commpents/mobile-frame/index"
+    }
+  }

+ 158 - 0
pages/coaAdmin/course/coachlist.less

@@ -0,0 +1,158 @@
+.main {
+    height: var(--twoHeight);
+    background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            padding: 2vw;
+            margin: 2vw 2vw 0;
+            border-radius: 10px;
+            border: 1px dashed var(--blackColor);
+
+
+            .list_1 {
+                display: flex;
+                flex-direction: row;
+                margin: 0 0 2vw 0;
+                border: 2px dashed var(--blackColor);
+                border-radius: 10px;
+
+                .icon {
+                    width: 18vw;
+                    height: 18vw;
+                    margin-top: 2vw;
+                    margin-left: 2vw;
+
+                    image {
+                        width: 100%;
+                        height: 100%;
+                        border-radius: 50%;
+                        background-color: var(--f85Color);
+                    }
+                }
+
+                .content {
+                    display: flex;
+                    flex-direction: column;
+                    margin: 0 0 0 3vw;
+
+                    .name {
+                        font-weight: 700;
+                        font-size: var(--font18Szie);
+                        color: var(--blackColor);
+                        margin: 1vw 0;
+                    }
+
+                    .other {
+                        font-size: var(--font15Size);
+                        color: var(--f85Color);
+                        margin: 0.5vw 0 1vw 0;
+
+                        text {
+                            color: var(--redColor);
+                        }
+                    }
+                }
+            }
+
+            .btn {
+                display: flex;
+                flex-direction: row;
+
+                button {
+                    width: 100%;
+                    padding: 2vw;
+                    font-size: var(--font14Size);
+                    color: var(--whiteColor);
+                    border-radius: 50px;
+                    margin: 0 2vw;
+                    background-color: #35d4bd;
+                    box-sizing: content-box;
+                    border: 2px dashed var(--whiteColor);
+                }
+
+                button:nth-child(2n) {
+                    background-color: #f860df;
+                }
+
+                button:last-child {
+                    background-color: #FF7F50;
+                }
+            }
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}
+
+.dialog {
+    .dialog_1 {
+        .name {
+            text-align: center;
+            font-size: var(--font18Szie);
+            font-weight: bold;
+            margin: 3vw 0;
+        }
+
+        .image {
+            text-align: center;
+            height: 18vh;
+            overflow: hidden;
+
+            .qrcode {
+                height: 22vh;
+                position: absolute;
+                left: 32vw;
+            }
+        }
+
+        .remark {
+            text-align: center;
+            font-size: 15px;
+            margin: 0 0 4vw 0;
+        }
+    }
+}

+ 31 - 0
pages/coaAdmin/course/coachlist.wxml

@@ -0,0 +1,31 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2" wx:if="{{total==0&&lessonInfo.type=='1'}}">
+                <button type="primary" bindtap="toAdd">添加</button>
+            </view>
+        </view>
+        <view class="two">
+            <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                <view class="list-scroll-view">
+                    <view class="list" wx:for="{{list}}" wx:key="item">
+                        <view class="list_1">
+                            <view class="content">
+                                <view class="name textOver">{{item.coach_id_name||'教练姓名'}}</view>
+                                <view class="other">课时费:{{item.money||'暂无'}}元</view>
+                                <view class="other">课程名称:{{item.lesson_id_title||'暂无'}}</view>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button bindtap="toEdit" data-item="{{item}}">维护信息</button>
+                            <button bindtap="toDel" data-item="{{item}}">删除信息</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>

+ 129 - 0
pages/coaAdmin/course/coachlist.wxss

@@ -0,0 +1,129 @@
+.main {
+  height: var(--twoHeight);
+  background-color: var(--mainColor);
+}
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  padding: 2vw;
+  margin: 2vw 2vw 0;
+  border-radius: 10px;
+  border: 1px dashed var(--blackColor);
+}
+.main .two .list .list_1 {
+  display: flex;
+  flex-direction: row;
+  margin: 0 0 2vw 0;
+  border: 2px dashed var(--blackColor);
+  border-radius: 10px;
+}
+.main .two .list .list_1 .icon {
+  width: 18vw;
+  height: 18vw;
+  margin-top: 2vw;
+  margin-left: 2vw;
+}
+.main .two .list .list_1 .icon image {
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+  background-color: var(--f85Color);
+}
+.main .two .list .list_1 .content {
+  display: flex;
+  flex-direction: column;
+  margin: 0 0 0 3vw;
+}
+.main .two .list .list_1 .content .name {
+  font-weight: 700;
+  font-size: var(--font18Szie);
+  color: var(--blackColor);
+  margin: 1vw 0;
+}
+.main .two .list .list_1 .content .other {
+  font-size: var(--font15Size);
+  color: var(--f85Color);
+  margin: 0.5vw 0 1vw 0;
+}
+.main .two .list .list_1 .content .other text {
+  color: var(--redColor);
+}
+.main .two .list .btn {
+  display: flex;
+  flex-direction: row;
+}
+.main .two .list .btn button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+  color: var(--whiteColor);
+  border-radius: 50px;
+  margin: 0 2vw;
+  background-color: #35d4bd;
+  box-sizing: content-box;
+  border: 2px dashed var(--whiteColor);
+}
+.main .two .list .btn button:nth-child(2n) {
+  background-color: #f860df;
+}
+.main .two .list .btn button:last-child {
+  background-color: #FF7F50;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}
+.dialog .dialog_1 .name {
+  text-align: center;
+  font-size: var(--font18Szie);
+  font-weight: bold;
+  margin: 3vw 0;
+}
+.dialog .dialog_1 .image {
+  text-align: center;
+  height: 18vh;
+  overflow: hidden;
+}
+.dialog .dialog_1 .image .qrcode {
+  height: 22vh;
+  position: absolute;
+  left: 32vw;
+}
+.dialog .dialog_1 .remark {
+  text-align: center;
+  font-size: 15px;
+  margin: 0 0 4vw 0;
+}

+ 124 - 0
pages/coaAdmin/course/info.js

@@ -0,0 +1,124 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+        //状态
+        statusList: [],
+        //学员
+        student: {},
+        // 教练
+        coach: {},
+        // 选中
+        tabs: {
+            active: '0',
+            menu: [
+                { title: '课程信息', active: '0' },
+                { title: '教练人员', active: '1' },
+                { title: '学生人员', active: '2' },
+            ]
+        },
+    },
+    // 跳转菜单
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 选项卡选择
+    tabsChange: function (e) {
+        const that = this;
+        let data = e.detail;
+        that.setData({ 'tabs.active': data.active })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || '' })
+        // 查询其他信息
+        await that.searchOther();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'lesson_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        let statusList = that.data.statusList;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const arr = await app.$get(`/lesson/${that.data.id}`);
+                    if (arr.errcode == '0') {
+                        let status = statusList.find(i => i.value == arr.data.status)
+                        if (status) arr.data.zhStatus = status.label;
+                        if (arr.data.school_id) {
+                            const school = await app.$get(`/school/${arr.data.school_id}`)
+                            if (school.errcode == '0') arr.data.zhSchool = school.data.name;
+                        }
+                        const coach = await app.$get(`/lessonCoach`, { lesson_id: that.data.id })
+                        console.log(coach);
+                        if (coach.errcode == '0') that.setData({ coach: coach.data })
+                        const student = await app.$get(`/lessonStudent`, { lesson_id: that.data.id })
+                        if (student.errcode == '0') that.setData({ student: student.data })
+                        that.setData({ form: arr.data })
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/coaAdmin/course/info.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+      "mobile-main": "/commpents/mobile-frame/index",
+      "s-tab": "/commpents/tabs/index"
+    }
+  }

+ 106 - 0
pages/coaAdmin/course/info.less

@@ -0,0 +1,106 @@
+.main {
+    height: var(--twoHeight);
+    background-color: var(--mainColor);
+
+    .one {
+        width: 100vw;
+        margin: 0 0 2vw 0;
+    }
+
+    .two {
+        position: relative;
+        flex-grow: 1;
+
+        .a {
+            height: 83vh;
+
+            .one {
+                width: 96vw;
+                padding: 0 2vw;
+
+                .one_1 {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: space-between;
+                    border: 1px dashed var(--f85Color);
+                    border-radius: 5px;
+                    margin: 0 0 10px 0;
+                    padding: 10px;
+
+                    .text {
+                        color: var(--f85Color);
+                        font-size: var(--font16Size);
+                    }
+
+                    .text1 {
+                        font-size: var(--font16Size);
+                    }
+
+                    .image {
+                        width: 15vw;
+                        height: 15vw;
+                    }
+
+                    .name {
+                        display: flex;
+                        flex-direction: column;
+                    }
+                }
+            }
+        }
+
+        .b {
+            height: 83vh;
+
+            .list {
+                background-color: var(--f9Color);
+                margin: 0 0 2vw 0;
+                padding: 2vw;
+                margin: 0 2vw 2vw 2vw;
+                border-radius: 5px;
+                border: 1px dashed var(--f85Color);
+
+                .name {
+                    font-size: var(--font18Szie);
+                    font-weight: bold;
+                    margin: 0 0 1vw 0;
+                }
+
+                .other {
+                    margin: 0 0 1vw 0;
+
+                    .other_1 {
+                        margin: 0 0 1vw 0;
+                        font-size: var(--font16Size);
+
+                        text:first-child {
+                            color: var(--f85Color);
+                        }
+                    }
+                }
+
+                .btn {
+                    text-align: center;
+
+                    button {
+                        margin: 0 2vw;
+                        font-size: var(--font14Size);
+                    }
+                }
+            }
+        }
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 99 - 0
pages/coaAdmin/course/info.wxml

@@ -0,0 +1,99 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <s-tab tabs="{{tabs}}" bind:tabsChange="tabsChange"></s-tab>
+        </view>
+        <view class="two">
+            <view wx:if="{{tabs.active=='0'}}" class="a">
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <view class="one">
+                            <view class="one_1">
+                                <text class="text">课程标题:</text>
+                                <text class="text1">{{form.title||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">学校名称:</text>
+                                <text class="text1">{{form.zhSchool||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">人数上限:</text>
+                                <text class="text1">{{form.limit||'暂无'}}人</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">开始时间:</text>
+                                <text class="text1">{{form.time_start||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">结束时间:</text>
+                                <text class="text1">{{form.time_end||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">状态:</text>
+                                <text class="text1">{{form.zhStatus||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">课程费(元):</text>
+                                <text class="text1">{{form.money||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">退款期限:</text>
+                                <text class="text1">{{form.refund_hour||'暂无'}}</text>
+                            </view>
+                            <view class="one_1">
+                                <text class="text">简介:</text>
+                                <text class="text1">{{form.brief||'暂无'}}</text>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+            <view wx:elif="{{tabs.active=='1'}}" class="b">
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <view class="list" wx:for="{{coach}}" wx:key="index">
+                            <view class="name">{{item.coach_id_name||'暂无'}}</view>
+                            <view class="other">
+                                <view class="other_1">
+                                    <text>课程名称:</text>
+                                    <text>{{item.lesson_id_title||'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>报名费用:</text>
+                                    <text>{{item.money||'暂无'}}元</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>所属学校:</text>
+                                    <text>{{item.school_id_name||'暂无'}}</text>
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+            <view wx:elif="{{tabs.active=='2'}}" class="b">
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <view class="list" wx:for="{{student}}" wx:key="index">
+                            <view class="name">{{item.student_id_name||'暂无'}}</view>
+                            <view class="other">
+                                <view class="other_1">
+                                    <text>是否试课:</text>
+                                    <text>{{item.is_try=='0'?'非试课':item.is_try=='1'?'试课':'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>缴费金额:</text>
+                                    <text>{{item.money||'暂无'}}元</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>所属学院:</text>
+                                    <text>{{item.school_id_name||'暂无'}}</text>
+                                </view>
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 87 - 0
pages/coaAdmin/course/info.wxss

@@ -0,0 +1,87 @@
+.main {
+  height: var(--twoHeight);
+  background-color: var(--mainColor);
+}
+.main .one {
+  width: 100vw;
+  margin: 0 0 2vw 0;
+}
+.main .two {
+  position: relative;
+  flex-grow: 1;
+}
+.main .two .a {
+  height: 83vh;
+}
+.main .two .a .one {
+  width: 96vw;
+  padding: 0 2vw;
+}
+.main .two .a .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .two .a .one .one_1 .text {
+  color: var(--f85Color);
+  font-size: var(--font16Size);
+}
+.main .two .a .one .one_1 .text1 {
+  font-size: var(--font16Size);
+}
+.main .two .a .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}
+.main .two .a .one .one_1 .name {
+  display: flex;
+  flex-direction: column;
+}
+.main .two .b {
+  height: 83vh;
+}
+.main .two .b .list {
+  background-color: var(--f9Color);
+  margin: 0 0 2vw 0;
+  padding: 2vw;
+  margin: 0 2vw 2vw 2vw;
+  border-radius: 5px;
+  border: 1px dashed var(--f85Color);
+}
+.main .two .b .list .name {
+  font-size: var(--font18Szie);
+  font-weight: bold;
+  margin: 0 0 1vw 0;
+}
+.main .two .b .list .other {
+  margin: 0 0 1vw 0;
+}
+.main .two .b .list .other .other_1 {
+  margin: 0 0 1vw 0;
+  font-size: var(--font16Size);
+}
+.main .two .b .list .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .two .b .list .btn {
+  text-align: center;
+}
+.main .two .b .list .btn button {
+  margin: 0 2vw;
+  font-size: var(--font14Size);
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}

+ 1 - 1
pages/coaAdmin/course/list.js

@@ -6,7 +6,7 @@ Page({
      * 页面的初始数据
      */
     data: {
-        frameStyle: { useTop: true, name: '提现申请', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
         list: [],
         total: 0,
         page: 0,

+ 2 - 0
pages/coaAdmin/course/list.wxml

@@ -20,7 +20,9 @@
                         </view>
                         <view class="btn">
                             <button size="mini" type="primary" bindtap="toCommon" data-item="{{item}}" data-route="coaAdmin/course/info">详细信息</button>
+                            <button size="mini" type="primary" bindtap="toCommon" data-item="{{item}}" data-route="coaAdmin/course/coachlist">教练信息</button>
                             <button size="mini" type="primary" bindtap="toCommon" data-item="{{item}}" data-route="coaAdmin/course/add" wx:if="{{item.type=='1'}}">信息维护</button>
+                            <button size="mini" type="primary" bindtap="toCommon" data-item="{{item}}" data-route="coaAdmin/course/statuslist" wx:if="{{item.type=='1'}}">临时添加学员</button>
                         </view>
                     </view>
                 </view>

+ 142 - 0
pages/coaAdmin/course/statusadd.js

@@ -0,0 +1,142 @@
+const app = getApp()
+import WxValidate from '../../../utils/wxValidate';
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '信息维护', leftArrow: true, useBar: false },
+        form: { img_url: [] },
+        // 课程信息
+        lesson_id: '',
+        // 学校信息
+        schoolInfo: {},
+        // 学生列表
+        studentList: [],
+
+    },
+    initValidate() {
+        const rules = { student_id: { required: true }, money: { required: true }, img_url: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { student_id: { required: '请选择学生' }, money: { required: '课程费用' }, img_url: { required: '证据图片' } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    // 返回
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 选择学生
+    stuChange: function (e) {
+        const that = this;
+        let data = that.data.studentList[e.detail.value];
+        if (data) {
+            that.setData({ 'form.student_id': data.student_id })
+            that.setData({ 'form.student_id_name': data.student_id_name })
+        }
+    },
+    imgUpl: function (e) {
+        const that = this;
+        let data = that.data.form.img_url;
+        data.push(e.detail)
+        that.setData({ 'form.img_url': data })
+    },
+    // 删除图片
+    imgDel: function (e) {
+        const that = this;
+        let list = that.data.form.img_url;
+        let arr = list.filter((i, index) => index != e.detail.index)
+        that.setData({ 'form.img_url': arr })
+    },
+    //提交
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const form = that.data.form;
+        form.img_url = form.img_url;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
+            console.log(params);
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: async function (options) {
+        const that = this;
+        that.setData({ lesson_id: options.id || '' })
+        //验证规则函数
+        that.initValidate();
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let data = res.data;
+                let arr;
+                // 学员与学校的关系
+                arr = await app.$get(`/rss`);
+                if (arr.errcode == '0') that.setData({ studentList: arr.data });
+                // 教练与学校的关系
+                arr = await app.$get(`/rcs`, { coach_id: data.info.id });
+                if (arr.errcode == '0' && arr.total > 0) that.setData({ schoolInfo: arr.data[0] });
+                let form = { school_id: that.data.schoolInfo.school_id, lesson_id: that.data.lesson_id, coach_id: data.info._id, img_url: [] };
+                that.setData({ form })
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/coaAdmin/course/statusadd.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+        "mobile-main": "/commpents/mobile-frame/index",
+        "upload": "/commpents/upload/index"
+    }
+}

+ 34 - 0
pages/coaAdmin/course/statusadd.less

@@ -0,0 +1,34 @@
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        .content {
+            display: flex;
+            flex-direction: row;
+            border-bottom: 1px dashed var(--f1Color);
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
+
+            .value {
+                flex-grow: 1;
+                color: var(--blackColor);
+
+                textarea {
+                    position: static;
+                    width: 73vw;
+                }
+            }
+        }
+
+        .btn {
+            text-align: center;
+            margin: 5vw 0 0 0;
+
+            button {
+                width: 40vw;
+                margin: 0 2vw;
+                padding: 1vw 0;
+            }
+        }
+    }
+}

+ 49 - 0
pages/coaAdmin/course/statusadd.wxml

@@ -0,0 +1,49 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <view class="label">数据id:</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学校id:</view>
+                    <view class="value">
+                        <input type="text" name="school_id" value="{{form.school_id}}" placeholder="请输入学校id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程id:</view>
+                    <view class="value">
+                        <input type="text" name="lesson_id" value="{{form.lesson_id}}" placeholder="请输入课程id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">学生:</view>
+                    <view class="value">
+                        <picker mode="selector" name="student_id" value="{{form.student_id}}" bindchange="stuChange" range="{{studentList}}" range-key="student_id_name">
+                            <view class="picker">{{form.student_id_name||'请选择学生'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">课程费用:</view>
+                    <view class="value">
+                        <input type="number" name="money" value="{{form.money}}" placeholder="请输入课程费用" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">证据图片(6):</view>
+                    <view class="value">
+                        <upload list="{{form.img_url}}" count="{{6}}" previewSize="{{25}}" bind:imgUpload="imgUpl" bind:imgDel="imgDel"></upload>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 0
pages/coaAdmin/course/statusadd.wxss

@@ -0,0 +1,27 @@
+.main {
+  background-color: var(--mainColor);
+}
+.main .one .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.main .one .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+}
+.main .one .content .value textarea {
+  position: static;
+  width: 73vw;
+}
+.main .one .btn {
+  text-align: center;
+  margin: 5vw 0 0 0;
+}
+.main .one .btn button {
+  width: 40vw;
+  margin: 0 2vw;
+  padding: 1vw 0;
+}

+ 133 - 0
pages/coaAdmin/course/statuslist.js

@@ -0,0 +1,133 @@
+const app = getApp()
+Page({
+    data: {
+        frameStyle: { useTop: true, name: '临时学员', leftArrow: true, useBar: false },
+        // 课程id
+        id: '',
+        // 课程信息
+        lessonInfo: {},
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+    },
+    // 返回
+    back(e) {
+        wx.navigateBack({ delta: 1 })
+    },
+    //添加信息,信息维护
+    toCommon: function (e) {
+        const that = this;
+        const { item, route } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] });
+        wx.navigateTo({ url: `/pages/${route}?id=${that.data.id}` })
+    },
+    // 删除
+    toDel: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/tempLessonApply/${item.id}`);
+                    if (arr.errcode == '0') {
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        that.setData({ id: options.id || '' })
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                let arr;
+                arr = await app.$get(`/lesson/${that.data.id}`);
+                if (arr.errcode == '0') { that.setData({ lessonInfo: arr.data }) };
+                let info = { skip: that.data.skip, limit: that.data.limit, lesson_id: that.data.id };
+                arr = await app.$get(`/tempLessonApply`, { ...info });
+                if (arr.errcode == '0') {
+                    that.setData({ list: [...that.data.list, ...arr.data] });
+                    that.setData({ total: arr.total });
+                }
+                else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        const that = this;
+        // 监听用户是否登录
+        that.watchLogin();
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/coaAdmin/course/statuslist.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+      "mobile-main": "/commpents/mobile-frame/index"
+    }
+  }

+ 90 - 0
pages/coaAdmin/course/statuslist.less

@@ -0,0 +1,90 @@
+.main {
+    height: var(--twoHeight);
+    background-color: var(--mainColor);
+
+    .one {
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        flex-grow: 1;
+        position: relative;
+        width: 96vw;
+        margin: 2vw;
+        background-color: var(--mainColor);
+
+        .list {
+            display: flex;
+            flex-direction: column;
+            border: 2px dashed var(--f1Color);
+            padding: 2vw;
+            margin: 0 0 2vw 0;
+            border-radius: 10px;
+
+            .name {
+                font-size: var(--font16Szie);
+                font-weight: bold;
+                margin: 0 0 2vw 0;
+            }
+
+            .other {
+                margin: 0 0 2vw 0;
+
+                .other_1 {
+                    font-size: var(--font14Szie);
+                    margin: 0 0 1vw 0;
+
+                    text:first-child {
+                        color: var(--f85Color);
+                    }
+                }
+            }
+
+            .btn {
+                margin: 2vw 0 0 0;
+                text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                }
+            }
+        }
+
+    }
+}
+
+.scroll-view {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    .list-scroll-view {
+        display: flex;
+        flex-direction: column;
+    }
+}

+ 29 - 0
pages/coaAdmin/course/statuslist.wxml

@@ -0,0 +1,29 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2">
+                <button type="primary" bindtap="toCommon" data-route="coaAdmin/course/statusadd">添加</button>
+            </view>
+        </view>
+        <view class="two">
+            <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
+                <view class="list-scroll-view">
+                    <view class="list" wx:for="{{list}}" wx:key="item">
+                        <view class="name">{{item.title}}</view>
+                        <view class="other">
+                            <view class="other_1"><text>课程时间:</text><text>{{item.time_start}}至{{item.time_end}}</text></view>
+                            <view class="other_1"><text>课程类型:</text><text>{{item.zhType}}</text></view>
+                            <view class="other_1"><text>审核状态:</text><text>{{item.zhStatus}}</text></view>
+                        </view>
+                        <view class="btn">
+                            <button>信息维护</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
+        </view>
+    </view>
+</mobile-main>

+ 74 - 0
pages/coaAdmin/course/statuslist.wxss

@@ -0,0 +1,74 @@
+.main {
+  height: var(--twoHeight);
+  background-color: var(--mainColor);
+}
+.main .one {
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  flex-grow: 1;
+  position: relative;
+  width: 96vw;
+  margin: 2vw;
+  background-color: var(--mainColor);
+}
+.main .two .list {
+  display: flex;
+  flex-direction: column;
+  border: 2px dashed var(--f1Color);
+  padding: 2vw;
+  margin: 0 0 2vw 0;
+  border-radius: 10px;
+}
+.main .two .list .name {
+  font-size: var(--font16Szie);
+  font-weight: bold;
+  margin: 0 0 2vw 0;
+}
+.main .two .list .other {
+  margin: 0 0 2vw 0;
+}
+.main .two .list .other .other_1 {
+  font-size: var(--font14Szie);
+  margin: 0 0 1vw 0;
+}
+.main .two .list .other .other_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .two .list .btn {
+  margin: 2vw 0 0 0;
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}