|
@@ -1,8 +1,8 @@
|
|
|
-import { defineComponent, reactive, ref } from 'vue'
|
|
|
-import { Sticky, List, Popup, Icon } from 'vant'
|
|
|
+import { defineComponent, nextTick, onMounted, reactive, ref } from 'vue'
|
|
|
+import { Sticky, List, Popup, Icon, Switch } from 'vant'
|
|
|
import Search from '@/components/col-search'
|
|
|
import request from '@/helpers/request'
|
|
|
-import Item from './item'
|
|
|
+// import Item from './item'
|
|
|
import SelectTag from '../search/select-tag'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import ColResult from '@/components/col-result'
|
|
@@ -12,8 +12,12 @@ import { state } from '@/state'
|
|
|
import SelectSubject from '../search/select-subject'
|
|
|
import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
|
|
|
import Song from '../component/song'
|
|
|
+import ColHeader from '@/components/col-header'
|
|
|
+import { useRect } from '@vant/use'
|
|
|
|
|
|
-const noop = () => {}
|
|
|
+const noop = () => {
|
|
|
+ //
|
|
|
+}
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'MusicList',
|
|
@@ -82,6 +86,7 @@ export default defineComponent({
|
|
|
//
|
|
|
const params = reactive({
|
|
|
search: (route.query.search as string) || '',
|
|
|
+ // exquisiteFlag: 1,
|
|
|
musicTagIds: route.query.tagids || '',
|
|
|
page: 1,
|
|
|
...defauleParams,
|
|
@@ -92,6 +97,7 @@ export default defineComponent({
|
|
|
const finished = ref(false)
|
|
|
const isError = ref(false)
|
|
|
const tagVisibility = ref(false)
|
|
|
+ const exquisiteFlag = ref(false)
|
|
|
const apiSuffix = ref(
|
|
|
state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
|
|
|
)
|
|
@@ -141,7 +147,17 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const onComfirm = tags => {
|
|
|
- const d = Object.values(tags).flat().filter(Boolean).join(',')
|
|
|
+ const tempTags: any = {}
|
|
|
+ // 单独处理乐谱类型
|
|
|
+ for (const tag in tags) {
|
|
|
+ if (Number(tag) === -1) {
|
|
|
+ exquisiteFlag.value = tags[tag][0] ? true : false
|
|
|
+ } else {
|
|
|
+ tempTags[tag] = tags[tag]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const d = Object.values(tempTags).flat().filter(Boolean).join(',')
|
|
|
params.musicTagIds = d
|
|
|
params.page = 1
|
|
|
data.value = null
|
|
@@ -166,6 +182,7 @@ export default defineComponent({
|
|
|
FetchList()
|
|
|
subject.show = false
|
|
|
}
|
|
|
+
|
|
|
const getSubject: any = useSubjectId(SubjectEnum.SEARCH)
|
|
|
const subject = reactive({
|
|
|
show: false,
|
|
@@ -181,6 +198,32 @@ export default defineComponent({
|
|
|
|
|
|
return () => (
|
|
|
<>
|
|
|
+ {!hideSearch && (
|
|
|
+ <Sticky class={styles.sticky}>
|
|
|
+ <Search
|
|
|
+ showAction
|
|
|
+ onSearch={onSearch}
|
|
|
+ onFilter={() => (tagVisibility.value = true)}
|
|
|
+ filterDot={!!params.musicTagIds}
|
|
|
+ v-slots={{
|
|
|
+ left: () => (
|
|
|
+ <div
|
|
|
+ class={styles.label}
|
|
|
+ onClick={() => (subject.show = true)}
|
|
|
+ >
|
|
|
+ {subject.name}
|
|
|
+ <Icon
|
|
|
+ classPrefix="iconfont"
|
|
|
+ name="down"
|
|
|
+ size={12}
|
|
|
+ color="#333"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Sticky>
|
|
|
+ )}
|
|
|
<List
|
|
|
loading={loading.value}
|
|
|
finished={finished.value}
|
|
@@ -190,33 +233,6 @@ export default defineComponent({
|
|
|
onLoad={FetchList}
|
|
|
error={isError.value}
|
|
|
>
|
|
|
- {!hideSearch && (
|
|
|
- <Sticky class={styles.sticky}>
|
|
|
- <Search
|
|
|
- showAction
|
|
|
- onSearch={onSearch}
|
|
|
- onFilter={() => (tagVisibility.value = true)}
|
|
|
- filterDot={!!params.musicTagIds}
|
|
|
- v-slots={{
|
|
|
- left: () => (
|
|
|
- <div
|
|
|
- class={styles.label}
|
|
|
- onClick={() => (subject.show = true)}
|
|
|
- >
|
|
|
- {subject.name}
|
|
|
- <Icon
|
|
|
- classPrefix="iconfont"
|
|
|
- name="down"
|
|
|
- size={12}
|
|
|
- color="#333"
|
|
|
- />
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- />
|
|
|
- </Sticky>
|
|
|
- )}
|
|
|
-
|
|
|
{data.value && data.value.rows.length ? (
|
|
|
<div class={styles.alumnList}>
|
|
|
<Song
|
|
@@ -227,30 +243,10 @@ export default defineComponent({
|
|
|
} else {
|
|
|
onItemClick?.(item)
|
|
|
}
|
|
|
- // if (onItemClick === noop || !onItemClick) {
|
|
|
- // musicBuy(item, () => {}, {
|
|
|
- // albumId: route.params.id,
|
|
|
- // albumName: albumDetail.value?.albumName
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // onItemClick(item)
|
|
|
- // }
|
|
|
}}
|
|
|
/>
|
|
|
</div>
|
|
|
) : (
|
|
|
- // data.value.rows.map(item => (
|
|
|
- // <Item
|
|
|
- // data={item}
|
|
|
- // onClick={() => {
|
|
|
- // if (onItemClick === noop) {
|
|
|
- // musicBuy(item)
|
|
|
- // } else {
|
|
|
- // onItemClick?.(item)
|
|
|
- // }
|
|
|
- // }}
|
|
|
- // />
|
|
|
- // ))
|
|
|
!loading.value && (
|
|
|
<ColResult
|
|
|
tips="暂无曲目"
|
|
@@ -270,8 +266,11 @@ export default defineComponent({
|
|
|
onUpdate:show={val => (tagVisibility.value = val)}
|
|
|
>
|
|
|
<SelectTag
|
|
|
+ exquisiteFlag
|
|
|
onConfirm={onComfirm}
|
|
|
- onCancel={() => {}}
|
|
|
+ onCancel={() => {
|
|
|
+ //
|
|
|
+ }}
|
|
|
defaultValue={route.query.tagids as string}
|
|
|
/>
|
|
|
</Popup>
|