|
@@ -6,7 +6,7 @@ import ColResult from '@/components/col-result'
|
|
|
import request from '@/helpers/request'
|
|
|
import { state } from '@/state'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { Button, Sticky, Tab, Tabs } from 'vant'
|
|
|
+import { Button, Sticky, Tab, Tabs, Toast } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './live-detail.module.less'
|
|
|
interface IProps {
|
|
@@ -64,6 +64,17 @@ export default defineComponent({
|
|
|
studentList() {
|
|
|
const live = this.live as any
|
|
|
return live.studentList || []
|
|
|
+ },
|
|
|
+ courseOffStatus() {
|
|
|
+ const live = this.live as any
|
|
|
+ let status = false
|
|
|
+ if (
|
|
|
+ (live.status === 'APPLY' && live.studentList.length === 0) ||
|
|
|
+ live.status === 'NOT_SALE'
|
|
|
+ ) {
|
|
|
+ status = true
|
|
|
+ }
|
|
|
+ return status
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -85,15 +96,18 @@ export default defineComponent({
|
|
|
methods: {
|
|
|
async cancelCourseGroup() {
|
|
|
try {
|
|
|
- const res = await request.post(
|
|
|
+ const res = await request.get(
|
|
|
'/api-teacher/courseGroup/cancelCourseGroup',
|
|
|
{
|
|
|
- data: {
|
|
|
+ params: {
|
|
|
groupId: this.groupId
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
- console.log(res)
|
|
|
+ Toast('下架成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ postMessage({ api: 'back', content: {} })
|
|
|
+ }, 500)
|
|
|
} catch {}
|
|
|
}
|
|
|
},
|
|
@@ -130,9 +144,7 @@ export default defineComponent({
|
|
|
</Tabs>
|
|
|
</SectionDetail>
|
|
|
|
|
|
- {/* {((this.live.status === 'APPLY' &&
|
|
|
- this.live.studentList.length === 0) ||
|
|
|
- this.live.status === 'NOT_SALE') && (
|
|
|
+ {this.courseOffStatus && (
|
|
|
<Sticky offsetBottom={0} position="bottom">
|
|
|
<div class={['btnGroup']} style={{ paddingTop: '12px' }}>
|
|
|
<Button
|
|
@@ -145,7 +157,7 @@ export default defineComponent({
|
|
|
</Button>
|
|
|
</div>
|
|
|
</Sticky>
|
|
|
- )} */}
|
|
|
+ )}
|
|
|
</div>
|
|
|
)
|
|
|
}
|