Compare commits

...

18 Commits

Author SHA1 Message Date
hunlongyu
96c9aa56fa 0.5.8 2019-12-24 11:40:27 +08:00
hunlongyu
be6f4a57c6 修改播放器的大小位置 2019-12-24 11:40:00 +08:00
hunlongyu
72f4502ccb v0.5.6 2019-12-24 10:26:06 +08:00
hunlongyu
c0194b94a4 0.5.6 2019-12-24 10:19:03 +08:00
hunlongyu
f5d4489f88 v0.5.5 2019-12-24 10:18:55 +08:00
hunlongyu
9fa1bf2ccc v0.5.5 2019-12-24 10:08:37 +08:00
hunlongyu
e10d06f9f8 v0.5.4 2019-12-24 10:02:39 +08:00
hunlongyu
6fee707e0d v0.5.3 2019-12-24 09:55:14 +08:00
hunlongyu
8dfb3b8c01 v0.5.2 2019-12-24 09:52:23 +08:00
Hunlongyu
2899d81ba5 Create LICENSE 2019-12-24 09:41:54 +08:00
hunlongyu
58387784ee modify vue config 2019-12-24 09:33:26 +08:00
hunlongyu
c7b4f77f34 新增Logo 2019-12-23 18:53:36 +08:00
hunlongyu
f6bef563d2 核心功能完成 2019-12-23 15:45:35 +08:00
Hunlongyu
3488d7c2ed modify version 2019-12-12 15:52:51 +08:00
Hunlongyu
3a69b0616a detail done 2019-12-12 15:52:26 +08:00
Hunlongyu
5df7f0e0cc modify version 2019-12-11 10:52:18 +08:00
Hunlongyu
b12ab83747 collection done 2019-12-11 10:30:46 +08:00
Hunlongyu
5fa078d628 remove console.log 2019-12-11 09:00:01 +08:00
29 changed files with 775 additions and 168 deletions

29
AppVeyor.yml Normal file
View File

@@ -0,0 +1,29 @@
version: 0.1.{build}
branches:
only:
- master
image: Visual Studio 2017
platform:
- x64
cache:
- node_modules
- '%APPDATA%\npm-cache'
- '%USERPROFILE%\.electron'
- '%USERPROFILE%\AppData\Local\Yarn\cache'
init:
- git config --global core.autocrlf input
install:
- ps: Install-Product node 8 x64
- git reset --hard HEAD
- yarn
- node --version
build_script:
- yarn run release
test: off

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Hunlongyu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,7 +1,9 @@
{
"name": "zy-player",
"version": "0.2.2",
"private": true,
"version": "0.5.8",
"author": "Hunlongyu",
"description": "A Video Player",
"license": "MIT",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
@@ -9,7 +11,11 @@
"electron:build": "vue-cli-service electron:build",
"dev": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps"
"postuninstall": "electron-builder install-app-deps",
"publish": "electron-builder --publish onTagOrDraft",
"patch": "npm version patch && git push origin master && git push origin --tags",
"minor": "npm version minor && git push origin master && git push origin --tags",
"major": "npm version major && git push origin master && git push origin --tags"
},
"main": "background.js",
"dependencies": {
@@ -19,7 +25,9 @@
"view-design": "^4.0.2",
"vue": "^2.6.10",
"vue-router": "^3.0.3",
"vuex": "^3.0.1"
"vuex": "^3.0.1",
"xgplayer": "^2.4.1",
"xgplayer-hls.js": "^2.1.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.12.0",

BIN
public/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

BIN
public/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>evt</title>
<title>ZY Player</title>
</head>
<body>
<noscript>

View File

@@ -4,9 +4,9 @@
<Sider class="sider" width="70"><ZYSider /></Sider>
<Layout>
<Header class="header"><ZYHeader /></Header>
<Content class="content">
<ZYContent class="content">
<router-view />
</Content>
</ZYContent>
</Layout>
</Layout>
</div>
@@ -15,6 +15,7 @@
import { mapGetters, mapActions } from 'vuex'
import ZYSider from '@/components/zy_sider.vue'
import ZYHeader from '@/components/zy_header.vue'
import ZYContent from '@/components/zy_content.vue'
import setting from './plugin/nedb/setting'
export default {
name: 'app',
@@ -28,7 +29,8 @@ export default {
},
components: {
ZYSider,
ZYHeader
ZYHeader,
ZYContent
},
methods: {
...mapActions([
@@ -51,6 +53,7 @@ export default {
</script>
<style lang="scss">
@import './assets/global/global.scss';
@import './assets/theme/dark.scss';
@import './assets/theme/light.scss';
html, body, #app, .box{
@@ -62,5 +65,9 @@ html, body, #app, .box{
height: 50px;
padding: 0;
}
.content{
width: 100%;
height: 100%;
}
}
</style>

View File

@@ -0,0 +1,50 @@
.detail{
padding: 10px;
.detail-box{
border: 1px solid #ddd;
padding: 10px;
display: flex;
justify-content: flex-start;
align-items: flex-start;
margin-bottom: 10px;
flex-wrap: wrap;
.vodImg{
width: 200px;
img{
width: 100%;
height: auto;
}
}
.vodInfo{
flex: 1;
overflow: hidden;
margin-left: 20px;
.vodh{
h2{
display: inline-block;
}
span{
font-size: 12px;
color: #999;
margin-left: 10px;
}
label{
font-size: 20px;
font-weight: bold;
color: #f90;
margin-left: 20px;
}
}
li{
list-style: none;
font-size: 12px;
color: #666;
height: 20px;
overflow: hidden;
a{
pointer-events: none;
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -52,4 +52,11 @@
}
}
}
.collection{
.ivu-table-cell{
button{
margin: 0 4px;
}
}
}
}

View File

@@ -23,10 +23,10 @@ function createWindow () {
webPreferences: {
webSecurity: false,
nodeIntegration: true
}
},
icon: `${__static}/app.ico`
})
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)

View File

@@ -1,24 +0,0 @@
<template>
<div class="detail">{{ video }}</div>
</template>
<script>
export default {
name: 'detail',
computed: {
video () {
return this.$store.getters.getVideo
}
}
}
</script>
<style lang="scss" scoped>
.detail{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
background-color: #fff;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<Row></Row>
<router-view />
</template>
<script>
export default {

View File

@@ -18,7 +18,11 @@ export default {
</script>
<style lang="scss" scoped>
.header-box{
height: 100%;
position: absolute;
top: 0;
left: 70px;
width: calc(100% - 70px);
height: 50px;
-webkit-app-region: drag;
-webkit-user-select: none;
display: flex;

View File

@@ -1,13 +1,13 @@
<template>
<Row class="sider-box">
<div class="top">
<Icon :class="iconActive === 'list' ? 'active': ''" type="md-list" @click="iconClickEvent('list')"/>
<Icon :class="iconActive === 'search' ? 'active': ''" type="md-search" @click="iconClickEvent('search')"/>
<Icon :class="iconActive === 'play' ? 'active': ''" type="md-play" @click="iconClickEvent('play')"/>
<Icon :class="iconActive === 'collection' ? 'active': ''" type="md-star" @click="iconClickEvent('collection')"/>
<Icon title="搜索" :class="iconActive === 'search' ? 'active': ''" type="md-search" @click="iconClickEvent('search')"/>
<Icon title="详情" v-show="Object.keys(video).length !== 0" :class="iconActive === 'detail' ? 'active': ''" type="md-list" @click="iconClickEvent('detail')"/>
<Icon title="播放" v-show="Object.keys(video).length !== 0" :class="iconActive === 'play' ? 'active': ''" type="md-play" @click="iconClickEvent('play')"/>
<Icon title="收藏" :class="iconActive === 'collection' ? 'active': ''" type="md-star" @click="iconClickEvent('collection')"/>
</div>
<div class="bottom">
<Icon :class="iconActive === 'settings' ? 'active': ''" type="md-settings" @click="iconClickEvent('settings')"/>
<Icon title="设置" :class="iconActive === 'settings' ? 'active': ''" type="md-settings" @click="iconClickEvent('settings')"/>
</div>
</Row>
</template>
@@ -17,6 +17,9 @@ export default {
computed: {
iconActive () {
return this.$store.getters.getIconActive
},
video () {
return this.$store.getters.getVideo
}
},
methods: {

View File

@@ -2,7 +2,8 @@ import Vue from 'vue'
import 'view-design/dist/styles/iview.css'
import {
Layout, Sider, Header, Content, Row, Col,
Icon, Button, Input, Progress, Table
Icon, Button, Input, Progress, Table,
Message, Notice
} from 'view-design'
Vue.component('Layout', Layout)
@@ -16,3 +17,9 @@ Vue.component('Button', Button)
Vue.component('Input', Input)
Vue.component('Progress', Progress)
Vue.component('Table', Table)
Vue.prototype.$Message = Message
Vue.prototype.$Notice = Notice
Vue.prototype.$Notice.config({
top: 60
})

View File

@@ -1,22 +1,22 @@
import Vue from 'vue'
import Router from 'vue-router'
import List from './views/List.vue'
import Search from './views/Search.vue'
Vue.use(Router)
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
// mode: 'history',
// base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'list',
component: List
name: 'search',
component: Search
},
{
path: '/search',
name: 'search',
component: () => import(/* webpackChunkName: "about" */ './views/Search.vue')
path: '/detail',
name: 'detail',
component: () => import(/* webpackChunkName: "about" */ './views/Detail.vue')
},
{
path: '/settings',

View File

@@ -36,9 +36,6 @@ export default new Vuex.Store({
}
},
actions: {
addCollection: (payload) => {
// localStorage.collection = payload
},
changeTheme: ({ commit }, payload) => {
setting.update(payload.id, { theme: payload.color }).then(res => {
commit('SET_THEME', payload)

94
src/util/util.666zy.js Normal file
View File

@@ -0,0 +1,94 @@
import axios from 'axios'
const haku = {
url: 'https://www.666zy.com',
getHtml (txt) {
return new Promise((resolve, reject) => {
const t = encodeURI(txt)
const d = `wd=${t}&submit=search`
axios({
url: this.url + '/index.php',
method: 'post',
params: { m: 'vod-search' },
data: d
}).then(res => {
resolve(this.getVideoInfo(res.data))
}).catch(err => {
reject(err)
})
})
},
getVideoInfo (txt) {
return new Promise((resolve, reject) => {
const parser = new DOMParser()
let html = parser.parseFromString(txt, 'text/html')
let nameList = html.querySelectorAll('.xing_vb4 a')
let name = []
let detail = []
for (let i = 0; i < nameList.length; i++) {
name.push(nameList[i].innerText)
detail.push(this.url + nameList[i].getAttribute('href'))
}
let categoryList = html.querySelectorAll('.xing_vb5 a')
let category = []
for (let i = 0; i < categoryList.length; i++) {
category.push(categoryList[i].innerText)
}
let timeList = html.querySelectorAll('.xing_vb6')
let time = []
for (let i = 0; i < timeList.length; i++) {
time.push(timeList[i].innerText)
}
let data = []
for (let i = 0; i < name.length; i++) {
let d = {}
d.name = name[i]
d.detail = detail[i]
d.category = category[i]
d.time = time[i]
d.index = 0
d.urls = []
d.check = false
data.push(d)
}
resolve(data)
})
},
getDetail (url) {
return new Promise((resolve, reject) => {
axios({
url: url,
method: 'get'
}).then(res => {
resolve(this.getUrls(res.data))
}).catch(err => {
reject(err)
})
})
},
getUrls (txt) {
return new Promise((resolve, reject) => {
const parser = new DOMParser()
let html = parser.parseFromString(txt, 'text/html')
let data = {
box: null,
info: null,
urls: []
}
data.box = html.querySelector('.vodBox').innerHTML
data.info = html.querySelector('.vodplayinfo').innerHTML
let url = html.querySelectorAll('.vodplayinfo a')
let arr = []
for (let i in url) {
let j = url[i].innerHTML
if (j !== undefined && j.indexOf('.m3u8') !== -1) {
arr.push(url[i].innerHTML)
}
}
data.urls = arr
resolve(data)
})
}
}
export default haku

View File

@@ -1,54 +0,0 @@
// import Axios from "axios"
import axios from 'axios'
const video = {
getList (url, txt) {
return new Promise((resolve, reject) => {
const t = encodeURI(txt)
const d = `wd=${t}&submit=search`
axios({
url: url,
method: 'post',
params: { m: 'vod-search' },
data: d
}).then(res => {
resolve(this.parser(url, res.data))
})
})
},
parser (url, txt) {
return new Promise((resolve, reject) => {
const parser = new DOMParser()
let html = parser.parseFromString(txt, 'text/html')
let data = []
let name = []
let detail = []
let category = []
let time = []
let nameList = html.querySelectorAll('.xing_vb4 a')
for (let i = 0; i < nameList.length; i++) {
name.push(nameList[i].innerText)
detail.push(url + nameList[i].getAttribute('href'))
}
let typeList = html.querySelectorAll('.xing_vb5 a')
for (let i = 0; i < typeList.length; i++) {
category.push(typeList[i].innerText)
}
let timeList = html.querySelectorAll('.xing_vb6')
for (let i = 0; i < timeList.length; i++) {
time.push(timeList[i].innerText)
}
for (let i = 0; i < name.length; i++) {
let d = {}
d.name = name[i]
d.detail = detail[i]
d.category = category[i]
d.time = time[i]
data.push(d)
}
console.log(data)
resolve(data)
})
}
}
export default video

View File

@@ -1,8 +1,90 @@
<template>
<Row class="collection">collection</Row>
<Row class="collection">
<div class="collectionBox">
<Table stripe :columns="columns" :data="data" :loading="loading">
<template slot-scope="{ row }" slot="action" >
<Button size="small" @click="play(row)">Play</Button>
<Button size="small" type="info" ghost @click="detailShow(row)">Detail</Button>
<Button size="small" type="error" ghost @click="deleteLi(row)">Delete</Button>
</template>
</Table>
</div>
</Row>
</template>
<script>
import db from '@/plugin/nedb/video'
export default {
name: 'collection'
name: 'collection',
data () {
return {
columns: [
{
title: 'Name',
key: 'name',
sortable: true
},
{
title: 'Category',
key: 'category',
width: 120,
align: 'center'
},
{
title: 'Time',
key: 'time',
width: 180,
align: 'center'
},
{
title: 'Action',
slot: 'action',
align: 'center',
width: 260
}
],
data: [],
loading: false,
detail: false
}
},
methods: {
getList () {
db.find().then(res => {
this.data = res
})
},
play (e) {
this.$router.push({ name: 'play' })
this.$store.commit('SET_ICON_ACTIVE', 'play')
this.$store.commit('SET_VIDEO', e)
},
detailShow (e) {
this.$store.commit('SET_ICON_ACTIVE', 'detail')
this.$store.commit('SET_VIDEO', e)
this.$router.push({ name: 'detail' })
},
deleteLi (e) {
db.remove(e._id).then(res => {
this.getList()
})
}
},
created () {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.collection{
height: 100%;
position: relative;
.collectionBox{
position: absolute;
width: 100%;
top: 0px;
height: 100%;
overflow: scroll;
&::-webkit-scrollbar { display: none }
}
}
</style>

71
src/views/Detail.vue Normal file
View File

@@ -0,0 +1,71 @@
<template>
<div class="detail">
<div v-show="box" class="detail-box" v-html="data.box"></div>
<div v-show="box" class="detail-box" v-html="data.info"></div>
<div v-show="box" class="detail-box">
<Button v-for="(i, j) in data.urls" :key="j" @click="playBtn(i, j, video)">{{i | ftLink}}</Button>
</div>
</div>
</template>
<script>
import haku from '@/util/util.666zy'
import { mapMutations } from 'vuex'
export default {
name: 'detail',
data () {
return {
data: {
box: null,
info: null,
m3u8: null
},
box: false
}
},
filters: {
ftLink (e) {
let name = e.split('$')[0]
return name
}
},
computed: {
video () {
return this.$store.getters.getVideo
}
},
methods: {
...mapMutations([
'SET_VIDEO'
]),
async getDetail () {
this.box = false
let url = this.video.detail
this.data = await haku.getDetail(url)
this.video.urls = this.data.urls
this.video.check = true
this.box = true
},
playBtn (i, j, e) {
this.video.index = j
this.$store.commit('SET_VIDEO', this.video)
this.$router.push({ name: 'play' })
this.$store.commit('SET_ICON_ACTIVE', 'play')
}
},
created () {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.detail{
.btns{
margin-bottom: 10px;
}
.detail-box{
button{
margin: 4px;
}
}
}
</style>

View File

@@ -1,10 +0,0 @@
<template>
<Row>
<div class="list">list</div>
</Row>
</template>
<script>
export default {
name: 'list'
}
</script>

View File

@@ -1,13 +1,119 @@
<template>
<Row class="player">{{video}}</Row>
<Row class="player">
<div class="title">{{ video.name }} -- {{ info }}</div>
<div class="playerBox">
<div id="xg"></div>
</div>
<div class="list">
<Button v-for="(i, j) in video.urls" :key="j" @click="playBtn(i, j, video)">{{i | ftLink}}</Button>
</div>
</Row>
</template>
<script>
import 'xgplayer'
import Hls from 'xgplayer-hls.js'
import haku from '@/util/util.666zy'
export default {
name: 'player',
data () {
return {
data: {},
url: null,
xg: null,
info: '',
config: {
id: 'xg',
url: null,
fluid: true,
autoplay: true,
keyShortcut: 'on',
defaultPlaybackRate: 1,
playbackRate: [0.5, 0.75, 1, 1.5, 2]
}
}
},
filters: {
ftLink (e) {
let name = e.split('$')[0]
return name
}
},
computed: {
video () {
return this.$store.getters.getVideo
}
},
methods: {
init () {
if (this.video.check) {
let url = this.video.urls[this.video.index].split('$')[1]
this.info = this.video.urls[this.video.index].split('$')[0]
this.$nextTick(() => {
this.playEvent(url)
})
} else {
this.getDetail()
}
},
async getDetail () {
let d = this.video.detail
let index = this.video.index
this.data = await haku.getDetail(d)
let urls = this.data.urls
this.video.urls = urls
this.video.check = true
let playUrl = urls[index].split('$')[1]
this.info = urls[index].split('$')[0]
this.$nextTick(() => {
this.playEvent(playUrl)
})
},
playEvent (e) {
this.config.url = e
this.xg = new Hls(this.config)
},
playBtn (i, j, e) {
this.video.index = j
let url = this.video.urls[this.video.index].split('$')[1]
this.xg.src = url
}
},
created () {
this.init()
},
destroyed () {
this.xg.destroy()
}
}
</script>
<style lang="scss" scoped>
.player{
padding: 10px;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.title{
margin-bottom: 8px;
font-size: 18px;
text-align: left;
width: 800px;
}
.playerBox{
width: 100%;
max-width: 800px;
border: 1px solid #000;
}
.list{
margin-top: 10px;
width: 800px;
text-align: left;
button{
margin-right: 10px;
margin-bottom: 10px;
}
}
}
</style>

View File

@@ -17,18 +17,18 @@
<span class="progress-txt">搜索中</span>
</Progress>
</div>
<Detail v-if="show.detail" />
</div>
</template>
<script>
import video from '@/util/util.video'
import Detail from '@/components/detail.vue'
import db from '@/plugin/nedb/video'
import haku from '@/util/util.666zy'
import { mapGetters } from 'vuex'
export default {
name: 'search',
data () {
return {
txt: '吸血鬼',
active: true,
txt: '',
active: false,
percent: 0,
columns: [
{
@@ -55,19 +55,16 @@ export default {
}
],
data: [],
loading: true,
show: {
detail: false
}
loading: true
}
},
components: {
Detail
computed: {
...mapGetters(['getVideo'])
},
methods: {
async searchEvent () {
if (this.txt !== '') {
this.data = await video.getList('http://www.666zy.com/', this.txt)
this.data = await haku.getHtml(this.txt)
this.active = true
this.loading = false
this.percent = 20
@@ -78,22 +75,48 @@ export default {
this.active = false
},
play (e) {
console.log(e)
this.$router.push({ name: 'play' })
if (this.getVideo.detail !== e.detail) {
this.$store.commit('SET_VIDEO', e)
}
this.$store.commit('SET_ICON_ACTIVE', 'play')
this.$store.commit('SET_VIDEO', e)
this.$router.push({ name: 'play' })
},
collection (e) {
this.$store.commit('SET_ICON_ACTIVE', 'collection')
this.$store.commit('SET_VIDEO', e)
async collection (e) {
let d = await haku.getDetail(e.detail)
let data = {
category: e.category,
detail: e.detail,
name: e.name,
time: e.time,
type: 'single',
index: 0,
urls: [],
check: false
}
data.urls = d.urls
data.check = true
this.$store.commit('SET_VIDEO', data)
db.find({ detail: data.detail }).then(res => {
if (res.length >= 1) {
this.$Notice.warning({
title: '资源已存在',
backgroud: true
})
} else {
db.add(data).then(res => {
this.$Notice.success({
title: '收藏成功',
backgroud: true
})
})
}
})
},
detail (e) {
this.show.detail = true
this.$store.commit('SET_VIDEO', e)
this.$store.commit('SET_ICON_ACTIVE', 'detail')
this.$router.push({ name: 'detail' })
}
},
created () {
this.searchEvent()
}
}
</script>

View File

@@ -1,13 +1,29 @@
<template>
<Row>
<Button type="primary" @click="changeTheme({ id: getTheme.id, color: 'light' })">light</Button>
<Button type="primary" @click="changeTheme({ id: getTheme.id, color: 'dark' })">Dark</Button>
<Button type="primary" @click="add()">Add</Button>
<Row class="setting">
<div class="item about">
<div class="title">关于:</div>
<ul>
<li>作者: <a href="https://github.com/Hunlongyu">Hunlongyu</a></li>
<li>官网: <a href="https://zy_player.hunlongyu.fun">ZY Player</a></li>
<li>反馈: <a href="https://github.com/Hunlongyu/ZY-Player/issues">Issues</a></li>
</ul>
</div>
<div class="item upgrade">
<div class="title">更新:</div>
<div class="btns">版本: v</div>
<div class="btns"><Button @click="checkUpgrade">检查更新</Button></div>
</div>
<div class="item theme">
<div class="title">主题:</div>
<div class="btns">
<Button @click="changeTheme({ id: getTheme.id, color: 'light' })">light</Button>
<Button @click="changeTheme({ id: getTheme.id, color: 'dark' })">Dark</Button>
</div>
</div>
</Row>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
import settingDB from '@/plugin/nedb/setting'
export default {
name: 'settings',
computed: {
@@ -19,18 +35,28 @@ export default {
...mapActions([
'changeTheme'
]),
add () {
let data = {
name: '冰雪奇缘',
detail: '1',
category: '动画片',
time: '20191206 12:12:45'
}
settingDB.add(data).then(res => {
console.log(res)
})
}
},
created () {}
checkUpgrade () {}
}
}
</script>
<style lang="scss" scoped>
.setting{
padding: 10px;
.item{
margin-bottom: 10px;
.title{
font-size: 16px;
}
ul{
margin-left: 10px;
list-style: none;
}
.btns{
margin-left: 10px;
button{
margin-right: 10px;
}
}
}
}
</style>

View File

@@ -1,6 +1,15 @@
module.exports = {
pluginOptions: {
electronBuilder: {
builderOptions: {
win: {
icon: './public/app.ico'
},
mac: {
icon: './public/app.png'
},
productName: 'ZY Player'
},
chainWebpackRendererProcess: config => {
if (process.env.NODE_ENV === 'development') {
config.plugins.delete('prefetch')

167
yarn.lock
View File

@@ -2233,7 +2233,7 @@ chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1573282949696&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=
@@ -2525,7 +2525,7 @@ commander@2.17.x:
resolved "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
integrity sha1-vXerfebelCBc6sxy8XFtKfIKd78=
commander@^2.18.0, commander@^2.20.0:
commander@^2.15.1, commander@^2.18.0, commander@^2.20.0:
version "2.20.3"
resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=
@@ -3036,6 +3036,21 @@ cyclist@^1.0.1:
resolved "https://registry.npm.taobao.org/cyclist/download/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=
d@1, d@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==
dependencies:
es5-ext "^0.10.50"
type "^1.0.1"
danmu.js@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/danmu.js/-/danmu.js-0.1.0.tgz#928fb297dc6598850cd06610dd6454a497748f6b"
integrity sha512-RRmDSbcrO8kvRJw0GsqdUk1fMhtzschsbSqZj1xop/kKeizNFuJ8BZTOZNNOH2g2sF3K6z2klJFT9ZT9F2EI2w==
dependencies:
event-emitter "^0.3.5"
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -3115,7 +3130,12 @@ deep-is@~0.1.3:
resolved "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
deepmerge@^1.5.2:
deepmerge@2.0.1, deepmerge@~2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/deepmerge/download/deepmerge-2.0.1.tgz#25c1c24f110fb914f80001b925264dd77f3f4312"
integrity sha1-JcHCTxEPuRT4AAG5JSZN138/QxI=
deepmerge@^1.5.0, deepmerge@^1.5.2:
version "1.5.2"
resolved "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753"
integrity sha1-EEmdhohEza1P7ghC34x/bwyVp1M=
@@ -3125,11 +3145,6 @@ deepmerge@^2.2.1:
resolved "https://registry.npm.taobao.org/deepmerge/download/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170"
integrity sha1-XT/yKgHAD2RUBaL7wX0HeKGAEXA=
deepmerge@~2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/deepmerge/download/deepmerge-2.0.1.tgz#25c1c24f110fb914f80001b925264dd77f3f4312"
integrity sha1-JcHCTxEPuRT4AAG5JSZN138/QxI=
default-gateway@^4.2.0:
version "4.2.0"
resolved "https://registry.npm.taobao.org/default-gateway/download/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b"
@@ -3388,6 +3403,19 @@ dotenv@^8.0.0:
resolved "https://registry.npm.taobao.org/dotenv/download/dotenv-8.2.0.tgz?cache=0&sync_timestamp=1571190685588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdotenv%2Fdownload%2Fdotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha1-l+YZJZradQ7qPk6j4mvO6lQksWo=
downloadjs@1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/downloadjs/-/downloadjs-1.4.7.tgz#f69f96f940e0d0553dac291139865a3cd0101e3c"
integrity sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw=
draggabilly@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/draggabilly/-/draggabilly-2.2.0.tgz#9bac6849816c5cd4e4a59707f63f14ea7d863baf"
integrity sha512-SygXstYyzRgLcb7VGr03QYC7166wgoaUfBoA9y+hiI7Swkyct4NNFDrEmO6T4Sz35qo71j0QAmuTagUGcwxWbg==
dependencies:
get-size "^2.0.2"
unidragger "^2.3.0"
duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.npm.taobao.org/duplexer3/download/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
@@ -3627,11 +3655,37 @@ es-to-primitive@^1.2.1:
is-date-object "^1.0.1"
is-symbol "^1.0.2"
es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@~0.10.14:
version "0.10.53"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1"
integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==
dependencies:
es6-iterator "~2.0.3"
es6-symbol "~3.1.3"
next-tick "~1.0.0"
es6-error@^4.1.1:
version "4.1.1"
resolved "https://registry.npm.taobao.org/es6-error/download/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
integrity sha1-njr0B0Wd7tR+mpH5uIWoTrBcVh0=
es6-iterator@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c=
dependencies:
d "1"
es5-ext "^0.10.35"
es6-symbol "^3.1.1"
es6-symbol@^3.1.1, es6-symbol@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18"
integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==
dependencies:
d "^1.0.1"
ext "^1.1.2"
escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
@@ -3914,6 +3968,19 @@ etag@~1.8.1:
resolved "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
ev-emitter@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ev-emitter/-/ev-emitter-1.1.1.tgz#8f18b0ce5c76a5d18017f71c0a795c65b9138f2a"
integrity sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q==
event-emitter@^0.3.5:
version "0.3.5"
resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=
dependencies:
d "1"
es5-ext "~0.10.14"
event-pubsub@4.3.0:
version "4.3.0"
resolved "https://registry.npm.taobao.org/event-pubsub/download/event-pubsub-4.3.0.tgz#f68d816bc29f1ec02c539dc58c8dd40ce72cb36e"
@@ -4048,6 +4115,13 @@ express@^4.16.3, express@^4.17.1:
utils-merge "1.0.1"
vary "~1.1.2"
ext@^1.1.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244"
integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==
dependencies:
type "^2.0.0"
extend-shallow@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
@@ -4426,6 +4500,15 @@ fs-extra@^4.0.1:
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-extra@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd"
integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-extra@^7.0.1:
version "7.0.1"
resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
@@ -4520,6 +4603,11 @@ get-caller-file@^2.0.1:
resolved "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=
get-size@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/get-size/-/get-size-2.0.3.tgz#54a1d0256b20ea7ac646516756202769941ad2ef"
integrity sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==
get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.npm.taobao.org/get-stdin/download/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
@@ -6473,6 +6561,11 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1:
resolved "https://registry.npm.taobao.org/neo-async/download/neo-async-2.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fneo-async%2Fdownload%2Fneo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=
next-tick@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
integrity sha1-yobR/ogoFpsBICCOPchCS524NCw=
nice-try@^1.0.4:
version "1.0.5"
resolved "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
@@ -7084,6 +7177,11 @@ pascalcase@^0.1.1:
resolved "https://registry.npm.taobao.org/pascalcase/download/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=
pasition@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/pasition/-/pasition-1.0.3.tgz#133d6ed4ae7ebd819d29651491d53f74151273bd"
integrity sha512-hsUNLhS7e5uWGkTtgbxoHMzCUb0PeboQelyqPmpRkAk26AkKal0Z6JfYWhjIEhZHIYzJTfr6Aom/BpBPrZXHnA==
path-browserify@0.0.1:
version "0.0.1"
resolved "https://registry.npm.taobao.org/path-browserify/download/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
@@ -8103,6 +8201,11 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"
request-frame@^1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/request-frame/-/request-frame-1.5.3.tgz#813c3160d9b023583889aaa977389b68fcaa2e3d"
integrity sha1-gTwxYNmwI1g4iaqpdzibaPyqLj0=
request-promise-core@1.1.3:
version "1.1.3"
resolved "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9"
@@ -9474,6 +9577,16 @@ type-is@~1.6.17, type-is@~1.6.18:
media-typer "0.3.0"
mime-types "~2.1.24"
type@^1.0.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0"
integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==
type@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3"
integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==
typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.npm.taobao.org/typedarray/download/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
@@ -9515,6 +9628,13 @@ unicode-property-aliases-ecmascript@^1.0.4:
resolved "https://registry.npm.taobao.org/unicode-property-aliases-ecmascript/download/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57"
integrity sha1-qcxsx85joKMCP8meNBuUQx1AWlc=
unidragger@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/unidragger/-/unidragger-2.3.0.tgz#ab9d9fd62106f3252d88fae5f3a99575e6d31d02"
integrity sha512-dVkSqQdwcsaNmXaandBAOcJ4QVvkrDPosfCcZ7opYPkAiisCQaGlNw0pg00lBV4MQoWEXsEaiwhtQlbnvlXrQQ==
dependencies:
unipointer "^2.3.0"
union-value@^1.0.0:
version "1.0.1"
resolved "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"
@@ -9525,6 +9645,13 @@ union-value@^1.0.0:
is-extendable "^0.1.1"
set-value "^2.0.1"
unipointer@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/unipointer/-/unipointer-2.3.0.tgz#ba0dc462ce31c2a88e80810e19c3bae0ce47ed9f"
integrity sha512-m85sAoELCZhogI1owtJV3Dva7GxkHk2lI7A0otw3o0OwCuC/Q9gi7ehddigEYIAYbhkqNdri+dU1QQkrcBvirQ==
dependencies:
ev-emitter "^1.0.1"
uniq@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/uniq/download/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
@@ -10192,6 +10319,30 @@ xdg-basedir@^3.0.0:
resolved "https://registry.npm.taobao.org/xdg-basedir/download/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"
integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=
xgplayer-hls.js@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/xgplayer-hls.js/-/xgplayer-hls.js-2.1.6.tgz#1e969a77a7546114a5e1b4509e89401fe74536da"
integrity sha512-va/xmx0ES5oerbZ6bMVlXEw38Alz9dwEnvC0iwGOC6Kf543hv0ma/9qJ9JxWOPFsvAblmburT4rbAUxoMKGUDA==
dependencies:
deepmerge "2.0.1"
event-emitter "^0.3.5"
xgplayer@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/xgplayer/-/xgplayer-2.4.1.tgz#12202a82d5a074627c793fe6c1b8e392faeb0e95"
integrity sha512-D7n8K2vrlgJuknu4a8SrCPFHjEEJzlwS7p8Jhd+SlN44d2Ek82FMKP2KJO+cDfKZ9I6MgqfTfXemO0odskqVDg==
dependencies:
chalk "^2.3.2"
commander "^2.15.1"
danmu.js "0.1.0"
deepmerge "^1.5.0"
downloadjs "1.4.7"
draggabilly "^2.2.0"
event-emitter "^0.3.5"
fs-extra "^5.0.0"
pasition "^1.0.1"
request-frame "^1.5.3"
xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:
version "4.0.2"
resolved "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"