|
@@ -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 }) }
|