设置页面增加清除缓存(隐藏)
This commit is contained in:
parent
e6cc9605a6
commit
6d450987ba
|
|
@ -25,6 +25,10 @@
|
|||
<view>注销账号</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
</view>
|
||||
<!-- <view class="flex justify-between padding bg-white solid-bottom" @click="clearCache">
|
||||
<view>清除缓存</view>
|
||||
<view>{{cacheSize}}</view>
|
||||
</view> -->
|
||||
<view class="flex justify-between padding bg-white solid-bottom" @click="loginOut">
|
||||
<view>退出登录</view>
|
||||
<view><u-icon name="arrow-right"></u-icon></view>
|
||||
|
|
@ -39,6 +43,7 @@
|
|||
data() {
|
||||
return {
|
||||
version: null,
|
||||
cacheSize:'0M'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -54,8 +59,30 @@
|
|||
// console.log(widgetInfo)
|
||||
// this.version = widgetInfo.version
|
||||
// })
|
||||
const info= uni.getStorageInfoSync()
|
||||
console.log(info);
|
||||
const size=(info.currentSize/1024).toFixed(2)
|
||||
this.cacheSize=size<1?(info.currentSize+'kb'):(size) +'M'
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
clearCache(){
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:`是否清除全部缓存
|
||||
`,
|
||||
success(res) {
|
||||
if(res.confirm){
|
||||
cacheClearAll()
|
||||
const info= uni.getStorageInfoSync()
|
||||
info.keys.map(v=>{
|
||||
console.log(v);
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goNav(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
|
|
|
|||
Loading…
Reference in New Issue