|
@@ -4,6 +4,7 @@ import { defineComponent, ref } from 'vue'
|
|
|
import { Cell, Skeleton } from 'vant'
|
|
|
import Item from '../list/item'
|
|
|
import { musicBuy } from '../music'
|
|
|
+import { state } from '@/state'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'Practice',
|
|
@@ -11,9 +12,15 @@ export default defineComponent({
|
|
|
setup(props, { expose, emit }) {
|
|
|
/** 这里条数不会变动,设置固定高度避免抖动 */
|
|
|
const prevNum = ref(0)
|
|
|
- const { isLoading, state, execute } = useAsyncState(
|
|
|
+ const {
|
|
|
+ isLoading,
|
|
|
+ state: resState,
|
|
|
+ execute
|
|
|
+ } = useAsyncState(
|
|
|
(args): Promise<any> =>
|
|
|
- request.get('/api-student/music/sheet/practice', {
|
|
|
+ request.get('/music/sheet/practice', {
|
|
|
+ prefix:
|
|
|
+ state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
|
|
|
params: {
|
|
|
rows: args?.rows || 3
|
|
|
}
|
|
@@ -26,7 +33,7 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
return () => {
|
|
|
- const list: any[] = state.value?.data.rows || []
|
|
|
+ const list: any[] = resState.value?.data.rows || []
|
|
|
if (prevNum.value === 0) {
|
|
|
prevNum.value = list.length
|
|
|
}
|