|
@@ -1,6 +1,6 @@
|
|
|
import TheSticky from '@/components/the-sticky'
|
|
|
import styles from './new-index.module.less'
|
|
|
-import { useEventListener, useThrottleFn, useWindowScroll } from '@vueuse/core'
|
|
|
+import { useThrottleFn } from '@vueuse/core'
|
|
|
import { postMessage, promisefiyPostMessage } from '@/helpers/native-message'
|
|
|
// import iconShare from '../../images/icon-share.png'
|
|
|
import oStart from '../album-detail/icon-hart.png'
|
|
@@ -14,11 +14,8 @@ import {
|
|
|
onMounted,
|
|
|
onUnmounted,
|
|
|
reactive,
|
|
|
- ref,
|
|
|
- toRaw,
|
|
|
- watch
|
|
|
+ ref
|
|
|
} from 'vue'
|
|
|
-import umiRequest from 'umi-request'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import request from '@/helpers/request'
|
|
|
import ColHeader from '@/components/col-header'
|
|
@@ -37,16 +34,16 @@ import {
|
|
|
Picker
|
|
|
} from 'vant'
|
|
|
import { useRect } from '@vant/use'
|
|
|
-import { Vue3Lottie } from 'vue3-lottie'
|
|
|
+// import { Vue3Lottie } from 'vue3-lottie'
|
|
|
import { getRandomKey, musicBuy } from '../music'
|
|
|
-import { getOssUploadUrl, state } from '@/state'
|
|
|
+import { state } from '@/state'
|
|
|
import { browser, getHttpOrigin, moneyFormat } from '@/helpers/utils'
|
|
|
import { orderStatus } from '@/views/order-detail/orderStatus'
|
|
|
-import AstronautJSON from './animate/refresh_anim.json'
|
|
|
+// import AstronautJSON from './animate/refresh_anim.json'
|
|
|
// import ColShare from '@/components/col-share'
|
|
|
import iconListen from './images/icon_listen.png'
|
|
|
-import iconTeacher from '@common/images/icon_teacher.png'
|
|
|
-import emtpy from './images/emtpy.png'
|
|
|
+// import iconTeacher from '@common/images/icon_teacher.png'
|
|
|
+// import emtpy from './images/emtpy.png'
|
|
|
import { state as baseState } from '@/state'
|
|
|
|
|
|
import activeButtonIcon from './images/icon_checkbox.png'
|
|
@@ -59,12 +56,7 @@ import Plyr from 'plyr'
|
|
|
import 'plyr/dist/plyr.css'
|
|
|
import Download from './download'
|
|
|
import { getInstrumentName } from '@/constant/instruments'
|
|
|
-// import { getUploadSign, onOnlyFileUpload } from '@/helpers/oss-file-upload'
|
|
|
import { svgtopng } from './formatSvgToImg'
|
|
|
-// import { shareCall } from '@/teacher/share-page/share'
|
|
|
-import deepClone from '@/helpers/deep-clone'
|
|
|
-import { formatXML, getCustomInfo, onlyVisible } from './instrument'
|
|
|
-import { data } from 'browserslist'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'new-index',
|
|
@@ -81,22 +73,9 @@ export default defineComponent({
|
|
|
const headers = ref(null)
|
|
|
const footers = ref(null)
|
|
|
const heightInfo = ref<any>('0')
|
|
|
- const musicDetail = ref<any>(null)
|
|
|
const audioFileUrl = ref('')
|
|
|
- const showImg = ref([] as any)
|
|
|
- const firstList = ref<Array<any>>([])
|
|
|
- const fixedList = ref<Array<any>>([])
|
|
|
- const staffList = ref<Array<any>>([])
|
|
|
- const musicPdfUrl = ref('')
|
|
|
|
|
|
const partColumns = ref<any>([])
|
|
|
-
|
|
|
- const uploadImgs = ref<boolean>(false)
|
|
|
- const defaultImgs = ref({
|
|
|
- first: false,
|
|
|
- fixed: false,
|
|
|
- staff: false
|
|
|
- })
|
|
|
const downloadStatus = ref<boolean>(false)
|
|
|
const staff = reactive({
|
|
|
status: false,
|
|
@@ -110,6 +89,7 @@ export default defineComponent({
|
|
|
const onChangeStaff = (type: string) => {
|
|
|
staff.radio = type
|
|
|
staff.status = false
|
|
|
+ staffData.imgs = []
|
|
|
if (type == 'FIRST') {
|
|
|
loading.value = false
|
|
|
const tempPdf = staffData.details?.firstPdfUrl
|
|
@@ -391,6 +371,22 @@ export default defineComponent({
|
|
|
(item: any) => item.value === staffData.selectedPartIndex
|
|
|
)
|
|
|
})
|
|
|
+
|
|
|
+ // 是否转谱不能转,默认谱面不是五线谱时
|
|
|
+ const defaultConvertible = computed(() => {
|
|
|
+ const details = staffData.details
|
|
|
+ let isConvertibleScore = details.isConvertibleScore
|
|
|
+ let isHiddenStaff = false // 是否隐藏五线谱转谱
|
|
|
+
|
|
|
+ if(!isConvertibleScore && ["FIRST", "JIAN"].includes(details.scoreType)) {
|
|
|
+ isConvertibleScore = true
|
|
|
+ isHiddenStaff = true
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ isConvertibleScore,
|
|
|
+ isHiddenStaff
|
|
|
+ }
|
|
|
+ })
|
|
|
/** 渲染五线谱 */
|
|
|
// 长笛、单簧管、萨克斯、小号、长号、圆号、大号、上低音号
|
|
|
// const sortList = {
|
|
@@ -447,22 +443,22 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
// 根据当前选中的声部和曲目筛选出对应的声轨
|
|
|
- function filterSoundInfo(musicalInstruments: any) {
|
|
|
- if (musicalInstruments.length <= 0) return null
|
|
|
- // 老师端,加上乐器id
|
|
|
- const instrumentIds = staffData.instrumentId //appState.instrumentId || appState.user?.instrumentId || route.query.instrumentId
|
|
|
- if (instrumentIds) {
|
|
|
- const item =
|
|
|
- musicalInstruments.find((item: any) => {
|
|
|
- return (
|
|
|
- instrumentIds == item.musicalInstrumentId &&
|
|
|
- item.audioPlayType == 'PLAY'
|
|
|
- )
|
|
|
- }) || null
|
|
|
- return item
|
|
|
- }
|
|
|
- return null
|
|
|
- }
|
|
|
+ // function filterSoundInfo(musicalInstruments: any) {
|
|
|
+ // if (musicalInstruments.length <= 0) return null
|
|
|
+ // // 老师端,加上乐器id
|
|
|
+ // const instrumentIds = staffData.instrumentId //appState.instrumentId || appState.user?.instrumentId || route.query.instrumentId
|
|
|
+ // if (instrumentIds) {
|
|
|
+ // const item =
|
|
|
+ // musicalInstruments.find((item: any) => {
|
|
|
+ // return (
|
|
|
+ // instrumentIds == item.musicalInstrumentId &&
|
|
|
+ // item.audioPlayType == 'PLAY'
|
|
|
+ // )
|
|
|
+ // }) || null
|
|
|
+ // return item
|
|
|
+ // }
|
|
|
+ // return null
|
|
|
+ // }
|
|
|
|
|
|
// 获取PDF
|
|
|
const getCurrentPdf = (item: any, scoreType: string) => {
|
|
@@ -542,7 +538,10 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
if (row.musicSheetType === 'SINGLE') {
|
|
|
- staffData.musicPdfUrl = row.musicPdfUrl
|
|
|
+ staffData.musicPdfUrl = getCurrentPdf(
|
|
|
+ defaultShowStaff,
|
|
|
+ row.scoreType
|
|
|
+ )
|
|
|
// 生成的图片
|
|
|
// staffData.imgs = row.musicImg ? row.musicImg.split(',') : [];
|
|
|
} else {
|
|
@@ -566,7 +565,7 @@ export default defineComponent({
|
|
|
if (row.defaultScoreRender) {
|
|
|
pdfUrl = getCurrentPdf(row, row.scoreType)
|
|
|
} else {
|
|
|
- staffData.musicPdfUrl = getCurrentPdf(
|
|
|
+ pdfUrl = getCurrentPdf(
|
|
|
defaultShowStaff,
|
|
|
row.scoreType
|
|
|
)
|
|
@@ -895,7 +894,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
<div class={styles.musicContent}>
|
|
|
- {staffData.details?.isConvertibleScore ? (
|
|
|
+ {defaultConvertible.value.isConvertibleScore && staffData.details?.musicSheetType === 'SINGLE' ? (
|
|
|
<span
|
|
|
class={styles.iconTransfer}
|
|
|
style={{
|
|
@@ -1177,7 +1176,7 @@ export default defineComponent({
|
|
|
<div class={styles.staffTitle}>转换曲谱</div>
|
|
|
<RadioGroup v-model={staff.radio}>
|
|
|
<CellGroup border={false}>
|
|
|
- <Cell
|
|
|
+ {!defaultConvertible.value.isHiddenStaff ? <Cell
|
|
|
center
|
|
|
border={false}
|
|
|
class={staff.radio === 'STAVE' ? styles.active : ''}
|
|
@@ -1206,7 +1205,7 @@ export default defineComponent({
|
|
|
</Radio>
|
|
|
)
|
|
|
}}
|
|
|
- </Cell>
|
|
|
+ </Cell> : ""}
|
|
|
<Cell
|
|
|
center
|
|
|
border={false}
|