Skip to content

Commit

Permalink
软件重置,屏蔽已关闭的视频源
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunlongyu committed Nov 18, 2020
1 parent f3db0fd commit 348072f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
25 changes: 19 additions & 6 deletions pages/film/film.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<u-loading mode="flower" size="80"></u-loading>
</view>
</u-mask>
<u-toast ref="uToast" />
</view>
</template>

Expand Down Expand Up @@ -187,15 +188,24 @@ export default {
async getSite() {
const res = await db.getAll("site");
if (res.flag) {
this.siteList = res.data;
const arr = []
for (const i of res.data) {
if (i.isActive) {
arr.push(i)
}
}
this.siteList = arr
} else {
this.$refs.uToast.show({ title: '读取视频源出错', type: 'warning', duration: '2300' })
return false
}
const setting = await db.get("setting", "config");
const site = await db.get("site", setting.data.site);
this.site = site.data;
this.siteDefault = [site.id];
this.site = this.siteList[0]
this.siteDefault = [this.site.id];
await this.getPage()
await this.getClass(this.site.key)
this.addData(this.site.key, this.pageCount)
await this.addData(this.site.key, this.pageCount)
this.pageCount--
await this.addData(this.site.key, this.pageCount)
},
async getPage (type) {
const res = await http.page(this.site.key, type)
Expand Down Expand Up @@ -233,6 +243,9 @@ export default {
await this.addData(this.site.key, this.pageCount, this.type.tid);
this.loadStatus = "loadmore";
},
onTabItemTap() {
this.getSite();
}
};
</script>

Expand Down
22 changes: 13 additions & 9 deletions pages/me/me.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
</view>
<view class="name"> ZY Player Andriod </view>
<u-cell-group>
<u-cell-item
title="视频源管理"
value="TODO(未完成)"
:arrow="false"
@click="siteEdite()"
></u-cell-item>
<u-cell-item
title="清空收藏夹"
value="清空收藏夹数据"
Expand Down Expand Up @@ -50,6 +56,9 @@ export default {
};
},
methods: {
siteEdite () {
this.$refs.uToast.show({ title: '视频源管理努力开发中...', type: 'warning', duration: '2300' })
},
async clearStar() {
const res = await db.removeAll('star')
if (res.flag) {
Expand All @@ -63,16 +72,11 @@ export default {
this.modalShow = true
},
async resetAppconfirm () {
const c = await db.clearDB()
if (c.flag) {
const res = await db.reset()
if (res.flag) {
this.$refs.uToast.show({ title: '软件重置成功', type: 'success', duration: '2300' })
}
} else {
this.$refs.uToast.show({ title: '软件重置失败', type: 'warning', duration: '2300' })
}
await db.clearDB()
await db.reset('site')
await db.reset('setting')
this.modalShow = false
this.$refs.uToast.show({ title: '软件重置成功', type: 'success', duration: '2300' })
},
resetAppCancel () {
this.modalShow = false
Expand Down

0 comments on commit 348072f

Please sign in to comment.