|
@@ -1,7 +1,9 @@
|
|
|
import OEmpty from '@/components/o-empty'
|
|
|
import { postMessage } from '@/helpers/native-message'
|
|
|
import request from '@/helpers/request'
|
|
|
+import { browser } from '@/helpers/utils'
|
|
|
import { state } from '@/state'
|
|
|
+import { useRect } from '@vant/use'
|
|
|
import {
|
|
|
Cell,
|
|
|
CellGroup,
|
|
@@ -15,7 +17,7 @@ import {
|
|
|
Sticky
|
|
|
} from 'vant'
|
|
|
import { defineComponent, reactive, ref, onMounted, nextTick, computed } from 'vue'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { getImage } from './images'
|
|
|
import styles from './index.module.less'
|
|
|
|
|
@@ -46,7 +48,7 @@ export default defineComponent({
|
|
|
})
|
|
|
const option1 = computed(() => {
|
|
|
const v1: any = props.musicTree.find((n: any) => n.id == route.query.categorieid)
|
|
|
- console.log('🚀 ~ v1', v1)
|
|
|
+ // console.log('🚀 ~ v1', v1)
|
|
|
if (Array.isArray(v1?.musicSheetCategoriesList)) {
|
|
|
const list = v1.musicSheetCategoriesList.map((m: any) => {
|
|
|
if (!data.value1) {
|
|
@@ -87,7 +89,7 @@ export default defineComponent({
|
|
|
const res: any = await request.post(state.platformApi + '/musicSheet/page', {
|
|
|
data: {
|
|
|
...data.pagenation,
|
|
|
- keyword: data.keyword,
|
|
|
+ keyword: data.keyword
|
|
|
// musicTag: data.value2 || data.value1
|
|
|
}
|
|
|
})
|
|
@@ -133,11 +135,7 @@ export default defineComponent({
|
|
|
//进入云教练
|
|
|
const openView = (item: any) => {
|
|
|
const Authorization = sessionStorage.getItem('Authorization') || ''
|
|
|
- const dev = /(localhost|192)/.test(location.host)
|
|
|
- console.log(dev, 'https://ponline.colexiu.com')
|
|
|
- let src = `${
|
|
|
- dev ? `http://192.168.3.114:3000` : location.origin
|
|
|
- }/orchestra-music-score/#/?id=${item.id}&Authorization=${Authorization}`
|
|
|
+ let src = `${location.origin}/orchestra-music-score/?id=${item.id}`
|
|
|
postMessage({
|
|
|
api: 'openAccompanyWebView',
|
|
|
content: {
|
|
@@ -149,9 +147,17 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ const headeRef = ref()
|
|
|
+ const headerData = reactive({
|
|
|
+ height: 0
|
|
|
+ })
|
|
|
+ onMounted(() => {
|
|
|
+ const rect = useRect(headeRef)
|
|
|
+ headerData.height = rect.height
|
|
|
+ })
|
|
|
return () => (
|
|
|
<div class={styles['accompany-music-list']}>
|
|
|
- <Sticky>
|
|
|
+ <div class={styles.heade} ref={headeRef}>
|
|
|
<DropdownMenu>
|
|
|
<DropdownItem
|
|
|
v-model:modelValue={data.value1}
|
|
@@ -196,7 +202,31 @@ export default defineComponent({
|
|
|
}}
|
|
|
</Search>
|
|
|
</div>
|
|
|
- </Sticky>
|
|
|
+ </div>
|
|
|
+ {headerData.height && <div style={{height: headerData.height + 'px'}}></div>}
|
|
|
+ <Cell
|
|
|
+ center
|
|
|
+ title="无别,胜强测试"
|
|
|
+ isLink
|
|
|
+ onClick={() => {
|
|
|
+ let src = `http://192.168.3.114:3000/orchestra-music-score/?id=1603573996544364546`
|
|
|
+ console.log("🚀 ~ 去云教练的src", src)
|
|
|
+ if (browser().isApp) {
|
|
|
+ postMessage({
|
|
|
+ api: 'openAccompanyWebView',
|
|
|
+ content: {
|
|
|
+ url: src,
|
|
|
+ orientation: 0,
|
|
|
+ isHideTitle: true,
|
|
|
+ statusBarTextColor: false,
|
|
|
+ isOpenLight: true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ location.href = src
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ ></Cell>
|
|
|
<PullRefresh v-model:modelValue={data.refreshing} onRefresh={onRefresh}>
|
|
|
<List
|
|
|
immediateCheck={false}
|
|
@@ -210,12 +240,7 @@ export default defineComponent({
|
|
|
<CellGroup inset>
|
|
|
{data.list.map((item: any) => {
|
|
|
return (
|
|
|
- <Cell
|
|
|
- center
|
|
|
- title={item.musicSheetName}
|
|
|
- isLink
|
|
|
- onClick={() => openView(item)}
|
|
|
- >
|
|
|
+ <Cell center title={item.musicSheetName} isLink onClick={() => openView(item)}>
|
|
|
{{
|
|
|
icon: () => (
|
|
|
<Icon style={{ marginRight: '12px' }} size={40} name={imgDefault} />
|
|
@@ -227,6 +252,7 @@ export default defineComponent({
|
|
|
</CellGroup>
|
|
|
</List>
|
|
|
</PullRefresh>
|
|
|
+
|
|
|
{!data.loading && !data.list.length && <OEmpty tips="空空如也" />}
|
|
|
</div>
|
|
|
)
|