diff --git a/components/remaining/remaining.vue b/components/remaining/remaining.vue index f494a95..430567d 100644 --- a/components/remaining/remaining.vue +++ b/components/remaining/remaining.vue @@ -22,8 +22,8 @@ - 立即体验 - + 立即体验 + diff --git a/pageE/setting/Index.vue b/pageE/setting/Index.vue index bbc4a28..0c723a6 100644 --- a/pageE/setting/Index.vue +++ b/pageE/setting/Index.vue @@ -10,6 +10,10 @@ {{ item.title }} + + 清除缓存 + {{ fileSizeString }} + 退出登录 @@ -76,9 +80,13 @@ }, ], content: "是否退出登录!", - show: false + show: false, + fileSizeString: "", // 缓存大小 } }, + onLoad() { + this.getCache(); + }, methods: { ...mapMutations(['logout']), // 退出登录选择 0:切换账号 | 1:退出登录 @@ -88,6 +96,45 @@ this.show = true; } }, + // 获取缓存 + getCache() { + let _this = this; + // #ifdef APP-PLUS + plus.cache.calculate(function(size) { + let sizeCache = size; + if (sizeCache == 0) { + _this.fileSizeString = "0B"; + } else if (sizeCache < 1024) { + _this.fileSizeString = sizeCache + "B"; + } else if (sizeCache < 1048576) { + _this.fileSizeString = (sizeCache / 1024).toFixed(2) + "KB"; + } else if (sizeCache < 1073741824) { + _this.fileSizeString = (sizeCache / 1048576).toFixed(2) + "MB"; + } else { + _this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + "GB"; + } + }); + // #endif + }, + // 清除缓存 + clearCache() { + // #ifdef APP-PLUS + uni.showModal({ + title: "确定要清理缓存吗?", + cancelColor: "#999", + confirmColor: "#f00", + success: (res) => { + // console.log(res); + if (res.confirm) { + plus.cache.clear(function(e) { + console.log(e); + }) + } + this.getCache(); + } + }) + // #endif + }, toNextPage(url, ...params) { uni.navigateTo({ url: url @@ -125,6 +172,11 @@ width: 14rpx; height: 24rpx; } + + .left-text { + margin-left: auto; + font-size: 28rpx; + } } } diff --git a/pages.json b/pages.json index fbcc15f..a7488a7 100644 --- a/pages.json +++ b/pages.json @@ -124,7 +124,7 @@ "backgroundColor":"#ffffff", "buttons": [ { - "type":"none", + // "type":"none", "text":"\ue636", "float":"right", "fontSize":"18", diff --git a/static/fonts/cart.ttf b/static/fonts/cart.ttf index 25c4fbd..bf35aa8 100644 Binary files a/static/fonts/cart.ttf and b/static/fonts/cart.ttf differ