|
@@ -7,7 +7,7 @@ import {
|
|
|
ref,
|
|
|
watch
|
|
|
} from 'vue'
|
|
|
-import { Sticky, List, Popup, Icon, Switch, Tabs, Tab } from 'vant'
|
|
|
+import { Sticky, List, Popup, Icon, Switch, Tabs, Tab, Button } from 'vant'
|
|
|
import Search from '@/components/col-search'
|
|
|
import request from '@/helpers/request'
|
|
|
// import Item from './item'
|
|
@@ -27,6 +27,7 @@ import bgImg from './icons/bgImg.png'
|
|
|
import iconSearch from './icons/icon_search.png'
|
|
|
import { browser } from '@/helpers/utils'
|
|
|
import TheSticky from '@/components/the-sticky'
|
|
|
+import deepClone from '@/helpers/deep-clone'
|
|
|
|
|
|
const noop = () => {
|
|
|
//
|
|
@@ -87,6 +88,12 @@ export default defineComponent({
|
|
|
|
|
|
const stickyHeight = ref(height || 0)
|
|
|
|
|
|
+ const searchObj = reactive({
|
|
|
+ searchStatus: false,
|
|
|
+ tagId: '',
|
|
|
+ chargeType: ''
|
|
|
+ })
|
|
|
+
|
|
|
const updateStickyHeight = (height: number) => {
|
|
|
stickyHeight.value = height
|
|
|
}
|
|
@@ -163,9 +170,10 @@ export default defineComponent({
|
|
|
|
|
|
const params = reactive({
|
|
|
search: (route.query.search as string) || '',
|
|
|
- musicSortType: (route.query.type as string) || "",
|
|
|
+ musicSortType: (route.query.type as string) || '',
|
|
|
// exquisiteFlag: 1,
|
|
|
- musicTagIds: route.query.tagids || '',
|
|
|
+ musicTagIds: route.query.tagids || '', // 标签
|
|
|
+ changeType: '', // 曲目类型
|
|
|
page: 1,
|
|
|
...defauleParams,
|
|
|
...tempParams
|
|
@@ -227,17 +235,17 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
// 设置默认声部
|
|
|
- const setDefaultSubject = async (subjectId: any) => {
|
|
|
- try {
|
|
|
- await request.post('/api-teacher/teacher/defaultSubject', {
|
|
|
- params: {
|
|
|
- subjectId
|
|
|
- }
|
|
|
- })
|
|
|
- } catch {
|
|
|
- //
|
|
|
- }
|
|
|
- }
|
|
|
+ // const setDefaultSubject = async (subjectId: any) => {
|
|
|
+ // try {
|
|
|
+ // await request.post('/api-teacher/teacher/defaultSubject', {
|
|
|
+ // params: {
|
|
|
+ // subjectId
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } catch {
|
|
|
+ // //
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
const onComfirm = tags => {
|
|
|
const tempTags: any = {}
|
|
@@ -336,7 +344,7 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
return () => {
|
|
|
- // const tagList = ((state.value && state.value.data) as any) || []
|
|
|
+ const tagList = ((state.value && state.value.data) as any) || []
|
|
|
return (
|
|
|
<>
|
|
|
{!hideSearch && (
|
|
@@ -367,7 +375,7 @@ export default defineComponent({
|
|
|
class={styles.tabSection}
|
|
|
v-model:active={params.musicSortType}
|
|
|
shrink
|
|
|
- onClick-tab={(val) => {
|
|
|
+ onClick-tab={val => {
|
|
|
params.musicSortType = val.name
|
|
|
onSearch(params.search)
|
|
|
}}
|
|
@@ -379,29 +387,6 @@ export default defineComponent({
|
|
|
</Tabs>
|
|
|
</div>
|
|
|
)
|
|
|
- // right: () =>
|
|
|
- // !isAudit.value && (
|
|
|
- // <span
|
|
|
- // class={styles.fleg}
|
|
|
- // onClick={() => {
|
|
|
- // // 不要看这个字段的意思
|
|
|
- // exquisiteFlag.value != exquisiteFlag.value
|
|
|
- // useSubjectId(
|
|
|
- // SubjectEnum.MUSIC_FREE,
|
|
|
- // JSON.stringify({
|
|
|
- // chargeType: exquisiteFlag.value
|
|
|
- // }),
|
|
|
- // 'set'
|
|
|
- // )
|
|
|
- // data.value = null
|
|
|
- // params.page = 1
|
|
|
- // FetchList()
|
|
|
- // }}
|
|
|
- // >
|
|
|
- // <Switch v-model={exquisiteFlag.value} size="20px" />
|
|
|
- // <span>免费</span>
|
|
|
- // </span>
|
|
|
- // )
|
|
|
}}
|
|
|
/>
|
|
|
<Search
|
|
@@ -409,25 +394,25 @@ export default defineComponent({
|
|
|
background="transparent"
|
|
|
inputBackground="transparent"
|
|
|
leftIcon={iconSearch}
|
|
|
- // v-slots={{
|
|
|
- // left: () => (
|
|
|
- // <div
|
|
|
- // class={styles.label}
|
|
|
- // onClick={() => (subject.show = true)}
|
|
|
- // >
|
|
|
- // {baseState.platformType === 'TEACHER'
|
|
|
- // ? teacherDetaultSubject.value.name
|
|
|
- // : subject.name}
|
|
|
-
|
|
|
- // <Icon
|
|
|
- // classPrefix="iconfont"
|
|
|
- // name="down"
|
|
|
- // size={12}
|
|
|
- // color="#fff"
|
|
|
- // />
|
|
|
- // </div>
|
|
|
- // )
|
|
|
- // }}
|
|
|
+ v-slots={{
|
|
|
+ left: () => (
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.label,
|
|
|
+ searchObj.searchStatus ? styles.labelActive : ''
|
|
|
+ ]}
|
|
|
+ onClick={() => (searchObj.searchStatus = true)}
|
|
|
+ >
|
|
|
+ 筛选
|
|
|
+ <Icon
|
|
|
+ classPrefix="iconfont"
|
|
|
+ name="down"
|
|
|
+ size={12}
|
|
|
+ color="#fff"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
/>
|
|
|
{/* <Tabs
|
|
|
shrink
|
|
@@ -457,25 +442,26 @@ export default defineComponent({
|
|
|
inputBackground="white"
|
|
|
// leftIcon={iconSearch}
|
|
|
class={styles.searchGroup}
|
|
|
- // v-slots={{
|
|
|
- // left: () => (
|
|
|
- // <div
|
|
|
- // class={[styles.label, styles.searchs]}
|
|
|
- // onClick={() => (subject.show = true)}
|
|
|
- // >
|
|
|
- // {baseState.platformType === 'TEACHER'
|
|
|
- // ? teacherDetaultSubject.value.name
|
|
|
- // : subject.name}
|
|
|
-
|
|
|
- // <Icon
|
|
|
- // classPrefix="iconfont"
|
|
|
- // name="down"
|
|
|
- // size={12}
|
|
|
- // color="#949597"
|
|
|
- // />
|
|
|
- // </div>
|
|
|
- // )
|
|
|
- // }}
|
|
|
+ v-slots={{
|
|
|
+ left: () => (
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.label,
|
|
|
+ styles.searchs,
|
|
|
+ searchObj.searchStatus ? styles.labelActive : ''
|
|
|
+ ]}
|
|
|
+ onClick={() => (searchObj.searchStatus = true)}
|
|
|
+ >
|
|
|
+ 筛选
|
|
|
+ <Icon
|
|
|
+ classPrefix="iconfont"
|
|
|
+ name="down"
|
|
|
+ size={12}
|
|
|
+ color="#333"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
/>
|
|
|
</Sticky>
|
|
|
) : (
|
|
@@ -565,6 +551,120 @@ export default defineComponent({
|
|
|
onComfirm={onComfirmSubject}
|
|
|
/>
|
|
|
</Popup> */}
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ round
|
|
|
+ closeable
|
|
|
+ safe-area-inset-bottom
|
|
|
+ position="bottom"
|
|
|
+ v-model:show={searchObj.searchStatus}
|
|
|
+ >
|
|
|
+ <div class={styles.popupContainer}>
|
|
|
+ <div class={styles.popupTitle}>筛选</div>
|
|
|
+
|
|
|
+ <div class={styles.popupSearchList}>
|
|
|
+ <div class={styles.popupSection}>
|
|
|
+ <div class={styles.title}>
|
|
|
+ <span>标签</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={[styles.timeCount, styles.timeSubject]}>
|
|
|
+ <p
|
|
|
+ class={searchObj.tagId === '' ? styles.active : ''}
|
|
|
+ onClick={() => (searchObj.tagId = '')}
|
|
|
+ >
|
|
|
+ 全部
|
|
|
+ </p>
|
|
|
+ {tagList.map((item: any) => (
|
|
|
+ <p
|
|
|
+ class={searchObj.tagId === item.id ? styles.active : ''}
|
|
|
+ onClick={() => {
|
|
|
+ searchObj.tagId = item.id
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {item.name}
|
|
|
+ </p>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.popupSection}>
|
|
|
+ <div class={styles.title}>
|
|
|
+ <span>类型</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={[styles.timeCount, styles.timeSubject]}>
|
|
|
+ <p
|
|
|
+ class={searchObj.chargeType === '' ? styles.active : ''}
|
|
|
+ onClick={() => (searchObj.chargeType = '')}
|
|
|
+ >
|
|
|
+ 全部曲目
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <p
|
|
|
+ class={
|
|
|
+ searchObj.chargeType === 'VIP' ? styles.active : ''
|
|
|
+ }
|
|
|
+ onClick={() => {
|
|
|
+ searchObj.chargeType = 'VIP'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 会员曲目
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ class={
|
|
|
+ searchObj.chargeType === 'CHARGE' ? styles.active : ''
|
|
|
+ }
|
|
|
+ onClick={() => {
|
|
|
+ searchObj.chargeType = 'CHARGE'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 点播曲目
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ class={
|
|
|
+ searchObj.chargeType === 'FREE' ? styles.active : ''
|
|
|
+ }
|
|
|
+ onClick={() => {
|
|
|
+ searchObj.chargeType = 'FREE'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 免费曲目
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.popupBottom}>
|
|
|
+ <Button
|
|
|
+ round
|
|
|
+ block
|
|
|
+ type="default"
|
|
|
+ onClick={() => {
|
|
|
+ searchObj.tagId = JSON.parse(JSON.stringify(params.musicTagIds))
|
|
|
+ searchObj.chargeType = JSON.parse(JSON.stringify(params.changeType))
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 重置
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ round
|
|
|
+ block
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ params.musicTagIds = JSON.parse(JSON.stringify(searchObj.tagId))
|
|
|
+ params.changeType = JSON.parse(JSON.stringify(searchObj.chargeType))
|
|
|
+ data.value = null
|
|
|
+ params.page = 1
|
|
|
+ FetchList()
|
|
|
+ searchObj.searchStatus = false
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 确定
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
</>
|
|
|
)
|
|
|
}
|