This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
appcat
/
sonist
Archived
1
0
Fork 0

屏蔽未开放的功能

2.x 0.9.0-alpha1
宇天 2019-01-19 23:29:34 +08:00
parent c3bdde6495
commit 6730b5f3c0
10 changed files with 28 additions and 68 deletions

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<link href="lib/css/reset-basic.css" rel="stylesheet">
<link href="/css/desktop-lrc.css" rel="stylesheet">
<script>window.LIBS_BASE_URL = location.origin + '/lib';window.__ENV_LANG__ = 'zh'</script>
<script>window.LIBS_BASE_URL = location.origin + '/lib';</script>
<script type="module" src="js/desktop-lrc.js"></script>
</head>
<body class="do-fn-noselect" anot="lrc">

View File

@ -8,7 +8,7 @@
<link href="lib/css/elem-ui.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
<link href="css/modules.css" rel="stylesheet">
<script>window.LIBS_BASE_URL = location.origin + '/lib';window.__ENV_LANG__ = 'zh'</script>
<script>window.LIBS_BASE_URL = location.origin + '/lib';</script>
<script type="module" src="js/app.js"></script>
</head>
<body class="do-fn-noselect" anot="app" :css="{'background-image': coverBG}">

View File

@ -15,6 +15,7 @@ import Api from '/js/api.js'
import Artist from '/js/modules/artist.js'
import Local from '/js/modules/local.js'
import Profile from '/js/modules/profile.js'
import Search from '/js/modules/search.js'
import KTV from '/js/modules/ktv.js'
@ -80,10 +81,9 @@ const LRC_WIN = new remote.BrowserWindow({
hasShadow: false,
thickFrame: false,
transparent: true,
// focusable: false,
show: false
})
// LRC_WIN.setIgnoreMouseEvents(true)
window.LRC_WIN = LRC_WIN
LRC_WIN.loadURL('app://sonist/desktop-lrc.html')
@ -237,6 +237,9 @@ Anot({
case 'profile':
Profile.__init__()
break
case 'search':
Search.__init__()
break
default:
break
}

0
src/js/modules/rank.js Normal file
View File

View File

@ -14,20 +14,10 @@ export default Anot({
$id: 'search',
state: {
filter: 'hot',
list: [], //歌手列表
display: 'artist', // list | artist | album
artist: {
avatar:
'http://singerimg.kugou.com/uploadpic/softhead/240/20181023/20181023141706176.jpg',
id: 3060,
name: '薛之谦',
info: '',
songCount: 0,
mvCount: 0,
albumCount: 0
},
songList: [], //单曲列表
albumList: [] //专辑列表
list: [] //歌手列表
},
methods: {}
methods: {
__init__() {},
play() {}
}
})

View File

@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<link href="lib/css/reset-basic.css" rel="stylesheet">
<link href="/css/desktop-lrc.css" rel="stylesheet">
<script>window.LIBS_BASE_URL = location.origin + '/lib';window.__ENV_LANG__ = 'zh'</script>
<script type="module" src="js/desktop-lrc.js"></script>
</head>
<body class="do-fn-noselect" anot="lrc">
<div class="lrc-box">
<section class="left">
<span class="shadow" :text="lrc.l.txt"></span>
</section>
<section class="right">
<span class="shadow" :text="lrc.r.txt"></span>
</section>
</div>
<div class="lrc-box">
<section class="left">
<span :text="lrc.l.txt" :css="{background: lrc.l.bg}"></span>
</section>
<section class="right">
<span :text="lrc.r.txt" :css="{background: lrc.r.bg}"></span>
</section>
</div>
<div class="touch-bar do-fn-drag">
<a class="do-icon-lock lock do-fn-nodrag" :class="{actived: isLock}" :click="lock"></a>
<a class="do-icon-close quit do-fn-nodrag" :click="quit"></a>
</div>
</body>
</html>

View File

@ -4,7 +4,6 @@ const {
protocol,
Tray,
Menu,
MenuItem,
session
} = require('electron')
const path = require('path')
@ -30,8 +29,7 @@ let tray = null
const TRAYMENU_TMPL = [
{
label: '显示Sonist',
type: 'normal',
label: '显示主窗口',
click: () => {
win.show()
}
@ -40,8 +38,7 @@ const TRAYMENU_TMPL = [
type: 'separator'
},
{
label: '退出应用',
type: 'normal',
label: '退出',
role: 'quit'
}
]
@ -57,7 +54,7 @@ const MENUBAR_TMPL = [
]
if (process.platform === 'darwin') {
MENU_TMPL.unshift({
MENUBAR_TMPL.unshift({
label: 'Sonist',
submenu: [{ role: 'about' }, { type: 'separator' }, { role: 'quit' }]
})
@ -89,7 +86,9 @@ function createWindow() {
// 然后加载应用的 index.html。
win.loadURL('app://sonist/index.html')
}
app.commandLine.appendSwitch('--lang', 'zh-CN')
app.commandLine.appendSwitch('--autoplay-policy', 'no-user-gesture-required')
app.setPath('appData', path.resolve(HOME, '.sonist/'))
protocol.registerStandardSchemes(['app'], { secure: true })
@ -102,7 +101,7 @@ if (!fs.exists(appPath)) {
}
// 创建窗口
app.on('ready', () => {
app.once('ready', () => {
protocol.registerBufferProtocol('app', (req, cb) => {
let file = req.url.replace(/^app:\/\/sonist\//, '')
let ext = path.extname(req.url).slice(1)
@ -116,15 +115,18 @@ app.on('ready', () => {
tray.on('click', _ => {
win.show()
})
tray.on('right-click', _ => {
tray.popUpContextMenu(traymenuList)
})
} else {
tray.setContextMenu(traymenuList)
}
Menu.setApplicationMenu(menubarList)
// const ses = session.defaultSession
// ses.setUserAgent('Hello wolrd')
session.defaultSession.setUserAgent(
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36'
)
createWindow()
// win.tray = tray
win.webContents.openDevTools()
// win.openDevTools()
})

View File

@ -38,7 +38,7 @@
<section class="block">
<span class="label">关于Sonist</span>
<div class="desc">
<p>当前版本: 0.0.1</p>
<p>当前版本: 0.9.0-alpha1</p>
<p>Sonist是一个本地音乐播放器, 同时支持酷狗的API来获取最新的歌曲信息,如排行榜, 最近单曲等(不提供下载服务, 仅为资讯展示, 如需要下载请到酷狗官网购买下载)。</p>
<p>本播放器所使用的歌词/封面信息均来源于网络搜索, 不保证内容的准确性和时效性。</p>
<p>免责声明</p>

1
src/views/rank.htm Normal file
View File

@ -0,0 +1 @@
<h1>敬请期待...</h1>

View File

@ -1,4 +1,4 @@
<div class="do-mod-search">
<div class="do-mod-search" anot="search">
<div class="tabbar">
<span class="item active">我的音乐</span>
<span class="item">汪苏泷 <i class="do-icon-close"></i></span>
@ -17,7 +17,6 @@
</thead>
<tbody>
<tr
:class="{active: it.id === curr.id}"
:for="it in list"
:dblclick="play(it, $index)">
<td><i class="s-icon-music"></i></td>