|
@@ -1,11 +1,12 @@
|
|
|
import request from '@/helpers/request'
|
|
|
import { useAsyncState } from '@vueuse/core'
|
|
|
import { defineComponent, ref } from 'vue'
|
|
|
-import { Cell, Skeleton } from 'vant'
|
|
|
+import { Cell, Skeleton, Popup, Button } from 'vant'
|
|
|
import Item from '../list/item'
|
|
|
import { openDefaultWebView, state } from '@/state'
|
|
|
import styles from './index.module.less'
|
|
|
import Song from '../component/song'
|
|
|
+import songEmpty from '@/common/images/song-empty.png'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
|
export default defineComponent({
|
|
@@ -15,6 +16,8 @@ export default defineComponent({
|
|
|
const router = useRouter()
|
|
|
/** 这里条数不会变动,设置固定高度避免抖动 */
|
|
|
const prevNum = ref(0)
|
|
|
+ const songStatus = ref(false)
|
|
|
+ const songItem = ref({})
|
|
|
const {
|
|
|
isLoading,
|
|
|
state: resState,
|
|
@@ -31,6 +34,20 @@ export default defineComponent({
|
|
|
null
|
|
|
)
|
|
|
|
|
|
+ const onSure = async () => {
|
|
|
+ try {
|
|
|
+ request.get('/music/sheet/practice/del/' + songItem.value.id , {
|
|
|
+ prefix:
|
|
|
+ state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
|
|
|
+ })
|
|
|
+ execute()
|
|
|
+
|
|
|
+ songStatus.value = false
|
|
|
+ } catch {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
expose({
|
|
|
reload: execute
|
|
|
})
|
|
@@ -54,6 +71,11 @@ export default defineComponent({
|
|
|
showTitleImg
|
|
|
list={list}
|
|
|
onDetail={(item: any) => {
|
|
|
+ if(item.play === 1) {
|
|
|
+ songItem.value = item
|
|
|
+ songStatus.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
const url =
|
|
|
location.origin +
|
|
|
location.pathname +
|
|
@@ -72,6 +94,21 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</>
|
|
|
)}
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ show={songStatus.value}
|
|
|
+ class={styles.songEfficacy}
|
|
|
+ round
|
|
|
+ onClose={() => (songStatus.value = false)}
|
|
|
+ >
|
|
|
+ <div class={styles.songContainer}>
|
|
|
+ <div class={styles.title}>该曲目已失效</div>
|
|
|
+ <img src={songEmpty} />
|
|
|
+ <div class={styles.btnGroup}>
|
|
|
+ <Button round onClick={onSure}>我知道了</Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
</>
|
|
|
)
|
|
|
}
|