|
@@ -1,11 +1,4 @@
|
|
-import {
|
|
|
|
- computed,
|
|
|
|
- defineComponent,
|
|
|
|
- nextTick,
|
|
|
|
- onMounted,
|
|
|
|
- reactive,
|
|
|
|
- ref
|
|
|
|
-} from 'vue'
|
|
|
|
|
|
+import { computed, defineComponent, nextTick, watch, reactive, ref } from 'vue'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
import ColHeader from '@/components/col-header'
|
|
import ColHeader from '@/components/col-header'
|
|
@@ -22,15 +15,9 @@ import {
|
|
Popup,
|
|
Popup,
|
|
Sticky
|
|
Sticky
|
|
} from 'vant'
|
|
} from 'vant'
|
|
-// import classNames from 'classnames'
|
|
|
|
-// import Footer from '../album/footer'
|
|
|
|
-// import FavoriteIcon from '../album/favorite.svg'
|
|
|
|
-// import FavoritedIcon from '../album/favorited.svg'
|
|
|
|
import styles from './index.module.less'
|
|
import styles from './index.module.less'
|
|
-// import Item from '../list/item'
|
|
|
|
-import { useRect } from '@vant/use'
|
|
|
|
-import { useEventListener, useWindowScroll } from '@vueuse/core'
|
|
|
|
-import { getRandomKey, musicBuy } from '../music'
|
|
|
|
|
|
+import { useScroll } from '@vueuse/core'
|
|
|
|
+import { getRandomKey } from '../music'
|
|
import { openDefaultWebView, state } from '@/state'
|
|
import { openDefaultWebView, state } from '@/state'
|
|
import IconPan from './pan.png'
|
|
import IconPan from './pan.png'
|
|
import oStart from './oStart.png'
|
|
import oStart from './oStart.png'
|
|
@@ -87,7 +74,6 @@ export default defineComponent({
|
|
const isError = ref(false)
|
|
const isError = ref(false)
|
|
const favorited = ref(0)
|
|
const favorited = ref(0)
|
|
const albumFavoriteCount = ref(0)
|
|
const albumFavoriteCount = ref(0)
|
|
- const headers = ref(null)
|
|
|
|
const background = ref<string>('rgba(55, 205, 177, 0)')
|
|
const background = ref<string>('rgba(55, 205, 177, 0)')
|
|
const color = ref<string>('#fff')
|
|
const color = ref<string>('#fff')
|
|
const heightInfo = ref<any>('auto')
|
|
const heightInfo = ref<any>('auto')
|
|
@@ -165,18 +151,18 @@ export default defineComponent({
|
|
|
|
|
|
FetchDetail()
|
|
FetchDetail()
|
|
FetchList()
|
|
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 = ' '
|
|
|
|
|
|
+ const musicContentMainRef = ref<HTMLDivElement>()
|
|
|
|
+ const { y } = useScroll(musicContentMainRef)
|
|
|
|
+ watch(
|
|
|
|
+ () => y.value,
|
|
|
|
+ () => {
|
|
|
|
+ if (y.value > 20) {
|
|
|
|
+ title.value = albumDetail.value?.albumName || ' '
|
|
|
|
+ } else {
|
|
|
|
+ title.value = ' '
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ )
|
|
|
|
|
|
useEventTracking('专辑')
|
|
useEventTracking('专辑')
|
|
|
|
|
|
@@ -322,19 +308,18 @@ export default defineComponent({
|
|
return () => {
|
|
return () => {
|
|
return (
|
|
return (
|
|
<div class={styles.detail}>
|
|
<div class={styles.detail}>
|
|
- <div ref={headers}>
|
|
|
|
|
|
+ <TheSticky
|
|
|
|
+ position="top"
|
|
|
|
+ onBarHeight={(height: number) => {
|
|
|
|
+ heightInfo.value = height
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
<ColHeader
|
|
<ColHeader
|
|
background={background.value}
|
|
background={background.value}
|
|
border={false}
|
|
border={false}
|
|
title={title.value}
|
|
title={title.value}
|
|
color={color.value}
|
|
color={color.value}
|
|
backIconColor="white"
|
|
backIconColor="white"
|
|
- onHeaderBack={() => {
|
|
|
|
- nextTick(() => {
|
|
|
|
- const { height } = useRect(headers as any)
|
|
|
|
- heightInfo.value = height
|
|
|
|
- })
|
|
|
|
- }}
|
|
|
|
v-slots={{
|
|
v-slots={{
|
|
right: () => (
|
|
right: () => (
|
|
<div
|
|
<div
|
|
@@ -352,164 +337,156 @@ export default defineComponent({
|
|
)
|
|
)
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
- </div>
|
|
|
|
|
|
+ </TheSticky>
|
|
<img class={styles.bgImg} src={albumDetail.value?.albumCoverUrl} />
|
|
<img class={styles.bgImg} src={albumDetail.value?.albumCoverUrl} />
|
|
<div class={styles.musicContent}></div>
|
|
<div class={styles.musicContent}></div>
|
|
- <div class={styles.bg}>
|
|
|
|
- <div class={styles.alumWrap}>
|
|
|
|
- <div class={styles.img}>
|
|
|
|
- {albumDetail.value?.paymentType === 'CHARGE' && (
|
|
|
|
- <span class={styles.albumType}>付费</span>
|
|
|
|
- )}
|
|
|
|
- <Image
|
|
|
|
- class={styles.image}
|
|
|
|
- width="100%"
|
|
|
|
- height="100%"
|
|
|
|
- fit="cover"
|
|
|
|
- src={albumDetail.value?.albumCoverUrl}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class={styles.alumDes}>
|
|
|
|
- <div class={[styles.alumTitle, 'van-ellipsis']}>
|
|
|
|
- {albumDetail.value?.albumName}
|
|
|
|
|
|
+ <div class={styles.musicContentMain} ref={musicContentMainRef}>
|
|
|
|
+ <div class={styles.bg}>
|
|
|
|
+ <div class={styles.alumWrap}>
|
|
|
|
+ <div class={styles.img}>
|
|
|
|
+ {albumDetail.value?.paymentType === 'CHARGE' && (
|
|
|
|
+ <span class={styles.albumType}>付费</span>
|
|
|
|
+ )}
|
|
|
|
+ <Image
|
|
|
|
+ class={styles.image}
|
|
|
|
+ width="100%"
|
|
|
|
+ height="100%"
|
|
|
|
+ fit="cover"
|
|
|
|
+ src={albumDetail.value?.albumCoverUrl}
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- <div class={styles.tags}>
|
|
|
|
- {albumDetail.value?.musicTagNames?.map((tag: any) => (
|
|
|
|
- <span class={styles.tag}>{tag}</span>
|
|
|
|
- ))}
|
|
|
|
|
|
+ <div class={styles.alumDes}>
|
|
|
|
+ <div class={[styles.alumTitle, 'van-ellipsis']}>
|
|
|
|
+ {albumDetail.value?.albumName}
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles.tags}>
|
|
|
|
+ {albumDetail.value?.musicTagNames?.map((tag: any) => (
|
|
|
|
+ <span class={styles.tag}>{tag}</span>
|
|
|
|
+ ))}
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class={[styles.des, 'van-multi-ellipsis--l3']}
|
|
|
|
+ style={{
|
|
|
|
+ height: '48px',
|
|
|
|
+ lineHeight: '16px'
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ {albumDetail.value?.albumDesc}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class={styles.alumCollect}>
|
|
|
|
+ <img src={IconPan} />
|
|
|
|
+ <span>共{albumDetail.value?.musicSheetCount}首曲目</span>
|
|
<div
|
|
<div
|
|
- class={[styles.des, 'van-multi-ellipsis--l3']}
|
|
|
|
- style={{
|
|
|
|
- height: '48px',
|
|
|
|
- lineHeight: '16px'
|
|
|
|
- }}
|
|
|
|
|
|
+ class={styles.right}
|
|
|
|
+ onClick={() => toggleFavorite(albumDetail.value?.id)}
|
|
>
|
|
>
|
|
- {albumDetail.value?.albumDesc}
|
|
|
|
|
|
+ <img src={favorited.value ? iStart : oStart} />
|
|
|
|
+ <span>{albumFavoriteCount.value}人收藏</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class={styles.alumCollect}>
|
|
|
|
- <img src={IconPan} />
|
|
|
|
- <span>共{albumDetail.value?.musicSheetCount}首曲目</span>
|
|
|
|
- <div
|
|
|
|
- class={styles.right}
|
|
|
|
- onClick={() => toggleFavorite(albumDetail.value?.id)}
|
|
|
|
- >
|
|
|
|
- <img src={favorited.value ? iStart : oStart} />
|
|
|
|
- <span>{albumFavoriteCount.value}人收藏</span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
|
|
- {albumDetail.value?.paymentType === 'CHARGE' &&
|
|
|
|
- albumDetail.value?.orderStatus !== 'PAID' && (
|
|
|
|
- <div class={styles.albumTips}>
|
|
|
|
- <span>此专辑为付费专辑,购买即可自由练习该专辑</span>
|
|
|
|
- <span class={styles.albumPrice}>
|
|
|
|
- ¥{moneyFormat(albumDetail.value?.albumPrice)}
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- )}
|
|
|
|
- </div>
|
|
|
|
- <div class={styles.alumnContainer}>
|
|
|
|
- <div class={styles.alumnList}>
|
|
|
|
- {/* <Title title="曲目列表" isMore={false}>
|
|
|
|
- {{
|
|
|
|
- right: () =>
|
|
|
|
- albumDetail.value?.albumType === 'CONCERT' && (
|
|
|
|
- <div
|
|
|
|
- class={[
|
|
|
|
- styles.subjectSearch,
|
|
|
|
- subjects.show ? styles.active : ''
|
|
|
|
- ]}
|
|
|
|
- onClick={() => (subjects.show = true)}
|
|
|
|
- >
|
|
|
|
- {subjects.name}
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
- }}
|
|
|
|
- </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>
|
|
|
|
- ) : (
|
|
|
|
- ''
|
|
|
|
- )
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- <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="暂无曲目" />
|
|
|
|
|
|
+ {albumDetail.value?.paymentType === 'CHARGE' &&
|
|
|
|
+ albumDetail.value?.orderStatus !== 'PAID' && (
|
|
|
|
+ <div class={styles.albumTips}>
|
|
|
|
+ <span>此专辑为付费专辑,购买即可自由练习该专辑</span>
|
|
|
|
+ <span class={styles.albumPrice}>
|
|
|
|
+ ¥{moneyFormat(albumDetail.value?.albumPrice)}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
)}
|
|
)}
|
|
- </List>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class={styles.alumnContainer}>
|
|
|
|
+ <div class={styles.alumnList}>
|
|
|
|
+ <Sticky
|
|
|
|
+ offsetTop={heightInfo.value}
|
|
|
|
+ class={styles.stickySearch}
|
|
|
|
+ >
|
|
|
|
+ <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>
|
|
|
|
+ ) : (
|
|
|
|
+ ''
|
|
|
|
+ )
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </Sticky>
|
|
|
|
+ <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 && (
|
|
albumDetail.value?.relatedMusicAlbum.length > 0 && (
|
|
<>
|
|
<>
|
|
<Title
|
|
<Title
|
|
@@ -539,54 +516,55 @@ export default defineComponent({
|
|
/>
|
|
/>
|
|
</>
|
|
</>
|
|
)} */}
|
|
)} */}
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
|
|
|
|
- {/* 判断是否是收费 是否是已经购买 */}
|
|
|
|
- {albumDetail.value?.paymentType === 'CHARGE' &&
|
|
|
|
- albumDetail.value?.orderStatus !== 'PAID' && (
|
|
|
|
- <TheSticky position="bottom">
|
|
|
|
- <div
|
|
|
|
- class={[
|
|
|
|
- styles.btnGroup,
|
|
|
|
- buyVip.value &&
|
|
|
|
- !(state.user.data.userVip?.vipType !== 'NOT_VIP') &&
|
|
|
|
- 'btnMore'
|
|
|
|
- ]}
|
|
|
|
- >
|
|
|
|
- <Button
|
|
|
|
- block
|
|
|
|
- round
|
|
|
|
- type="primary"
|
|
|
|
- style={{ fontSize: '16px' }}
|
|
|
|
- onClick={onBuy}
|
|
|
|
|
|
+ {/* 判断是否是收费 是否是已经购买 */}
|
|
|
|
+ {albumDetail.value?.paymentType === 'CHARGE' &&
|
|
|
|
+ albumDetail.value?.orderStatus !== 'PAID' && (
|
|
|
|
+ <TheSticky varName="--bottom-height" position="bottom">
|
|
|
|
+ <div
|
|
|
|
+ class={[
|
|
|
|
+ styles.btnGroup,
|
|
|
|
+ buyVip.value &&
|
|
|
|
+ !(state.user.data.userVip?.vipType !== 'NOT_VIP') &&
|
|
|
|
+ 'btnMore'
|
|
|
|
+ ]}
|
|
>
|
|
>
|
|
- 购买专辑
|
|
|
|
- </Button>
|
|
|
|
- {buyVip.value &&
|
|
|
|
- !(state.user.data.userVip?.vipType !== 'NOT_VIP') && (
|
|
|
|
- <Button
|
|
|
|
- block
|
|
|
|
- round
|
|
|
|
- type="primary"
|
|
|
|
- style={{ fontSize: '16px' }}
|
|
|
|
- onClick={() => {
|
|
|
|
- router.push({
|
|
|
|
- path: '/memberCenter',
|
|
|
|
- query: {
|
|
|
|
- ...route.query
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- {studentActivityId.value > 0 && (
|
|
|
|
- <div class={[styles.buttonDiscount]}>专属优惠</div>
|
|
|
|
- )}
|
|
|
|
- 开通会员
|
|
|
|
- </Button>
|
|
|
|
- )}
|
|
|
|
- </div>
|
|
|
|
- </TheSticky>
|
|
|
|
- )}
|
|
|
|
|
|
+ <Button
|
|
|
|
+ block
|
|
|
|
+ round
|
|
|
|
+ type="primary"
|
|
|
|
+ style={{ fontSize: '16px' }}
|
|
|
|
+ onClick={onBuy}
|
|
|
|
+ >
|
|
|
|
+ 购买专辑
|
|
|
|
+ </Button>
|
|
|
|
+ {buyVip.value &&
|
|
|
|
+ !(state.user.data.userVip?.vipType !== 'NOT_VIP') && (
|
|
|
|
+ <Button
|
|
|
|
+ block
|
|
|
|
+ round
|
|
|
|
+ type="primary"
|
|
|
|
+ style={{ fontSize: '16px' }}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/memberCenter',
|
|
|
|
+ query: {
|
|
|
|
+ ...route.query
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ {studentActivityId.value > 0 && (
|
|
|
|
+ <div class={[styles.buttonDiscount]}>专属优惠</div>
|
|
|
|
+ )}
|
|
|
|
+ 开通会员
|
|
|
|
+ </Button>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ </TheSticky>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
|
|
<Popup
|
|
<Popup
|
|
v-model:show={shareStatus.value}
|
|
v-model:show={shareStatus.value}
|