|
@@ -71,7 +71,7 @@ Page({
|
|
|
wx.getStorage({
|
|
|
key: 'user',
|
|
|
success: async (res) => {
|
|
|
- let obj = { openid: res.data.openid, money: money, school_id: form.school_id, payer_id: user.info.id, payer_role: payer_role, pay_for: 'lessonStudent' }
|
|
|
+ let obj = { openid: res.data.openid, money: 0.1, school_id: form.school_id, payer_id: user.info.id, payer_role: payer_role, pay_for: 'lessonStudent' }
|
|
|
const arr = await app.$post(`/payOrder`, obj)
|
|
|
if (arr.errcode == '0') {
|
|
|
wx.requestPayment({
|
|
@@ -81,7 +81,7 @@ Page({
|
|
|
"signType": arr.data.wxSign.signType,
|
|
|
"paySign": arr.data.wxSign.paySign,
|
|
|
"success": async function (res) {
|
|
|
- let params = { school_id: form.school_id, lesson_id: form._id, student_id: user.info.id, money: money, is_try: that.data.is_try, pay_id: arr.data.data._id }
|
|
|
+ let params = { school_id: form.school_id, lesson_id: form._id, student_id: user.info.id, money: money, is_try: that.data.is_try, pay_id: arr.data.data._id, is_pay: '1' }
|
|
|
let lessonStudent = await app.$post(`/lessonStudent`, params);
|
|
|
if (lessonStudent.errcode == '0') {
|
|
|
wx.showToast({ title: `报名申请完成`, icon: 'success', duration: 2000 });
|
|
@@ -141,13 +141,13 @@ Page({
|
|
|
const lesson = await app.$post(`/tryLessonApply/checkCanUse`, { school_id: arr.data.school_id, lesson_id: that.data.id, student_id: res.data.info.id })
|
|
|
if (lesson.errcode == '0') arr.data.type_try = '0';
|
|
|
else wx.showToast({ title: `${lesson.errmsg}`, icon: 'none', duration: 2000 })
|
|
|
- const lessonStudent = await app.$get(`/lessonStudent`, { school_id: arr.data.school_id, student_id: res.data.info.id, lesson_id: that.data.id })
|
|
|
- if (lessonStudent.errcode == '0' && lessonStudent.total > 0) arr.data.sign = '1';
|
|
|
- else arr.data.sign = '0';
|
|
|
+ const lessonStudent = await app.$post(`/lessonStudent/checkCanUse`, { school_id: arr.data.school_id, student_id: res.data.info.id, lesson_id: that.data.id })
|
|
|
+ if (lessonStudent.errcode == '0') arr.data.sign = '0';
|
|
|
+ else arr.data.sign = '1';
|
|
|
}
|
|
|
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 })
|
|
|
+ const student = await app.$get(`/lessonStudent`, { lesson_id: that.data.id, is_pay: '1' })
|
|
|
if (student.errcode == '0') that.setData({ student: student.data })
|
|
|
that.setData({ form: arr.data })
|
|
|
} else {
|