|
@@ -171,11 +171,10 @@ export default defineComponent({
|
|
watch(
|
|
watch(
|
|
() => state.details,
|
|
() => state.details,
|
|
() => {
|
|
() => {
|
|
- state.ensembleCounts = state.details?.ensembleCounts <= 0 ? false : true
|
|
|
|
- state.subjectCounts = state.details?.subjectCounts <= 0 ? false : true
|
|
|
|
- state.musicCounts = state.details?.musicCounts <= 0 ? false : true
|
|
|
|
- state.coursewareCounts =
|
|
|
|
- state.details?.coursewareCounts <= 0 ? false : true
|
|
|
|
|
|
+ state.ensembleCounts = state.details?.ensembleCounts ? true : false
|
|
|
|
+ state.subjectCounts = state.details?.subjectCounts ? true : false
|
|
|
|
+ state.musicCounts = state.details?.musicCounts ? true : false
|
|
|
|
+ state.coursewareCounts = state.details?.coursewareCounts ? true : false
|
|
if (state.details.buyTimesFlag) {
|
|
if (state.details.buyTimesFlag) {
|
|
if (state.details.buyedTimes >= state.details.buyTimes) {
|
|
if (state.details.buyedTimes >= state.details.buyTimes) {
|
|
state.hasBuyStatus = false
|
|
state.hasBuyStatus = false
|
|
@@ -187,7 +186,11 @@ export default defineComponent({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|
|
+ let listController
|
|
const FetchList = async (hideLoading = false) => {
|
|
const FetchList = async (hideLoading = false) => {
|
|
|
|
+ if (listController) {
|
|
|
|
+ listController.abort()
|
|
|
|
+ }
|
|
state.loading = true
|
|
state.loading = true
|
|
state.isError = false
|
|
state.isError = false
|
|
const tempParams = {
|
|
const tempParams = {
|
|
@@ -197,11 +200,14 @@ export default defineComponent({
|
|
}
|
|
}
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
+ listController = new AbortController()
|
|
|
|
+ const { signal } = listController
|
|
const { data } = await request.post(
|
|
const { data } = await request.post(
|
|
`${apiSuffix.value}/tenantAlbumMusic/page`,
|
|
`${apiSuffix.value}/tenantAlbumMusic/page`,
|
|
{
|
|
{
|
|
hideLoading,
|
|
hideLoading,
|
|
- data: tempParams
|
|
|
|
|
|
+ data: tempParams,
|
|
|
|
+ signal
|
|
}
|
|
}
|
|
)
|
|
)
|
|
if (state.list.length > 0 && data.pageNo === 1) {
|
|
if (state.list.length > 0 && data.pageNo === 1) {
|
|
@@ -220,14 +226,14 @@ export default defineComponent({
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
- useEventListener(document, 'scroll', evt => {
|
|
|
|
- const { y } = useWindowScroll()
|
|
|
|
- if (y.value > 20) {
|
|
|
|
- background.value = `rgba(255, 255, 255)`
|
|
|
|
- } else {
|
|
|
|
- background.value = 'transparent'
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // useEventListener(document, 'scroll', evt => {
|
|
|
|
+ // const { y } = useWindowScroll()
|
|
|
|
+ // if (y.value > 20) {
|
|
|
|
+ // background.value = `rgba(255, 255, 255)`
|
|
|
|
+ // } else {
|
|
|
|
+ // background.value = 'transparent'
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
|
|
state.loading = true
|
|
state.loading = true
|
|
state.loadingAlbum = true
|
|
state.loadingAlbum = true
|
|
@@ -336,6 +342,7 @@ export default defineComponent({
|
|
{!state.loading && !state.details.id && state.buy != '1' ? (
|
|
{!state.loading && !state.details.id && state.buy != '1' ? (
|
|
<>
|
|
<>
|
|
<TheSticky
|
|
<TheSticky
|
|
|
|
+ class={styles.theSticky}
|
|
position="top"
|
|
position="top"
|
|
onBarHeight={(height: any) => {
|
|
onBarHeight={(height: any) => {
|
|
console.log(height, 'height', height)
|
|
console.log(height, 'height', height)
|
|
@@ -364,6 +371,7 @@ export default defineComponent({
|
|
!state.loadingAlbum && (
|
|
!state.loadingAlbum && (
|
|
<>
|
|
<>
|
|
<TheSticky
|
|
<TheSticky
|
|
|
|
+ class={styles.theSticky}
|
|
position="top"
|
|
position="top"
|
|
onBarHeight={(height: any) => {
|
|
onBarHeight={(height: any) => {
|
|
state.heightV = height
|
|
state.heightV = height
|