Compare commits

...

4 Commits

Author SHA1 Message Date
hunlongyu
3afa38beb7 🎉 正式版v1.0.0发布 2020-05-18 09:26:08 +08:00
hunlongyu
68fe961791 😱 修复bug 2020-05-13 13:41:53 +08:00
hunlongyu
3d7a686ca7 😥 重置后,关闭软件. 2020-05-13 13:33:50 +08:00
hunlongyu
57e6ea50ad 😋 精简模式优化 2020-05-13 11:46:04 +08:00
6 changed files with 86 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "0.9.33",
"version": "1.0.0",
"private": true,
"author": {
"name": "Hunlongyu",
@@ -33,8 +33,8 @@
"vue": "^2.6.11",
"vue-i18n": "^8.17.0",
"vuex": "^3.1.3",
"xgplayer": "^2.6.20",
"xgplayer-hls.js": "^2.2.0"
"xgplayer": "^2.6.24",
"xgplayer-hls.js": "^2.2.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
@@ -44,7 +44,7 @@
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"babel-plugin-component": "^1.1.1",
"electron": "^8.2.5",
"electron": "^8.3.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",

View File

@@ -9,8 +9,6 @@ import path from 'path'
import { autoUpdater } from 'electron-updater'
const isDevelopment = process.env.NODE_ENV !== 'production'
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win
let mini

View File

@@ -60,6 +60,10 @@
<img class="qrcode-item" src="../assets/image/wepay.jpg">
</div>
</div>
<div class="clearDB">
<span @click="clearDBEvent" class="clearBtn">{{$t('clearDB')}}</span>
<span class="clearTips">{{$t('clearTips')}}</span>
</div>
</div>
</div>
</template>
@@ -67,9 +71,11 @@
import { mapMutations } from 'vuex'
import setting from '../lib/dexie/setting'
import { sites } from '../lib/site/sites'
import db from '../lib/dexie/index'
import '../lib/cloud/index.js'
import { shell } from 'electron'
import pkg from '../../package.json'
const ipc = require('electron').ipcRenderer
export default {
name: 'setting',
data () {
@@ -148,6 +154,12 @@ export default {
setting.update(this.s).then(res => {
this.$m.success(this.$t('set_success'))
})
},
clearDBEvent () {
db.delete().then(res => {
this.$m.success(this.$t('set_success'))
ipc.send('close')
})
}
},
created () {
@@ -248,5 +260,26 @@ export default {
}
}
}
.clearDB{
margin-top: 20px;
margin-bottom: 20px;
.clearBtn{
margin-left: 20px;
color: red;
cursor: pointer;
border: 1px solid #ff000088;
display: inline-block;
width: 160px;
height: 32px;
font-size: 14px;
text-align: center;
line-height: 32px;
}
.clearTips{
font-size: 12px;
color: #ff000088;
margin-left: 10px;
}
}
}
</style>

View File

@@ -44,5 +44,7 @@
"copy_success": "has been copied, Download it now",
"async_failed": "Synchronization successful, no updates found.",
"async_success": "Synchronization succeeded, update found.",
"no_history": "No history data."
"no_history": "No history data.",
"clearDB": "Reset software",
"clearTips": "Click to clear the database and close the software"
}

View File

@@ -29,7 +29,7 @@
"sync": "同步",
"total": "条数据",
"website": "官网",
"issues": "内测反馈",
"issues": "反馈",
"theme": "主题",
"donate": "捐赠",
"set_success": "设置成功。",
@@ -44,5 +44,7 @@
"copy_success": "已复制,快去下载吧。",
"async_failed": "同步成功, 未查询到更新。",
"async_success": "同步成功, 查询到更新。",
"no_history": "无历史记录"
"no_history": "无历史记录",
"clearDB": "重置软件",
"clearTips": "软件没有问题,请勿重置软件,否则数据丢失概不负责.点击即清空数据库,并关闭软件."
}

View File

@@ -2,14 +2,14 @@
<div class="mini">
<div class="top">
<div class="left">
<span class="number" v-show="show.number">{{index + 1}} / {{length}}</span>
<span class="zy-svg" @click="prevEvent" v-show="show.prev">
<span class="number" v-show="length > 0">{{index + 1}} / {{length}}</span>
<span class="zy-svg" @click="prevEvent" v-show="index > 0">
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="backIconTitle">
<title id="backIconTitle">上一集</title>
<path d="M14 14.74L21 19V5l-7 4.26V5L2 12l12 7v-4.26z"></path>
</svg>
</span>
<span class="zy-svg" @click="nextEvent" v-show="show.next">
<span class="zy-svg" @click="nextEvent" v-show="index < (length - 1)">
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="forwardIconTitle">
<title id="forwardIconTitle">下一集</title>
<path d="M10 14.74L3 19V5l7 4.26V5l12 7-12 7v-4.26z"></path>
@@ -57,11 +57,6 @@ export default {
opacity: 100,
video: {},
d: {},
show: {
prev: false,
next: false,
number: false
},
index: 0,
length: 0
}
@@ -76,16 +71,9 @@ export default {
getUrls () {
mini.find().then(res => {
const v = res
if (v.index > 0) {
this.show.next = true
this.show.number = true
}
this.video = res
tools.detail_get(v.site, v.detail).then(res => {
this.d = res
if (v.index >= this.d.m3u8_urls.length) {
this.show.next = false
}
this.index = v.index
this.length = this.d.m3u8_urls.length
const link = res.m3u8_urls[v.index]
@@ -101,6 +89,16 @@ export default {
this.xg.play()
}
this.onPlayVideo()
this.xg.on('ended', () => {
if (this.d.m3u8_urls.length > 1 && (this.d.m3u8_urls.length - 1 > this.index)) {
this.video.currentTime = 0
this.index++
let src = this.d.m3u8_urls[this.index]
src = src.split('$')[1]
this.xg.src = src
this.xg.play()
}
})
})
})
},
@@ -122,37 +120,42 @@ export default {
this.timer = setInterval(() => {
history.find({ detail: d }).then(res => {
if (res) {
const h = { ...this.video }
h.currentTime = this.xg.currentTime
h.id = res.id
history.update(res.id, h)
const v = res
v.currentTime = this.xg.currentTime
const id = v.id
delete v.id
history.update(id, v)
}
})
}, 10000)
},
prevEvent () {
if (this.index > 0) {
this.index--
let src = this.d.m3u8_urls[this.index]
src = src.split('$')[1]
this.xg.src = src
this.show.next = true
}
if (this.index === 0) {
this.show.prev = false
}
history.find({ detail: this.video.detail }).then(res => {
const v = res
v.index--
const id = v.id
delete v.id
history.update(id, v).then(e => {
let src = this.d.m3u8_urls[v.index]
src = src.split('$')[1]
this.xg.src = src
this.index--
})
})
},
nextEvent () {
if (this.index < this.d.m3u8_urls.length - 1) {
this.index++
let src = this.d.m3u8_urls[this.index]
src = src.split('$')[1]
this.xg.src = src
this.show.prev = true
}
if (this.index === this.d.m3u8_urls.length - 1) {
this.show.next = false
}
history.find({ detail: this.video.detail }).then(res => {
const v = res
v.index++
const id = v.id
delete v.id
history.update(id, v).then(e => {
let src = this.d.m3u8_urls[v.index]
src = src.split('$')[1]
this.xg.src = src
this.index++
})
})
}
},
created () {