From 332aab16348cccb280a1d78452b13338c8cfae27 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期三, 09 七月 2025 15:06:03 +0800
Subject: [PATCH] 清空缓存 - 模拟退出

---
 pages/personalCenter/components/user-center-card/index.js |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/pages/personalCenter/components/user-center-card/index.js b/pages/personalCenter/components/user-center-card/index.js
index 21481f1..c31ec95 100644
--- a/pages/personalCenter/components/user-center-card/index.js
+++ b/pages/personalCenter/components/user-center-card/index.js
@@ -1,8 +1,14 @@
+import {
+  loginInfo
+} from '../../../../assets/js/login';
+
 const AuthStepType = {
   ONE: 1,
   TWO: 2,
   THREE: 3,
 };
+
+const app = getApp()
 
 Component({
   options: {
@@ -23,9 +29,9 @@
     },
   },
   data: {
-    defaultAvatarUrl:
-      'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
+    defaultAvatarUrl: 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
     AuthStepType,
+    count: 0, //妯℃嫙閫�鍑猴紝
   },
   methods: {
     gotoUserEditPage() {
@@ -34,5 +40,31 @@
     editUserType() {
       this.triggerEvent('editUserType');
     },
+    cilckFive() {
+      this.data.count += 1
+      if (this.data.count >= 5) {
+        wx.clearStorageSync()
+        wx.showModal({
+          title: '宸叉竻绌猴紝璇风偣鍑荤櫥褰�',
+          content: '',
+          complete: (res) => {
+            if (res.confirm) {
+              loginInfo(app, (data) => {
+                if (data) {
+                  this.setData({
+                    count: 0
+                  })
+                  return false
+                }
+              })
+            } else {
+              wx.switchTab({
+                url: '/pages/home/home',
+              })
+            }
+          }
+        })
+      }
+    }
   },
-});
+});
\ No newline at end of file

--
Gitblit v1.9.1