wjt
2024-06-26 6dd9823b8495252e6d0ba35e6114799321453cbe
policy/components/mine.vue
@@ -2,15 +2,16 @@
   <view class="page-mine-box">
      <view class="top-box">
         <view class="user-news">
            <u-avatar :src="src"></u-avatar>
            <!-- <u-avatar :src="src"></u-avatar> -->
            <image src="/static/policy/header.png" mode="widthFix"></image>
            <view class="user-info">
               <view class="user-name">
                  <view class="inckname">刘小雅</view>
                  <view class="inckname">{{userInfo.data.nickName}}</view>
                  <view class="direc"></view>
                  <view class="dept-per">执法人员</view>
               </view>
               <view class="dept-name">
                  环保局--第一部门
               <view class="dept-name u-line-1">
                  {{userInfo.data.dept.deptName}}
               </view>
            </view>
         </view>
@@ -18,17 +19,19 @@
      <view class="main-box">
         <view class="show-phone-number">
            <text class="label">联系电话</text>
            <text>168****4164</text>
            <text v-if="userInfo.data.phonenumber">{{userInfo.data.phonenumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}}</text>
            <text v-else>暂无手机号</text>
         </view>
         <view class="show-phone-number" @click="goChangePhone">
            <view class="set-flex">
               <u-icon name="phone" size="22"></u-icon>
               <text class="change" >修改手机号</text>
               <!-- <u-icon name="phone" size="22"></u-icon> -->
               <image src="/static/policy/phone.png" mode="widthFix"></image>
               <text class="change">修改手机号</text>
            </view>
            <u-icon name="arrow-right"></u-icon>
         </view>
      </view>
      <view class="logout">
      <view class="logout" @click="logOut">
         退出登录
      </view>
   </view>
@@ -36,15 +39,35 @@
<script>
   export default {
      props: {
         userInfo: {
            type: Object,
            default: () => ({})
         },
      },
      data(){
         return {
            src: ''
            src: '/static/policy/header.png'
         }
      },
      methods: {
         goChangePhone() {
            uni.navigateTo({
               url: '/policy/changePhone/changePhone'
               url: `/policy/changePhone/changePhone?code=${this.userInfo.data.userType}`
            })
         },
         logOut() {
            uni.showModal({
               title: '提示',
               content: '确认退出登录?',
               success: res => {
                  if(res.confirm) {
                     uni.clearStorageSync()
                     uni.redirectTo({
                        url: '/pages/index/index'
                     })
                  }
               }
            })
         }
      }
@@ -64,13 +87,21 @@
            display: flex;
            justify-content: flex-start;
            align-items: center;
            image{
               width: 108rpx;
               height: 108rpx;
               background-color: white;
               border-radius: 50%;
            }
            .user-info{
               margin-left: 24rpx;
               color: white;
               width: calc(100% - 108rpx);
               .user-name{
                  display: flex;
                  justify-content: flex-start;
                  align-items: center;
                  margin-bottom: 24rpx;
                  .direc{
                     width: 2rpx ;
                     height: 20rpx;
@@ -112,6 +143,10 @@
            margin-left: 20rpx;
            color: #202D44FF;
         }
         image{
            width: 44rpx;
            height: 44rpx;
         }
      }
      .logout{
         text-align: center;
@@ -125,7 +160,10 @@
         width: calc(100% - 64rpx);
         left: 32rpx;
         position: fixed;
         bottom: 140rpx;
         bottom: 220rpx;
      }
      .inckname{
         font-size: 36rpx;
      }
   }
</style>