From c5b3505dcd34afaea700adf1db4f1b1ec721b0f1 Mon Sep 17 00:00:00 2001 From: Gdpao <1341331954@qq.com> Date: Tue, 1 Sep 2020 20:32:15 +0800 Subject: [PATCH] gdpao --- pages/index/details.vue | 13 +++++++- pages/login/login.vue | 1 + pages/user/index.vue | 67 ++++++++++++++++++++++++++++++++++++++--- pages/user/myinfo.vue | 49 +++++++++++++++++++++++++++++- 4 files changed, 124 insertions(+), 6 deletions(-) diff --git a/pages/index/details.vue b/pages/index/details.vue index d844774..bc435fc 100644 --- a/pages/index/details.vue +++ b/pages/index/details.vue @@ -125,7 +125,7 @@ 填写快递单号 - 确认 + 确认 @@ -262,6 +262,17 @@ export default { } }); }, + // 保存订单号 + saveDelivery() { + if (!this.pushid) { + uni.showToast({ + title: "请填写快递单号!", + icon: "none" + }) + return + } + this.showExpress = false; + }, // 取消退款 cancel() { this.showRefunds = false; diff --git a/pages/login/login.vue b/pages/login/login.vue index 8c22ee8..23763bf 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -89,6 +89,7 @@ export default { loading() {}, logins() { // 判断是否可以点击 + console.log(this.zhanghao); if(this.clickstate==false){ this.clickstate=true }else{ diff --git a/pages/user/index.vue b/pages/user/index.vue index 9a28156..6c4b383 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -23,11 +23,15 @@ 骑手投诉 - + + 清除缓存 + {{ fileSizeString }} + + 退出登录 - + @@ -37,17 +41,72 @@ export default { data() { return { info:{}, - is_loginout: false, + isLoginOut: false, content: "是否退出登录?", - num:0 + num:0, + fileSizeString: "", // 缓存大小 } }, + watch: { + isLoginOut() { + // console.log(this.isLoginOut); + if (this.isLoginOut) { + uni.hideTabBar(); + } else { + setTimeout(function() { + uni.showTabBar(); + },200) + } + } + }, onLoad() { + this.getCache(); + console.log(222); }, onShow() { this.getmyinfo() }, methods: { + // 获取缓存 + getCache() { + let _this = this; + // #ifdef APP-PLUS + plus.cache.calculate(function(size) { + console.log(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 + }, // 退出登陆 loginOut(){ uni.clearStorage(); diff --git a/pages/user/myinfo.vue b/pages/user/myinfo.vue index 4d4598d..b6bc03a 100644 --- a/pages/user/myinfo.vue +++ b/pages/user/myinfo.vue @@ -19,6 +19,10 @@ 内容管理 + + 清除缓存 + {{ fileSizeString }} + 退出登录 @@ -55,22 +59,65 @@ export default { name:"user", data() { return { - publishstate:false, + publishstate: false, is_loginout: false, content: "是否退出登录?", info:{}, + fileSizeString: "", // 缓存大小 } }, onShow(){ this.getmyinfo() }, onLoad() { + this.getCache(); const user = uni.getStorageSync('userinfo'); console.log(user) this.imService.login(user.userId,user.member_nickname,user.member_avatar) this.imService.connectIM() }, methods: { + // 获取缓存 + getCache() { + let _this = this; + // #ifdef APP-PLUS + plus.cache.calculate(function(size) { + console.log(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 + }, + // 退出登录 loginOut(){ this.imService.disconnect(); uni.clearStorage();