|
@@ -2,9 +2,11 @@ import { defineComponent, onMounted, reactive, watch } from "vue";
|
|
import styles from "./index.module.less";
|
|
import styles from "./index.module.less";
|
|
import { api_musicSheetPage } from "../../api";
|
|
import { api_musicSheetPage } from "../../api";
|
|
import state, { togglePlay } from "/src/state";
|
|
import state, { togglePlay } from "/src/state";
|
|
-import { List, Image } from "vant";
|
|
|
|
|
|
+import { List, Image, Field } from "vant";
|
|
import { postMessage } from "/src/utils/native-message";
|
|
import { postMessage } from "/src/utils/native-message";
|
|
import qs from "query-string";
|
|
import qs from "query-string";
|
|
|
|
+import searImg from "./imgs/searImg.png"
|
|
|
|
+import huoimg from "./imgs/huo.png"
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: "TheMusicList-list",
|
|
name: "TheMusicList-list",
|
|
@@ -16,6 +18,7 @@ export default defineComponent({
|
|
},
|
|
},
|
|
setup(props) {
|
|
setup(props) {
|
|
const forms = reactive({
|
|
const forms = reactive({
|
|
|
|
+ name: "",
|
|
page: 1,
|
|
page: 1,
|
|
rows: 20,
|
|
rows: 20,
|
|
musicSheetCategoriesId: state.bizMusicCategoryId,
|
|
musicSheetCategoriesId: state.bizMusicCategoryId,
|
|
@@ -23,6 +26,7 @@ export default defineComponent({
|
|
excludeMusicId: props.recentFlag ? null : state.examSongId,
|
|
excludeMusicId: props.recentFlag ? null : state.examSongId,
|
|
});
|
|
});
|
|
const data = reactive({
|
|
const data = reactive({
|
|
|
|
+ isFocus: false,
|
|
list: [] as any[],
|
|
list: [] as any[],
|
|
finished: false,
|
|
finished: false,
|
|
loading: false,
|
|
loading: false,
|
|
@@ -46,6 +50,15 @@ export default defineComponent({
|
|
|
|
|
|
data.loading = false;
|
|
data.loading = false;
|
|
};
|
|
};
|
|
|
|
+ function handleQuery(){
|
|
|
|
+ forms.page = 1
|
|
|
|
+ forms.rows = 20
|
|
|
|
+ data.list = []
|
|
|
|
+ data.finished =false
|
|
|
|
+ data.loading = false
|
|
|
|
+ data.hasNext = true
|
|
|
|
+ getList()
|
|
|
|
+ }
|
|
watch(
|
|
watch(
|
|
() => props.recentFlag,
|
|
() => props.recentFlag,
|
|
() => {
|
|
() => {
|
|
@@ -78,6 +91,11 @@ export default defineComponent({
|
|
};
|
|
};
|
|
return () => (
|
|
return () => (
|
|
<div class={styles.wrap}>
|
|
<div class={styles.wrap}>
|
|
|
|
+ <div class={[styles.searchBox,data.isFocus && styles.isFocus]}>
|
|
|
|
+ <img src={searImg} />
|
|
|
|
+ <Field placeholder="请输入曲目名称" v-model={forms.name} autocomplete="off" onFocus={()=>{ data.isFocus = true }} onBlur={()=>{ data.isFocus = false }} />
|
|
|
|
+ <div class={styles.searchBtn} onClick={handleQuery}>搜索</div>
|
|
|
|
+ </div>
|
|
<List
|
|
<List
|
|
loading={data.loading}
|
|
loading={data.loading}
|
|
finished={data.finished}
|
|
finished={data.finished}
|
|
@@ -96,7 +114,10 @@ export default defineComponent({
|
|
</div>
|
|
</div>
|
|
<div class={styles.content}>
|
|
<div class={styles.content}>
|
|
<p class={styles.name}>{item.musicSheetName}</p>
|
|
<p class={styles.name}>{item.musicSheetName}</p>
|
|
- {item.composer && <p class={styles.author}>{item.composer}</p>}
|
|
|
|
|
|
+ <div class={styles.detail}>
|
|
|
|
+ {item.usedNum && <div class={styles.usedNum}><img src={huoimg}/><div>{item.usedNum}</div></div>}
|
|
|
|
+ {item.composer && <p class={styles.author}>{item.composer}</p>}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|