From 2e36f2a22f17d401d038379c93969c29e31f45e5 Mon Sep 17 00:00:00 2001 From: Gdpao <1341331954@qq.com> Date: Wed, 26 Aug 2020 20:31:30 +0800 Subject: [PATCH 1/2] gdpao --- App.vue | 2 +- components/remaining/remaining.vue | 4 +-- pageE/setting/Index.vue | 54 +++++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/App.vue b/App.vue index 7eb3095..aa4518b 100644 --- a/App.vue +++ b/App.vue @@ -28,7 +28,7 @@ // #endif }, onShow(){ - this.getVersion(); + // this.getVersion(); }, onLoad() { diff --git a/components/remaining/remaining.vue b/components/remaining/remaining.vue index 5c7cdf5..c090d2e 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 59538b6..ff39278 100644 --- a/pageE/setting/Index.vue +++ b/pageE/setting/Index.vue @@ -10,6 +10,10 @@ {{ item.title }} + + 清除缓存 + {{ fileSizeString }} + 退出登录 @@ -73,9 +77,13 @@ }, ], content: "是否退出登录!", - show: false + show: false, + fileSizeString: "", // 缓存大小 } }, + onLoad() { + this.getCache(); + }, methods: { ...mapMutations(['logout']), // 退出登录选择 0:切换账号 | 1:退出登录 @@ -85,6 +93,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 @@ -122,6 +169,11 @@ width: 14rpx; height: 24rpx; } + + .left-text { + margin-left: auto; + font-size: 28rpx; + } } } From 8937a3168439eacc732a0bc5f2ae193518f07df0 Mon Sep 17 00:00:00 2001 From: Gdpao <1341331954@qq.com> Date: Mon, 31 Aug 2020 09:07:24 +0800 Subject: [PATCH 2/2] gdpao --- pages.json | 2 +- static/fonts/cart.ttf | Bin 1776 -> 1752 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pages.json b/pages.json index 144ff1c..12e4d19 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 25c4fbd5cfe86298562a448e50f3e39d2ebb1bc5..bf35aa83678d8681704b70f1730930cad9b56722 100644 GIT binary patch delta 468 zcmeysdxLj^f{Asd+gAn##u^3&hOp$^#DZtqn>GXacYwGcJ*P6Q@1@RG1_tI3p!|c3 z)Wj4iX6u@XA-d)TKmi73A0WY&n^;l6$j=Z3)FJ`oE952SrrL%4t7TwdF=1d}$}Pw* zF1h>o-ZP-mB@=fTSaJWbkBjHG`O3h}0y2c*c2V^?WSWJ6=`oPc!N3F(1p-DOW@7MT zV4keRIE&>e^Hb)@2N=URo-+Uc&%p4Md9xgo3S<3KW)K^ynt=i2J`j(AxdUjL0D~ff zF9U6seNRE+>pNWrASy5ckNK}MPSrMp8omm-3nwpqdGXmx1 z8O7uo85{YfMYy>|q~)bVxw%E97$bpv9v+c;X*n=0Jw;4{n~_Ag|p@sk{ZpMQ=f+FnAn(~tF oiu~ey;?g{f<=le890DSod>njiJf3vvu;?Xtu~dRTT4>V-^iZM2 zf1x6H@a#d%pSYgEsmDH5^R`B~%`z z8+SmPjQUK${JgO`B3&*7cg+;b`$k#fzl0EDR&7xm@o13?COB@&vhh?i z+uw6idX9sqImhv&+!ZFi-UsVF?z0Byu9od!tL9w6WKsZ>WH&zQOhw QN{>^DL;|WGRP-%&1BFpy^8f$<