- 升级tauri1.4 - 隐藏未完的页面 - 修复一些bug

This commit is contained in:
ZilongYang
2023-06-29 14:40:56 +08:00
parent a3c872c7d7
commit 3cc551fe0d
45 changed files with 5698 additions and 4692 deletions

View File

@@ -50,7 +50,8 @@ const route = useRoute();
const type = ref(snap.type);
const page = ref(snap.page);
const pageSize = ref(snap.pageSize);
const keywords = ref(props.keywords);
// const keywords = ref(props.keywords);
const keywords = ref('');
// type.value=snap.type
// page.value=snap.page
@@ -67,20 +68,35 @@ const djRadios = ref([]);
const mvs = ref([]);
const videos = ref([]);
watch(
() => [props.keywords, type.value, page.value, pageSize.value],
([k, t]) => {
keywords.value = k;
// console.log('Searching...', keywords.value, type.value, page.value, pageSize.value);
search();
// watch(
// () => [keywords.value, type.value, page.value, pageSize.value],
// ([k, t]) => {
// // keywords.value = k;
// console.log('watch Searching...', keywords.value, type.value, page.value, pageSize.value);
// search();
// }
// // { immediate: true }
// );
const token = pubsub.subscribe("zp", (msg, data) => {
switch (msg) {
case "zp.search":
keywords.value = data;
page.value = 1
search();
break;
}
// { immediate: true }
);
});
onMounted(() => {
search();
});
//卸载组件
onUnmounted(() => {
pubsub.unsubscribe(token);
});
// let firstTime = true;
// onActivated(()=>{
// console.log('actived---------');
@@ -124,7 +140,9 @@ const search = () => {
.then((res) => {
if (res.data.code == 200) {
if (type.value == 1) {
// console.log("单曲", res.data.result.songCount, res.data.result.songs.length)
count.value = res.data.result.songCount;
// console.log(count.value)
songs.value = res.data.result.songs;
} else if (type.value == 100) {
count.value = res.data.result.artistCount;
@@ -200,6 +218,7 @@ const click = () => {
const pageChange = (p) => {
page.value = p;
saveSnap({ scrollTop: 0 });
search();
};
</script>
@@ -221,6 +240,7 @@ const pageChange = (p) => {
@click="
type = 1;
page = 1;
search();
"
>
单曲
@@ -231,6 +251,7 @@ const pageChange = (p) => {
@click="
type = 100;
page = 1;
search();
"
>
歌手
@@ -241,6 +262,7 @@ const pageChange = (p) => {
@click="
type = 10;
page = 1;
search();
"
>
专辑
@@ -251,6 +273,7 @@ const pageChange = (p) => {
@click="
type = 1000;
page = 1;
search();
"
>
歌单
@@ -261,6 +284,7 @@ const pageChange = (p) => {
@click="
type = 1009;
page = 1;
search();
"
>
电台
@@ -271,6 +295,7 @@ const pageChange = (p) => {
@click="
type = 1004;
page = 1;
search();
"
>
MV
@@ -281,6 +306,7 @@ const pageChange = (p) => {
@click="
type = 1014;
page = 1;
search();
"
>
视频