Kaynağa Gözat

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

YY 2 yıl önce
ebeveyn
işleme
be881151c0

+ 4 - 0
pages/stuAdmin/course/info.wxml

@@ -77,6 +77,10 @@
                                     <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>

+ 14 - 2
pages/stuAdmin/course/sign.js

@@ -36,12 +36,24 @@ Page({
     //试课
     toClass: function () {
         const that = this;
+        const form = that.data.form;
+        const user = that.data.user;
         wx.showModal({
             title: '提示',
             content: '您是否确定试课?',
             async success(res) {
                 if (res.confirm) {
-                    that.setData({ is_try: '1' })
+                    let arr;
+                    let params = {
+                        school_id: form.school_id,
+                        lesson_id: form._id,
+                        student_id: user.info.id,
+                    }
+                    const lesson = await app.$get(`/tryLessonApply`, { school_id: form.school_id, lesson_id: that.data.id, student_id: user.info.id })
+                    if (lesson.errcode == '0' && lesson.total > 0) arr = await app.$post(`/tryLessonApply/${lesson.data[0]._id}`, params);
+                    else arr = await app.$post(`/tryLessonApply`, params);
+                    if (arr.errcode == '0') { wx.showToast({ title: `试课申请完成`, icon: 'success', duration: 2000 }); that.watchLogin(); }
+                    else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
                 } else if (res.cancel) { }
             }
         });
@@ -65,7 +77,7 @@ Page({
                         is_try: that.data.is_try,
                         try_status: '0'
                     }
-                    const student = await app.$get(`/lessonStudent`, { lesson_id: that.data.id, student_id: user.info.id })
+                    const student = await app.$get(`/lessonStudent`, { school_id: form.school_id, lesson_id: that.data.id, student_id: user.info.id })
                     if (student.errcode == '0' && student.total > 0) arr = await app.$post(`/lessonStudent/${student.data[0]._id}`, params);
                     else arr = await app.$post(`/lessonStudent`, params);
                     if (arr.errcode == '0') { wx.showToast({ title: `报名申请完成`, icon: 'success', duration: 2000 }); that.watchLogin(); }

+ 4 - 0
pages/stuAdmin/course/sign.wxml

@@ -84,6 +84,10 @@
                                     <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>