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 4b862f2 commit f3db0fd
Show file tree
Hide file tree
Showing 4 changed files with 1,751 additions and 854 deletions.
140 changes: 95 additions & 45 deletions pages/me/me.vue
Original file line number Diff line number Diff line change
@@ -1,60 +1,110 @@
<template>
<view class="me">
<view class="status_bar"></view>
<view class="logo">
<img src="static/images/logo.png" alt="">
</view>
<view class="name">
ZY Player Andriod
</view>
<u-cell-group>
<u-cell-item title="清空收藏夹" value="清空收藏夹数据" :arrow="false" @click="itemClickEvent(i)"></u-cell-item>
<u-cell-item title="重置软件" value="清空所有数据, 慎点" :arrow="false" @click="itemClickEvent(i)"></u-cell-item>
<u-cell-item title="版本更新" value="0.1.0" :arrow="false" @click="itemClickEvent(i)"></u-cell-item>
<u-cell-item title="关于" value="" :arrow="false" @click="itemClickEvent(i)"></u-cell-item>
<view class="me">
<view class="status_bar"></view>
<view class="logo">
<img src="static/images/logo.png" alt="" />
</view>
<view class="name"> ZY Player Andriod </view>
<u-cell-group>
<u-cell-item
title="清空收藏夹"
value="清空收藏夹数据"
:arrow="false"
@click="clearStar()"
></u-cell-item>
<u-cell-item
title="重置软件"
value="清空所有数据, 慎点"
:arrow="false"
@click="resetApp()"
></u-cell-item>
<u-cell-item
title="版本更新"
value="0.1.0"
:arrow="false"
@click="itemClickEvent(i)"
></u-cell-item>
<u-cell-item
title="关于"
value=""
:arrow="false"
@click="itemClickEvent(i)"
></u-cell-item>
</u-cell-group>
<view class="tips">
所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容, 禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.
</view>
</view>
<view class="tips">
所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容,
禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.
</view>
<u-toast ref="uToast" />
<u-modal v-model="modalShow" :content="modalContent" @confirm="resetAppconfirm" :mask-close-able="true" show-cancel-button @cancel="resetAppCancel"></u-modal>
</view>
</template>

<script>
export default {
data() {
return {
import db from "../../utils/database.js";
export default {
data() {
return {
modalShow: false,
modalContent: ''
};
},
methods: {
async clearStar() {
const res = await db.removeAll('star')
if (res.flag) {
this.$refs.uToast.show({ title: '清空收藏夹数据成功', type: 'success', duration: '2300' })
} else {
this.$refs.uToast.show({ title: '清空收藏夹数据失败', type: 'warning', duration: '2300' })
}
},
methods: {
itemClickEvent(item) {}
}
}
async resetApp() {
this.modalContent = '重置软件会清空:收藏夹数据,历史记录,导入的视频源等。恢复默认设置,以及默认的视频源。'
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' })
}
this.modalShow = false
},
resetAppCancel () {
this.modalShow = false
},
itemClickEvent(item) {},
},
};
</script>

<style lang="scss" scoped>
.me{
.status_bar {
.me {
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
.logo{
margin-top: 10px;
width: 100%;
text-align: center;
img{
width: 26%;
}
}
.name{
margin-top: 10px;
text-align: center;
font-size: 20px;
margin-bottom: 10px;
}
.tips{
color: #ff4445;
padding: 15px;
}
.logo {
margin-top: 10px;
width: 100%;
text-align: center;
img {
width: 26%;
}
}
.name {
margin-top: 10px;
text-align: center;
font-size: 20px;
margin-bottom: 10px;
}
.tips {
color: #ff4445;
padding: 15px;
}
}
</style>
1,624 changes: 1,077 additions & 547 deletions unpackage/dist/dev/app-plus/app-service.js

Large diffs are not rendered by default.

Loading

0 comments on commit f3db0fd

Please sign in to comment.