From b97bfcb85b2ded3b1f380e9a98b54b836faabba5 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 28 三月 2025 14:26:35 +0800 Subject: [PATCH] 除过数字教材外的页面的登录迁移 --- packageCourse/pages/studentClass/index.js | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/packageCourse/pages/studentClass/index.js b/packageCourse/pages/studentClass/index.js index e18f442..4ba4389 100644 --- a/packageCourse/pages/studentClass/index.js +++ b/packageCourse/pages/studentClass/index.js @@ -42,11 +42,14 @@ // 閫氳繃code鏌ヨ鐝骇 getClassDetail() { - if (this.data.refCode == '') { + if (!this.data.refCode) { wx.showToast({ title: '璇疯緭鍏ラ個璇风爜', duration: 1000, icon: "none", + }) + this.setData({ + classDetail: null }) return false } @@ -56,14 +59,29 @@ app.MG.edu .getCourseClass(data) .then(res => { - if (res) { + if (res.linkProductDto) { res.classTime = moment(res.beginDate).format('YYYY-MM-DD') + '--' + moment(res.endDate).format('YYYY-MM-DD') this.setData({ classDetail: res }) + } else { + this.setData({ + classDetail: null + }) + wx.showToast({ + title: '閭�璇风爜鏃犳晥', + icon: "none" + }) } }) .catch(err => { + wx.showToast({ + title: '閭�璇风爜鏃犳晥', + icon: "none" + }) + this.setData({ + classDetail: null + }) console.log(err) }) }, @@ -78,7 +96,9 @@ // 鍏抽棴鐢宠 cancle() { this.setData({ - visible: false + visible: false, + classDetail: null, + refCode: '' }) }, @@ -161,6 +181,8 @@ classList: list, totalSize: totalSize, visible: false, + classDetail: null, + refCode: '', skeletonLoding: false, bottomLoading: false }) -- Gitblit v1.9.1