|
@@ -10,7 +10,18 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
import request from '@/helpers/request'
|
|
|
import ColHeader from '@/components/col-header'
|
|
|
import { postMessage } from '@/helpers/native-message'
|
|
|
-import { Button, Dialog, Icon, Image, List, NavBar, Popup, Sticky } from 'vant'
|
|
|
+import {
|
|
|
+ Button,
|
|
|
+ Dialog,
|
|
|
+ DropdownItem,
|
|
|
+ DropdownMenu,
|
|
|
+ Icon,
|
|
|
+ Image,
|
|
|
+ List,
|
|
|
+ NavBar,
|
|
|
+ Popup,
|
|
|
+ Sticky
|
|
|
+} from 'vant'
|
|
|
// import classNames from 'classnames'
|
|
|
// import Footer from '../album/footer'
|
|
|
// import FavoriteIcon from '../album/favorite.svg'
|
|
@@ -24,21 +35,24 @@ import { openDefaultWebView, state } from '@/state'
|
|
|
import IconPan from './pan.png'
|
|
|
import oStart from './oStart.png'
|
|
|
import iStart from './iStart.png'
|
|
|
-import Title from '../component/title'
|
|
|
+// import Title from '../component/title'
|
|
|
import Song from '../component/song'
|
|
|
import ColResult from '@/components/col-result'
|
|
|
-import MusicGrid from '../component/music-grid'
|
|
|
+// import MusicGrid from '../component/music-grid'
|
|
|
import { useEventTracking } from '@/helpers/hooks'
|
|
|
-import ColSticky from '@/components/col-sticky'
|
|
|
+// import ColSticky from '@/components/col-sticky'
|
|
|
import { moneyFormat } from '@/helpers/utils'
|
|
|
import { orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import iconShare from '../album/icon_share.svg'
|
|
|
import iconShare2 from '../album/icon_share2.svg'
|
|
|
import ColShare from '@/components/col-share'
|
|
|
-import iconShareMusic from '/src/views/music/component/images/icon_album_active.png'
|
|
|
+// import iconShareMusic from '/src/views/music/component/images/icon_album_active.png'
|
|
|
import SongShare from '../component/song-share'
|
|
|
import icon_music_list from './icon_music_list.png'
|
|
|
import SelectSubject from '../search/select-subject'
|
|
|
+import TheSticky from '@/components/the-sticky'
|
|
|
+import ColSearch from '@/components/col-search'
|
|
|
+import SearchGroup from './search-group'
|
|
|
|
|
|
const noop = () => {}
|
|
|
|
|
@@ -56,17 +70,20 @@ export default defineComponent({
|
|
|
const route = useRoute()
|
|
|
const params = reactive({
|
|
|
search: '',
|
|
|
- relatedNum: 6, //相关专辑数
|
|
|
+ // relatedNum: 6, //相关专辑数
|
|
|
+ musicSheetName: '',
|
|
|
+ albumCategoryLevelId: null,
|
|
|
+ albumCategoryTypeId: null,
|
|
|
page: 1,
|
|
|
- rows: 200
|
|
|
+ rows: 20
|
|
|
})
|
|
|
+ const title = ref(' ')
|
|
|
const albumDetail = ref<any>(null)
|
|
|
- // const data = ref<any>(null)
|
|
|
const rows = ref<any[]>([])
|
|
|
const loading = ref(false)
|
|
|
const aId = Number(route.query.activityId) || 0
|
|
|
const studentActivityId = ref(aId)
|
|
|
- // const finished = ref(false)
|
|
|
+ const finished = ref(false)
|
|
|
const isError = ref(false)
|
|
|
const favorited = ref(0)
|
|
|
const albumFavoriteCount = ref(0)
|
|
@@ -74,18 +91,19 @@ export default defineComponent({
|
|
|
const background = ref<string>('rgba(55, 205, 177, 0)')
|
|
|
const color = ref<string>('#fff')
|
|
|
const heightInfo = ref<any>('auto')
|
|
|
+
|
|
|
+ const dropdownItemRef = ref()
|
|
|
+
|
|
|
const subjects = reactive({
|
|
|
show: false,
|
|
|
name: route.query.subjectName || '全部声部',
|
|
|
id: route.query.subjectId || null
|
|
|
})
|
|
|
|
|
|
- const FetchList = async (id?: any) => {
|
|
|
- if (loading.value) {
|
|
|
- return
|
|
|
- }
|
|
|
- loading.value = true
|
|
|
- isError.value = false
|
|
|
+ const albumLevel = ref([])
|
|
|
+ const albumType = ref([])
|
|
|
+
|
|
|
+ const FetchDetail = async (id?: any) => {
|
|
|
try {
|
|
|
const res = await request.post('/music/album/detail', {
|
|
|
prefix:
|
|
@@ -93,11 +111,13 @@ export default defineComponent({
|
|
|
data: {
|
|
|
id: id || route.params.id,
|
|
|
...params,
|
|
|
+ queryMusicSheet: false,
|
|
|
+ queryCategory: true,
|
|
|
+ queryRelatedAlbum: false,
|
|
|
subjectIds: subjects.id
|
|
|
}
|
|
|
})
|
|
|
- const { musicSheetList, ...rest } = res.data
|
|
|
- rows.value = [...musicSheetList.rows]
|
|
|
+ const { albumLevelList, albumTypeList, ...rest } = res.data
|
|
|
const musicTagNames = rest?.musicTagNames
|
|
|
? rest?.musicTagNames?.split(',')
|
|
|
: []
|
|
@@ -105,8 +125,36 @@ export default defineComponent({
|
|
|
...rest,
|
|
|
musicTagNames
|
|
|
}
|
|
|
+ albumLevel.value = albumLevelList || []
|
|
|
+ albumType.value = albumTypeList || []
|
|
|
+
|
|
|
favorited.value = rest.favorite
|
|
|
albumFavoriteCount.value = rest.albumFavoriteCount
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const FetchList = async (id?: any) => {
|
|
|
+ if (loading.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ loading.value = true
|
|
|
+ isError.value = false
|
|
|
+ try {
|
|
|
+ const { data } = await request.post('/music/album/musicPage', {
|
|
|
+ prefix:
|
|
|
+ state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
|
|
|
+ data: {
|
|
|
+ id: id || route.params.id,
|
|
|
+ ...params,
|
|
|
+ subjectIds: subjects.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const result = (rows.value || []).concat(data.rows || [])
|
|
|
+ rows.value = result
|
|
|
+ params.page = data.pageNo + 1
|
|
|
+ finished.value = data.pageNo >= data.totalPage
|
|
|
} catch (error) {
|
|
|
isError.value = true
|
|
|
}
|
|
@@ -115,30 +163,23 @@ export default defineComponent({
|
|
|
|
|
|
const favoriteLoading = ref(false)
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- FetchList()
|
|
|
- useEventListener(document, 'scroll', evt => {
|
|
|
- const { y } = useWindowScroll()
|
|
|
- if (y.value > 20) {
|
|
|
- background.value = `rgba(255, 255, 255)`
|
|
|
- color.value = 'black'
|
|
|
- // postMessage({
|
|
|
- // api: 'backIconChange',
|
|
|
- // content: { iconStyle: 'black' }
|
|
|
- // })
|
|
|
- } else {
|
|
|
- background.value = 'transparent'
|
|
|
- color.value = '#fff'
|
|
|
- // postMessage({
|
|
|
- // api: 'backIconChange',
|
|
|
- // content: { iconStyle: 'white' }
|
|
|
- // })
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- useEventTracking('专辑')
|
|
|
+ FetchDetail()
|
|
|
+ FetchList()
|
|
|
+ useEventListener(document, 'scroll', () => {
|
|
|
+ const { y } = useWindowScroll()
|
|
|
+ if (y.value > 20) {
|
|
|
+ background.value = `rgba(255, 255, 255)`
|
|
|
+ color.value = 'black'
|
|
|
+ title.value = albumDetail.value?.albumName || ' '
|
|
|
+ } else {
|
|
|
+ background.value = 'transparent'
|
|
|
+ color.value = '#fff'
|
|
|
+ title.value = ' '
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+ useEventTracking('专辑')
|
|
|
+
|
|
|
const toggleFavorite = async (id: number) => {
|
|
|
favoriteLoading.value = true
|
|
|
try {
|
|
@@ -173,7 +214,7 @@ export default defineComponent({
|
|
|
|
|
|
const res = await request.post('/userOrder/getPendingOrder', {
|
|
|
prefix:
|
|
|
- state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
|
|
|
+ state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
|
|
|
data: {
|
|
|
goodType: 'ALBUM',
|
|
|
bizId: album.id
|
|
@@ -251,7 +292,6 @@ export default defineComponent({
|
|
|
const userId = state.user.data.userId
|
|
|
const id = route.params.id
|
|
|
let activityId = 0
|
|
|
- console.log(state.user, userId)
|
|
|
if (state.platformType === 'TEACHER') {
|
|
|
const res = await request.post('/api-teacher/open/vipProfit', {
|
|
|
data: {
|
|
@@ -286,6 +326,7 @@ export default defineComponent({
|
|
|
<ColHeader
|
|
|
background={background.value}
|
|
|
border={false}
|
|
|
+ title={title.value}
|
|
|
color={color.value}
|
|
|
backIconColor="white"
|
|
|
onHeaderBack={() => {
|
|
@@ -372,7 +413,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.alumnContainer}>
|
|
|
<div class={styles.alumnList}>
|
|
|
- <Title title="曲目列表" isMore={false}>
|
|
|
+ {/* <Title title="曲目列表" isMore={false}>
|
|
|
{{
|
|
|
right: () =>
|
|
|
albumDetail.value?.albumType === 'CONCERT' && (
|
|
@@ -387,39 +428,88 @@ export default defineComponent({
|
|
|
</div>
|
|
|
)
|
|
|
}}
|
|
|
- </Title>
|
|
|
- <Song
|
|
|
- list={rows.value}
|
|
|
- onDetail={(item: any) => {
|
|
|
- if (onItemClick === noop || !onItemClick) {
|
|
|
- const url =
|
|
|
- location.origin +
|
|
|
- location.pathname +
|
|
|
- '#/music-detail?id=' +
|
|
|
- item.id +
|
|
|
- '&albumId=' +
|
|
|
- route.params.id
|
|
|
- openDefaultWebView(url, () => {
|
|
|
- router.push({
|
|
|
- path: '/music-detail',
|
|
|
- query: {
|
|
|
- id: item.id,
|
|
|
- albumId: route.params.id
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- onItemClick(item)
|
|
|
- }
|
|
|
+ </Title> */}
|
|
|
+ <ColSearch
|
|
|
+ class={styles.searchSection}
|
|
|
+ background="transparent"
|
|
|
+ placeholder="请输入曲目关键词"
|
|
|
+ onSearch={(val: string) => {
|
|
|
+ params.musicSheetName = val
|
|
|
+ rows.value = []
|
|
|
+ params.page = 1
|
|
|
+ FetchList()
|
|
|
+ }}
|
|
|
+ v-slots={{
|
|
|
+ left: () =>
|
|
|
+ albumLevel.value.length > 0 ||
|
|
|
+ albumType.value.length > 0 ? (
|
|
|
+ <DropdownMenu activeColor="#2DC7AA">
|
|
|
+ <DropdownItem title="筛选" ref={dropdownItemRef}>
|
|
|
+ <SearchGroup
|
|
|
+ searchList={{
|
|
|
+ albumLevelList: albumLevel.value,
|
|
|
+ albumTypeList: albumType.value
|
|
|
+ }}
|
|
|
+ searchObj={{
|
|
|
+ albumCategoryLevelId: params.albumCategoryLevelId,
|
|
|
+ albumCategoryTypeId: params.albumCategoryTypeId
|
|
|
+ }}
|
|
|
+ onConfirm={(val: any) => {
|
|
|
+ params.albumCategoryLevelId =
|
|
|
+ val.albumCategoryLevelId
|
|
|
+ params.albumCategoryTypeId =
|
|
|
+ val.albumCategoryTypeId
|
|
|
+ dropdownItemRef.value?.toggle()
|
|
|
+ rows.value = []
|
|
|
+ params.page = 1
|
|
|
+ FetchList()
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </DropdownItem>
|
|
|
+ </DropdownMenu>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )
|
|
|
}}
|
|
|
/>
|
|
|
-
|
|
|
- {rows.value && rows.value.length <= 0 && (
|
|
|
- <ColResult btnStatus={false} tips="暂无曲目" />
|
|
|
- )}
|
|
|
+ <List
|
|
|
+ loading={loading.value}
|
|
|
+ finished={finished.value}
|
|
|
+ onLoad={FetchList}
|
|
|
+ error={isError.value}
|
|
|
+ >
|
|
|
+ <Song
|
|
|
+ list={rows.value}
|
|
|
+ onDetail={(item: any) => {
|
|
|
+ if (onItemClick === noop || !onItemClick) {
|
|
|
+ const url =
|
|
|
+ location.origin +
|
|
|
+ location.pathname +
|
|
|
+ '#/music-detail?id=' +
|
|
|
+ item.id +
|
|
|
+ '&albumId=' +
|
|
|
+ route.params.id
|
|
|
+ openDefaultWebView(url, () => {
|
|
|
+ router.push({
|
|
|
+ path: '/music-detail',
|
|
|
+ query: {
|
|
|
+ id: item.id,
|
|
|
+ albumId: route.params.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ onItemClick(item)
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {rows.value && !loading.value && rows.value.length <= 0 && (
|
|
|
+ <ColResult btnStatus={false} tips="暂无曲目" />
|
|
|
+ )}
|
|
|
+ </List>
|
|
|
</div>
|
|
|
|
|
|
- {albumDetail.value?.relatedMusicAlbum &&
|
|
|
+ {/* {albumDetail.value?.relatedMusicAlbum &&
|
|
|
albumDetail.value?.relatedMusicAlbum.length > 0 && (
|
|
|
<>
|
|
|
<Title
|
|
@@ -448,21 +538,20 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
</>
|
|
|
- )}
|
|
|
+ )} */}
|
|
|
</div>
|
|
|
|
|
|
{/* 判断是否是收费 是否是已经购买 */}
|
|
|
{albumDetail.value?.paymentType === 'CHARGE' &&
|
|
|
albumDetail.value?.orderStatus !== 'PAID' && (
|
|
|
- <ColSticky position="bottom" background="white">
|
|
|
+ <TheSticky position="bottom">
|
|
|
<div
|
|
|
class={[
|
|
|
- 'btnGroup',
|
|
|
+ styles.btnGroup,
|
|
|
buyVip.value &&
|
|
|
!(state.user.data.userVip?.vipType !== 'NOT_VIP') &&
|
|
|
'btnMore'
|
|
|
]}
|
|
|
- style={{ padding: '0' }}
|
|
|
>
|
|
|
<Button
|
|
|
block
|
|
@@ -496,7 +585,7 @@ export default defineComponent({
|
|
|
</Button>
|
|
|
)}
|
|
|
</div>
|
|
|
- </ColSticky>
|
|
|
+ </TheSticky>
|
|
|
)}
|
|
|
|
|
|
<Popup
|