|
@@ -20,13 +20,14 @@ import iconMenu from './images/icon-menu.png'
|
|
|
import iconRightTop from './images/icon-right-top.png'
|
|
|
import iconAlbumCover from '../../images/icon-album-cover.png'
|
|
|
import iconTimer from './images/icon-timer.png'
|
|
|
-import { state as baseState } from '@/state'
|
|
|
+import { state as baseState, setLogout } from '@/state'
|
|
|
import Song from '../component/song'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import ColResult from '@/components/col-result'
|
|
|
import { moneyFormat } from '@/helpers/utils'
|
|
|
import { orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
import { postMessage } from '@/helpers/native-message'
|
|
|
+import { browser } from '@/helpers/utils'
|
|
|
// Import Swiper Vue.js components
|
|
|
// import Swiper core and required modules
|
|
|
import { Pagination } from 'swiper/modules'
|
|
@@ -49,6 +50,7 @@ export default defineComponent({
|
|
|
buy: route.query.buy as any,
|
|
|
albumId: route.query.albumId || null,
|
|
|
activeTab: route.query.subjectType || 'SUBJECT',
|
|
|
+ loadingAlbum: false,
|
|
|
loading: false,
|
|
|
finished: false,
|
|
|
isError: false,
|
|
@@ -82,6 +84,7 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
const getDetails = async () => {
|
|
|
+ state.loadingAlbum = true
|
|
|
try {
|
|
|
// tenantGroupAlbum/buyAlbumInfo
|
|
|
if (state.albumId) {
|
|
@@ -104,14 +107,33 @@ export default defineComponent({
|
|
|
state.albumList = data || []
|
|
|
if (state.albumList.length > 0) {
|
|
|
state.details = state.albumList[0]
|
|
|
+ } else {
|
|
|
+ // state.albumList
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '该专辑不可购买',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonColor: '#2dc7aa'
|
|
|
+ }).then(() => {
|
|
|
+ if (browser().isApp) {
|
|
|
+ postMessage({ api: 'back' })
|
|
|
+ } else {
|
|
|
+ setLogout()
|
|
|
+ router.replace({
|
|
|
+ path: '/login' as any,
|
|
|
+ query: {
|
|
|
+ returnUrl: '/train-tool',
|
|
|
+ ...route.query
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // state.tenantAlbumStatus = data.tenantAlbumStatus
|
|
|
- // state.ablumStatus = data.status
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
|
+ state.loadingAlbum = false
|
|
|
}
|
|
|
|
|
|
watch(
|
|
@@ -214,8 +236,10 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
state.loading = true
|
|
|
+ state.loadingAlbum = true
|
|
|
await getDetails()
|
|
|
await FetchList()
|
|
|
+ state.loadingAlbum = false
|
|
|
state.loading = false
|
|
|
})
|
|
|
|
|
@@ -331,8 +355,8 @@ export default defineComponent({
|
|
|
)}
|
|
|
</>
|
|
|
) : (
|
|
|
- <>
|
|
|
- {!route.query.taId && (
|
|
|
+ !state.loadingAlbum && (
|
|
|
+ <>
|
|
|
<TheSticky
|
|
|
position="top"
|
|
|
onBarHeight={(height: any) => {
|
|
@@ -343,204 +367,205 @@ export default defineComponent({
|
|
|
background={background.value}
|
|
|
border={false}
|
|
|
isFixed={false}
|
|
|
+ hideHeader={route.query.taId ? true : false}
|
|
|
color={color.value}
|
|
|
backIconColor="white"
|
|
|
/>
|
|
|
</TheSticky>
|
|
|
- )}
|
|
|
- {/* <img class={styles.bgImg} src={state.details?.coverImg} /> */}
|
|
|
- <div class={styles.musicContent}></div>
|
|
|
- <div class={styles.bg}>
|
|
|
- <div class={styles.alumWrap}>
|
|
|
- {isSingleAlbum.value ? (
|
|
|
- <div class={styles.singleAlbum}>
|
|
|
- <div class={styles.img}>
|
|
|
- {state.details?.buyTimesFlag && (
|
|
|
- <span class={styles.quota}>
|
|
|
- 限购:{state.details?.buyedTimes}/
|
|
|
- {state.details?.buyTimes}次
|
|
|
- </span>
|
|
|
- )}
|
|
|
- <Image
|
|
|
- class={styles.image}
|
|
|
- width="100%"
|
|
|
- height="100%"
|
|
|
- fit="cover"
|
|
|
- src={state.details?.coverImg || iconAlbumCover}
|
|
|
- errorIcon={iconAlbumCover}
|
|
|
- />
|
|
|
- <div class={styles.iconPian}></div>
|
|
|
+
|
|
|
+ {/* <img class={styles.bgImg} src={state.details?.coverImg} /> */}
|
|
|
+ <div class={styles.musicContent}></div>
|
|
|
+ <div class={styles.bg}>
|
|
|
+ <div class={styles.alumWrap}>
|
|
|
+ {isSingleAlbum.value ? (
|
|
|
+ <div class={styles.singleAlbum}>
|
|
|
+ <div class={styles.img}>
|
|
|
+ {state.details?.buyTimesFlag && (
|
|
|
+ <span class={styles.quota}>
|
|
|
+ 限购:{state.details?.buyedTimes}/
|
|
|
+ {state.details?.buyTimes}次
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ <Image
|
|
|
+ class={styles.image}
|
|
|
+ width="100%"
|
|
|
+ height="100%"
|
|
|
+ fit="cover"
|
|
|
+ src={state.details?.coverImg || iconAlbumCover}
|
|
|
+ errorIcon={iconAlbumCover}
|
|
|
+ />
|
|
|
+ <div class={styles.iconPian}></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- <Swiper
|
|
|
- watchSlidesProgress={true}
|
|
|
- slidesPerView={'auto'}
|
|
|
- centeredSlides={true}
|
|
|
- modules={[Pagination]}
|
|
|
- pagination={{ clickable: true }}
|
|
|
- onSlideChange={(swiper: any) => {
|
|
|
- state.details = state.albumList[swiper.activeIndex]
|
|
|
- }}
|
|
|
- onTransitionEnd={() => {
|
|
|
- params.page = 1
|
|
|
- state.list = []
|
|
|
- FetchList()
|
|
|
- }}
|
|
|
- >
|
|
|
- {state.albumList.map((album: any) => (
|
|
|
- <SwiperSlide>
|
|
|
- <div class={styles.img}>
|
|
|
- {album.buyTimesFlag && (
|
|
|
- <span class={styles.quota}>
|
|
|
- 限购:{album.buyedTimes}/{album.buyTimes}次
|
|
|
- </span>
|
|
|
- )}
|
|
|
+ ) : (
|
|
|
+ <Swiper
|
|
|
+ watchSlidesProgress={true}
|
|
|
+ slidesPerView={'auto'}
|
|
|
+ centeredSlides={true}
|
|
|
+ modules={[Pagination]}
|
|
|
+ pagination={{ clickable: true }}
|
|
|
+ onSlideChange={(swiper: any) => {
|
|
|
+ state.details = state.albumList[swiper.activeIndex]
|
|
|
+ }}
|
|
|
+ onTransitionEnd={() => {
|
|
|
+ params.page = 1
|
|
|
+ state.list = []
|
|
|
+ FetchList()
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {state.albumList.map((album: any) => (
|
|
|
+ <SwiperSlide>
|
|
|
+ <div class={styles.img}>
|
|
|
+ {album.buyTimesFlag && (
|
|
|
+ <span class={styles.quota}>
|
|
|
+ 限购:{album.buyedTimes}/{album.buyTimes}次
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
|
|
|
- <Image
|
|
|
- class={styles.image}
|
|
|
- width="100%"
|
|
|
- height="100%"
|
|
|
- fit="cover"
|
|
|
- src={album?.coverImg || iconAlbumCover}
|
|
|
- errorIcon={iconAlbumCover}
|
|
|
- />
|
|
|
- <div class={styles.iconPian}></div>
|
|
|
- </div>
|
|
|
- </SwiperSlide>
|
|
|
- ))}
|
|
|
- </Swiper>
|
|
|
- )}
|
|
|
+ <Image
|
|
|
+ class={styles.image}
|
|
|
+ width="100%"
|
|
|
+ height="100%"
|
|
|
+ fit="cover"
|
|
|
+ src={album?.coverImg || iconAlbumCover}
|
|
|
+ errorIcon={iconAlbumCover}
|
|
|
+ />
|
|
|
+ <div class={styles.iconPian}></div>
|
|
|
+ </div>
|
|
|
+ </SwiperSlide>
|
|
|
+ ))}
|
|
|
+ </Swiper>
|
|
|
+ )}
|
|
|
|
|
|
- <div class={styles.alumDes}>
|
|
|
- <div class={[styles.alumTitle, 'van-ellipsis']}>
|
|
|
- {state.details?.name}
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class={[styles.des, 'van-multi-ellipsis--l2']}
|
|
|
- style={{
|
|
|
- height: '32px',
|
|
|
- lineHeight: '16px'
|
|
|
- }}
|
|
|
- >
|
|
|
- {state.details?.describe}
|
|
|
+ <div class={styles.alumDes}>
|
|
|
+ <div class={[styles.alumTitle, 'van-ellipsis']}>
|
|
|
+ {state.details?.name}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class={[styles.des, 'van-multi-ellipsis--l2']}
|
|
|
+ style={{
|
|
|
+ height: '32px',
|
|
|
+ lineHeight: '16px'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {state.details?.describe}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- {state.buy != '1' && baseState.platformType === 'STUDENT' && (
|
|
|
- <div class={styles.albumPriceGroup}>
|
|
|
- <div class={styles.albumTimer}>
|
|
|
- <img src={iconTimer} class={styles.iconTimer} />
|
|
|
- <span>有效期:{state.details?.purchaseNum || 0}天</span>
|
|
|
- </div>
|
|
|
- <div class={styles.albumPriceList}>
|
|
|
- {(state.details?.originalPrice || 0) >
|
|
|
- (state.details?.actualPrice || 0) && (
|
|
|
- <span class={styles.originPrice}>
|
|
|
- 原价:¥
|
|
|
- {moneyFormat(state.details?.originalPrice || 0)}
|
|
|
- </span>
|
|
|
- )}
|
|
|
+ {state.buy != '1' && baseState.platformType === 'STUDENT' && (
|
|
|
+ <div class={styles.albumPriceGroup}>
|
|
|
+ <div class={styles.albumTimer}>
|
|
|
+ <img src={iconTimer} class={styles.iconTimer} />
|
|
|
+ <span>有效期:{state.details?.purchaseNum || 0}天</span>
|
|
|
+ </div>
|
|
|
+ <div class={styles.albumPriceList}>
|
|
|
+ {(state.details?.originalPrice || 0) >
|
|
|
+ (state.details?.actualPrice || 0) && (
|
|
|
+ <span class={styles.originPrice}>
|
|
|
+ 原价:¥
|
|
|
+ {moneyFormat(state.details?.originalPrice || 0)}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
|
|
|
- <span class={styles.currentPrice}>
|
|
|
- <span>
|
|
|
- ¥{moneyFormat(state.details?.actualPrice || 0)}
|
|
|
+ <span class={styles.currentPrice}>
|
|
|
+ <span>
|
|
|
+ ¥{moneyFormat(state.details?.actualPrice || 0)}
|
|
|
+ </span>
|
|
|
</span>
|
|
|
- </span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- )}
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <div class={styles.musicList}>
|
|
|
- <Sticky position="top" offsetTop={state.heightV}>
|
|
|
- <Tabs
|
|
|
- color="var(--van-primary)"
|
|
|
- background="transparent"
|
|
|
- lineWidth={20}
|
|
|
- shrink
|
|
|
- v-model:active={state.activeTab}
|
|
|
- onChange={val => {
|
|
|
- state.activeTab = val
|
|
|
+ <div class={styles.musicList}>
|
|
|
+ <Sticky position="top" offsetTop={state.heightV}>
|
|
|
+ <Tabs
|
|
|
+ color="var(--van-primary)"
|
|
|
+ background="transparent"
|
|
|
+ lineWidth={20}
|
|
|
+ shrink
|
|
|
+ v-model:active={state.activeTab}
|
|
|
+ onChange={val => {
|
|
|
+ state.activeTab = val
|
|
|
|
|
|
- params.page = 1
|
|
|
- state.list = []
|
|
|
- FetchList()
|
|
|
- }}
|
|
|
- >
|
|
|
- {state.subjectCounts && (
|
|
|
- <Tab title="声部练习" name="SUBJECT"></Tab>
|
|
|
- )}
|
|
|
- {state.musicCounts && (
|
|
|
- <Tab title="独奏曲目" name="MUSIC"></Tab>
|
|
|
- )}
|
|
|
- {state.ensembleCounts && (
|
|
|
- <Tab title="合奏练习" name="ENSEMBLE"></Tab>
|
|
|
- )}
|
|
|
- </Tabs>
|
|
|
- </Sticky>
|
|
|
+ params.page = 1
|
|
|
+ state.list = []
|
|
|
+ FetchList()
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {state.subjectCounts && (
|
|
|
+ <Tab title="声部练习" name="SUBJECT"></Tab>
|
|
|
+ )}
|
|
|
+ {state.musicCounts && (
|
|
|
+ <Tab title="独奏曲目" name="MUSIC"></Tab>
|
|
|
+ )}
|
|
|
+ {state.ensembleCounts && (
|
|
|
+ <Tab title="合奏练习" name="ENSEMBLE"></Tab>
|
|
|
+ )}
|
|
|
+ </Tabs>
|
|
|
+ </Sticky>
|
|
|
|
|
|
- <div class={styles.alumnList}>
|
|
|
- <List
|
|
|
- loading={state.loading}
|
|
|
- finished={state.finished}
|
|
|
- finished-text={' '}
|
|
|
- onLoad={FetchList}
|
|
|
- immediateCheck={false}
|
|
|
- error={state.isError}
|
|
|
- >
|
|
|
- {state.list && state.list.length ? (
|
|
|
- <Song
|
|
|
- showNumber
|
|
|
- list={state.list}
|
|
|
- onDetail={(item: any) => {
|
|
|
- sessionStorage.setItem(
|
|
|
- 'tool-subject-type',
|
|
|
- state.activeTab as any
|
|
|
- )
|
|
|
- router.push({
|
|
|
- path: '/music-detail',
|
|
|
- query: {
|
|
|
- id: item.id,
|
|
|
- tenantAlbumId: item.tenantAlbumId
|
|
|
- // albumId: route.params.id
|
|
|
- }
|
|
|
- })
|
|
|
- }}
|
|
|
- />
|
|
|
- ) : (
|
|
|
- !state.loading && (
|
|
|
- <ColResult
|
|
|
- tips="暂无曲目"
|
|
|
- classImgSize="SMALL"
|
|
|
- btnStatus={false}
|
|
|
- />
|
|
|
- )
|
|
|
- )}
|
|
|
- </List>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- {baseState.platformType === 'STUDENT' && state.buy != '1' && (
|
|
|
- <TheSticky position="bottom">
|
|
|
- <div class={styles.btnGroup}>
|
|
|
- <Button
|
|
|
- round
|
|
|
- block
|
|
|
- disabled={
|
|
|
- state.details?.musicNum <= 0 && !state.hasBuyStatus
|
|
|
- }
|
|
|
- color="linear-gradient(270deg, #FF204B 0%, #FE5B71 100%)"
|
|
|
- onClick={onSubmit}
|
|
|
+ <div class={styles.alumnList}>
|
|
|
+ <List
|
|
|
+ loading={state.loading}
|
|
|
+ finished={state.finished}
|
|
|
+ finished-text={' '}
|
|
|
+ onLoad={FetchList}
|
|
|
+ immediateCheck={false}
|
|
|
+ error={state.isError}
|
|
|
>
|
|
|
- 购买教程
|
|
|
- </Button>
|
|
|
+ {state.list && state.list.length ? (
|
|
|
+ <Song
|
|
|
+ showNumber
|
|
|
+ list={state.list}
|
|
|
+ onDetail={(item: any) => {
|
|
|
+ sessionStorage.setItem(
|
|
|
+ 'tool-subject-type',
|
|
|
+ state.activeTab as any
|
|
|
+ )
|
|
|
+ router.push({
|
|
|
+ path: '/music-detail',
|
|
|
+ query: {
|
|
|
+ id: item.id,
|
|
|
+ tenantAlbumId: item.tenantAlbumId
|
|
|
+ // albumId: route.params.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ !state.loading && (
|
|
|
+ <ColResult
|
|
|
+ tips="暂无曲目"
|
|
|
+ classImgSize="SMALL"
|
|
|
+ btnStatus={false}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ )}
|
|
|
+ </List>
|
|
|
</div>
|
|
|
- </TheSticky>
|
|
|
- )}
|
|
|
- </>
|
|
|
+ </div>
|
|
|
+ {baseState.platformType === 'STUDENT' && state.buy != '1' && (
|
|
|
+ <TheSticky position="bottom">
|
|
|
+ <div class={styles.btnGroup}>
|
|
|
+ <Button
|
|
|
+ round
|
|
|
+ block
|
|
|
+ disabled={
|
|
|
+ state.details?.musicNum <= 0 && !state.hasBuyStatus
|
|
|
+ }
|
|
|
+ color="linear-gradient(270deg, #FF204B 0%, #FE5B71 100%)"
|
|
|
+ onClick={onSubmit}
|
|
|
+ >
|
|
|
+ 购买教程
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </TheSticky>
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ )
|
|
|
)}
|
|
|
- {/**/}
|
|
|
</div>
|
|
|
)
|
|
|
}
|