Skip to content

Commit

Permalink
Merge pull request #10 from ZyqGitHub1/dev
Browse files Browse the repository at this point in the history
更新readme
  • Loading branch information
ZyqGitHub1 authored Jul 23, 2019
2 parents e0997b5 + 1269846 commit d4f6f2c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,20 @@ See [Configuration Reference](https://quasar.dev/quasar-cli/quasar-conf-js).
1. 到release下载最新版本的压缩包
2. 解压文件到任意目录
3. 运行解压目录下的h-player.exe文件
4. 未导入视频源时会显示导入视频源界面
5. 点击`暂无视频源,点击选择文件导入`按钮
6. 选择视频源文件导入。***示例文件位于[gist](https://gist.github.com/ZyqGitHub1/104becf19ebb84f601e3d32b59418944)***
7. have fun

> ### Note
>
> 1. 视频源只需导入一次,可以在设置界面重新导入或清空视频源
## TODO

- [x] 高亮当前分类
- [x] 页面缓存
- [x] 独立窗口播放
- [ ] 持久化配置文件
- [ ] 支持导入视频源
- [x] 持久化配置文件
- [x] 支持导入视频源
- [ ] http/https 功能优化
32 changes: 21 additions & 11 deletions src/layouts/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ import { mapState, mapMutations, mapGetters } from 'vuex';
import util from 'util';
import { parseString } from 'xml2js';
const Store = require('electron-store');
const store = new Store();
const ipc = require('electron').ipcRenderer;
const parseStringSync = util.promisify(parseString);
Expand All @@ -195,25 +199,31 @@ export default {
httoOrHttps: false,
};
},
beforeRouteEnter(from, to, next) {
const storeSiteList = store.get('siteList');
if (!storeSiteList || storeSiteList.length === 0) {
next('/import');
}
next();
},
created() {
const storeSiteList = this.$electronStore.get('siteList');
this.setSiteList(storeSiteList);
if (!this.siteList || this.siteList.length === 0) {
this.$router.replace('/import');
}
ipc.on('from-mini', (event, message) => {
this.gotoPlayer(message);
});
this.setCurrentClass('all');
this.setCurrentSiteId(this.tab);
this.getClass();
this.$router.push('/');
},
watch: {
tab: {
handler() {
this.setCurrentClass('all');
this.setCurrentSiteId(this.tab);
this.getClass();
this.$router.push('/');
},
immediate: true,
tab() {
this.setCurrentClass('all');
this.setCurrentSiteId(this.tab);
this.getClass();
this.$router.push('/');
},
keyWord() {
if (this.keyWord === null) {
Expand Down

0 comments on commit d4f6f2c

Please sign in to comment.