|
@@ -25,6 +25,8 @@ import ColPopup from '@/components/col-popup'
|
|
|
import StudentInfo from './model/student-info'
|
|
|
import StudentConfirm from './model/student-info/student-confirm'
|
|
|
import { useEventListener, useWindowScroll } from '@vueuse/core'
|
|
|
+import { state } from '@/state'
|
|
|
+import { callbackify } from 'util'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `./images/${fileName}`
|
|
@@ -71,7 +73,8 @@ export default defineComponent({
|
|
|
studentStatus: false,
|
|
|
studentConfirm: false,
|
|
|
studentChangeObject: {} as any,
|
|
|
- background: 'transparent'
|
|
|
+ background: 'transparent',
|
|
|
+ setLoading: false
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -118,12 +121,15 @@ export default defineComponent({
|
|
|
},
|
|
|
async getList() {
|
|
|
try {
|
|
|
+ if (this.setLoading) return
|
|
|
+ this.setLoading = true
|
|
|
const res = await request.post(
|
|
|
'/api-teacher/courseSchedule/selectCourseList',
|
|
|
{
|
|
|
data: this.params
|
|
|
}
|
|
|
)
|
|
|
+ this.setLoading = false
|
|
|
this.loading = false
|
|
|
const result = res.data || {}
|
|
|
// 处理重复请求数据
|
|
@@ -198,6 +204,18 @@ export default defineComponent({
|
|
|
this.onSearch()
|
|
|
}, 1000)
|
|
|
} catch {}
|
|
|
+ },
|
|
|
+ onTeacherAuth(callBack: any) {
|
|
|
+ // 是否老师认证
|
|
|
+ // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过,可用值:UNPAALY,DOING,PASS,UNPASS
|
|
|
+ const data = state.user.data
|
|
|
+ if (data.entryStatus === 'PASS') {
|
|
|
+ callBack && callBack()
|
|
|
+ } else if (data.entryStatus === 'DOING') {
|
|
|
+ Toast('认证审核中,请稍后再试')
|
|
|
+ } else {
|
|
|
+ this.$router.push('/teacherCert')
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
render() {
|
|
@@ -240,11 +258,10 @@ export default defineComponent({
|
|
|
size="small"
|
|
|
class={styles.chargeTimer}
|
|
|
onClick={() => {
|
|
|
- this.$router.push({
|
|
|
- path: '/accountRechargeTimer',
|
|
|
- query: {
|
|
|
- remainTime: this.remain.remainTime
|
|
|
- }
|
|
|
+ this.onTeacherAuth(() => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/accountRechargeTimer'
|
|
|
+ })
|
|
|
})
|
|
|
}}
|
|
|
>
|
|
@@ -268,7 +285,9 @@ export default defineComponent({
|
|
|
round
|
|
|
block
|
|
|
onClick={() => {
|
|
|
- this.shareStatus = true
|
|
|
+ this.onTeacherAuth(() => {
|
|
|
+ this.shareStatus = true
|
|
|
+ })
|
|
|
}}
|
|
|
>
|
|
|
<img src={getAssetsHomeFile('icon_invite_student.png')} />
|
|
@@ -279,7 +298,9 @@ export default defineComponent({
|
|
|
round
|
|
|
block
|
|
|
onClick={() => {
|
|
|
- this.$router.push('/classArrangement')
|
|
|
+ this.onTeacherAuth(() => {
|
|
|
+ this.$router.push('/classArrangement')
|
|
|
+ })
|
|
|
}}
|
|
|
>
|
|
|
<img src={getAssetsHomeFile('icon_class_plan.png')} />
|
|
@@ -334,6 +355,7 @@ export default defineComponent({
|
|
|
{this.list.map((item: any) => (
|
|
|
<Course
|
|
|
item={item}
|
|
|
+ operation={item.status === 'NOT_START' ? true : false}
|
|
|
onCourseDelete={this.onCourseDelete}
|
|
|
onStudentAdjust={(item: any) => {
|
|
|
console.log(item)
|
|
@@ -419,8 +441,9 @@ export default defineComponent({
|
|
|
<StudentConfirm
|
|
|
courseInfo={this.timeUpdateInfo}
|
|
|
studentObject={this.studentChangeObject}
|
|
|
- onSubmit={(item: any) => {
|
|
|
- this.onStudentChange(item)
|
|
|
+ onSubmit={async (item: any) => {
|
|
|
+ await this.onStudentChange(item)
|
|
|
+ await this._init()
|
|
|
}}
|
|
|
/>
|
|
|
</Popup>
|