k94314517
2024-10-16 17efddc6a667670dca682bf36b51a43e99615e6d
h5/pages/changePassword/changePassword.vue
@@ -1,9 +1,5 @@
<template>
   <view class="box">
      <view class="box_tips">
         <image src="@/static/ic_tip@2x.png" mode="widthFix"></image>
         <text>如遗忘密码,请联系园区系统管理员重置</text>
      </view>
      <view class="list">
         <view class="list_item">
            <view class="list_item_label">
@@ -11,7 +7,7 @@
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="number" maxlength="11" placeholder="请输入旧密码" placeholder-style="color: #999999;" />
               <input type="password" v-model="param.oldPwd" :maxlength="32" placeholder="请输入旧密码" placeholder-style="color: #999999;" />
            </view>
         </view>
         <view class="list_item">
@@ -20,7 +16,7 @@
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="number" maxlength="11" placeholder="请输入6-18位数字、字母组合新密码" placeholder-style="color: #999999;" />
               <input type="password" v-model="param.newPwd" :maxlength="32" placeholder="请输入6-18位数字、字母组合" placeholder-style="color: #999999;" />
            </view>
         </view>
         <view class="list_item">
@@ -29,22 +25,64 @@
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="number" maxlength="11" placeholder="请输入6-18位数字、字母组合新密码" placeholder-style="color: #999999;" />
               <input type="password" v-model="param.newPwdTemp" :maxlength="32" placeholder="请再输一次新密码" placeholder-style="color: #999999;" />
            </view>
         </view>
      </view>
      <view class="box_tips">
         <u-icon name="info-circle" class="mr12" color="#4d99a8"></u-icon>
         <text>如密码遗忘,请联系园区系统管理员重置</text>
      </view>
      <view class="footer-box">
         <view class="submit-button">提交</view>
         <view class="submit-button" @click="onSubmit">提交</view>
      </view>
   </view>
</template>
<script>
import { uploadPassword } from '@/api'
   export default {
      data() {
         return {
            param: {}
         };
      },
      methods: {
         onSubmit() {
      const { param } = this
      if (!param.oldPwd) return uni.showToast({
        title: '旧密码不能为空',
        icon: 'none'
      })
      if (!param.newPwd) return uni.showToast({
        title: '新密码不能为空',
        icon: 'none'
      })
      if (!param.newPwdTemp) return uni.showToast({
        title: '确认密码不能为空',
        icon: 'none'
      })
      if (param.newPwdTemp != param.newPwd) return uni.showToast({
        title: '两次输入密码不一致',
        icon: 'none'
      })
      uploadPassword({
        ...param
      }).then(res => {
        if (res && res.code == 200) {
          setTimeout(() => {
            uni.showToast({
              title: '密码修改成功,请重新登录',
              icon: 'success',
              duration: 2000
            })
          })
          uni.redirectTo({
            url: "/pages/staffLogin/login"
          })
        }
      })
    }
      }
   }
</script>
@@ -70,7 +108,7 @@
         text {
            font-size: 26rpx;
            font-weight: 400;
            color: #E0312A;
            color: #4c99a7;
         }
      }
      .list {
@@ -135,8 +173,7 @@
      }
      .footer-box {
         width: 100%;
         position: fixed;
         bottom: 30rpx;
         margin-top: 48rpx;
         height: 80rpx;
         display: flex;
         justify-content: center;
@@ -145,7 +182,7 @@
            width: calc(100% - 60rpx);
            height: 88rpx;
            line-height: 88rpx;
            background: #025eef;
            background: #4d99a8;
            border-radius: 4rpx;
            color: #fff;
            border-radius: 44rpx;