| <template> | 
|     <view class="box"> | 
|         <view class="list"> | 
|             <view class="list_item"> | 
|                 <view class="list_item_label"> | 
|                     <text>旧密码</text> | 
|                     <text>*</text> | 
|                 </view> | 
|                 <view class="list_item_content"> | 
|                     <input type="password" v-model="param.oldPwd" :maxlength="32" placeholder="请输入旧密码" placeholder-style="color: #999999;" /> | 
|                 </view> | 
|             </view> | 
|             <view class="list_item"> | 
|                 <view class="list_item_label"> | 
|                     <text>新密码</text> | 
|                     <text>*</text> | 
|                 </view> | 
|                 <view class="list_item_content"> | 
|                     <input type="password" v-model="param.newPwd" :maxlength="32" placeholder="请输入6-18位数字、字母组合" placeholder-style="color: #999999;" /> | 
|                 </view> | 
|             </view> | 
|             <view class="list_item"> | 
|                 <view class="list_item_label"> | 
|                     <text>确认密码</text> | 
|                     <text>*</text> | 
|                 </view> | 
|                 <view class="list_item_content"> | 
|                     <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" @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> | 
| <style> | 
|     page { | 
|         background-color: #f7f7f7 !important; | 
|     } | 
| </style> | 
| <style lang="scss" scoped> | 
|     .box { | 
|         width: 100%; | 
|         .box_tips { | 
|             width: 100%; | 
|             padding: 20rpx 30rpx; | 
|             box-sizing: border-box; | 
|             display: flex; | 
|             align-items: center; | 
|             image { | 
|                 width: 20rpx; | 
|                 height: 20rpx; | 
|                 margin-right: 18rpx; | 
|             } | 
|             text { | 
|                 font-size: 26rpx; | 
|                 font-weight: 400; | 
|                 color: #4c99a7; | 
|             } | 
|         } | 
|         .list { | 
|             width: 100%; | 
|             padding: 0 30rpx; | 
|             box-sizing: border-box; | 
|             background-color: #ffffff; | 
|          | 
|             .list_item { | 
|                 width: 100%; | 
|                 height: 98rpx; | 
|                 display: flex; | 
|                 align-items: center; | 
|                 justify-content: space-between; | 
|                 border-bottom: 1rpx solid #E5E5E5; | 
|          | 
|                 .list_item_label { | 
|                     flex-shrink: 0; | 
|                     display: flex; | 
|                     align-items: center; | 
|          | 
|                     text { | 
|                         &:nth-child(1) { | 
|                             font-size: 30rpx; | 
|                             font-weight: 400; | 
|                             color: #222222; | 
|                         } | 
|          | 
|                         &:nth-child(2) { | 
|                             font-size: 30rpx; | 
|                             font-weight: 400; | 
|                             color: #E42D2D; | 
|                         } | 
|                     } | 
|                 } | 
|          | 
|                 .list_item_content { | 
|                     flex: 1; | 
|                     height: 100%; | 
|                     margin-left: 30rpx; | 
|                     display: flex; | 
|                     align-items: center; | 
|                     justify-content: flex-end; | 
|          | 
|                     text { | 
|                         font-size: 28rpx; | 
|                         font-weight: 400; | 
|                         color: #999999; | 
|                         margin-right: 6rpx; | 
|                     } | 
|          | 
|                     input { | 
|                         width: 100%; | 
|                         height: 100%; | 
|                         text-align: right; | 
|                         font-size: 28rpx; | 
|                         font-weight: 400; | 
|                         color: #222222; | 
|                     } | 
|                 } | 
|             } | 
|         } | 
|         .footer-box { | 
|             width: 100%; | 
|             margin-top: 48rpx; | 
|             height: 80rpx; | 
|             display: flex; | 
|             justify-content: center; | 
|             align-items: center; | 
|             .submit-button { | 
|                 width: calc(100% - 60rpx); | 
|                 height: 88rpx; | 
|                 line-height: 88rpx; | 
|                 background: #4d99a8; | 
|                 border-radius: 4rpx; | 
|                 color: #fff; | 
|                 border-radius: 44rpx; | 
|                 font-size: 32rpx; | 
|                 display: flex; | 
|                 align-items: center; | 
|                 justify-content: center; | 
|             } | 
|         } | 
|     } | 
| </style> |