feat: 修改样式和启动命令

This commit is contained in:
alger
2023-12-19 14:42:53 +08:00
parent 9211dcd3bb
commit 6c8229a21d
13 changed files with 239 additions and 233 deletions
+1 -1
View File
@@ -14,8 +14,8 @@ function createWindow() {
win.setMinimumSize(1280, 900); win.setMinimumSize(1280, 900);
if (process.env.NODE_ENV === 'dev') { if (process.env.NODE_ENV === 'dev') {
win.loadURL('http://localhost:4678/')
win.webContents.openDevTools({ mode: 'detach' }) win.webContents.openDevTools({ mode: 'detach' })
win.loadURL('http://localhost:4678/')
} else { } else {
win.loadURL(`file://${__dirname}/dist/index.html`) win.loadURL(`file://${__dirname}/dist/index.html`)
} }
+1
View File
@@ -10,6 +10,7 @@
href="./public/icon/iconfont.css" href="./public/icon/iconfont.css"
/> />
<link rel="stylesheet" href="./public/css/animate.css" /> <link rel="stylesheet" href="./public/css/animate.css" />
<link rel="stylesheet" href="./public/css/base.css" />
<style> <style>
:root { :root {
--animate-delay: 0.5s; --animate-delay: 0.5s;
+3 -4
View File
@@ -7,9 +7,9 @@
"build": "vite build", "build": "vite build",
"serve": "vite preview", "serve": "vite preview",
"es": "vite && electron .", "es": "vite && electron .",
"eb": "vite build && electron-builder", "start": "set NODE_ENV=production && electron .",
"start": "electron .", "e:b": "electron-builder --config ./electron.config.json",
"e:b": "electron-builder --config ./electron.config.json" "eb": "vite build && e:b"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/postcss7-compat": "^2.2.4", "@tailwindcss/postcss7-compat": "^2.2.4",
@@ -35,7 +35,6 @@
"typescript": "^4.3.2", "typescript": "^4.3.2",
"vfonts": "^0.1.0", "vfonts": "^0.1.0",
"vite": "^4.4.7", "vite": "^4.4.7",
"vite-plugin-electron-builder": "^0.1.0",
"vite-plugin-vue-devtools": "1.0.0-beta.5", "vite-plugin-vue-devtools": "1.0.0-beta.5",
"vue-tsc": "^0.0.24" "vue-tsc": "^0.0.24"
} }
+3
View File
@@ -0,0 +1,3 @@
body{
background-color: #000;
}
+2 -2
View File
@@ -2,7 +2,7 @@
<!-- 歌单分类列表 --> <!-- 歌单分类列表 -->
<div class="play-list-type"> <div class="play-list-type">
<div class="title" :class="setAnimationClass('animate__fadeInLeft')">歌单分类</div> <div class="title" :class="setAnimationClass('animate__fadeInLeft')">歌单分类</div>
<n-layout> <div>
<template v-for="(item, index) in playlistCategory?.sub" :key="item.name"> <template v-for="(item, index) in playlistCategory?.sub" :key="item.name">
<span <span
class="play-list-type-item" class="play-list-type-item"
@@ -24,7 +24,7 @@
" "
@click="isShowAllPlaylistCategory = !isShowAllPlaylistCategory" @click="isShowAllPlaylistCategory = !isShowAllPlaylistCategory"
>{{ !isShowAllPlaylistCategory ? "显示全部" : "隐藏一些" }}</div> >{{ !isShowAllPlaylistCategory ? "显示全部" : "隐藏一些" }}</div>
</n-layout> </div>
</div> </div>
</template> </template>
+1 -2
View File
@@ -137,8 +137,7 @@ defineExpose({
.music-lrc { .music-lrc {
background-color: inherit; background-color: inherit;
min-width: 400px; width: 500px;
max-width: 800px;
height: 550px; height: 550px;
&-text { &-text {
+2 -2
View File
@@ -82,7 +82,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { SongResult } from '@/type/music' import type { SongResult } from '@/type/music'
import { secondToMinute, getImgUrl } from '@/utils' import { secondToMinute, getImgUrl, getIsMc } from '@/utils'
import { computed, onMounted, ref, watch } from 'vue' import { computed, onMounted, ref, watch } from 'vue'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { setAnimationClass } from '@/utils' import { setAnimationClass } from '@/utils'
@@ -107,7 +107,7 @@ const playMusicUrl = ref('')
watch( watch(
() => store.state.playMusicUrl, () => store.state.playMusicUrl,
async (value, oldValue) => { async (value, oldValue) => {
const isUrlHasMc = location.href.includes('mc.') const isUrlHasMc = getIsMc()
if (value && isUrlHasMc) { if (value && isUrlHasMc) {
let playMusicUrl1 = value as string let playMusicUrl1 = value as string
if (!ProxyUrl) { if (!ProxyUrl) {
+31 -31
View File
@@ -1,54 +1,54 @@
const layoutRouter = [ const layoutRouter = [
{ {
path: "/", path: '/',
name: "home", name: 'home',
mate: { mate: {
keepAlive: true, keepAlive: true,
title: "首页", title: '首页',
icon: "icon-Home", icon: 'icon-Home',
}, },
component: () => import("@/views/home/index.vue"), component: () => import('@/views/home/index.vue'),
}, },
{ {
path: "/search", path: '/search',
name: "search", name: 'search',
mate: { mate: {
title: "搜索", title: '搜索',
keepAlive: true, keepAlive: true,
icon: "icon-Search", icon: 'icon-Search',
}, },
component: () => import("@/views/search/index.vue"), component: () => import('@/views/search/index.vue'),
}, },
{ {
path: "/list", path: '/list',
name: "list", name: 'list',
mate: { mate: {
title: "歌单", title: '歌单',
keepAlive: true, keepAlive: true,
icon: "icon-Paper", icon: 'icon-Paper',
}, },
component: () => import("@/views/list/index.vue"), component: () => import('@/views/list/index.vue'),
}, },
{ {
path: "/user", path: '/user',
name: "user", name: 'user',
mate: { mate: {
title: "用户", title: '用户',
keepAlive: true, keepAlive: true,
icon: "icon-Profile", icon: 'icon-Profile',
}, },
component: () => import("@/views/user/index.vue"), component: () => import('@/views/user/index.vue'),
}, },
{ // {
path: "/test", // path: "/test",
name: "test", // name: "test",
mate: { // mate: {
title: "用户", // title: "用户",
keepAlive: true, // keepAlive: true,
icon: "icon-Profile", // icon: "icon-Profile",
}, // },
component: () => import("@/views/test/test.vue"), // component: () => import("@/views/test/test.vue"),
}, // },
]; ]
export default layoutRouter; export default layoutRouter;
+1 -1
View File
@@ -31,7 +31,7 @@ export const getIsMc = () => {
return true return true
} }
export const getImgUrl = computed(() => (url: string, size: string) => { export const getImgUrl = computed(() => (url: string, size: string = '') => {
const bdUrl = 'https://image.baidu.com/search/down?url=' const bdUrl = 'https://image.baidu.com/search/down?url='
const imgUrl = encodeURIComponent(`${url}?param=${size}`) const imgUrl = encodeURIComponent(`${url}?param=${size}`)
return `${bdUrl}${imgUrl}` return `${bdUrl}${imgUrl}`
+7 -6
View File
@@ -1,5 +1,6 @@
<template> <template>
<n-layout class="main-page" :native-scrollbar="false"> <div class="main-page">
<n-scrollbar>
<!-- 推荐歌手 --> <!-- 推荐歌手 -->
<recommend-singer /> <recommend-singer />
<div class="main-content"> <div class="main-content">
@@ -10,7 +11,8 @@
<!-- 推荐最新专辑 --> <!-- 推荐最新专辑 -->
<recommend-album /> <recommend-album />
</div> </div>
</n-layout> </n-scrollbar>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@@ -22,11 +24,10 @@ const RecommendAlbum = defineAsyncComponent(() => import("@/components/Recommend
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-page { .main-page{
@apply mt-4 h-full; @apply pt-4 h-full w-full;
} }
.main-content { .main-content {
@apply mt-6 flex; @apply mt-6 flex pb-28;
} }
</style> </style>
+6 -6
View File
@@ -105,7 +105,7 @@ const handlePlay = (item: any) => {
<template> <template>
<div class="list-page"> <div class="list-page">
<!-- 歌单列表 --> <!-- 歌单列表 -->
<n-layout class="recommend" :native-scrollbar="false" @click="showMusic = false"> <n-scrollbar class="recommend" @click="showMusic = false" :size="100">
<div <div
class="recommend-title" class="recommend-title"
:class="setAnimationClass('animate__bounceInLeft')" :class="setAnimationClass('animate__bounceInLeft')"
@@ -133,7 +133,7 @@ const handlePlay = (item: any) => {
<div class="recommend-item-title">{{ item.name }}</div> <div class="recommend-item-title">{{ item.name }}</div>
</div> </div>
</div> </div>
</n-layout> </n-scrollbar>
<transition name="musicPage"> <transition name="musicPage">
<div class="music-page" v-if="showMusic"> <div class="music-page" v-if="showMusic">
@@ -157,7 +157,7 @@ const handlePlay = (item: any) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.list-page { .list-page {
@apply relative h-full; @apply relative h-full w-full pt-4;
} }
.musicPage-enter-active { .musicPage-enter-active {
@@ -169,13 +169,13 @@ const handlePlay = (item: any) => {
} }
.recommend { .recommend {
@apply w-full h-full; @apply w-full h-full bg-none;
&-title { &-title {
@apply text-lg font-bold text-white py-4; @apply text-lg font-bold text-white pb-4;
} }
&-list { &-list {
@apply grid gap-6 pb-28; @apply grid gap-6 pb-28 pr-3;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
} }
&-item { &-item {
+4 -1
View File
@@ -46,6 +46,9 @@ const timerIsQr = (key: string) => {
console.log(res); console.log(res);
}) })
clearInterval(timer) clearInterval(timer)
setTimeout(() => {
router.push('/user')
}, 1000);
} }
}, 5000); }, 5000);
} }
@@ -67,7 +70,7 @@ const loginPhone = async () => {
store.state.user = data.profile store.state.user = data.profile
localStorage.setItem('token', data.cookie) localStorage.setItem('token', data.cookie)
setTimeout(() => { setTimeout(() => {
router.push('/') router.push('/user')
}, 1000); }, 1000);
} }
} }
+1 -1
View File
@@ -89,7 +89,7 @@ const handlePlay = (item: any) => {
<div class="page"> <div class="page">
<div class="user-name">{{ user.nickname }}</div> <div class="user-name">{{ user.nickname }}</div>
<div class="user-info"> <div class="user-info">
<n-avatar round :size="50" :src="user.avatarUrl" /> <n-avatar round :size="50" :src="getImgUrl(user.avatarUrl)" />
<div class="user-info-list"> <div class="user-info-list">
<div class="user-info-item"> <div class="user-info-item">
<div class="label">{{ userDetail.profile.followeds }}</div> <div class="label">{{ userDetail.profile.followeds }}</div>