rk
2026-04-30 cf17c2f7012fc4351f66c71d66a4aa3a9fe9e34a
app/pages/mine/mine.vue
@@ -6,20 +6,19 @@
         </view>
      </view>
      <scroll-view class="mine-page__body" scroll-y :style="bodyStyle">
      <view class="mine-page__body" :style="bodyStyle">
         <view class="mine-page__content">
            <view class="mine-page__profile">
               <image class="mine-page__avatar" src="/static/image/ic_pic@2x.png" mode="aspectFill"></image>
               <image class="mine-page__avatar" :src="userInfo.imgurl || '/static/image/ic_pic@2x.png'" mode="aspectFill"></image>
               <view class="mine-page__profile-info">
                  <view class="mine-page__name-row">
                     <text class="mine-page__name">{{ currentProfile.name }}</text>
                     <view v-if="currentProfile.levelTag" class="mine-page__level-tag">
                        <!-- <text class="mine-page__level-dot"></text> -->
                     <text class="mine-page__name">{{ userInfo.name }}</text>
                     <view v-if="userInfo.driverLevel" class="mine-page__level-tag">
                        <image src="/static/image/ic_jiangpai@2x.png" mode="widthFix" class="mine-page__level-dot"></image>
                        <text class="mine-page__level-text">{{ currentProfile.levelTag }}</text>
                        <text class="mine-page__level-text">{{ getDriverLevelText(userInfo.driverLevel) }}</text>
                     </view>
                  </view>
                  <text class="mine-page__phone">{{ currentProfile.phone }}</text>
                  <text class="mine-page__phone">{{ userInfo.telephone || '' }} ({{ userInfo.carCode || '' }} )</text>
               </view>
            </view>
@@ -47,12 +46,11 @@
                     <template v-if="item.key === 'wallet'">
                        <text class="menu-panel__sub menu-panel__sub--muted">余额:{{ currentProfile.walletBalance }}</text>
                     </template>
                     <template v-else-if="item.key === 'driver' && !currentProfile.verified">
                        <text class="menu-panel__sub menu-panel__sub--danger">完成认证后即可接单</text>
                     </template>
                     <template v-else-if="item.key === 'driver' && currentProfile.verified">
                        <text class="menu-panel__sub menu-panel__sub--warning">审核中</text>
                        <text class="menu-panel__sub menu-panel__sub--primary">已认证</text>
                     <template v-if="item.key === 'driver'">
                        <text v-if="userInfo.auditStatus === 99" class="menu-panel__sub menu-panel__sub--danger">完成认证后即可接单</text>
                        <text v-else-if="userInfo.auditStatus === 0" class="menu-panel__sub menu-panel__sub--danger">审核中</text>
                        <text v-if="userInfo.auditStatus === 2" class="menu-panel__sub menu-panel__sub--danger">已驳回</text>
                        <text v-else-if="userInfo.auditStatus === 3" class="menu-panel__sub menu-panel__sub--primary">已认证</text>
                     </template>
                     <template v-else-if="item.key === 'setting'">
                        <text class="menu-panel__sub menu-panel__sub--muted">当前版本V1.0.0</text>
@@ -63,16 +61,18 @@
                  </view>
               </view>
            </view>
            <view style="width: 100%; height: 5rpx;"></view>
         </view>
      </scroll-view>
      </view>
      <view class="mine-page__footer">
         <button class="mine-page__logout" hover-class="mine-page__logout--hover">退出登录</button>
         <button class="mine-page__logout" hover-class="mine-page__logout--hover" @click.stop="handleLogout">退出登录</button>
      </view>
   </view>
</template>
<script>
   import { mapState } from 'vuex'
   export default {
      data() {
         return {
@@ -82,7 +82,13 @@
            menuList: [
               { key: 'wallet', title: '我的钱包' },
               { key: 'driver', title: '司机认证' },
               { key: 'guide', title: '规范须知' },
               { key: 'agreementPrivacy', title: '司机隐私政策', type: 'driverPrivacyPolicy' },
               { key: 'agreementErrandLuggage', title: '跑腿车主行李寄存须知', type: 'errandLuggageStorageNotice' },
               { key: 'agreementErrandService', title: '跑腿达人服务协议', type: 'errandServiceAgreement' },
               { key: 'agreementErrandRisk', title: '跑腿达人风险承诺', type: 'errandRiskCommitment' },
               { key: 'agreementOwnerLuggage', title: '平台车主行李寄存须知', type: 'ownerLuggageStorageNotice' },
               { key: 'agreementOwnerService', title: '平台车主服务协议', type: 'ownerServiceAgreement' },
               { key: 'agreementOwnerRisk', title: '平台车主风险承诺', type: 'ownerRiskCommitment' },
               { key: 'help', title: '帮助与客服' },
               { key: 'setting', title: '设置' }
            ],
@@ -101,24 +107,23 @@
                  name: '汤子新',
                  phone: '18166565677(皖BD23189)',
                  levelTag: 'S级',
                  totalIncome: '8,314.90',
                  pendingIncome: '2000.00',
                  orderCount: '329',
                  walletBalance: '¥1500.00',
                  totalIncome: '-',
                  pendingIncome: '-',
                  orderCount: '-',
                  walletBalance: '¥0',
                  verified: true
               }
            }
         }
      },
      computed: {
         ...mapState(['userInfo']),
         currentProfile() {
            return this.useVerifiedState ? this.profileStates.verified : this.profileStates.guest
         },
         bodyStyle() {
            const footerHeight = uni.upx2px(124)
            return {
               marginTop: this.navHeight + 'px',
               height: `calc(100vh - ${this.navHeight + footerHeight}px)`
               marginTop: this.navHeight + 'px'
            }
         }
      },
@@ -127,7 +132,32 @@
         this.statusBarHeight = systemInfo.statusBarHeight || 0
         this.navHeight = this.statusBarHeight + uni.upx2px(88)
      },
      onShow() {
         this.getStats()
         this.getUserInfo()
      },
      methods: {
         getUserInfo() {
            this.$u.api.verifyDetail().then(user => {
               if (user.code === 200) {
                  this.$store.commit('setUserInfo', user.data);
               }
            })
         },
         getStats() {
            this.$u.api.stats().then(res => {
               if (res.code === 200 && res.data) {
                  this.profileStates.verified.totalIncome = (res.data.totalCommission / 100).toFixed(2)
                  this.profileStates.verified.pendingIncome = (res.data.pendingCommission / 100).toFixed(2)
                  this.profileStates.verified.orderCount = res.data.totalOrderCount || 0
                  this.profileStates.verified.walletBalance = '¥' + (res.data.balance / 100).toFixed(2)
               }
            })
         },
         getDriverLevelText(level) {
            const map = { 5: 'S', 4: 'A', 3: 'B', 2: 'C', 1: 'D' }
            return map[level] ? map[level] + '级' : ''
         },
         jump(item) {
            console.log(item)
            if (item.key === 'setting') {
@@ -135,10 +165,38 @@
                  url: '/pages/settings/settings'
               })
            } else if (item.key === 'driver') {
               if (this.userInfo.auditStatus === 99) {
                  uni.navigateTo({
                     url: '/pages/driver-certification/driver-certification'
                  })
               } else {
                  uni.navigateTo({
                     url: '/pages/certification-details/certification-details'
                  })
               }
            } else if (item.key === 'wallet') {
               uni.navigateTo({
                  url: '/pages/certification-details/certification-details'
                  url: '/pages/wallet/wallet'
               })
            } else if (item.key && item.key.startsWith('agreement')) {
               uni.navigateTo({
                  url: `/pages/agreement/agreement?type=${item.type}&title=${encodeURIComponent(item.title)}`
               })
            }
         },
         handleLogout() {
            uni.showToast({ title: '退出中...', icon: 'loading' })
            this.$u.api.logOutDriver().then(res => {
               console.log('logout res', res)
               if (res.code === 200) {
                  this.$store.commit('clearAll')
                  uni.reLaunch({
                     url: '/pages/login/login'
                  })
               }
            }).catch(err => {
               console.log('logout err', err)
            })
         }
      }
   }
@@ -146,9 +204,7 @@
<style lang="scss" scoped>
   .mine-page {
      height: 100vh;
      background: #f6f8fc;
      overflow: hidden;
      &__nav {
         position: fixed;
@@ -174,10 +230,11 @@
      &__body {
         box-sizing: border-box;
         // overflow: hidden;
      }
      &__content {
         padding: 28rpx 20rpx 20rpx;
         padding: 28rpx 20rpx 0;
      }
      &__profile {
@@ -243,23 +300,22 @@
         position: fixed;
         left: 0;
         right: 0;
         bottom: 0;
         padding: 16rpx 0 calc(env(safe-area-inset-bottom) + 20rpx);
         background: #f6f8fc;
         bottom: 60rpx;
         // padding: 16rpx 0 calc(env(safe-area-inset-bottom) + 20rpx);
         display: flex;
         justify-content: center;
      }
      &__logout {
         width: 186rpx;
         height: 70rpx;
         line-height: 70rpx;
         border-radius: 999rpx;
         width: 200rpx;
         height: 72rpx;
         line-height: 72rpx;
         border-radius: 36rpx;
         background: #ffffff;
         border: 1rpx solid #d8dde5;
         border: 1rpx solid #999999;
         font-weight: 400;
         font-size: 28rpx;
         font-weight: 500;
         color: #7e8794;
         color: #333333;
         padding: 0;
         &::after {
@@ -328,6 +384,7 @@
   .menu-panel {
      margin-top: 20rpx;
      margin-bottom: 200rpx;
      border-radius: 22rpx;
      background: #ffffff;
      overflow: hidden;
@@ -367,7 +424,7 @@
         }
         &--danger {
            color: #ff5a4f;
            color: #FA1010;
         }
         &--warning {
@@ -375,7 +432,7 @@
         }
         &--primary {
            color: #2b7cff;
            color: #106EFA;
         }
      }