马宇豪
2025-04-29 9d5b4d650e5b01081d3537c750e7469db4d161e3
pages/tabBar/count/count.vue
@@ -30,7 +30,7 @@
          </view>
          <view class="info-id" @click="resetPwd()">
            <span>重置密码</span><u-icon name="edit-pen" color="#e6e6e6" size="16"></u-icon>
            <u-icon name="edit-pen" color="#e6e6e6" size="16"></u-icon><span>修改密码</span>
          </view>
        </view>
      </view>
@@ -57,40 +57,32 @@
        <u-button @click="loginOut" type="primary" text="退出登录" style="width: 80%" shape="circle"></u-button>
      </view>
    </view>
    <u-modal :show="showModal" title="重置密码" :showConfirmButton="false" :closeOnClickOverlay="true" ref="uModal" :asyncClose="true" @close="closeModal()">
    <u-modal :show="showModal" title="修改密码" :showConfirmButton="false" :closeOnClickOverlay="true" ref="uModal" :asyncClose="true" @close="closeModal()">
      <view>
        <u--form labelPosition="top" labelWidth="120" :model="pwdForm" :rules="rules" ref="uForm">
        <u-form labelPosition="top" labelWidth="120" :model="pwdForm" :rules="rules" ref="uForm">
          <u-form-item
              prop="password"
              ref="password"
              label="新密码"
          >
            <u--input
                v-model="pwdForm.password"
                placeholder="请输入新密码"
                :type="codeType1"
            >
            <u-input v-model="pwdForm.password" placeholder="请输入新密码" :password="isPwd1">
              <template slot="suffix">
                <u-icon v-show="codeType1 == 'password'" name="eye" color="#999" size="20" @click="viewCode(1)"></u-icon>
                <u-icon v-show="codeType1 == 'text'" name="eye-off" color="#999" size="20" @click="viewCode(1)"></u-icon>
                <u-icon :name="isPwd1?'eye':'eye-off'" color="#999" size="20" @click="isPwd1 = !isPwd1"></u-icon>
              </template>
            </u--input>
            </u-input>
          </u-form-item>
          <u-form-item
              prop="rePassword"
              ref="rePassword"
              label="确认密码"
          >
            <u--input
                v-model="pwdForm.rePassword"
                placeholder="请确认密码"
                :type="codeType2"
            ><template slot="suffix">
              <u-icon v-show="codeType2 == 'password'" name="eye" color="#999" size="20" @click="viewCode(2)"></u-icon>
              <u-icon v-show="codeType2 == 'text'" name="eye-off" color="#999" size="20" @click="viewCode(2)"></u-icon>
            </template></u--input>
            <u-input v-model="pwdForm.rePassword" placeholder="请输入新密码" :password="isPwd2">
              <template slot="suffix">
                <u-icon :name="isPwd2?'eye':'eye-off'" color="#999" size="20" @click="isPwd2 = !isPwd2"></u-icon>
              </template>
            </u-input>
          </u-form-item>
        </u--form>
        </u-form>
        <u-button type="primary" style="margin-top: 20px" text="确认" @click="confirmPwd()"></u-button>
      </view>
    </u-modal>
@@ -121,7 +113,7 @@
        examList: [],
        totalPage: 0,
        user: {},
        avator: '',
        avator: avatorPic,
        showModal: false,
        pwdForm:{
          id: null,
@@ -160,8 +152,8 @@
            }
          ]
        },
        codeType1: 'password',
        codeType2: 'password'
        isPwd1: true,
        isPwd2: true
         }
         
      },
@@ -174,11 +166,11 @@
         // uni.hideTabBar();
      // this.getUserInfo()
      this.user = uni.getStorageSync('userSet')
      if(this.user.logoPath && this.user.logoPath !== ''){
        this.avator = VUE_APP_BASE_URL + '/api/' + this.user.logoPath
      }else{
        this.avator = avatorPic
      }
      // if(this.user.logoPath && this.user.logoPath !== ''){
      //   this.avator = VUE_APP_BASE_URL + '/api/' + this.user.logoPath
      // }else{
      //   this.avator = avatorPic
      // }
      },
      methods: {
@@ -233,23 +225,6 @@
        t.showModal = true
      },
      viewCode(type){
        const t = this
        if(type == 1){
          if(this.codeType1 == 'password'){
            this.codeType1 = 'text'
          } else{
            this.codeType1 = 'password'
          }
        }else{
          if(this.codeType2 == 'password'){
            this.codeType2 = 'text'
          } else{
            this.codeType2 = 'password'
          }
        }
      },
      confirmPwd(){
        const t = this
        t.$refs.uForm.validate().then(res => {
@@ -260,7 +235,7 @@
            if(r.code == 200){
              t.$refs.uToast.show({
                type: 'default',
                message: '密码已重置,请重新登录',
                message: '密码已修改,请重新登录',
                duration: 1000
              })
              loginOut().then(res=>{
@@ -299,6 +274,8 @@
          password: '',
          rePassword: ''
        }
        this.isPwd1 = true
        this.isPwd2 = true
      }
      }
   }