Просмотр исходного кода

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

guhongwei 2 лет назад
Родитель
Сommit
85b38ac5e0

+ 5 - 1
pages/schAdmin/coach/add.js

@@ -26,6 +26,7 @@ Page({
     back: function () {
         wx.navigateBack({ delta: 1 })
     },
+    // 上传照片
     imgUpl: function (e) {
         const that = this;
         let data = that.data.form.icon;
@@ -57,7 +58,6 @@ Page({
             that.setData({ 'form.zhLevel': data.label });
         }
     },
-
     // 提交登录
     onSubmit: async function (e) {
         const that = this;
@@ -95,15 +95,19 @@ Page({
             key: 'user',
             success: async res => {
                 that.setData({ school_id: res.data.info.id })
+                // 教练等级
                 const aee = await app.$get(`/dict`, { code: "coach_grade" });
                 if (aee.errcode == '0' && aee.total > 0) that.setData({ levelList: aee.data[0].list });
+                // 性别
                 const ree = await app.$get(`/dict`, { code: "gender" });
                 if (ree.errcode == '0' && ree.total > 0) that.setData({ genderList: ree.data[0].list });
                 if (that.data.id) {
                     const arr = await app.$get(`/coach/${that.data.id}`);
                     if (arr.errcode == '0') {
+                        // 性别
                         let gender = that.data.genderList.find(i => i.value == arr.data.gender)
                         if (gender) arr.data.zhGender = gender.label;
+                        // 教练等级
                         let level = that.data.levelList.find(i => i.value == arr.data.level)
                         if (level) arr.data.zhLevel = level.label;
                         that.setData({ form: arr.data });

+ 1 - 1
pages/schAdmin/coach/list.js

@@ -82,7 +82,6 @@ Page({
             correctLevel: QRCode.CorrectLevel.L,
         });
     },
-
     // 关闭弹框
     toClose: function () {
         const that = this;
@@ -136,6 +135,7 @@ Page({
                 const arr = await app.$get(`/rcs`, { ...info });
                 if (arr.errcode == '0') {
                     for (const val of arr.data) {
+                        // 教练等级
                         let level = that.data.levelList.find(i => i.value == val.coach_id_level)
                         if (level) val.zhLevel = level.label;
                     }

+ 1 - 1
pages/schAdmin/coach/list.wxml

@@ -26,7 +26,7 @@
                         </view>
                         <view class="btn">
                             <button bindtap="toEdit" data-item="{{item}}">信息维护</button>
-                            <button bindtap="toBind" data-item="{{item}}">绑定账号</button>
+                            <button bindtap="toBind" data-item="{{item}}" wx:if="{{item.coach_id_user_id==null}}">绑定账号</button>
                             <button bindtap="toDel" data-item="{{item}}">删除信息</button>
                         </view>
                     </view>

+ 3 - 3
pages/schAdmin/course/add.js

@@ -81,9 +81,9 @@ Page({
         const params = e.detail.value;
         const form = that.data.form;
         params.school_id = that.data.school_id;
-        params.time_start = form.start_date + '-' + form.start_time;
-        params.time_end = form.end_date + '-' + form.end_time;
-        params.refund_hour = form.refund_date + '-' + form.refund_time;
+        params.time_start = form.start_date + ' ' + form.start_time;
+        params.time_end = form.end_date + ' ' + form.end_time;
+        params.refund_hour = form.refund_date + ' ' + form.refund_time;
         if (!this.WxValidate.checkForm(params)) {
             const error = this.WxValidate.errorList[0];
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })

+ 2 - 0
pages/schAdmin/course/coachlist.wxml

@@ -20,6 +20,8 @@
                                 <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">

+ 90 - 26
pages/schAdmin/course/info.js

@@ -1,66 +1,130 @@
-// pages/schAdmin/course/info.js
+const app = getApp()
+const moment = require("../../../utils/moment.min")
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
-
+        frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
+        id: '',
+        form: {},
+        user: {},
+        //是否试课
+        is_try: '0',
+        //状态
+        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(options) {
-
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || null })
+        // 查询其他信息
+        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 => {
+                that.setData({ user: res.data })
+                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;
+                        // 学校名称
+                        const school = await app.$get(`/school/${arr.data.school_id}`)
+                        if (school.errcode == '0') arr.data.zhSchool = school.data.name;
+                        // 课程信息
+                        that.setData({ form: arr.data })
+                        // 教练信息
+                        const coach = await app.$get(`/lessonCoach`, { lesson_id: that.data.id })
+                        if (coach.errcode == '0') that.setData({ coach: coach.data })
+                        // 学员信息
+                        const student = await app.$get(`/lessonStudent`, { lesson_id: that.data.id, is_pay: '1' })
+                        if (student.errcode == '0') that.setData({ student: student.data })
+                    }
+                    else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady() {
-
-    },
-
+    onReady: function () { },
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow() {
+    onShow: function () {
 
     },
 
+    /**
+     * 页面上拉触底事件的处理函数
+     */
     /**
      * 生命周期函数--监听页面隐藏
      */
-    onHide() {
+    onHide: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面卸载
      */
-    onUnload() {
+    onUnload: function () {
 
     },
 
     /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+    onPullDownRefresh: function () {
 
     },
 
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage() {
+    onShareAppMessage: function () {
 
     }
 })

+ 6 - 2
pages/schAdmin/course/info.json

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

+ 123 - 0
pages/schAdmin/course/info.less

@@ -0,0 +1,123 @@
+.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;
+                    }
+
+                    button {
+                        font-size: var(--font14Size);
+                        margin: 0;
+                        background: -webkit-linear-gradient(right, lightblue, #53C9F8);
+                    }
+                }
+
+                .btn {
+                    width: 92vw;
+                    text-align: center;
+                    margin: 2vw 0 0 0;
+
+                    button {
+                        font-size: var(--font14Size);
+                        background: -webkit-linear-gradient(right, lightblue, #53C9F8);
+                    }
+                }
+            }
+        }
+
+        .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;
+    }
+}

+ 103 - 2
pages/schAdmin/course/info.wxml

@@ -1,2 +1,103 @@
-<!--pages/schAdmin/course/info.wxml-->
-<text>pages/schAdmin/course/info.wxml</text>
+<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">
+                        <form class="one" catchsubmit="onSubmit">
+                            <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>
+                        </form>
+                    </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.is_sign=='0'?'未签到':item.is_sign=='1'?'已签到':'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>课程名称:</text>
+                                    <text>{{item.lesson_id_title||'暂无'}}</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.is_sign=='0'?'未签到':item.is_sign=='1'?'已签到':'暂无'}}</text>
+                                </view>
+                                <view class="other_1">
+                                    <text>缴费金额:</text>
+                                    <text>{{item.money||'0'}}元</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>

+ 101 - 1
pages/schAdmin/course/info.wxss

@@ -1 +1,101 @@
-/* pages/schAdmin/course/info.wxss */
+.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 .a .one .one_1 button {
+  font-size: var(--font14Size);
+  margin: 0;
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
+}
+.main .two .a .one .btn {
+  width: 92vw;
+  text-align: center;
+  margin: 2vw 0 0 0;
+}
+.main .two .a .one .btn button {
+  font-size: var(--font14Size);
+  background: -webkit-linear-gradient(right, lightblue, #53C9F8);
+}
+.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;
+}

+ 8 - 0
pages/schAdmin/course/list.js

@@ -27,12 +27,20 @@ Page({
         that.setData({ skip: 0, page: 0, list: [] })
         wx.navigateTo({ url: `/pages/schAdmin/course/add?id=${item._id}` })
     },
+    // 教练
     toCoach: function (e) {
         const that = this;
         let { item } = e.currentTarget.dataset;
         that.setData({ skip: 0, page: 0, list: [] })
         wx.navigateTo({ url: `/pages/schAdmin/course/coachlist?id=${item._id}` })
     },
+    // 详情
+    toInfo: function (e) {
+        const that = this;
+        let { item } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] })
+        wx.navigateTo({ url: `/pages/schAdmin/course/info?id=${item._id}` })
+    },
     // 删除
     toDel: async function (e) {
         const that = this;

+ 4 - 5
pages/schAdmin/course/list.less

@@ -88,16 +88,15 @@
             }
 
             .btn {
-                display: flex;
-                flex-direction: row;
+                text-align: center;
 
                 button {
-                    width: 100%;
-                    padding: 2vw;
+                    width: 23vw;
+                    margin: 0 1vw 1vw 1vw;
+                    padding: 1vw;
                     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);

+ 5 - 7
pages/schAdmin/course/list.wxml

@@ -16,20 +16,18 @@
                             <view class="content">
                                 <view class="name textOver">{{item.title||'暂无'}}</view>
                                 <view class="other">课程类型:<text>{{item.zhtype||'暂无'}}</text></view>
-                                <view class="other">课程状态:<text>{{item.zhstatus||'暂无'}}</text>
-                                </view>
+                                <view class="other">课程状态:<text>{{item.zhstatus||'暂无'}}</text></view>
                                 <view class="other">开课时间:{{item.time_start||'暂无'}}
                                 </view>
-                                <view class="other">人数上限:{{item.limit||'暂无'}}
-                                </view>
                                 <view class="other">金额:<text>{{item.money||'0.00'}}</text>元
                                 </view>
                             </view>
                         </view>
                         <view class="btn">
-                            <button bindtap="toEdit" data-item="{{item}}">信息维护</button>
-                            <button bindtap="toCoach" data-item="{{item}}">教练管理</button>
-                            <button bindtap="toDel" data-item="{{item}}">删除信息</button>
+                            <button bindtap="toEdit" size="mini" data-item="{{item}}">信息维护</button>
+                            <button bindtap="toCoach" size="mini" data-item="{{item}}">教练管理</button>
+                            <button bindtap="toInfo" size="mini" data-item="{{item}}">详细信息</button>
+                            <button bindtap="toDel" size="mini" data-item="{{item}}">删除信息</button>
                         </view>
                     </view>
                 </view>

+ 4 - 5
pages/schAdmin/course/list.wxss

@@ -75,16 +75,15 @@
   color: var(--redColor);
 }
 .main .two .list .btn {
-  display: flex;
-  flex-direction: row;
+  text-align: center;
 }
 .main .two .list .btn button {
-  width: 100%;
-  padding: 2vw;
+  width: 23vw;
+  margin: 0 1vw 1vw 1vw;
+  padding: 1vw;
   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);

+ 2 - 1
pages/schAdmin/courseexam/info.js

@@ -72,7 +72,7 @@ Page({
                 const acc = await app.$get(`/dict`, { code: "lesson_type" });
                 if (acc.errcode == '0' && aee.total > 0) that.setData({ typeList: acc.data[0].list });
                 if (that.data.id) {
-                    const aee = await app.$get(`/lessonStudent/${that.data.id}`);
+                    const aee = await app.$get(`/tempLessonApply/${that.data.id}`);
                     if (aee.errcode == '0') {
                         that.setData({ student_id: aee.data.student_id })
                         that.setData({ lesson_id: aee.data.lesson_id })
@@ -94,6 +94,7 @@ Page({
                         let type = that.data.typeList.find(i => i.value == abb.data.type)
                         if (type) abb.data.zhtype = type.label;
                         that.setData({ lesInfo: abb.data });
+
                     }
                 }
             },

+ 2 - 3
pages/schAdmin/courseexam/list.wxml

@@ -16,9 +16,8 @@
                             </view>
                             <view class="content">
                                 <view class="name textOver">{{item.student_id_name||'学员姓名'}}</view>
-                                <view class="other">课程名称:<text>{{item.lesson_id||'一级'}}</text></view>
-                                <view class="other">联系电话:{{item.student_id_phone||'暂无'}}
-                                </view>
+                                <view class="other">课程名称:<text>{{item.lesson_id_title||'一级'}}</text></view>
+                                <view class="other">已付金额:<text>{{item.money||'0.00'}}元</text></view>
                             </view>
                         </view>
                         <view class="btn">

+ 1 - 1
pages/schAdmin/student/list.wxml

@@ -27,7 +27,7 @@
                         </view>
                         <view class="btn">
                             <button bindtap="toEdit" data-item="{{item}}">信息维护</button>
-                            <button bindtap="toBind" data-item="{{item}}">绑定账号</button>
+                            <button bindtap="toBind" data-item="{{item}}" wx:if="{{item.student_id_user_id==null}}">绑定账号</button>
                             <button bindtap="toDel" data-item="{{item}}">删除信息</button>
                         </view>
                     </view>

+ 2 - 2
pages/stuAdmin/course/info.wxml

@@ -34,7 +34,7 @@
                             </view>
                             <view class="one_1">
                                 <text class="text">课程费(元):</text>
-                                <text class="text1">{{form.money||'暂无'}}</text>
+                                <text class="text1">{{form.money||'0'}}</text>
                             </view>
                             <view class="one_1">
                                 <text class="text">退款期限:</text>
@@ -79,7 +79,7 @@
                                 </view>
                                 <view class="other_1">
                                     <text>缴费金额:</text>
-                                    <text>{{item.money||'暂无'}}元</text>
+                                    <text>{{item.money||'0'}}元</text>
                                 </view>
                                 <view class="other_1">
                                     <text>所属学院:</text>

+ 12 - 1
pages/stuAdmin/course/list.js

@@ -1,4 +1,5 @@
 const app = getApp()
+const moment = require("../../../utils/moment.min")
 Page({
     data: {
         frameStyle: { useTop: true, name: '课程信息', leftArrow: true, useBar: false },
@@ -38,6 +39,11 @@ Page({
         const { item } = e.currentTarget.dataset;
         wx.navigateTo({ url: `/pages/stuAdmin/course/info?id=${item._id}` })
     },
+    // 退课
+    toDrop: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+    },
     // 签到
     toSign: async function (e) {
         const that = this;
@@ -114,7 +120,12 @@ Page({
                 let info = { skip: that.data.skip, limit: that.data.limit, type: that.data.tabs.active, student_id: res.data.info._id, is_pay: '1' };
                 let arr = await app.$get(`/studentView/lessonList`, { ...info });
                 if (arr.errcode == '0') {
-                    for (const val of arr.data) { let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label; }
+                    for (const val of arr.data) {
+                        let status = statusList.find(i => i.value == val.status); if (status) val.zhStatus = status.label;
+                        let date = moment().isBefore(val.refund_hour)
+                        if (date == true) val.drop = '0'
+                        else val.drop = '1'
+                    }
                     that.setData({ list: [...that.data.list, ...arr.data] })
                     that.setData({ total: arr.total })
                 } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }

+ 2 - 2
pages/stuAdmin/course/list.wxml

@@ -25,7 +25,7 @@
                             </view>
                             <view class="btn">
                                 <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
-                                <button size="mini" type="primary" bindtap="toDrop" data-item="{{item}}">退课</button>
+                                <button wx:if="{{item.drop=='0'&&item.is_try=='0'}}" size="mini" type="primary" bindtap="toDrop" data-item="{{item}}">退课</button>
                                 <button wx:if="{{item.type=='3'&&item.is_sign=='0'}}" size="mini" type="primary" bindtap="toSign" data-item="{{item}}">签到</button>
                             </view>
                         </view>
@@ -48,7 +48,7 @@
                             </view>
                             <view class="btn">
                                 <button size="mini" type="primary" bindtap="toView" data-item="{{item}}">详细信息</button>
-                                <button size="mini" type="primary" bindtap="toDrop" data-item="{{item}}">退课</button>
+                                <button wx:if="{{item.drop=='0'&&item.is_try=='0'}}" size="mini" type="primary" bindtap="toDrop" data-item="{{item}}">退课</button>
                                 <button wx:if="{{item.type=='3'&&item.is_sign=='0'}}" size="mini" type="primary" bindtap="toSign" data-item="{{item}}">签到</button>
                             </view>
                         </view>

+ 1 - 1
pages/stuAdmin/course/sign.wxml

@@ -48,7 +48,7 @@
                                 <text class="text">是否试课:</text>
                                 <button type="primary" size="mini" bindtap="toClass">试课</button>
                             </view>
-                            <view class="btn" wx:if="{{form.type_try=='0'&&user.type=='3'&&form.sign=='0'}}">
+                            <view class="btn" wx:if="{{user.type=='3'&&form.sign=='0'}}">
                                 <button type="primary" size="mini" formType="submit">报名</button>
                             </view>
                         </form>

+ 1 - 1
utils/dict.js

@@ -65,7 +65,7 @@ export const school_menu = [
                 icon: 'icon-yonghu',
                 btn: [
                     { title: '课程管理', route: 'schAdmin/course/list', icon: 'icon-gongkaikekaifangke' },
-                    { title: '课程学员信息', route: 'schAdmin/coursestu/list', icon: 'icon-gongkaikekaifangke' },
+                    // { title: '课程学员信息', route: 'schAdmin/coursestu/list', icon: 'icon-gongkaikekaifangke' },
                     { title: '试课学员审批', route: 'schAdmin/coursetryexam/list', icon: 'icon-tianshenpi' },
                     { title: '临时上课学员', route: 'schAdmin/courseexam/list', icon: 'icon-tianshenpi' },
                 ]