From c098f1e3a3e052aa3d65584aae6dc003a70d75ad Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 16 十二月 2025 00:09:14 +0800
Subject: [PATCH] feat: 停止轮询 uncount

---
 app/pages/mine/index.vue |  215 +++++++++++++++++++++++++----------------------------
 1 files changed, 100 insertions(+), 115 deletions(-)

diff --git a/app/pages/mine/index.vue b/app/pages/mine/index.vue
index e936762..e6ccd74 100644
--- a/app/pages/mine/index.vue
+++ b/app/pages/mine/index.vue
@@ -14,7 +14,7 @@
           </view>
           <view v-if="name" @click="handleToInfo" class="user-info">
             <view class="u_title">
-              鐢ㄦ埛鍚嶏細{{ name }}
+              {{ name }}
             </view>
           </view>
         </view>
@@ -26,34 +26,19 @@
     </view>
 
     <scroll-view class="content-section" scroll-y="true">
-      <view class="mine-actions grid col-4 text-center">
-        <view class="action-item" @click="handleJiaoLiuQun">
-          <view class="iconfont icon-friendfill text-pink icon"></view>
-          <text class="text">浜ゆ祦缇�</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-service text-blue icon"></view>
-          <text class="text">鍦ㄧ嚎瀹㈡湇</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-community text-mauve icon"></view>
-          <text class="text">鍙嶉绀惧尯</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-dianzan text-green icon"></view>
-          <text class="text">鐐硅禐鎴戜滑</text>
-        </view>
-      </view>
-
       <!-- 鐢ㄦ埛淇℃伅灞曠ず -->
       <view class="user-info-section">
         <view class="info-item">
-          <view class="info-label">鐢ㄦ埛鍚嶏細</view>
+          <view class="info-label">鏄电О锛�</view>
           <view class="info-value">{{ name || '鏈櫥褰�' }}</view>
         </view>
         <view class="info-item">
           <view class="info-label">鎵嬫満鍙风爜锛�</view>
           <view class="info-value">{{ phonenumber || '鏈粦瀹�' }}</view>
+        </view>
+        <view class="info-item">
+          <view class="info-label">鎵�灞炲垎鍏徃锛�</view>
+          <view class="info-value">{{ deptName || '鏈缃�' }}</view>
         </view>
         <view class="info-item">
           <view class="info-label">缁戝畾杞﹁締锛�</view>
@@ -63,39 +48,22 @@
           <view class="info-label">App鐗堟湰鍙凤細</view>
           <view class="info-value">{{ version || '1.0.0' }}</view>
         </view>
-        
-        <!-- 缁戝畾/瑙g粦杞﹁締鎿嶄綔 -->
-        <view class="vehicle-actions" v-if="boundVehicle && boundVehicle !== '鏈粦瀹�'">
-          <button class="unbind-btn" @click="unbindVehicle">鍙栨秷缁戝畾杞﹁締</button>
-        </view>
-        <view class="vehicle-actions" v-else>
-          <button class="bind-btn" @click="goToBindVehicle">缁戝畾杞﹁締</button>
-        </view>
       </view>
 
       <view class="menu-list">
-        <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
+        <!-- 缁戝畾/瑙g粦杞﹁締 -->
+        <view class="list-cell list-cell-arrow" @click="handleVehicleBinding">
           <view class="menu-item-box">
-            <view class="iconfont icon-user menu-icon"></view>
-            <view>缂栬緫璧勬枡</view>
+            <view class="iconfont icon-car menu-icon"></view>
+            <view>{{ boundVehicle && boundVehicle !== '鏈粦瀹�' ? '鏇存崲杞﹁締' : '缁戝畾杞﹁締' }}</view>
           </view>
         </view>
-        <view class="list-cell list-cell-arrow" @click="handleHelp">
+        
+        <!-- 閫�鍑虹櫥褰� -->
+        <view class="list-cell list-cell-arrow" @click="handleLogout">
           <view class="menu-item-box">
-            <view class="iconfont icon-help menu-icon"></view>
-            <view>甯歌闂</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="handleAbout">
-          <view class="menu-item-box">
-            <view class="iconfont icon-aixin menu-icon"></view>
-            <view>鍏充簬鎴戜滑</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="handleToSetting">
-          <view class="menu-item-box">
-            <view class="iconfont icon-setting menu-icon"></view>
-            <view>搴旂敤璁剧疆</view>
+            <view class="iconfont icon-logout menu-icon text-red"></view>
+            <view class="text-red">閫�鍑虹櫥褰�</view>
           </view>
         </view>
       </view>
@@ -106,13 +74,17 @@
 <script>
   import storage from '@/utils/storage'
   import { getUserProfile } from "@/api/system/user"
+  import { getUserBoundVehicle, unbindVehicleFromUser } from '@/api/vehicle'
+  import { getSystemInfo } from '@/utils/common'
   
   export default {
     data() {
       return {
-        name: this.$store.state.user.name,
+        name: this.$store.state.user.nickName,
         phonenumber: '',
-        boundVehicle: '', // 妯℃嫙缁戝畾鐨勮溅杈嗕俊鎭�
+        deptName: '', // 鎵�灞炲垎鍏徃
+        boundVehicle: '', // 缁戝畾鐨勮溅杈嗕俊鎭�
+        boundVehicleId: null, // 缁戝畾鐨勮溅杈咺D
         version: getApp().globalData.config.appInfo.version
       }
     },
@@ -121,43 +93,55 @@
         return this.$store.state.user.avatar
       },
       windowHeight() {
-        return uni.getSystemInfoSync().windowHeight - 50
+        return getSystemInfo().windowHeight - 50
       }
     },
     onLoad() {
       this.getUserInfo()
     },
+    onShow() {
+      // 姣忔鏄剧ず椤甸潰鏃跺埛鏂扮敤鎴蜂俊鎭�
+      this.getUserInfo()
+    },
     methods: {
       // 鑾峰彇鐢ㄦ埛淇℃伅
       getUserInfo() {
+        const userId = this.$store.state.user.userId
+        
+        // 鑾峰彇鐢ㄦ埛鍩烘湰淇℃伅
         getUserProfile().then(response => {
           const user = response.data
-          this.name = user.userName
+          this.name = user.nickName || user.userName // 浼樺厛浣跨敤鏄电О
           this.phonenumber = user.phonenumber
-          // 妯℃嫙缁戝畾杞﹁締淇℃伅锛屽疄闄呴」鐩腑搴斾粠鐢ㄦ埛淇℃伅鎴栬溅杈嗘帴鍙h幏鍙�
-          this.boundVehicle = '绮12345'
+          this.deptName = user.dept ? user.dept.deptName : '鏈缃�'
         }).catch(() => {
           // 鑾峰彇鐢ㄦ埛淇℃伅澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
-          this.name = this.$store.state.user.name || '鏈櫥褰�'
+          this.name = this.$store.state.user.nickName || '鏈櫥褰�'
           this.phonenumber = '鏈粦瀹�'
-          this.boundVehicle = '鏈粦瀹�'
+          this.deptName = '鏈缃�'
         })
+        
+        // 鑾峰彇鐢ㄦ埛缁戝畾鐨勮溅杈嗕俊鎭�
+        if (userId) {
+          getUserBoundVehicle(userId).then(response => {
+            if (response.code === 200 && response.data) {
+              const vehicle = response.data
+              this.boundVehicle = vehicle.vehicleNumber || '鏈煡杞︾墝'
+              this.boundVehicleId = vehicle.vehicleId
+            } else {
+              this.boundVehicle = '鏈粦瀹�'
+              this.boundVehicleId = null
+            }
+          }).catch(() => {
+            this.boundVehicle = '鏈粦瀹�'
+            this.boundVehicleId = null
+          })
+        }
       },
       
-      // 璺宠浆鍒扮粦瀹氳溅杈嗛〉闈�
-      goToBindVehicle() {
+      // 澶勭悊杞﹁締缁戝畾鎿嶄綔
+      handleVehicleBinding() {
         this.$tab.navigateTo('/pages/bind-vehicle')
-      },
-      
-      // 鍙栨秷缁戝畾杞﹁締
-      unbindVehicle() {
-        this.$modal.confirm('鏄惁鍙栨秷缁戝畾杞﹁締锛�').then(() => {
-          // 杩欓噷鍙互璋冪敤API鍙栨秷缁戝畾杞﹁締
-          this.boundVehicle = '鏈粦瀹�'
-          this.$modal.showToast('鍙栨秷缁戝畾鎴愬姛')
-        }).catch(() => {
-          // 鐢ㄦ埛鍙栨秷鎿嶄綔
-        })
       },
       
       handleToInfo() {
@@ -176,23 +160,11 @@
         this.$tab.navigateTo('/pages/mine/avatar/index')
       },
       handleLogout() {
-        this.$modal.confirm('纭畾娉ㄩ攢骞堕��鍑虹郴缁熷悧锛�').then(() => {
+        this.$modal.confirm('纭畾閫�鍑虹櫥褰曞悧锛�').then(() => {
           this.$store.dispatch('LogOut').then(() => {
-            this.$tab.reLaunch('/pages/index')
+            this.$tab.reLaunch('/pages/login')
           })
         })
-      },
-      handleHelp() {
-        this.$tab.navigateTo('/pages/mine/help/index')
-      },
-      handleAbout() {
-        this.$tab.navigateTo('/pages/mine/about/index')
-      },
-      handleJiaoLiuQun() {
-        this.$modal.showToast('QQ缇わ細鈶�133713780(婊�)銆佲憽146013835(婊�)銆佲憿189091635')
-      },
-      handleBuilding() {
-        this.$modal.showToast('妯″潡寤鸿涓瓇')
       }
     }
   }
@@ -276,25 +248,6 @@
       * {
         -ms-overflow-style: none; /* IE 10+ */
       }
-
-      .mine-actions {
-        margin: 15px 15px;
-        padding: 20px 0px;
-        border-radius: 8px;
-        background-color: white;
-
-        .action-item {
-          .icon {
-            font-size: 28px;
-          }
-
-          .text {
-            display: block;
-            font-size: 13px;
-            margin: 8px 0px;
-          }
-        }
-      }
       
       // 鐢ㄦ埛淇℃伅灞曠ず鍖哄煙
       .user-info-section {
@@ -326,26 +279,58 @@
             flex: 1;
           }
         }
+      }
+      
+      // 鑿滃崟鍒楄〃鏍峰紡
+      .menu-list {
+        background-color: white;
+        border-radius: 8px;
+        margin: 15rpx;
+        overflow: hidden;
         
-        .vehicle-actions {
-          padding: 30rpx 0 10rpx 0;
-          text-align: center;
+        .list-cell {
+          padding: 30rpx;
+          border-bottom: 1rpx solid #f0f0f0;
+          cursor: pointer;
+          transition: background-color 0.2s;
           
-          .bind-btn, .unbind-btn {
-            width: 80%;
-            height: 80rpx;
-            border-radius: 10rpx;
-            font-size: 32rpx;
+          &:last-child {
+            border-bottom: none;
           }
           
-          .bind-btn {
-            background-color: #007AFF;
-            color: white;
+          &:active {
+            background-color: #f5f5f5;
           }
           
-          .unbind-btn {
-            background-color: #ff4d4f;
-            color: white;
+          .menu-item-box {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            
+            .menu-icon {
+              font-size: 36rpx;
+              margin-right: 20rpx;
+            }
+            
+            view {
+              flex: 1;
+              font-size: 32rpx;
+              color: #333;
+            }
+            
+            .text-red {
+              color: #ff4d4f;
+            }
+          }
+          
+          &.list-cell-arrow .menu-item-box::after {
+            content: '';
+            width: 16rpx;
+            height: 16rpx;
+            border-top: 2rpx solid #999;
+            border-right: 2rpx solid #999;
+            transform: rotate(45deg);
+            margin-left: 20rpx;
           }
         }
       }

--
Gitblit v1.9.1